While the Apple Mac OS X graphical user interface is beautiful and very easy to use, having a powerful Unix command line at my disposal gives OS X something extra. Out of the box Terminal (Applications -> Utilities -> Terminal) is ready to go, but I like to customize all parts of my computer, so here is what I’ve done to Terminal.
I use a colored theme to provide high contrast in my Terminal window. This improves readability tremendously. The theme I like currently is called GiovanniStyle. It uses light yellow on a dark blue background. While the author suggests Consolas for the font I am using Anonymous Pro. Consolas comes with Microsoft Office which I don’t have installed. There is a free font called Inconsolas that mimics the Microsoft offering, but I still like the Anonymous appearance better.
The only drawback to GiovanniStyle is view manpages. By default some of the colors used in man’s output is not contrasty enough to be legible. Consequently I added a section to my .bash_profile to compensate. Here are the color designations I’m using for manpages:
# Color man pages:
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;31m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[01;32m' # begin underline{{ $image := .ResourceGetMatch “terminal.png” }}
Speaking of bash, I’ve modified my prompt, to make it standout more and to provide the information about who I’m logged in as and what my current working directory is, in a manner pleasing to me. Here’s the prompt:
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\]\n$\[\033]0;\u@\h:\w\007\] 'I do not pretend to understand (yet) all the ins and outs of what goes in a .bash_profile and what goes in a .bashrc file. With that disclaimer in mind, I know the .bash_profile is the personal initialization file, which is executed for login shells, and the .bashrc file is the individual per-interactive-shell startup file. In my case I tend to have PATH additions and exports in .bash_profile, while keeping aliases and functions in my .bashrc.
This is my current .bash_profile:
# .profile
# get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH="~/bin:${PATH}"
fi
# set PATH so it includes /usr/local/sbin if it exists
if [ -d /usr/local/sbin ] ; then
PATH="/usr/local/sbin:${PATH}"
fi
# set PATH so it includes /usr/local/bin if it exists
if [ -d /usr/local/bin ] ; then
PATH="/usr/local/bin:${PATH}"
fi
export PATH
# user specific environment and startup programs
# setup for java
JAVA_HOME=/Library/Java/Home
# configure how history works
HISTCONTROL=ignoredups # ignore the line if it matches previous line
HISTFILESIZE=20000 # size of the history file cf. also shopt -s histappend
HISTSIZE=1000 # size of the run-time history list
HISTIGNORE=ls:ll:la:l:cd:pwd:exit:mc:su:df:clear # do not put these in history file
# add colors to terminal (see man ls for details)
CLICOLOR=1
# Order:
# 1. directory, 2. symbolic link, 3. socket, 4. pipe, 5. executable,
# 6. block special, 7. character special 8. executabel with setuid
# bit set, 9. executable with setgid bit set, 10. directory writable
# to others, with sticky bit 11. directory writable to others,
# without sticky bit
#
# Colors
# a - black, b - red, c - green, d - brown (yellow), e - blue, f - magenta,
# g - cyan, h - light grey
# A - Bold black, B - Bold red, C - Bold green, D - Bold brown (yellow),
# E - Bold blue, F - Bold Magenta, G - Bold cyan,
# H - Bold light grey (appears bright white), x - default color
LSCOLORS=gxFxCxDxBxegedabagacad
# export settings
export JAVA_HOME HISTCONTROL HISTFILESIZE HISTSIZE HISTIGNORE CLICOLOR LSCOLORS
# Color man pages:
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;31m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[01;32m' # begin underline# user specific functions and aliases
# source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# prompts
# set prompt: user@host working directory new line $ using colors
# also set title to user@host and display current directory
PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\]\n$\[\033]0;\u@\h:\w\007\] '
# some alias settings, just for fun
#alias 'today=calendar -A 0 -f ~/calendar/calendar.mark | sort'
alias 'today=calendar -A 0 -f /usr/share/calendar/calendar.mark | sort'
alias 'dus=du -sckx * | sort -nr'
alias 'adventure=emacs -batch -l dunnet'
alias 'mailsize=du -hs ~/Library/mail'
alias 'bk=cd $OLDPWD'
# function to force prompt before overwriting
function r() {
rm -i $1
}
alias 'rm=rm -i'/usr/share/calendarThe dus alias produces a list of directories and files sorted into order from largest to smallest. It recurses through all sub-directories from where it is run, i.e., running it from your home directory could take a while depending on your processor and the number of files on your system. You can add an -h flag to the du command to get a human-readable output, but that breaks the sorting.
Adventure is fun, you should give it a try. Don’t blame me however, if you get eaten by a grue.
Mailsize spits out the current size of your mail directory. I’m up to 5 GB myself.
bk takes you back to the previous directory. It’s the same as cd - only shorter.
The r function and the rm alias are measures designed to protect me from careless use of the remove (rm) command. Be warned that issuing a rm -rf neatly sidesteps these “protections.” Command-line-interfaces are powerful and therefore can be dangerous.
From the first time I used my PowerBook nearly seven years ago until today, Safari has been my browser of choice. I dabble with all the major players, and a few of the minor ones, but I always come back to Safari.
It isn’t perfect however. There are two “enhancements” I make to my copy to better suit my browsing style.
By default, any time a web site uses the target="_blank" attribute on a link, Safari will open that link in a new window. I prefer it to open in a new tab in the current window. Open a Terminal window (Applicaitons -> Utilities -> Terminal) and enter the following command:
defaults write com.apple.Safari TargetedClicksCreateTabs -bool trueYou’ll need to re-start Safari for the change to take effect.
Ads and auto-loading Flash are annoying. The wonderful ClicktoFlash plug-in gives you control over what Flash plays and what doesn’t. I’m running the latest beta version without any difficulties at all. Download the plug-in, quit Safari, and install. Re-start Safari and after you visit a page with embedded Flash you’ll see a new Safari menu item: ClickToFlash…. The Preferences option there will let you configure the plug-in to your tastes. Here is how I have my plug-in configured:
{{ $image := .ResourceGetMatch “createTabs.png” }}
I allow sIFR text replacement to work automatically, and I opted to have YouTube play videos encoded for H.264 with QuickTime instead of Flash.
Shortly after moving to Kansas City I discovered a dish called “Dublin Coddle.” It’s a meat-and-potato-lovers dream soup. I’ve not made it in a very long time and wanted to try it again. Over the weekend we gathered the ingredients but ended up not making it. It needs to cook long and slow which lends itself to weekend cooking but not so much during the week. Then Sibylle suggested I make it at lunch and let it cook all afternoon. So that’s what I did and it turned out beautifully.
I suppose you could do this in a crock pot, but ours is the large economy size, and works best when it’s two-thirds full or more. So today I made coddle in an oven-proof 3-quart pan with a light fitting lid.
Slice the bacon into 1-inch pieces and put into pan with beef broth. Cut the sausage into bite-sized pieces and add to broth mixture. Bring to a boil and then simmer for 5 minutes.
Wash the potatoes. We like the skins so I leave them on. Slice the potatoes into thick slices. Peel and slice the onion into disks.
Remove the sausage and bacon from the broth and reserve the broth in a bowl for now. Cover the bottom of the pan in a layer of potatoes. Add a layer of onion and bacon, using half of each. Cover that with half the sausage. Repeat with another layer of potatoes, onions, bacon and the rest of the sausage. Cover the top with the last of the potatoes. If you add carrots sprinkle them into each layer of sausage.
Re-add the reserved broth and place in the oven at 250º for several hours. I cooked mine for 5 hours and it was perfect.
Serve hot, perhaps with thick bread.
I didn’t add any seasoning either in preparation or presentation. The salt from the bacon, the sweetness from the onion, and the seasonings from the sausage combine to create a wonderful flavor. I used sweet Turkey Italian sausage for this batch, you could substitute any other coarse or crumbly sausage I think.
Next time I want to try some leeks for a little added color and flavor.
One of the largest sets of data I had to transfer from my PowerBook to my MacBook Pro was my picture library. It took two tries and some fiddling around to get everything setup properly, so hopefully my posting here will save someone else the time and frustration I had.
You could use Apple’s Migration Assistant if you were willing to create a new account on the new machine. As near as I can tell Migration Assistant refuses to work unless it targets a new account. I decided before getting my new computer that I want to start fresh and not just blindly copy data from old machine to new, therefore using the Apple too was out.
For my initial attempt I booted the PowerBook into “target disk mode” by restarting it and holding the “T” key down until the FireWire symbol appeared on the screen. I then plugged it into the MacBook using a FireWire cable and it appeared as a new, mounted drive. I opened up iPhoto and chose the “File | Import to Library…” option. In the resulting dialog box I selected the iPhoto library on the FireWire connected drive and sat back to watch. Within a few minutes my entire photo library had been imported.
Unfortunately none of the albums were imported and therefore the collection was highly disorganized. I didn’t realize this at the time and started adding new pictures to the new iPhoto library from my camera right away. When I did realize that the pictures had lost their organization I wanted to re-import the library but not lose the newly added photos. Were I to do this again I would follow these steps and then start adding new pictures:
Moving data from an old computer to a new computer is a bit like moving in the real world. The anticipation of having all your stuff neatly put away, orderly and tidy in the new place isn’t enough to carry you through the actual doing.
Rather than just copy all my old documents and files from the PowerBook to the MacBook Pro I decided I’d sift through the data and copy what I wanted and needed. And that I would impose better (or at least different) organization as I went. After two days I’ve barely scratched the surface.
I could wave a white flag and just copy the lot of it from one machine to the other. I’d have all my stuff, and for the most part I’d know what the was and vaguely where it was at. Somehow that feels like moving to a brand new never-been-lived-in-house and bringing all your old two-by-four furniture and cinder block bookcases.
Or I could create a “PowerBook” directory on the new machine and park all the data there. Then I could leisurely sift through when the mood struck me and organize and catalog and properly locate everything. Yeah, right. This method has worked so well in the real world that there are boxes in the garage which have been moved two or three times, perhaps across state lines.
Leaving the data where it is (on the PowerBook) and only going to it when I need something is an option. I think of this as the “storage locker” approach. For several years some portion of my belongings were in storage about 5-minutes drive away from where I lived. Periodically I would want something that was “in storage.” Sometimes I’d go get it and sometimes not. Having to go there and find it made it surprisingly easy to live without some things. And sometimes when it was something I really needed, like my passport, hours were spent in fruitless searching. Not having a storage locker is truly a blessing.
The pain or cost of having to go to the storage location was good in a way, and leaving my data on the PowerBook until I need or want it would mimic that “cost.” Perhaps this would be good in that I would be less likely to copy stuff willy-nilly but rather only copy that which I truly needed.
If for some reason the PowerBook was going to go away I’d copy all the data in a heartbeat and sift through it on the new machine over time. But the PowerBook isn’t going away, and it is backed up in case it’s hard drive decides to stop working, so for now I think I’ll try the virtual boxes in the garage approach to transferring my data.
Now that I have most of the software I use on a recurring basis installed on the MacBook Pro, it is time to start addressing my data. Pictures and music were the low-hanging fruit, and have already been transferred. (Although I am considering deleting all the pictures and re-transferring them via the Migration Assistant. Doing it manually certainly worked, but the folder hierarchy I had before was lost. I really don’t want to recreate it and re-sort thousands of images.)
The rest of my data breaks down into about eight types: E-books, Manuals, Word documents, Excel spreadsheets, Powerpoint presentations, diagrams, PDF, and RFT files. Figuring out where to put all of this on the new machine isn’t as easy as simply copying it across. The current organization scheme grew organically and without much thought at times. It is less an organization and more a hodge-podge.
When a new user account is created on a Macintosh computer there are some directories included in the user’s home directory by default. They are:
The Dropbox folder itself, not the software that enables the client, is located in my home directory. This is the default location and I’m used to it and think it works very well.
bin is the folder where my program scripts, either bash, Ruby, or Python, live. bin is short for “binary.”
Projects is where I keep any source code that I am developing, or the files associated with a software project, e.g., WordPress site themes or web site files.
With a precedent set of adding home directories for specific uses, I need to decide whether my remaining files go into one of the established directories or into a specially created directory just for them.
I have been an avid e-book reader for several years. I got hooked on the format with a Palm and consequently most of my e-books are in the eReader format. I also have a number of PDF or Word copies of books. Heretofore my eBook folder has been located under the Documents folder in my home directory. However, eBooks aren’t Documents, they are specialized in format and purpose. I think it’s time to move eBooks out of Documents and into it’s own directory, Ebooks.
Over the years I’ve collected a number of technical books and references, some as PDFs, others as self-contained web sites. While these could be considered eBooks none of them require specialized or proprietary software to be viewed. I’ve always kept them in a directory in my home directory. I see no reason to change that now.
Historically I have tended to keep a directory under my Documents directory for each of these file types. I think this grew out of wanting to set a default save location for each in their respective programs. Over time these three directories have become the most jumbled and chaotic. Each is littered with files and sub-directories. The sub-directories were an attempt to impose order. “Resumes,” for example is a sub-folder under Word that houses many examples of my resume. It also holds some Rich Text Format (RTF) copies of my resume, and some PDF copies as well. I put the non-Word format files in with the Word-format ones since that is where my resumes were. Adding insult to injury not all of my resumes are in the Resume directory, there are a few running around loose in the Documents folder.
The Excel directory is equally messy for the same reasons. Powerpoint isn’t too bad simply because I don’y have too many slide shows. However it does hold a couple of OpenOffice Presentation files.
Clearly it is time for a major rethinking regarding how to organize files produced by my office productivity suite. Since I am switching from Microsoft Office to OpenOffice this seems like a good time to abandon the Word - Excel - Powerpoint triumvirate. The better approach I think would be to promote the sub-directories from inside Word, Excel, and Powerpoint, so that they live directly under Documents. Instead of saving things based on their file type, save them by topic. All resumes, regardless of file type, go in the resume directory.
The hard part will be moving everything around and developing a good sense for topics.
These files have their own directory on my old machine just like Word, Excel, and Powerpoint. And just like those three, it is a somewhat chaotic jumble of files. Once again, grouping files by type wasn’t a good idea. Henceforth PDFs and RTFs will be stored in the topical directory where they belong.
The final broad category of files are diagrams. Some of these are Visio documents I’ve saved from previous employment engagements and the rest are Omni Graffle files. And like all their sibling file types, these have tended to be segregated by file extension. So, just like the rest these files will be stored in the topic for which they were created.
With the addition of the new top-level directories, and the shifting of file-type directories to topics, the new hierarchy looks like this:
In Backing Up iTunes Purchases I talked about how I made DVD backups of a portion of my iTunes library. Now that I have a significantly larger hard drive (320 GB versus 100 GB) it’s time to put the restore feature to the test.
After an initial scare when I couldn’t find the backup where I thought it should be, everything seems to be working swimmingly. My recollection was that I had backup my iTunes purchases to one of my external backup drives, however I wasn’t able to find the material on either of those disks. For a few minutes I wondered if the backup had been there only to have been overlain with a subsequent full-drive backup. Then it occurred to me to re-read the posting I made, maybe I had left my self a clue.
Turns out the backup wants to be to CD or DVD. Armed with that knowledge it was relatively short work to find the five DVDs I made in May 2008.
Restoring from the DVDs is simple. Insert the disk into the computer and iTunes asks if you want to restore. There’s an option to overwrite existing material, but otherwise you just click restore and sit back while the process happens. It could not be simpler.
The following is a list of the software I installed on the new MacBook Pro in the first 24 hours.
There are some tools (VirtualBox being a good example) that insist on installing themselves in the root application folder, and I am content to allow that to happen. It means my /Applications folder won’t be pristine, with only Apple provided applications, but it will be much cleaner than the hodge-podge of nearly 300 applications my old machine had collected.
In addition to these installs I also imported 8,652 pictures via FireWire from the PowerBook. I also imported 7,081 MP3 files to the new machine. I setup Mail to read my IMAP Gmail account, and I imported the latest Address Book backup, via Dropbox, to enable email and chat.
The new machine is amazingly fast and responsive - importing pictures from the digital camera was astonishing. The whole process was over in less time than it takes the PowerBook to recognize that a camera is attached and to prepare the import. It also synchronized my 30,000 or so email messages relatively quickly, having more than an 802.11b wireless card makes a huge difference.
There are still a couple of outlier programs to install, and some development tools to download, build, and install, but by and large the machine is ready for 95% of my daily use. Now I need to focus on the 50 GB of documents, spreadsheets and other data files on the PowerBook to determine what to migrate, and how to better organize it on the MacBook Pro.
Not since February 2003 (maybe late January of that year) have I gone to work without carrying my PowerBook G4. It has been the ultimate filofax, holding pictures, music, words, code, and all the other electronic flotsam and jetsam near and dear to me.
Tomorrow will be the first day I’ve ventured off to work without it.
Of course tomorrow will also be the first (full) day that I carry the new MacBook Pro to work.
Not a bad trade all things considered. Still, there is a feeling of nostalgia, of loss tonight. Macs were thin on the ground in central Illinois 7 years ago. My PowerBook was unique and drew attention as a result. Even in 2004 when I took it to work in Kansas City it was different enough to attract some attention. Working for the University I am surrounded by MacBooks, MacBook Airs, MacBook Pros, and Mac Pros.
Seven years ago having a PowerBook and taking it with me nearly everywhere I went made me stand out in the crowd a little bit. It was an introverts way of being different. While I may not stand out in the crowd of Mac fans at the University, I am pleased to be one of the Mac-toting crowd there.
My new MacBook Pro was delivered this morning, less then two-and-a-half days after it shipped from Shanghai China. It is stunning and sleek, simply beautiful. I am very pleased with my choice.
As some of you might have guessed from the title of this posting, I’ve named the new machine BlackPerl. I thoroughly enjoyed the movie Pirates of the Caribbean: The Curse of the Black Pearl, and particularly liked the bits about the pirate’s code being more guidelines than rules. Anytime now when I hear the work guidelines used, mentally I say to myself, “They’re more like guidelines, welcome to the Black Pearl.” Typing the word pearl is difficult as I tend to spell it perl, which is the name of a powerful computer programming language. Sibylle pointed out that I was tending to spell Black Pearl, Black Perl, and the name stuck. I like the irony and the pun.
Migrating data, installing applications, and generally configuring the new laptop is now the order of the day. Probably the next several days.
Unboxing pictures will be up later this evening on Flickr, and over the next few days I’ll have postings about setting the machine, and some performance comparisons with my venerable PowerBook. (By the way, my Powerbook has been on continuously for 40 days and 22 hours as I write this; not bad for a 7-year old computer that travels everyday.)