Improve linux raid rebuild/resync speed

I have a small 🙂 NAS box with 6 x 1TB HDD in RAID 6 and 4 x 500GB HDD in RAID 5. Recently thanks to the arrival of my baby girl and a HD handy cam, I was running out of space fast on the array and so when when I saw a decent deal for 1TB drives in NewEgg I picked up couple to add to the RAID 6 volume.

Growing a raid array in linux using mdadm is easy. I made sure I used fdisk to create single large partition on the drive and mark the partition type fd (Linux raid autodetect) prior to adding it to the array.

 Device Boot      Start         End      Blocks   Id  System
/dev/sdm1               1      121601   976760001   fd  Linux raid autodetect

Adding the drives to the raid is straightforward

mdadm --add /dev/md1 /dev/sdl1
mdadm --add /dev/md1 /dev/sdm1

Read more

setting up http proxy for cli

Okay, I have to google this information every-time I need it, to so am going to blog it, so that I know exactly where to look for it 🙂

Setting up a proxy from the GUI on you browser or system does not always work for command line utilities like apt-get, yum, wget or customer bash scripts etc…

So here is how to setup proxy for CLI from CLI, assuming your proxy server is proxy.example.com (IP 192.168.2.252) and port 3128.

export http_proxy='http://proxy.example.com:port/'

OR

export http_proxy='http://192.168.2.252:3128/'

Read more

FANN python binding on ubuntu x86_64

Ok, Long time no see.. Was busy with too much work. Got a little bit of free time in the last couple of weeks and was mucking around with some Artifical Neural Network packages out there and ran into an issue with FANN 2.1.0 Beta.

I was able to compile and install the core libfann without any issues, however when I tried compiling the python binding pyfann I ran into some issues, first ubuntu did not have any of the python dev packages installed by default so installed them with

sudo apt-get install python-dev

and then installed the swig package

Read more