bashrc

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

export LANG="en_CA.UTF-8"

# If running interactively, then:
if [ "$PS1" ]; then

    # don't put duplicate lines in the history. See bash(1) for more options
    # export HISTCONTROL=ignoredups

    # enable color support of ls and also add handy aliases
    eval `dircolors -b`
    alias ls='ls --color=auto'
    alias ll='ls -hl'
    alias la='ls -Ah'
    alias x='startx > /var/log/x.log 2>&1'
    alias clear='clear;fortune -ae'
    alias nstll='sudo apt-get install '
    alias upgrade='apt-get update && apt-get dist-upgrade'
    alias rmv='sudo apt-get remove '
    alias apt-get='sudo apt-get'
    alias dpkg='sudo dpkg'
    alias vi='vim'
    alias vii='sudo vim '
    alias reboot='sudo reboot'
    alias halt='sudo halt -p'
    alias card="mount /dev/sda1;ls /mnt/card"
    alias uncard="umount /mnt/card"
    alias key="mount /dev/sda;ls /mnt/key"
    alias unkey="umount /mnt/key"
    alias dos2unix="flip -uv "
    alias unix2dos="flip -mv "
    alias spmlearn='sa-learn --mbox --spam /home/willyyam/Mail/spam;rm /home/willyyam/Mail/spam;touch /home/willyyam/Mail/spam'
    alias pal="pal -r 5"
    alias xconsole="Eterm -t xconsole &"
    alias flug="ssh ohiggins@flug.fis.utoronto.ca"
    alias frozen-bubble="frozen-bubble -ns"

    # set a fancy prompt
    PS1='\[\033[0;32m\]\t \[\033[1;31m\]\w \[\033[0;32m\]]\[\033[0m\] '
  #PS1='\[\033[1;33m\]\t \[\033[1;34m\]\w \[\033[1;33m\]]\[\033[0m\] '

    case $TERM in
    Eterm*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    urxvt*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    xterm*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    xfce4-terminal*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    rxvt*)
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
        ;;
    *)
    esac

    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc).
    #if [ -f /etc/bash_completion ]; then
    #  . /etc/bash_completion
    #fi
fi

SD Cards

I a similar vein, I’ve been looking around for a portable storage solution and an MP3 player, and I found a great combination in the RCA Lyra and SD Cards. I got the 64Mb model Lyra, because it was very cheap, and I put a 1Gb SD card in it, which is similarly cheap. I get 200 tracks on the card, leaving 350-odd Mbs free for files.

I did have a little trouble getting it working on Linux, but once I determined that the card was being mounted as /dev/sda1 (hurray for tail -f /var/log/messages) it was pretty easy. One other wrinkle was that the card is formatted as FAT16, which has an allocation-block limit of something silly, like 512 blocks in the root of the drive. I tried to fill the card with music, and got stopped at 90-odd files, about half-full, and I couldn’t figure it out. Eventually TLUG came to my rescue, and I learned that FAT16 breaks long filenames into blocks of a set size, so the 90-something files with long names became 512 full blocks. I created a directory on the card, dumped all the songs into it, and was able to fill the card. It seems that the limit is only for the root of the device. I’d love to use a better format, but I want it to work on any system I encounter – including the MP3 player, so I’m stuck for now. There is a 4Gb limit to FAT16 too, but I don’t think that’ll be a problem in the next year or two.