BrT

Musings about technology and other neat stuff

BrT random header image

Adding growl notification to Raymond Page’s bash prompt code

September 8th, 2008 · Comments   

Update (2008/09/10): Giles Orr kindly pointed out that he is not the author of the bash prompt package I use, I have updated to give proper credit to the author, Raymond Page.

For some time I have used Raymond Page’s bash prompt code (heavily based on the work by Giles Orr in the Bash Prompt HOWTO, you can get it at http://gentoo-wiki.com/TIP_Prompt_Magic or http://code.google.com/p/homenix/source/browse/, you need to get .prompt, .prompt_functions and .prompt_config from the trunk/ directory), which I like very much because it is highly customizable, and although a lot of the functions are Linux-specific, it can easily be made to work on Mac OS X. It features context-dependent prompt colorization (e.g. based on whether the current directory is writable and on the machine load), automatic shortening of the prompt based on window width, and many other features.

More recently, I came across this hint for producing Growl notifications for shell commands that run for more than a predefined length of time, which I find extremely useful for knowing when those commands have finished.

Because both rely on some of the same mechanisms in bash, merging them is not completely straightforward. Here’s what I did:

  1. Download and install .preexec.bash as instructed in the hint.
  2. Add the preexec() function and preexec_install call to your .bashrc or .bash_login file (as instructed)
  3. Add the code from the precmd() function in the hint to the preexisting precmd() function in the .prompt file. I added it at the end. This is the main difference from what is described in the hint. I added it at the very end of the function.

That’s it - a nice bash prompt with growl notifications for long-running commands.

Posted by email from zzamboni’s posterous

CommentsTags: · · · · ·

Updated script for defining a new wallet item in 1Password

September 8th, 2008 · Comments   

If you have been using my method for defining new wallet items in 1Password, you may have noticed that in recent versions the display of those new items has been broken. I have updated the instructions and the script to work with the recent changes, you can get it from the same page.

Posted by email from zzamboni’s posterous

Comments

Time & Attention Presentation: "Who Moved My Brain?" | 43 Folders - Very useful presentation about managing your time, reducing interruptions, and making better use of your brain. (tags: productivity gtd 43folders presentations )
Comments




Edmodo - Microblogging For Education - Possibly useful Twitter-like platform with features specifically geared toward education, like groups, assignments and events. Longer review here: http://www.boxoftricks.net/?p=403 (tags: networking education microblogging tools collaboration )
Comments




Nostradamus - Entertaining demonstration of creating MD5 collisions among meaningful documents. (tags: md5 cryptography cool hash )
Comments




Build Your Own URL Shortening and Redirection Service in WordPress | WebDevLounge | design, development, SEO and wordpress | articles, discussion and community - Interesting description of how to build your own URL-redirection service using Wordpress custom fields. (tags: howto wordpress tips tutorial )
Comments




Fixing Mail.app’s recent mail addresses problem

September 2nd, 2008 · Comments   

I had noticed for a while that somehow my Mail.app’s “recent mail addresses” list was not updating (I never seemed to get any of my recently used addresses in Quicksilver). Today I noticed the following error message in /var/log/system.log:

Mail[365]: AddressBook failed to save: Error Domain=NSCocoaErrorDomain Code=259 UserInfo=0×10c9a810 “The file MailRecents-v4.abcdmr€ could not be opened because it is not in the right format.” ({\n NSFilePath = “/Users/dza/Library/Application Support/AddressBook/MailRecents-v4.abcdmr”;\n NSUnderlyingException = Fatal error. The database at /Users/dza/Library/Application Support/AddressBook/MailRecents-v4.abcdmr is corrupted. SQLite error code:1;\n})

While trying to figure out what was wrong, I discovered that the file for some reason had an ACL that prevented everyone (including me!) from modifying it:

~/Library/Application Support/AddressBook $ /bin/ls -lea MailRecents-v4.abcdmr
-rw——-@ 1 dza staff 102400 Feb 4 2008 MailRecents-v4.abcdmr
0: group:everyone deny write,delete,append,writeattr,writeextattr,chown


So I removed the ACL:

$ /bin/chmod -a# 0 MailRecents-v4.abcdmr

And the error is gone! The file was not corrupted, but Mail could simply not write to it. The puzzling part is how did that ACL end up there…

Posted by email from zzamboni’s posterous

CommentsTags: · ·

My GTD system

September 1st, 2008 · Comments   

Here’s my mapping from David Allen’s GTD workflow to the parts in my system that implement each component. My main electronic tools are Things (http://culturedcode.com/things/), Journler (http://journler.com/), Mail.app and iCal. My main physical tools are my HPDA, my physical tickler file, my A-Z filing cabinets and my “inbox” and “pending” boxes.

(the workflow image is © David Allen & Co.)

Posted by email from zzamboni’s posterous

CommentsTags: ·

Testing posterous

August 28th, 2008 · Comments   

Posterous looks quite nice, with the ability to “do the right thing” for different media types, and to autopost to other places. I have just set it up to autopost to my blog (http://zzamboni.org/brt/), we’ll see if it does the right thing.

It should also auto-post to Flickr, so here goes a test photo.

Posted by email from zzamboni’s posterous

Comments

Moving to FeedBurner

August 19th, 2008 · Comments   

I have just configured things so that my RSS feed is served through FeedBurner. I am using a Wordpress plugin so that the redirection should be transparent (here’s the FB url: http://feeds.feedburner.com/BrT), but if you notice anything broken, please let me know.

Of course, I haven’t posted anything in so long that I wonder if anyone will even notice. That’s what having a second baby will do to you :-)

CommentsTags: