Pretty bash prompts

I stole this from a Debian .bashrc file - it makes your bash prompt nice and colourful.

export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

So what I did was put the above line in my local machine’s .bash_profile, and the following:

export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

in the dedicated server’s .bashrc (my terminal doesn’t listen to .bashrc locally it seems). Once both lines are in place, your local prompt will be mostly green, and the server prompt will be mostly red, giving you a quick visual indication of which command-line you are currently working on.

Improving iTerm keyboard shortcuts

iTerm is a cool terminal replacement for OS X (tabs, bookmarks, and profiles off the top of my head); I’m still using Tiger, I think Leopard’s terminal app has been improved, but I’m not sure how it matches up to iTerm.

I like to use Command (Apple key) + left and Command + right to skip to the beginning and end of lines respectively, unfortunately iTerm doesn’t understand these shortcuts out of the box (although you can use Function + left and right). To enable this:

  1. Open iTerm
  2. Bookmarks menu > Manage profiles
  3. Keyboard profiles > Global
  4. Click +
  5. Key: cursor left, Modifier: Command, Action: send escape sequence “OH”
  6. Click “High interception priority” and then OK
  7. Click +
  8. Key: cursor right, Modifier: Command, Action: send escape sequence “OF”
  9. Click “High interception priority” and then OK

You can also set up Alt + left and Alt + right to navigate between whole words, the commands are:

  • Key: cursor left, Modifier: Option, Action: send escape sequence “f”
  • Key: cursor right, Modifier: Option, Action: send escape sequence “b”

Howto build devkitARM on Mac OS X 10.4 (Tiger)

devkitARM release 23b is compiled on OS X 10.5 (Leopard) and most likely will not work on OS X 10.4 (Tiger) because it has been linked against different libraries (libiconv, libSystem.B). devkitARM is the toolchain of choice (read: only) for developing Nintendo DS Lite applications.

Here’s a summary on how to build it yourself:

My system
OS X 10.4.10
gcc version 4.0.1 (The version that comes on your install CD)
Target: i686-apple-darwin8

Building pre-requisites and devkitARM

FreeImage 3.10.0 (http://freeimage.sourceforge.net/download.html)
wget http://downloads.sourceforge.net/freeimage/FreeImage3100.zip
unzip FreeImage3100.zip
cd FreeImage
make
sudo make install

GMP 4.2.2 (http://gmplib.org/#DOWNLOAD)
wget http://ftp.sunet.se/pub/gnu/gmp/gmp-4.2.2.tar.bz2
tar jxf gmp-4.2.2.tar.bz2
cd gmp-4.2.2
./configure –build=none-apple-darwin –disable-shared –enable-static –prefix=/usr/local
make
sudo make install

MPFR 2.3.1 (http://www.mpfr.org/mpfr-current/#download)
wget http://www.mpfr.org/mpfr-current/mpfr-2.3.1.tar.bz2
tar jxf mpfr-2.3.1.tar.bz2
cd mpfr-2.3.1
./configure –disable-shared –enable-static –prefix=/usr/local
make
sudo make install

Buildscripts (devkitPro source)
Get it from http://sourceforge.net/project/showfiles.php?group_id=114505
&package_id=124206&release_id=609056

rm -rf /opt/devkitpro
tar jxf buildscripts-20080624.tar.bz2
cd buildscripts
mv config.sh config.sh.old
sudo ./buildscripts.sh

Choose devkitARM and say you want to download source packages
Enter install directory as: /opt/devkitpro

devkitARM will be installed in /opt/devkitpro if all went well. Make sure you moved anything important out’ve the directory before rm -rf’ing it.

I think that’s all - I typed this from memory - took about 25 min to build everything on my Intel macbook.

Next Page »