Sendmail remote connection refused

How to enable sendmail to accept remote connections. By default most distributions (or when compiling sendmail yourself) will only allow local connections for security reasons.

Using Ctrl+Alt+F1 in a VMWare Virtual Machine

I use VMWare Workstation 6.0 for testing out various Linux distributions either to run live CDs or install a full operating system without having to have a dedicated computer for that specific purpose only.

While playing around with a Linux distribution in VMWare Workstation the other day, I realised I needed to drop to the console, log in as root and do something from the command line. So I hit Ctrl+Alt+F1 expecting this to do it in the virtual machine, but it instead dropped my host operating system to the command line console. Not quite what I was expecting, but as I quickly remembered, Ctrl+Alt has special meaning in VMWare Workstation as a way of releasing keyboard and mouse control from the guest and returning it to the host.

PHP echo with commas versus concatenation

"echo" and "print" are used in PHP for writing strings out to a stream. I have always used concatenation when writing out multiple strings with echo or print, but recently discovered that echo accepts multiple arguments or parameters, comma separated like a regular function call. This post does some benchmarking to see which is faster: echo with commas, echo with concatenation, or print with concatenation.

Categories PHP

Create a file with a unique name with PHP

The PHP function tempnam() creates a file with a unique name. This can be useful if you need to output some data into a temporary file for one reason or another, and the actual name of the file is not important.

Categories PHP

Determine whether PHP is being run via HTTP or CLI

PHP can be run as a webserver module, as a CGI application or from the command line as a CLI script. There is both a function and a PHP constant which allows you to determine whether PHP is being run via HTTP or CLI. This post looks at the function and constant and the possible values, as determined in the PHP 5.2.5 source code.

Categories PHP

Checking daylight savings settings on Linux

The date daylight savings starts and ends changed in New Zealand last year, but unfortunately there was only a few months between when the decision was made and when it happened and the updates to the timezone databases on various Linux distributions wasn’t done in time in many cases. This affected many servers and services which displayed the wrong time for the couple of weeks between when daylight savings actually started and when it would have in previous years.