Linux Install Tweaks: System Infrastructure

As before, most of this is peculiar to my Xubuntu setup, but this way I’ll remember it and you might get some benefit, too… something similar will work for whatever distro you’re using, perhaps with a bit of adaptation.

Note: for all the files you tweak, first copy the original. I tend to save file whatever as whatever.base, but you may do as you see fit.

Edit ~/.bashrc to enable aliases and get a decent colored prompt:

 ... snippage ...
PS1="\[\e[1m\][\[\e[33m\]\u\[\e[32m\]@\[\e[36m\]\h \[\e[37m\]\W\[\e[32m\]]\\$ "
 ... snippage ...
alias ll='ls -l'
alias la='ls -A'

What look like gratuitous backslashes in PS1 actually make it work: they escape the unprintable stuff so bash (or whatever) correctly counts the length of the string. That way the command line wraps correctly and backspaces actually back up correctly from line to line.

It seems WordPress randomly eats backslash characters, so here’s that line with backslashes turned into pipe symbols. Use your favorite editor to replace pipes with backslashes and you should get the original text back:

PS1="|[|e[1m|][|[|e[33m|]|u|[|e[32m|]@|[|e[36m|]|h |[|e[37m|]|W|[|e[32m|]]||$ "

Incidentally, the reason you want a colored prompt is so you can find the prompts when you scroll upward in a terminal window. If all the text is the same color, you can’t spot the commands amid the output.

Edit /etc/bash.bashrc to turn on command completion:

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion

Add local addresses to /etc/hosts gateway oyster
 ... etc ..

Create NFS mount points:

sudo mkdir /mnt/bulkdata
sudo mkdir /mnt/diskimages
sudo mkdir /mnt/userfiles
sudo mkdir /mnt/music

Add NFS shares to /etc/fstab so they auto-mount:

oyster:/mnt/bulkdata    /mnt/bulkdata   nfs     defaults,noatime,noexec 0 0
oyster:/mnt/diskimages  /mnt/diskimages nfs     defaults,noatime,noexec 0 0
oyster:/mnt/userfiles   /mnt/userfiles  nfs     defaults,noatime        0 0
oyster:/mnt/music       /mnt/music      nfs     defaults,noatime,noexec 0 0

People pee all over NFS, but the alternatives seem worse. NFS preserves users & groups & permissions, doesn’t have the FAT 2-second timestamp resolution issue, and basically works. Admittedly, when the server goes Tango Uniform, things get really ugly, but that’s not a routine event.

If you have these files already set up on another system, you can fetch ’em using scp:

cd /etc
scp oyster:/etc/hosts /tmp
sudo mv hosts hosts.base
sudo cp /tmp/hosts .

Or, if you’re doing this in another partition, just cp the files from the old installation to the new one. Run diff on the two files to verify that you’ve changed what you think you have and that there’s nothing new sneaking in while you weren’t paying attention.