Little Annoyances: Mail.app

1) Next unread message.

I prefer to use a plain list view for a mailbox, and have to open a message to view it.

Remember Eudora? I used to use Eudora, and sometimes think I still should. It has this nice feature where you hit the spacebar, causing the current message to page down web-page style. When you reach the end hit that spacebar again and you jump to the next unread message in that mailbox. Nice, eh?

That does not work in Mail.

So, how about a key command to do that? Nope, not available either.

2) Invalid Email addresses.

What is so hard about telling me you can not send the email because I was too stupid to enter in a proper email address? Mail will happily harass you about opening too many windows at once.. so why not invalid email addresses?

Yeah, I caught myself BCC’ing several people, and some of them were not actual email addresses, just the domain name. Took me way too long to figure out too!

An Applescript for playing DVD’s off of your local drive

Joshua, now 2 and a half, loves to watch his Thomas the Tank Engine movies. I want to keep him away from the original media.. so the contents of the DVD is now on my drive.

Being irritated at the number of clicks I had to go through to play it, I found a script that would make things simple.

Thanks to the folks on the forums at applescript.net who also wanted to do this!.

Anyhow, here’s the script:

set prefix to “ExternalHD:”
set suffix to “:VIDEO_TS:”
set choice to “”
tell application “Finder”
set movies to the name of every item of alias prefix
set choice to (choose from list movies with prompt “Pick a movie to watch”)
set themovie to ((prefix & choice & suffix) as alias)
end tell

tell application “DVD Player”
activate
open dvd video folder themovie
set viewer full screen to true
play dvd
end tell

To use it you will need to edit the “ExternalHD:” to match wherever your movies are.

Looking for Disk Image Automator Actions!

Does anyone know of an Automator action, or Big Cat script, that when you right click on a mounted Disk Image, will unmount it and *delete* the original image.

Why? Well.. My download folder is huge.. and I need a faster way to look into a mounted disk image, test out whatever is in there and then delete it. If I like the application, or whatever it is, I will copy it to a more permanent location, and still need to delete the original!!!

If no such thing exists I’ll cobble one together, which should not be too hard seeing as I can start with Laine Lee’s work: Show Disk Image File of Selected Volume

Turning a man page into a PDF

In the end of a series of comments on Mike Harris’s article about Remind:

[minor edits by davidr]


#!/bin/sh

manpage to PDF generator

2004-08-02, Christopher Hansen

http://emilyandchristopher.com/

Usage: pdfman command

Creates command.pdf in current directory.

mandoc=/usr/bin/env man -w $1
grcmd=/usr/bin/env grog $mandoc
/usr/bin/env $grcmd | ps2pdf - > $1.pdf

To use it, select and copy the previous 11 lines. Then type the following into a Terminal window:

pbpaste > pdfman
chmod +x pdfman
cp pdfman ~/bin/

Now, if you type “pdfman remind” in a Terminal window, you’ll end up with a file called remind.pdf.

43 Folders Mike Harris looks at Remind

Thanks Christopher!

Installing Roundup on Mac OS X

I decided that I needed to install an issue-tracker for the support work I am doing, as jobs were trying to fall through the cracks.

This is the process I went through to install Roundup on Mac OS X 10.4.1 client, minus all the swearing, googling and reading the mailing list archives.

I grabbed the latest version, roundup-0.8.3.tar.gz, from Sourceforge and extracted it into a temporary directory. The README.txt led me to the Install Guide located in the doc folder.

From there I:

loki:~$ python run_tests.py

Which gave no errors..

Then I went back and followed the Basic Install steps:

loki:~$ sudo python setup.py install --install-scripts=/Users/davidr/bin

This installed everything as normal, except the administration scripts, which were installed in my bin/ directory.

I then created the storage space form my trackers:

loki:~$ mkdir ~/Documents/roundup/trackers

This is where the Support tracker will live, and any others in the future…

Then I installed the tracker:

loki:~$ roundup-admin install
Enter tracker home: /Users/davidr/Documents/roundup/trackers/support
Templates: classic-demo,minimal, classic
Select template [classic]: 
Back ends: anydbm
Select backend [anydbm]: 

 You should now edit the tracker configuration file:
   /Users/davidr/Documents/roundup/trackers/support/config.ini
 ... at a minimum, you must set following options:
   [mail]: domain, host
   [tracker]: web
loki:~$ 

