Archive for the ‘Linux’ Category

using mh-e under GTD

Sunday, April 20th, 2008

mh-e-gtd

1 Introduction

One thing you need to get to grips with when using GTD is the

  • Collect,
  • Process,
  • Organise,
  • Review,
  • Do

cyle.

This article focuses on how mh fits into this part of the equation for
me with the email part of my GTD. I use org-mode (another emacs mode)
for maintaining my lists, and find mh-e and org-mode work quite nicely
together.

I’m assuming that if you are using MH and mh-e under linux/unix etc,
you need no introduction to shell scripting, cronjobs etc.

1.1 Principles

When I go through my inbox in the morning I usually have around 60-80
emails which have collected overnight. These are a mixture of system
messages from our servers, a small number of low volume mailing lists
which I want to see daily (mh-e, org-mode, linux-thinkpad), and the
rest are emails from people I work with (from the same organisation,
from other organisations within the NHS, or from our commercial
customers).

Using the two minute rule, I deal with each email using one of the
following options:

  1. read and delete;

  2. read and file (no further action required, but want to keep for reference);

  3. read and reply (if can do in less than 2 minutes), followed by
    delete, file (for reference) or file for followup (see later);

  4. file into @today folder for emails which I need to deal with but
    will take more than 2 minutes. When I have finished going through
    my inbox, the @today folder is usually the next one I look at as I
    know there are emails there which need dealing with;

  5. file into +pending/tonight – usually personal emails I want to get
    out of my way so I can deal with them at home in the evening.

  6. file into one of my pending folders – these are for emails which:

    a. I can’t do anything about now (for example, I need to be in
    the lab to deal with, and won’t be there for a few days);

    b. are time dependent (agenda for a meeting, which I want to come
    back to me the day before the meeting);

    c. I want to cogitate about (a difficult email I want to think
    about for a few days before replying)

    d. I’m waiting for a response on – for example, if I send an email
    asking somebody to do something, I either put a note into my
    lists for that person, so I can check the progress when I next
    see them, or I may think that I would like to see that email
    again in a months time back in my inbox.

Some ‘time management’ methodologies say that you should only handle
each piece of paper (or email) only once. However, I have no problems
with seeing emails (or pieces of paper in fact) multiple times – it is
no different from reviewing your lists on a weekly basis in my
opinion. I know that sometimes I will be smarter in a few weeks or
even a few months time, and want emails to be automatically picked up
from their pending location and popped back into my +inbox at that
stage. Therefore I set them to ‘incubate’ in one of my pending
folders, knowing that they will be brought to my attention at a time
of my choosing.

So with the principles out of the way, here is how I do this.

1.2 Setting up your folders

The following commands will set up your basic set of folders for you:

 folder -create +@today
 folder -create +pending
 folder -create +nextweek
 folder -create +tonight
 folder -create +tomorrow

 for (( f = 0; f < 32; f += 1 )); do
 folder -create +pending/d$f
 done

 for i in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
 do
 folder -create +pending/$i
 done

 for i in Sunday Monday Tuesday Wednesday Thursday Friday Saturday
 do
 folder -create +pending/$i
 done

1.3 The crontabs

Using crontabs is the key to making all of this work.

