Picture of the day

Building for X-MenOlga and I went for a short walk today. For some strange reason, I’ve been seeing ‘X’s all over the place. I’ve seen an unfinished building with lots of ‘X’s in it, a sign pointing into direction of Xception cafe, a photo studio Kodak eXpress, and few others. Not all of these were photographable, but I managed to make a couple of shots. Check them out here.

I have also noticed that ‘Picture of the day’ project does improve my vision of things. I have started to notice photographs everywhere and I started to care about thing around me much more. Olga and I were sitting in the cafe, eating ice-cream, and she was so beautiful that I wanted to make a picture of her like this, but somehow my eye noticed by itself that there is a closed umbrella behind Olga that will look ugly on the photograph and that there is an ugly tungsten lamp on the right of her, which would spoil the picture too. I than tried to rearrange the frame mentally, but by the time I was done, the atmosphere was gone. At least I haven’t made yet another disappointing picture and saved the web from another portion of crap. Good me.

First rain

The summer is officially over. Today we we had the first rain in Limassol. It wasn’t anything major, just a few drops here and there, but it was good enough to be noticed. It counts. Summer was pretty short this year. Last rain was on 25 of June.

Welcome, winter, welcome. I missed rains, thunderstorms, wind, and cool weather for a long time now. Not it all will slowly start.

Update (6 Oct 2004, 22:32): Olga reminded me that today wasn’t the first rain, bur rather a second one. The first one happened on the next day my mother left Cyprus, a month ago. Well, both rains were rather minor. Today’s one was slightly bigger with some water staying on the streets for the next hour. I’ll call today’s rain the first one. At the end of the day, who said that we cannot have two first rains the same year? :)

What is the story behind most emailed pictures?

Yahoo! News has this page about most emailed pictures. It lists the images and provides a description for each one. The idea is interesting, but rather boring. Someone though tried to correct the situation with this project. The idea is basically to take 3 pictures from most emailed list and tie them up with a single story. Everyone can submit. Sometimes it gets funny, sometimes stupid. Take you turn.

Yet another Nucleus upgrade bug squashed

One of the most annoying bugs left from those upgrades of NucleusCMS that I did, was the double-slash (//) formation in URLs sometimes. I noticed that it was appearing when using ‘Add comment’ link. Apache though doesn’t care and works fine, so I left these as they were until today. The annoyance of the bug was that if I wanted to copy and paste the URL to the full post, I had to clean it up every time.

Today I got bored and pissed off about this problem and quickly found a solution to it. Apparently, it was discussed in NucleusCMS forums in this thread. All I had to do was to make this line from index.php:

$CONF['Self'] = './';

to look like this:

$CONF['Self'] = '/blog';

Those of you who had problems with posting comments should be now totally satisfied. Search engines should also start indexing better, since there will be no more ambigues URLs. Me, well done.

Copying files to remote destinations. With bells and whistles.

If you ever had to copy a file from one machine to another over a network, chances are you know more than one way to do it by now. Especially if you were doing it on some Unix machine. If you are still struggling, here is a short list to get you started:

  • Send the file as attachment via email.
  • Copy it over the web using http/https or ftp/ftps protocols.
  • Use secure copy (scp) provided by many secure shell (ssh) implementations.

Copying a file from one place to another (even remote) is easy. It gets slightly more complex when you need something a bit more smart than just a copy operation. Here is a short list of requirements you might have to your copy process:

  • Secure (encrypted) transaction.
  • Transfer of only those parts of file which have changed since last copy.
  • Support for resuming the transfer if connection was broken, instead of resending the whole thing.
  • Limit the bandwidth consumed by the copy process.

If you ever had to satisfy any or all of these requirements in a single solution, you might have scratched your head more than once. Or, at least, spent some quality time on the web looking for the right tool. I know, because I did. In order to improve someone else’s chances of finding such a tool faster, I’ll describe it here.

The tools itself is called rsync. As far as I know, it comes with most Unix boxes and for sure with most Linux installations. rsync has a number of options and a very flexible functionality. Just by itself it can satisfy all of the requirements above, except for secure encrypted transaction. And the beauty of the rsync is that it can be easily integrated with other tools to satisfy even more requirements. In order to provide encrypted transfer it can be easily used with secure shell (ssh) implementation, such as OpenSSH.

Enough of theory, let’s go for an examlpe.

Here is one way of using rsync which satisfies all the requirements above.

rsync -e ssh --bwlimit=50 /path/to/local/file user@remote_host:/path/to/remote/dir

Now, let’s see how it works. rsync itself can transfer only the changed parts of the file. If there is no prior copy of the file at the remote host, than the whole thing will be transfered. rsync by itself supports resuming of transfer. So, if connection between your two machines went down for a while, you can just rerun the same rsync command and it will continue from where it stopped. rsync supports bandwidth limitations. In the example above, I used --bwlimit=50 which will result in rsync transferring at speeds of 50 KiloBytes (not bits) per second or less. The encryption part is done by secure shell and rsync is told to use it by -e ssh argument. As you could probably guessed, in the example above, /path/to/local/file should point to the file that you want to transfer. user should be a username to use when identifying at remote_host. If there is a need for password input, you will be prompted before the transfer. /path/to/remote/dir should obviously point to the directory at remote machine where the file must be stored.

Read the manual for rsync and ssh and you will discover a number of other useful options that will make your life easier. To close on a nice note, I’ll suggest you use two other parameters to rsync: -r which tells rsync to use recursive mode, in case you want to transfer a directory structure and not a single file; and --progress which tells rsync to show what it is doing in real-time.