Free DNS provides easy shared DNS hosting & URL forwarding

Thursday, December 24, 2009

The power behind GMail

Have you ever wondered how does GMail manage to give us all these nice features? How about what makes it so fast? If you did, you'll find the answer in the following movie. It's a bit technical, but you should understand it even with basic computer skills.

Let me know if you did find the answer!

Thursday, December 17, 2009

Wikipedia Forever

Wikipedia Affiliate Button
Today I was reading a few lines about Python and I stumbled upon this text:
the language is named after the BBC show "Monty Python's Flying Circus" and has nothing to do with nasty reptiles
I red that before a couple of times, but I never understood the relation between the programming language and the show. I googled up the shows name and (obviously) the first two results were Wikipedia pages. I clicked one of them and I got into Wikipedia. There I saw it: a message from Jimmy Wales. I realized that I wanted to make a donation for Wikipedia a few days ago, but I forgot. Afraid this might happen again, I put everything on hold and made the donation. If you use Wikipedia, consider making donation, too. The ammount is not important. There are lots of cool things to find in there (e.g. did you know that spam is also related to Monty Python's Flying Circus?).

Monday, December 7, 2009

National Geographic Wallpapers

National Geographic is offering wallpaper-sized variants of many of their beautiful photo collections. One of the collections that I follow in iGoogle is the Photo of the day. I like it mostly because it doesn't have a particular theme and includes photos from many places around the world.
From time to time, I like some picture so much that I "go through all the trouble" (a 5-clicks process) and save it as my wallpaper.
I wanted something automated to do this (i.e. save the POD as my wallpaper). I know there is Opal (both for Windows & Linux), but I don't want to use it for two reasons:
  1. when I last tested it, it failed to work (i.e. it did not set any wallpaper)
  2. I fail to see the purpose of running a program full time (even if it's using almost none CPU & memory) just to update a file one time a day
Thus, I decided to practice my bash scripting & linux command skills to write a script that will save the National Geographic POG and set it as wallpaper in Gnome. This is what I came up with (it is not and will not be optimized nor use error control):
#!/bin/bash

# the URL of the photo feed
RSS_FEED=http://www.nationalgeographic.com/rss/photography/photo-of-the-day

# the prefix of the photos URL (used to find the newest photo)
IMAGE_URL_PREFIX=http://photography.nationalgeographic.com/staticfiles/

# format of the photo
# in = 270x179, sw = 800x600, lw = 1024x768, xl=1280x1024
IMAGE_FORMAT=sw

# directory where to save the images
IMAGE_DIRECTORY=~/Pictures

# retrieve the RSS feed, grep for the latest image and
# replace it's name to match the required format
IMAGE_URL=`wget -qO /dev/stdout $RSS_FEED | egrep -m 1 -o "$IMAGE_URL_PREFIX[^\"]*" | sed -e s/-in\.jpg\$/-$IMAGE_FORMAT\.jpg/`

# retrive the image
wget -q -nc -P $IMAGE_DIRECTORY $IMAGE_URL

# get the image file name
IMAGE_FILE=`basename $IMAGE_URL`

# set the image as background
gconftool -s -t string /desktop/gnome/background/picture_filename $IMAGE_DIRECTORY/$IMAGE_FILE
gconftool -s -t string /desktop/gnome/background/picture_options scaled