or learn more

Aug 18, 2004

My One True Way

Recently I’ve had to reinstall OSX Panther on my PowerMac because of a weird issue with certain pictures (including some toolbar, dock, and menu icons) were being rendered in Grimace purple and toxic pee green. It wasn’t a ground breaking issue, but it was annoying and gave me an excuse to start from scratch and reimplement My One True Way, which had fallen out of harmony. My One True Way is simply my method of setting up my system in a way that makes sense to me. This encompasses directory structure, dock/menu usage, symlink creation, script writing, desktop background, desktop allocation, program installation, and program configuration. For the most part, M1TW is virtually identical across platforms except for a few differences in the programs installed. This post describes the approach that I’ve taken with OSX recently while deviations for other platforms are highlighted when appropriate.

Step 0 – OS Installation
For any system conforming to M1TW, all hard-drives are first repartitioned and each individually formatted and checked for bad blocks. Using the OSX Panther disk (as well as Linux and Windows) this is a trivial matter. However, I adhere to a strict partitioning scheme for most of my systems, although the details for each differ.

OSX (Panther at the moment)

    1. Partition 0 – OSX System files and home directory.
    2. Partition 1 – iTunes library
    3. Partition 2 – CVSROOT
    4. Partition 3 – Vault
Linux (Debian at the moment – Vanilla install)
    1. /dev/sda1 – /boot | 2MB
    2. /dev/sda2 – /
    3. /dev/sda3 – /swap
    4. /dev/sda4 – Extended
    5. /dev/sda5 – /home
    6. /dev/sda6 – /usr
    7. /dev/sda7 – /usr/local
    8. /dev/sda8 – /var
    9. /dev/sda9 – /tmp
    10. /dev/sdb1 – /cvs
    11. /dev/sdb2 – /vault
Windows (XP Pro at the moment)
    1. Partition 0 – Windows
    2. Partition 1 – Mike
    3. Partition 2 – Yuki
    4. Partition 3 – Vault
The partition scheme above are fairly self-explanatory, however a few exceptions need to be explained. First, for all of my systems I like to keep a Vault partition. The vault is a repository for essential programs, configuration files, and backups. I usually keep a copy of the latest versions of my essential programs (listed below), any periodic backups, mirrored copies of all important configuration files (XF86Config, .vimrc, .bashrc, .profile, nethack.sav, etc…), and a mirror of the CVS repository. This partition is ALWAYS stored on a separate disk from the main OS and is occassionally burned to a disk. The Mike and Yuki volumes are our own sandboxes for to play in.

Once the partitions have been created, formatted, and checked for bad blocks, then the real fun begins. I always install from media even though most Linux systems allow for network installations — I like the tactility of CD-ROMS.

Step 1 – Booting Up for the First Time
Once the OSes have been installed, it is now time to boot up for the first time and install the critical software, or as I like to call it, Ring 0 software. Ring 0 software is generally comprised of the following:

    1. Bash
    2. GCC
    3. Perl
    4. Python
    5. SSH
    6. Apache httpd
    7. PHP
    8. MySQL
    9. CVS
    1. Software Updates
    2. DevTools
    3. Fink
    4. X
    1. Latest C libs
    2. Gnome, Xfce, BlackBox, and CDE.
    1. Norton Internet Security
    2. Software Updates and Security Patches
    3. .NET Framework
    4. .NET SDK
    5. Cygwin
Of course before this can be done a network has to be established and all security measures must be taken. With OSX and Linux doing so is a snap, however with a Windows an extra step is needed. With Windows it seems that almost immediately after establishing an internet connection remote bots start exploiting a brain-dead security hole present in the stock installation configuration. That is, Windows by default leaves all network ports wide open, and spammers like to send pop-up messages via a certain port (the number escapes me at the moment) that Windows listens for Windows Messenger Services calls. This is why it is possible to leave a freashly installed system for a few minutes and come back a little later with a screen full of Viagra adds. Once Norton Internet Security is installed however, that problem is fixed forever. I don’t buy much Windows software, but when Microsoft decides to leave your system wide open for attacks, remote exploits, scumware, etc… then the $50 for Norton is money well spent.

Step 2 – Creating Directory Structure
After the Ring 0 software has been installed and the system rebooted, it is time to create the M1TW sanctioned directory structure. I really despise the way that most system’s directory structures are laid out (esp. Windows). Therefore, I tend to prefer a mish-mash of structures that I have experienced in the past. Currently, my custom structure resides in the home directory and is built as follows:
  • home
    • bin
      • base (symlink to /usr/bin or “Program Files”)
      • ext (symlink to /usr/local or “Program Files\ext”)
    • dev
      • dvdrw (symlink to dvd+rw drive)
      • flash (symlink to compact flash card)
      • ipod (symlink to ipod, OSX only)
      • mb01 (symlink to Motherbox01, OSX only)
      • usb (symlink to USB pen drive)
    • doc
      • apidoc (stores javadoc and similar documentation)
      • tech (manuals, howtos, etc…)
      • writing (my own stuff)
    • etc
      • cfg (various configuration settings)
      • games
      • music (symlink to iTunes library, OSX only)
      • video (movie files)
    • src
      • repos (local CVS checkouts)
      • oss (open source CVS checkouts)
    • tmp
      • dl (download directory)
      • void (my own recycle bin)
    • www
      • local (localhost site)
      • mirror (mirrored sites)
      • www (visible to the outside world)
Step 3 – Configuration
Once all of the directories have been set up, it is necessary to set up all appropriate programs to point to them. For example, in OSX iTunes needs to be informed where the iTunes library is located. For this I like to have iTunes copy all added music files to the location and handle the directory structure for me. That way I can handle all of the music file tags directly in iTunes and have it create the proper tree for them without spending countless hours in doing so myself. I would like to have a little more control over the matter, but for the sake of time I’ve decided to igonore the shortcomings in this process. Also, at ths juncture I liked to setup Apache to serve files from that www/www directory. I have a number of scripts written for bash-enabled systems (Linux, OSX, Cygwin) that allow me to do platform independent tasks after only a few minor changes. For example, I have a script that acts as a front-end to CVS and runs a few pre-processors on the source files that I wish to check in (there is also a similar script). I also have a cool script that instead of outright removing files it instead copies them into the tmp/void directory. There have been too many occassions where I have accidentally deleted important files permenently. During this step I also like to copy my custom .bashrc and .bash_profile files which have my own personal settings including prompt style, aliases, and CVSROOT settings. Finally, I like to setup my X environment with whatever video card I happen to be using at the time.

Step 4 – Program Installation
Now that my environment is set up, I usually move on to installing the Ring 1 software. That is, software that is not essential, but that I really really like to use. This software includes:
Step 5 – Eye Candy
Once the boring technicalities are out of the way, then the systems can be made to look pretty. Usually I choose a solid color background (I tend to like #000051), but occassionally I feel fiesty and decide for a picture background. In the past I have gone with: Chomsky, Penguins, HAL9000, Giant Robots, Suspiria, DC city-scapes, Destro, Turing, Turing Machines, Kolmogorov, Tux, BSD Daemon, Spider Jerusalem, and other things that I thought were cool at one point or another.

Finally, the computer is useable.


No Comments, Comment or Ping

Reply to “”