Sunday, July 27, 2008

Backing up ArchLinux to USB Thumb Drive

I have to say, I'm loving ArchLinux. In my opinion, it has wonderful package management, a rolling-release model (you never have to download the latest ISO to upgrade), wonderfully community docs and support, etc.

But, like any distro, it's required a few tweaks to get things working properly with my particular laptop, an Everex StepNote ST5340T. Over the last few months, I've made tweaks here and there, and if I had to start over with a fresh install, I'd be sad. In particular, the laptop's wireless and suspend features needed tweaking to get them to work right.

This post is about backup solutions. After a little research, I came accross this site, and decided to go with dar. Here is my bash script which will backup everything (except for that which I don't want backed up) to my usb thumb drive. It's a 2GB thumb drive, and the backup takes 1.4GB. Pretty cool huh? I'm impressed.


#!/bin/bash
pacman -Scc
dar -v --alter=atime --empty-dir --fs-root / --noconf --create /media/usb/ backup08-Jul-27 -z6 -an -X "*.ogg" -X "*.avi" -X "*.mp?" -X "*.pk3" -X "*. flac" -Z "*.zip" -Z "*.tgz" -Z "*.gz" -Z "*.gzip" -Z "*.bz2" -Z "*.bzip2" -Z "*.mov" -Z "*.rar" -Z "*.jar" --prune lost+found --prune media --prune proc -- prune mnt --prune sys --prune home/gdw/music --prune home/gdw/pics

Friday, July 25, 2008

Dynamically getting fields from a Django Model Object

Response to my question on #django> gdw2: see get_* in django.db.models and then see model._meta.fields

> Package._meta.fields

... does the trick

Everex Suspend in Linux

I got my Everex StepNote ST5340T to suspend today in ArchLinux! Yea! Suspending is a very important feature, especially when you're on the road, because it allows you to turn the computer off and on quickly. Here is my little script:

#!/bin/bash
modprobe -r rt73usb
sleep .7
modprobe -r ehci_hcd
sleep .7
modprobe -r ohci_hcd
sleep .7
modprobe -r rt73usb
sleep .7
echo "mem" > /sys/power/state
sleep .7
modprobe rt73usb
sleep .7
modprobe ehci_hcd
sleep .7
modprobe ohci_hcd
sleep .7
modprobe rt73usb
sleep .7
/usr/bin/netcfg2 -a
sleep .7
/usr/bin/netcfg-auto-wireless wlan0

I'm confident that it could be optimized greatly, but it works for now. If you have any questions, send and email or post a comment.

Tuesday, July 08, 2008

svn commit all new files

svn add * --force
svn commit -m "blah blah blah"

Pyjamas