Backing up and restoring whole block devices

SD cards are not really a reliable storage, especially when used constantly e.g. while sitting in always powered-on Raspberry Pi. Because of that I’ve recently needed to perform lots of backup/restore operations ;) I wrote this script for backing up: #!/bin/bash if [[ -z $1 ]]; then echo "usage: $0 device_to_clone" exit fi device=$1 timestamp=`date +%Y%m%d` dest_file="/tmp/$timestamp.dd.xz" echo "about to clone $device to $dest_file" echo "ctrl-c or [enter]" read sudo umount $device? [Read More]

Adding voltage and current measurements to the sunpowered Pi

Remember my sunpowered Pi installation on the balcony ? The only indication I had, since recently, on how well the system is doing was an LED blinking red when battery was low. Not really helpful in making predictions or making measurements over the time. I’ve searched for simple ADC solution to hook up into Pi and allow for some voltage and power measurements. I’ve decided on ADC Pi, as it seemed very straightforward in its design and also comes with example python code. [Read More]

WiFi on RaspberryPi

Easiest way I’ve found to configure wifi on RaspberryPi, not really being mentioned when you search for such. Not using separate wpa_supplicant configuration at all.

root@frontend:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid  NETWORK_NAME
wpa-psk NETWORK_KEY

iface default inet dhcp

Sunpowered server setup

Remember my NAS ? It turned out great ! Very reliable storage, I had a disk failure once and haven’t noticed for some time because all the files were just there. Hardware enhanced virtualization is another great stuff. I ended up migrating all my of infrastructure there, each service in separate virtual machine; email, calendar, contacts, tor node and such. Only caveat ? Power consumption. This setup just eats Watts. About 50W constant power usage is not something you want to have turned on 24h/day. [Read More]

Compiling tarsnap on RaspberryPi

Just a quickie for tarsnap 1.0.35. Featuring my new favourite, download software called aria2. aptitude install aria2 libssl-dev zlib1g-dev e2fslibs-dev aria2c https://www.tarsnap.com/download/tarsnap-autoconf-1.0.35.tgz aria2c https://www.tarsnap.com/download/tarsnap-sigs-1.0.35.asc gpg --recv-key 2F102ABB gpg --decrypt tarsnap-sigs-1.0.35.asc sha256sum tarsnap-autoconf-1.0.35.tgz # should get the value from sig file, 6c9f67....9a tar xf tarsnap-autoconf-1.0.35.tgz cd tarsnap-autoconf-1.0.35/ ./configure time nice ionice make -j2 How do I know that -j2 really gives some advantage on raspi ? Well, here is the benchmark: [Read More]