Explode empty string returns one-element array

Pretty annoying, exploding an empty string with – for example space – returns an array with one element, indexed with 0 and containing an empty string: $string = “”; explode(” “, $string); returns array( [0] => ” ) There is a simple workaround that also removes the unnecessary empty elements – array_filter(). This function removes […]

Read More

Set up a FTP server (pure-ftpd-mysql)

There are multiple reasons I recommend using pure-ftpd-mysql as ftp service: can authenticate both physical and virtual (read from database) users. It’s highly but easily configurable. Installing: apt-get install pure-ftpd-mysql The configuration files are found at /etc/pure-ftpd. By default, pure-ftpd authenticates only users that has an uid 1000 or over. Thus root cannot authenticate (having […]

Read More

Stock photography

I’m living from stock photography. It’s about creating useful images for others, uploading these to so called internet-based ‘Agencies’ who make these online, make marketing for these and sell a license for these. I receive an amount of the selling price, from 15% to 50%, depending on the agency. Note that I don’t sell the […]

Read More

Set up a Samba server on Linux

With a Samba server installed and running on Linux, we can access partly or the whole system via LAN. Install Samba: apt-get install samba Follow the install wizard and enter “workgroup” or the group your network uses. The outside access can be configured for a special directory and for a special user or it’s possible […]

Read More