March 2007

Todo.txt – A Command Line Task Tracker

by damonp on March 28, 2007

in Lifehacks

I found Todo.txt by Gina Trapani, randomly last weekend and have been playing with it all week. Todo.txt is a todo list written in shell script. It should run fine under any system that supports a Unix like shell… Linux, OS X, Cygwin etc.

At any given time I have a half dozen post-it pads going with todo lists, usually the things that have to get done TODAY! Todo.txt is so simple to use I’ve misplaced most of my post-it pads (still need paper for the grocery list). :-)

Some examples:

todo.sh add This is my first task
todo.sh add Another task
todo.sh list
02 Another task
01 This is my first task
--
TODO: 2 tasks in /Users/damonp/etc/todo.txt.

Set task number one to the highest priority, A.

todo.sh pri 1 A
todo.sh list
01 (A) This is my first task
02 Another task
--
TODO: 2 tasks in /Users/damonp/etc/todo.txt.

I haven’t gotten much further than adding, prioritizing and marking off items, but the builtin help shows options for archiving, reporting, appending, prepending and deleting items.

Popularity: 1%

{ 0 comments }

Advanced OSX Mail Searches

by damonp on March 25, 2007

in Apple / Mac,Lifehacks

When you live and breathe email for work and play, it can be quite important to keep messages around for reference. In my business, client and project specific correspondence is supremely important as a record of what has been done, what needs done and project cost quotes among other things. The important information usually gets copied into my bug tracker, project information database and billing applications, but there is just something about the chronological nature of email that helps me follow a project.

What’s the point of keeping email around if you can’t accurately find the messages you are looking for? Apple’s Mail application can be used to do some heavy lifting searches if you can think outside of the box a little. Below are some examples of the general boolean search available directly in Mail.

Heads AND Tails

heads & tails

Heads OR Tails

heads | tails

Heads but NOT Tails

heads ! tails

Heads AND either Tails OR Both

heads & (tails | both)

While researching these search options I found some users that reported that and, or and not worked as well. This is not listed in the Mail documentation and I was not able to confirm their usage. These did not work on my machine. For reference, I am running 10.4.9 and Mail 2.1 (752/752.2).

From the Mail help system:

If you search the From, To, or Subject fields in selected mailboxes, Mail finds messages that contain the entire search phrase, in the order you entered the words. If you search an entire message or search in all mailboxes, Mail finds only messages containing words that have the same prefix (or the same beginning letters) as any of the words you entered in the Search field. The words can be in any order. For example, if you enter “box” in the Search field, the results would include “boxcar” but would not include “mailbox,” because “box” is not part of the prefix in that word.

The help document also mentions that any IMAP accounts need to be configured to “Keep copies of messages for offline viewing”. This setting is configured from the Advanced tab of the Accounts pane in Mail Preferences. The default is to cache “All messages and their attachments.” I use “All messages but omit their attachments.” I would like to use “Only messages I’ve read,” as that would omit all of the uncaught spam and messages that get deleted without being read, but from my tests that option still caches the attachments. I think caching attachments is a waste of bandwidth and local disk space, plus it doesn’t fit in with my normal usage. When I get an important attachment, I download it to a local folder, either a client folder to keep with the rest of the client data or to my general downloads folder where it can be dealt with and deleted when no longer needed.

I have been using a beta version of MailTags for a month now and am finding it more and more invaluable in tracking project and client emails. It adds customizable fields to messages so may easily tag a message with a project name or add notes to a message and adds to the built-in Mail search so you can search by these tags specifically. It also integrates nicely with OSX’s Calendar application, allowing you to create To Do items directly from the MailTags pane in a message.

Another searching option is to create a Smart Mailbox with your search parameters. Smart Mailboxes can be used to mix and match multiple search parameters in the same search. Don’t be shy about creating a Smart Mailbox to do a one-off search. Wouldn’t it be faster to create a Smart Mailbox, use it to find your messages and delete it afterwards than to manually search for a message for twenty minutes? You can also create a Smart Mailbox to pre-select a group of messages, say by including all messages from all of the parties involved in a particular project and then using Mail’s basic search over that Smart Mailbox to find only those messages that contain a particular keyword.