This is my crontab:

 # m h  dom mon dow   command
 # minute (0-59) hour (0-23) day of month (1-31) month (1-12)  day of week 0-7 (0 or 7 is Sun)
 PATH=/bin:/usr/bin:/usr/bin/mh
 HOME=/home/pete
 # run this every saturday morning at 1:10 am
 # see http://rand-mh.sourceforge.net/book/mh/e-rmmer.html
 10 01 * * 6 /usr/bin/find /home/pete/Mail/DELETE -mtime +10 | /usr/bin/xargs /bin/rm
 #############################################################
 #  Mail Section
 #############################################################
 ### Each month, refile all the pending stuff back to my inbox.
 ### 1:10 on the first day of each month
 10 4 1  * * $HOME/bin/monthly-pending
 ### Each monday refile all the next-week stuff
 15 4 *  * 1 $HOME/bin/weekly-pending
 ### Each day also has its own pending - Saturday, Sunday etc
 20 4 *  * * $HOME/bin/day-of-week-pending
 ### Each date of the month (1-31)  also has its own pending - d1, d11, d31 etc
 25 4 *  * * $HOME/bin/day-pending
 ### Each night at 17:30 - refile all pending/tonight to inbox
 30 17 *  * * $HOME/bin/tonight-pending
 ### Each night at 12:30 - refile all +today stuff back to +inbox
 40 01 *  * * $HOME/bin/today-refile-to-inbox
 # Each day refile the tomorrow pending back to +inbox
 35 4 *  * * $HOME/bin/tomorrow-pending
 #############################################################
 # email reminders about checking the various daily files
 # (physical, not email folders) I need to check - the 31 folders.
 #############################################################
 35 6 * * * /bin/echo "Check your black folder - stuff for lab." | /usr/bin/nail -s "check black folder - stuff for work ?  stuff to file ? receipts for office etc ?" pete@smtl.co.uk
 35 6 * * * /bin/echo "Check your daily files." | /usr/bin/nail -s "check daily files" pete@smtl.co.uk
 # index mail every hour. YMMV!
 30 * * * * /usr/bin/mairix -f /home/pete/Mail/.mairix/config 2>/dev/null

Note that I also use the rmmer scripts so that when I delete emails,
they are actually moved to +DELETE, and only deleted from there when
they are 10 days old by one of the cron jobs.

http://rand-mh.sourceforge.net/book/mh/e-rmmer.html

1.4 The shell scripts

These are very short shell scripts. You could proably stick them
directly into your crontab if you preferred.

1.4.1 monthly-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this months folder and stuff into inbox
 refile -src +pending/`date +%b` all  +inbox

1.4.2 weekly-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this months folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/nextweek all  +inbox

1.4.3 day-of-week-pending

 #!/bin/sh
 # shell script to be run monthly which will take all pending stuf
 # from this day's folder and stuff into inbox
 refile -src +pending/`date +%A` all  +inbox

1.4.4 day-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this day's folder and stuff into inbox
 # these mailboxes are labelled +pending/d1 - +pending/d31
 refile -src +pending/d`date +%-d` all  +inbox

1.4.5 tonight-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/tonight all  +inbox

1.4.6 today-refile-to-inbox

 #!/bin/sh
 # shell script to be run daily which will take all emails from the today
 # folder and stuff into inbox
 /usr/bin/mh/refile  -src +@today all  +inbox

1.4.7 tomorrow-pending

 #!/bin/sh
 # shell script to be run daily which will take all pending stuf
 # from this folder and stuff into inbox
 /usr/bin/mh/refile  -src +pending/tomorrow all  +inbox

1.5 How does it all work ?

So every day, I process my emails. I deal with emails in +@today later
in the day, but if I don’t get to them (something else comes up which
takes priority), they all get filed back into my +inbox during the
night. This is because the next day my priorities will have changed so
an email I thought I should deal with may now be one I need to delete.

If I file an email now (April) into +pending/November, then on the 1st
November, the crontab will refile it back into +inbox.

This is the same for all of the pending files – emails will stay in
the apporpriate folder until the crontab picks it up at the
appropriate time and dumps it back into +inbox.

If you have read GTD, you will probably recognise this as the 42
folders principle – each day you open the day folder and dump it into
your in-tray, and each month you dump the contents of that into your
in-tray and then process.

1.6 Other folders

These are my other top level folders:

1.6.1 +Contacts

In here I will have folders for anybody I receive emails from

 +Contacts/bill.wohler
 +Contacts/carsten.dominik
 +Contacts/joe.smith

I have around 1,400 folders in here

1.6.2 ‘+OUT_MAIL’

I have a custom header added to my emails in my components and
repl.comps files etc, so that every single email I send has the
following header:

 Dcc: pete@smtl.co.uk

See http://rand-mh.sourceforge.net/book/mh/hea.html for details.

This makes our mail server send the email back to myself, where
procmail can pick it up and file it according to a set of rules. The
most basic one is:

MONTH=`/bin/date +%b`
YEAR=yr`/bin/date +%Y`
RCVSTORE=/usr/lib/mh/rcvstore             # rcvstore location

 :0
 * (^Received: from lap1.smtl.co.uk.*)
 {

 :0
 * (^To:.*jim.smith@domain.net.*)
 | $RCVSTORE +Contacts/jim.smith

 [other rules go here]

# Otherwise, stick in OUTMAIL, filed by month/year ...

 :0 E
 * .*
 | ${RCVSTORE} +OUT_MAIL/$YEAR/$MONTH
 }

