apg as bash function

# Generate a random password
#  $1 = number of chars, defaults to 12
function apg() {
  if [ "$1" = "" ]
      len=`expr $1 / 2 + 1`
  # half of chars with special chars
  #     get random bits   | encode     | take line 2  | get char 2->
  var1=`head /dev/urandom | uuencode - | sed -n 2p    | cut -c2-$len`
  # rest of chars with base64
  #     get random bits   | encode base64 | take line 2 | get char 2->
  var2=`head /dev/urandom | uuencode -m - | sed -n 2p   | cut -c2-$len`
  echo "$var1$var2"

Mayavi on OS X Mountain Lion 10.8.5

1. Get homebrew: http://brew.sh/
2. Install homebrew’s version of python:

brew install python

(You should probably get SciPy too: http://fonnesbeck.github.io/ScipySuperpack/)
3. Change path so that /usr/local/bin is listed first: /etc/paths


4. Close console and open again to get new path.
5. Install pyqt:

brew install pyqt

6. Install version 5.10.1 of vtk (6.0.0 is currently not working):

brew tap  homebrew/science
brew versions vtk #list versions of vtk
cd /usr/local/Library/Taps/homebrew-science/ #so that git finds vtk repository
git checkout 27a4327 /usr/local/Library/Taps/homebrew-science/vtk.rb #checkout version 5.10.1
homebrew install vtk

7. Install mayavi:

pip install mayavi

8. Install ipython:

easy_install ipython

9. Run your mayavi plot:


netatalk 3.0.3 Ubuntu 12.04.2/10.04.3 LTS (Precise Pangolin)

Netatalk for use with Time Machine on MAC OSX Mountain Lion 10.8.3.

sudo -i
apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libdb5.1-dev db-util db5.1-util libgcrypt11 libgcrypt11-dev
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.0.3.tar.bz2?download
tar jxvf netatalk-3.0.3.tar.bz2?download
mv netatalk-3.0.3 /usr/src
cd /usr/src/netatalk-3.0.3
./configure --with-init-style=debian --with-zeroconf


mimic model = TimeCapsule6,106
log level = default:warn
log file = /var/log/afpd.log
hosts allow =

path = /mnt/timemachine
valid users = tmuser
time machine = yes

For Ubuntu 10.04.03 use this apt-get line instead:

apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libdb4.8-dev db4.8-util libgcrypt11 libgcrypt11-dev