There are some shortcomings I find in Mail’s search and Smart Mailbox implementations. My biggest beef is that Mail won’t let you Cmd-select multiple locations to do a keyword search over. For instance, you cannot search for an email address that appears in the From or To fields. You can do separate searches for both and manually merge them in your head or setup a Smart Mailbox to do the task.

The Smart Mailbox implementation is also crippled in that you can only select messages by all the criterion you supply or by any single criteria not some of these but none of those. This can be overcome by using multiple Smart Mailboxes, one to select all of the messages you want and a second mailbox to deselect the ones you don’t need that happen to fall in to the first mailbox.

Say you would like all messages from a particular domain except the general address info@domain.com. First create the deselect mailbox that finds all messages from info@domain.com, then create a second Smart Mailbox that selects all messages from domain.com and add a second criteria to it that says “Mail is not in mailbox” and choose the deselect Smart Mailbox you created. This is a simplistic example that can be overcome by creating a box that manually selects all messages from user1@domain.com … userN@domain.com, but that would require you to know all of the addresses and key them in.

All in all Mail’s searching implementation is powerful if you know the right tricks. Have some more Mail search tricks? Post via the comments below.

Popularity: 1%

{ 0 comments }

Selecting Filenames with Non-Standard Characters in the Filename from the Shell

20 March 2007

An erroneous cut and paste in an iTerm left me with a group of empty files named after hex color codes. -rw-r–r– 1 root root 0 Mar 20 16:54 #ffffb0, -rw-r–r– 1 root root 0 Mar 20 16:54 #ffd850, -rw-r–r– 1 root root 0 Mar 20 16:54 #ff50a8, -rw-r–r– 1 root root 0 Mar 20 [...]

Read the full article →

Nolisting – Poor Man’s Greylisting

20 March 2007

Nolisting – Poor Man’s Greylisting I thought this was an interesting option to try to weed out some spam on servers inundated by spam. It wouldn’t be a permanent fix as it would only require a trivial workaround. But in my experience, these types are lazy and will go off to easier pickens if they [...]

Read the full article →

Zencart Inventory Report Update v0.9.2

18 March 2007

Feedback from users prompted me to add an extra column to the report display… the master category. The master_category_id is listed in the products table and is generally the category the product was originally created in (unless changed later). The report won’t show every category a product is listed in if the product has been [...]

Read the full article →

Combating Card Fraud (or at least slow it down)

15 March 2007

I have a major client whose Authorize.net gateway account gets hit sometimes hundreds of times a day with charge attempts. Most are posted by an automated script from IPs coming out of Indonesia or Eastern Europe in an attempt to find a valid credit card number and security code. Fortunately, it hasn’t cost the client [...]

Read the full article →

Quick and Dirty MySQL Backup Script

14 March 2007

I previously posted a Quick and Dirty MySQL Backup snippet that has gotten a bit of traffic. It works well in a pinch, but it doesn’t have any features. I use it primarily as a safety backup when performing maintenance on a MySQL server. Several of my clients have requested a script that they can [...]

Read the full article →

WordPress Revision History Plugin

12 March 2007

Editing a post is a necessity from time to time, especially with any type of coding related blog. I particularly like to keep older posts up to date with revised download links as new versions are released. This prevents a user following a link off of a search engine to an old post and downloading [...]

Read the full article →

ZenCart Inventory Report – Updated

10 March 2007

Thanks to Ron for posting a bug back on the Zencart forums about my Zencart Inventory Report Fixed… download… enjoy.

Read the full article →

Update tzdata for New Daylight Savings Time

10 March 2007

The fed mandated daylight savings time changes go into effect this weekend. To ensure you have the updated days do a quick test zdump -v /etc/localtime | grep 2007 If you see this Sunday’s date March 11 2007 then you have the updated package. Sunday’s DST change should be handled. [root@calypso files]# zdump -v /etc/localtime [...]

Read the full article →