which checks if it is an email I sent from my laptop, and if so
assumes I have routed it back through procmail so it can be
filed. After going through rules which automatically file emails into
person specific folders, anything else just gets filed in an outbox by
year and month.

Note that you will have to check whether your MTA supports the Dcc
header. We use postfix, which is OK, and previosly used sendmail,
which also supported this.

1.7 Mailing Lists

I belong to around a dozen mailing lists, some of which are high
volume. I don’t have these funneled into my +inbox – using sieve, they
go into list-specific folders on our imap server, and I scan them
around once a month. I would recommend that unless you belong to
mailing lists which are mission critical to your work or projects, do
not have them delivered to your +inbox, as it makes the processing
phase take way too long. You want to be able to process your +inbox
in 30-60 minutes if you can.

$Revision: 1.2 $

Author: Pete Phillips
<pete@smtl.co.uk>

Date: 2008/04/20 16:00:18

Fixed problem with dead USB ports under Ubuntu Gutsy on Lenovo X61s

Wednesday, January 30th, 2008

THE PROBLEM:

Original Post to thinkpad mailing list
Hi

I am running Ubuntu 7.10 on a Lenovo X61s. very nice I have to say.

When I run suspend (to RAM), when the machine comes back up, everything
else works (usually) except USB. I have tried restarting the dbus
daemon, unloading and reloading uhci_hcd and ehci_hcd.

Note that *all* my USB ports are dead – I have seen posts where the RHS
ones only are dead after resume.

A complete reboot brings everything up as normal.

I have the acpi_sleep=s3_bios in my kernel at boot, as that fixed
problems I was having with the ipw3945 wifi card.

I have also set the PCI IRQ to Auto in the BIOS (made no difference).

THE SOLUTION:

The dead USB problem on my X61s with Ubuntu 7.10 (Gutsy) after resuming
from suspend has been fixed by upgrading the kernel to 2.6.24 (it was previously
the default 2.6.22 shipped with Gutsy).

Thanks to Peter Fruehberger for guiding me through the process and
providing an appropriate .config file for the kernel build.

Since performing the upgrade last night, I have performed 3-4 suspends
and the USB slots are still working! I still have

acpi_sleep=s3_bios

In my kernel options for the backlight problem. Not sure if that is
needed anymore.

This is the procedure I followed, based on Peter’s advice.

Upgrading 2.6.22 to 2.6.24 under Ubuntu 7.10 for X61s

Download and unpack kernel to /usr/src/linux-2.6.24

download thinkpad_acpi patch from

http://sourceforge.net/project/showfiles.php?group_id=117042

to /usr/src/thinkpad-acpi

patch kernel:

cd /usr/src/linux-2.6.24
patch -p1 < ../thinkpad-acpi/thinkpad-acpi-0.19-20080107_v2.6.24-rc7.patch

copy current kernel config


cp /boot/config-2.6.22-14-generic .config
make oldconfig

the next step is to do this:

make menuconfig (add iwlwifi and snd_hda)

for the snd_hda, go to Device drivers/Sound/PCI Devices
and select snd_hda as a module

I found the ‘make oldconfig” step confusing as I was faced with a
bunch of questions about experimental options. I wasn’t sure what to accept so emailed
Peter Frühberger who sent me his config file which you can pick up from here:

http://www.philfam.co.uk/pete/ftp/config-2.6.24-x61s.bz2

I copied this to the main directory as .config and compiled with this:

sudo make-kpkg clean && sudo make-kpkg --append-to-version "-test1" --initrd kernel_image

The .deb package is installed in the parent folder (/usr/src).

Peter said I needed to make sure I had the appropriate firmware files installed
in /lib/firmware/2.6.24-test1/

> Just copy over the whole content of the folder – this should
> work :-) – if not, the iwl firware can be obtained at: http://
> intellinuxwireless.org/iwlwifi/downloads/iwlwifi-3945-ucode-2.14.1.5.tgz
> just untar it and move it to the firmware directory

I just copied all files from /lib/firmware/2.6.22-14-generic/
to /lib/firmware/2.6.24-test1/

