Last week I started to play with my RaspberryPi (thanks @dani_viga). It seems simple and funny. I’d like to run an Hadoop cluster like LinkedIn or others geeks but first of all I need to setup the system.

My RaspberryPi kit includes the board, an USB-microUSB cable (as power supply), an SD card (16 GB) and an ethernet cable.

raspberry_kit

pidora_logoAs Linux distribution I choose Pidora because I like CentOS and this a Fedora/RedHat-like distribution. Base image can be downloaded from official page. Then you have to burn the image on the SD card. It seems that RaspberryPi can boot only from SD card. I can’t find any guide to boot it from USB key without SD card. Anyway is possible to use it as main drive. To burn it on SD on Mac o Linux you can use dd

dd if=/path/to/image/pidora-18-r1c/pidora-18-r1c.img of=/dev/disk3 bs=1m

First parameter is the path of the downloaded image, the second one is the endpoint of the SD drive (you can find it using diskutil list).

After this I simply plugged USB to my Mac and ethernet to a connection. After a dozen of seconds lights start blinking!

raspberrypi_running

System is already configured and on port 22 runs SSHd. If you try to connect to the IP using root as username and raspberrypi as password the RPi answers!

raspberrypi_shell

Next week I’ll try to install a LEMP stack on it. FUN! 😀

Many high-traffic web applications take advantages from caching systems. HTML cache is easy and powerful. IMHO best solution is serving it using something like nginx and Varnish. Many people use custom solutions (for example a WordPress plugin) which produce an HTML snapshot of the page and save it to disk.

If you website il quite large in a flash you get a huge amount of small files stored on your disk. Clean cache is not easy as you would hope.

First solution is to use:

rm -Rf [path]

But this is dangerous because IO wait is terrible (even with SSD) and load average of you machine rise up to 50 in a minute.

find can help you:

find [path] -type f -print -delete

Unfortunately, after a while, load average rise again. Rising is slower but is still dangerous.

Solution is to use ionice. It enable you to limit priority of your process and avoid load average rise.

ionice -c 3 find [path] -type f -print -delete

Thanks to @dani_viga for the tips! He saves my day 🙂

More about ionice