This is where things got confusing, as the references in the Documentation are to “MAILHOST, TRACKER_WEB, MAIL_DOMAIN and ADMIN_EMAIL.” Which do not exist by these names in the config.ini file.

Since the tracker will only be used by me, I am putting it on localhost, and email will be disabled.

I opened /Users/davidr/Documents/roundup/trackers/support/config.ini and edited the following:

instant_registration = yes
# Avoids email confirmation for new users

web = http://localhost:8080/support/
# This is where I will access my tracker

In the section [mail] I also had to set these so the tracker would run, even though I will not use email;
domain = local
host = loki.local # my machine’s local name

Then in the [nosy] section I also changed:
messages_to_author = no
add_author = no
This is likely not needed as nosy gets disabled soon…

Now to initialise the tracker database:

loki:~$ roundup-admin initialise
Enter tracker home: /Users/davidr/Documents/roundup/trackers/support
Admin Password: (You need to create one!)
Confirm: (re-enter the same one from the previous line)

After that you need to get to the web interface, I decided to use the built in server and so all I did was to run:

loki:~$ roundup-server support=/Users/davidr/Documents/roundup/trackers/support/

and that notified me that it was running: “Roundup server started on :8080”, so I went to the page I defined in config.ini: http://localhost:8080/support/

Create a new user, and you are almost ready to use the system.

After that I needed to disable the email, and create a more automatic way to launch the server:

Disabled the use of ‘nosy’ ie. the email interface, see FAQ.

loki:~$ mv /Users/davidr/Documents/roundup/trackers/support/detectors/nosyreaction.py /Users/davidr/Documents/roundup/trackers/support/detectors/nosyreaction.py_disabled

I then created a double-clickable terminal file which will launch the Roundup server. Open a new terminal window, and then go File:Save as: and named it “Support Roundup Server” and set ‘Execute this command’ to

/Users/davidr/bin/roundup-server support=/Users/davidr/Documents/roundup/trackers/support/

I also checked the ‘Execute this command in a shell’. Now when I double click the file it launches the roundup server and I can watch the log as it goes by. Once I get tired of it and am convinced it works without me looking at it.. I will figure out a way to launch it when I login, and run it in the background and have errors go to a logfile.

rentzsch.com: fs_usage Intro

rentzsch.com: fs_usage Intro

[excerpts from his blog entry follow]
fs_usage is a command line tool that displays file system activity.

That’s a little better, but still a firehose. You can cut it down by grepping out the CACHE_HIT lines and grep’s own reads:

$ sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep

Now you have a solid base. It’s still a lot of information delivered pretty quickly, but now it’s realistic to — say — start the recording, do your thing, stop the recording and comb through the resulting logs.

Of course, you can further focus the output. For example, discover what files are being opened, as they’re being opened:

$ sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep open

Or, who’s writing to your disk:

$ sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep write

Howto: Mirroring a site that uses cookies which expire at the end of a session

• Open your browser to the apropriate page and login
• Sniff session while loading random pages from the site in the browser
• Leave broswer open to the site
• Stop sniffing the data, and analyze the dump from the site, find and copy the Cookie string
• With wget you add –header “Cookie: cookiename=data; secondcookiename=data” http://username:password@site to the options.
• make sure that you start mirroring from inside the site, ie: beyond the login page.

In my case the final wget string looked like this:

wget –mirror –convert-links –page-requisites –html-extension –cookies=off –header “Cookie:ABC%2ESession=YcnpPdnqLFCfYA6p%2DITgU84eRUVSrKV30; ASPSESSIONIDCCSTCRTT=GCCLDPDDKDIACCHE” http://username:password@site

Note that most of the cookie data has been deleted to keep this example brief.

Linux Tips — Firefox 0.9 remote newtab syntax

When I open a link from another application (gnome-terminal or evolution, for example), I would like it to open in a new tab in Firefox, so I had a script which I called newmoz:
firefox -remote %u201CopenURL($1,new-tab)%u201D
This is my default web browser. With Firefox 0.9, the syntax has changed. You now need:
firefox -a firefox -remote %u201Copenurl($1,new-tab)%u201D
I believe this has something to do with the confusion of the possibility of several related Mozilla applications running all at once, although I%u2019m not entirely convinced. To make it really snazzy, try:
firefox -a firefox -remote %u201Copenurl($1,new-tab)%u201D || firefox $1
This way, if firefox isn%u2019t already running, it will still work.

Adam Rosi-Kessel’s Fair and Balanced Weblog