cp /lib/firmware/2.6.22-14-generic/ * /lib/firmware/2.6.24-test1/

Then installed the deb package

dpkg -i /usr/src/linux-image-2.6.24-test1_2.6.24-test1-10.00.Custom_i386.deb

Checked my grub file /boot/grub/menu.lst, and rebooted from the new kernel.

Canon ip4500 under Ubuntu 7.10

Friday, December 28th, 2007

My old epson 760 stylus kept crashing so I bit the bullet and went for a Canon ip4500 printer.

One of the reasons for this was that the reviews were good, I had read that you can print to 3×5 index cards on this series of printers, and you can also buy cheap ink cartridges at around £3.50 per cartridge.

The inks are also individual, so you only replace the one you need, not all three colours.

I used a windows dual-boot machine to run through the setup under XP, as the printer comes with a CD which does a printing alignment test. I’m not sure whether you can do this under Linux at all. This takes about 13 minutes to run, and at the end you are left with 2 pages with some black and blue boxes on them. It doesn’t tell you what you should be looking for. As there was nothing flashing, I assumed everything was OK and proceeded to hit the Next button as instructed on the installation sheet. In my view this is not helpful!

At present [Dec 2007] the usual CUPS drivers don’t support this model but the free version of Turboprint does

http://www.turboprint.de/english.html

Downloaded and Installed the files as per the website. Within minutes I was running the GUI which installed the printer and drivers into CUPS for me.

Very easy and straightforward. I have printed to a4 and that works fine. Also tried a4 300dpi draft mode, which really shoots through the printing at a fast lick.

I have also printed succesfully to 3×5 index cards for the DIY Hipster PDA cards (see http://www.diyplanner.com/templates/official for kits to download). Although you can’t actually set a custom size to print on 3×5 cards, if you set the width to 3.9 inches by 5 inches, I find that this actually works OK. the quality of printing on my 3×5 cards is *much* better than I was getting with the old Epson.

Note that to get higher resolutions you need to pay for a registration key. I haven’t needed this yet as I haven’t tried printing any photos.

upgrading topfield PVR firmware from Ubuntu/Gutsy (HOWTO)

Friday, December 28th, 2007

This is a short HOWTO on upgrading the Toppy firmware from Ubuntu 7.10

1 – Download firmware upgrade and unzip.

You will find that you have a .tfd file in the directory where you unzipped the file.

2 – Plug a USB cable into laptop and the Topfield

3 – Run the topfield ftp daemon:

ftpd-topfield -D -P 2021

4 – Now in another terminal connect to the daemon using lftp

lftp ftp://localhost:2021/

5 – cd to the /firmware directory on the toppy:

lftp localhost:/> cd firmware

6 – Using filename completion, put the file onto the Toppy:

lftp localhost:/firmware> put /home/pete/HOME/Topfield/Firmware/TEST\ 23-07-2007\ 5.13.65\ beta.tfd

1591778 bytes transferred in 10 seconds (152.6K/s)

7 – Once complete, the Toppy starts the countdown, and then flashed End.

8 – press the standby button, and restart.

making 3-up handouts from beamer presentations

Wednesday, June 13th, 2007

I use the latex package ‘beamer’ (with lyx) to create presentations for various talks etc.

For a forthcoming conference I was asked by the organisers to create a 3-up pdf file similar to what Powerpoint users produce.

I struggled with pgfpages for a while, and even contemplated writing my own pgfpages layout. However, common sense prevailed and I found the pfjam package.

So, once my presentation is ready,in the lyx preamble I add the ‘handout’ option to the class options in “Document/Settings/Document Class” so it reads: 12pt, handout

Then in the Latex Preamble I add:

\usecolortheme{dove}

and remove any ‘\setbeamertemplates’ which may conflict with a nice plain layout.

I then export this as a pdf file with File/Export/PDF (pdflatex)

Open this in acrobat and it *should* be 1 slide per page.

To convert this to 3 slides per page, with a frame around each slide, and the slides shifted to the left of the page (leaving the RHS of the page for people to write notes/comments) use this pdfjam command:

pdfnup presentation.pdf –nup 1×3 –delta “0.5cm 1.5cm” –frame true –offset “-4.0cm 0″ –scale 0.80

Easy!