<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet title="CSS_formatting" type="text/css" href="http://www.interglacial.com/rss/rss.css"?>
<!-- name="generator" content="loathsxome/0.99" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91"><channel>
<link>http://blog.xvx.ca</link><title>awg's blog</title>
<description>Rarely Used.</description><language>en</language>

<item><title>Using Exchange Effectively on Linux</title><link>http://blog.xvx.ca/using-exchange-effectively-on-linux</link><description>&lt;p&gt;I&apos;ve just started a new job at a company that uses Exchange for email et al.
Exchange works pretty well with Outlook on Windows, and the web UI is pretty
good in Internet Explorer, but if you want to use Linux it&apos;s a bit trickier.
But, I think I have everything working to my liking now, so I thought I should
post what I did.&lt;/p&gt;

&lt;p&gt;Specifically, the problems to solve with Exchange on Linux are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What to do with email, especially given that I only really like using Gmail.&lt;/li&gt;
&lt;li&gt;What to use for calendaring, with bonus points if it syncs to my Android
phone.&lt;/li&gt;
&lt;li&gt;How to access the company address book, for email recipient completion.&lt;/li&gt;
&lt;li&gt;How to do all this without storing passwords in plaintext.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Email&lt;/h2&gt;

&lt;p&gt;Email is pretty easy: Exchange exposes IMAP, so I use
&lt;a href=&quot;http://offlineimap.org/&quot;&gt;offlineimap&lt;/a&gt; to fetch it, and then index it with
&lt;a href=&quot;http://notmuchmail.org&quot;&gt;notmuch&lt;/a&gt;.  Notmuch approximates Gmail better than
anything else I&apos;ve seen, and the Emacs interface works well.&lt;/p&gt;

&lt;p&gt;My offlineimap config is very plain: it just synchronizes every two minutes.
There are only two customized things: a &lt;a href=&quot;http://xvx.ca/~awg/notmuch-new.txt&quot;&gt;post-sync
hook&lt;/a&gt; that imports mail into notmuch and
tags it, and a python script that fetches my username and password from
gnome-keyring.  The &lt;a href=&quot;http://xvx.ca/~awg/offlineimap.py.txt&quot;&gt;python script&lt;/a&gt; is
based on one from &lt;a href=&quot;http://www.clasohm.com/blog/one-entry?entry_id=90957&quot;&gt;Carsten
Clasohm&lt;/a&gt;, and on his page 
you will find an accompanying script to add your passwords to the keyring.  The
only addition I&apos;ve made is a main method that lets us fetch the username and
password; we&apos;ll see later why we want this.&lt;/p&gt;

&lt;p&gt;I use a &lt;a href=&quot;http://xvx.ca/~awg/emacs-notmuch.txt&quot;&gt;special &lt;code&gt;.emacs&lt;/code&gt;&lt;/a&gt; for notmuch.  I
start Emacs using an alias: &lt;code&gt;emacs -q -l $HOME/.emacs-notmuch -f notmuch&lt;/code&gt;,
which loads the config and starts the notmuch module.  A few notes on the
config:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has some stuff from my normal &lt;code&gt;.emacs&lt;/code&gt;, like keybindings and color schemes.&lt;/li&gt;
&lt;li&gt;It adds some Gmail keybindings that I use a lot.  It&apos;s by no means an
exhaustive set.&lt;/li&gt;
&lt;li&gt;It sets up authenticated, secured SMTP for sending mail.  This was by far the
most time-consuming thing to figure out.  You can see here why I modified the
offlineimap.py script earlier - so I can get the credentials from keyring
here!&lt;/li&gt;
&lt;li&gt;It sets up address lookup using a script called &lt;code&gt;address-lookup&lt;/code&gt;.  I&apos;ll talk
about this later on, in the Address Book section.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Calendar&lt;/h2&gt;

&lt;p&gt;Google actually has &lt;a href=&quot;http://www.google.com/support/calendar/bin/answer.py?hl=en&amp;amp;answer=89955&quot;&gt;a
tool&lt;/a&gt;
that syncs your Outlook calendar with your Google Calendar.  It &lt;em&gt;does&lt;/em&gt; require
that you have Outlook running, so you&apos;ll need a Windows VM and a registered
Outlook.  If you&apos;re willing to do that, it&apos;s the perfect solution: your
calendars get synced, and since your Exchange calendar events are on your
Google calendar, they&apos;ll show up on your Android phone.&lt;/p&gt;

&lt;h2&gt;Address Book&lt;/h2&gt;

&lt;p&gt;Tab completion from emails that are already in your notmuch database is easy:
just use &lt;a href=&quot;https://github.com/spaetz/vala-notmuch&quot;&gt;Sebastian Spaeth&apos;s addrlookup&lt;/a&gt;
(hint: check out the &lt;code&gt;static-sources&lt;/code&gt; branch if you don&apos;t want to compile Vala
code).  However, I wanted to have tab completion of the whole company directory,
not just people I&apos;ve emailed before.  This involves three steps.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step 1:&lt;/em&gt; Setup &lt;a href=&quot;http://davmail.sourceforge.net/&quot;&gt;DavMail&lt;/a&gt; to provide LDAP
access to the Exchange address book.  The trickiest part of this was figuring
out how to setup DavMail nicely.  The best way I found was to use the EWS URL
(e.g. https://exchange.example.com/ews/exchange.asmx), NOT the OWA URL that most
of the DavMail docs refer to.  You can tell DavMail it&apos;s talking to EWS with the
&lt;code&gt;davmail.enableEws=true&lt;/code&gt; config line.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step 2:&lt;/em&gt; Make something talk LDAP to DavMail.  I started with the old
&lt;a href=&quot;http://www.bsdconsulting.no/tools/mutt-ldap.pl&quot;&gt;mutt-ldap.pl&lt;/a&gt; script, but &lt;a href=&quot;http://xvx.ca/~awg/ldap-address.pl.txt&quot;&gt;made
some changes&lt;/a&gt;.  In particular, this uses my
offlineimap.py script to fetch my credentials, and changes the criteria a bit to
work better with DavMail&apos;s LDAP implementation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step 3:&lt;/em&gt; Integrate the LDAP script with the notmuch script to search both
places.  This is my &lt;a href=&quot;http://xvx.ca/~awg/address-lookup.txt&quot;&gt;address-lookup&lt;/a&gt;
script.  It searches notmuch, and if it doesn&apos;t find anything then it searches
LDAP; this keeps it fast for the most-contacted people.  To facilitate this, I
&lt;a href=&quot;https://github.com/adamwg/vala-notmuch&quot;&gt;made some changes to addrlookup&lt;/a&gt; so
that it returns the number of results it finds.&lt;/p&gt;

&lt;h2&gt;That&apos;s All!&lt;/h2&gt;

&lt;p&gt;Not so bad, eh?  I hope this will help other people deal with Exchange in a sane
manner.&lt;/p&gt;
</description></item>
<item><title>Time Tracking With Timebook</title><link>http://blog.xvx.ca/time-tracking-with-timebook</link><description>&lt;p&gt;Since I now have a real job, where I will eventually need to estimate how long
various tasks will take me, I decided it would be wise to start tracking my
time.  I&apos;m using a program called
&lt;a href=&quot;https://bitbucket.org/trevor/timebook/wiki/Home&quot;&gt;Timebook&lt;/a&gt;, which is a little
Python script that uses a sqlite3 database.  It&apos;s nice because the commands are
pretty simple, and if I forget to &lt;code&gt;t in&lt;/code&gt; or &lt;code&gt;t out&lt;/code&gt;, I can go and edit the
database to fix things up.&lt;/p&gt;

&lt;p&gt;Inspired by a zsh completion module I found for &lt;a href=&quot;http://tmux.sf.net&quot;&gt;tmux&lt;/a&gt;, I
decided to write a zsh completion module for Timebook, &lt;a href=&quot;http://xvx.ca/~awg/_t&quot;&gt;available
here&lt;/a&gt;.  It completes all the Timebook commands, as well
as timesheet names in appropriate places, and options to the few commands that
take them.  To use it, put it in &lt;code&gt;/usr/share/zsh/functions/Completion/Linux&lt;/code&gt;
(there is probably somewhere else zsh will look for it, but I&apos;m not sure where).
Note that if you call your Timebook executable something other than &lt;code&gt;t&lt;/code&gt;, you
will need to modify the script.&lt;/p&gt;
</description></item>
<item><title>Markdown for Loathsxome</title><link>http://blog.xvx.ca/markdown-for-loathsxome</link><description>&lt;p&gt;Since I started using werc, I&apos;ve become a bit enamored with
&lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt;.  So, I figured I&apos;d set
it up for my blog, too.  It already has a Blosxom plugin, so it was very quick
to make it work with Loathsxome.&lt;/p&gt;

&lt;p&gt;You can &lt;a href=&quot;http://xvx.ca/~awg/markdown-loathsxome&quot;&gt;download it here&lt;/a&gt;.  To use it,
move the file to plugins/markdown in your Loathsxome directory.  It should
probably run last, so you might need to rename it.  This is because it formats
the body of the post, which can screw up meta tags and things that are grabbed
by other plugins.&lt;/p&gt;
</description></item>
<item><title>The Not Insane Guide to Setting Up werc</title><link>http://blog.xvx.ca/the-not-insane-guide-to-setting-up-werc</link><description>&lt;p&gt;I used to maintain my website using plain old HTML files.  That works fine,
considering how small my site is, but I decided a CMS would be nice, and I
decided &lt;a href=&quot;http://werc.cat-v.org&quot;&gt;werc&lt;/a&gt; was probably the way to go.  Werc is to
CMSes what Loathsxome is to blogs.  It uses plain files and directories instead
of some silly database.  It&apos;s also written in rc, the plan9 shell, which is kind
of neat.&lt;/p&gt;

&lt;p&gt;The downside of werc is that it doesn&apos;t have a simple HOWTO or tutorial for
setting it up.  So, here&apos;s a quick-and-dirty version:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download werc from the website, and un-tar it somewhere.&lt;/li&gt;
&lt;li&gt;Follow their &lt;a href=&quot;http://werc.cat-v.org/docs/web-server-setup/&quot;&gt;web server setup&lt;/a&gt;
instructions for your web server.  I use lighttpd, and the instructions worked
fine.&lt;/li&gt;
&lt;li&gt;Create a directory &lt;code&gt;sites/example.com&lt;/code&gt; for your website to live
in, but &lt;strong&gt;only&lt;/strong&gt; if the domain of your website is actually example.com.  This is
where I got caught up: I was hitting the site as beta.xvx.ca, but my directory
was called xvx.ca, so nothing showed up.  When I symlinked beta.xvx.ca to
xvx.ca, it worked!&lt;/li&gt;
&lt;li&gt;Edit index.md, which will become your homepage.  If you edit foo.md, it will
be visible at example.com/foo.  If you edit bar/index.md, it will be visible at
example.com/bar.&lt;/li&gt;
&lt;li&gt;If it&apos;s not working, make sure the permissions are right on everything.  This
caught me a couple times.&lt;/li&gt;
&lt;li&gt;To change how it looks, edit the templates in lib/ and the stylesheets in
pub/styles.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That step 3 cost me a lot of time.  Watch out for it.&lt;/p&gt;
</description></item>
<item><title>Think of the Children</title><link>http://blog.xvx.ca/think-of-the-children</link><description>&lt;p&gt;From Malcolm Gladwell&apos;s &lt;i&gt;&lt;a
href=&quot;http://gladwell.com/tippingpoint/index.html&quot;&gt;The Tipping Point&lt;/a&gt;&lt;/i&gt;:&lt;/p&gt;

&lt;blockquote&gt;
The best analogy to this kind of epidemic is the outbreak of food poisoning that
swept through several public schools in Belgium in the summer of 1999.  It
started when forty-two children in the Belgian town of Bornem became
mysteriously ill after drinking Coca-Cola and had to be hospitalized.  Two days
later, eight more schoolchildren fell sick in Brugge, followed by thirteen in
Harelbeke the next day and forty-two in in Lochristi three days after that - and
on and on in a widening spiral that, in the end, sent more than one hundred
children to the hospital complaining of nausea, dizziness, and headaches, and
forced Coca-Cola into the biggest product recall in its 113-year history.  Upon
investigation, an apparent culprit was found.  In the Coca-Cola plant in
Antwerp, contaminated carbon dioxide had been used to carbonate a batch of the
soda&apos;s famous syrup.  But then the case got tricky: upon examination, the
contaminants in the carbon dioxide were found to be sulfur compounds present at
between five and seventeen parts per billion.  These sulfides can cause illness,
however only at levels a thousand times greater than that.  At seventeen parts
per billion, they simply impart a bad smell - like rotten eggs - which means
that Belgium should have experienced nothing more than a minor epidemic of nose
wrinkling.  More puzzling is the fact that, in four of the five schools where
the bad Coke allegedly caused illness, half the kids who got sick hadn&apos;t
actually drunk any Coke that day.  Whatever went on in Belgium, in other words,
probably wasn&apos;t Coca-Cola poisoning.  So what was it?  It was a kind of mass
hysteria, a phenomenon that is not at all uncommon among school-children.  Simon
Wessely, a psychiatrist at King&apos;s College of Medicine in London, has been
collecting reports of this kind of hysteria for about ten years and now has
hundreds of examples, dating back as far as 1787, when millworkers in Lancashire
suddenly took ill after they became persuaded that they were being poisoned by
tainted cotton.  According to Wessely, almost all cases fit a pattern.  Someone
sees a neighbor fall ill and becomes convinced that he is being contaminated by
some unseen evil - in the past it was demons and spirits; nowadays it tends to
be toxins and gases - and his fear makes him anxious.  His anxiety makes him
dizzy and nauseated.  He begins to hyperventilate.  He collapses.  Other people
hear the same allegation, see the &quot;victim&quot; faint, and they begin to get anxious
themselves.  They feel nauseated.  They hyperventilate.  They collapse, and
before you know it everyone in the room is hyperventilating and collapsing.
These symptoms, Wessely stresses, are perfectly genuine.  It&apos;s just that they
are manifestations of a threat that is wholly imagined.  &quot;This kind of thing is
extremely common,&quot; he says, &quot;and it&apos;s almost normal.  It doesn&apos;t mean that you
are mentally ill or crazy.&quot;  What happened in Belgium was a fairly typical
example of a more standard form of contagious anxiety, possibly heightened by
the recent Belgian scare over dioxin-contaminated animal feed.  The students&apos;
alarm over the rotten-egg odor of their Cokes, for example, is straight out of
the hysteria textbooks.  &quot;The vast majority of these events are triggered by
some abnormal but benign smell,&quot; Wessely said.  &quot;Something strange, like a weird
odor coming from the air conditioning.&quot;  The fact that the outbreaks occurred in
schools is also typical of hysteria cases.  &quot;The classic ones always involve
schoolchildren,&quot; Wessely continued.  &quot;There is a famous British case involving
hundreds of schoolgirls who collapsed during a 1980 Nottinghamshire jazz
festival.  They blamed it on a local farmer spraying pesticides.&quot;  There have
been more than a hundred and fifteen documented hysteria cases in schools over
the past three hundred years.&quot;
&lt;/blockquote&gt;

&lt;p&gt;Nowadays, of course, it&apos;s not demons and spirits or toxins and gases, &lt;a
href=&quot;http://www.cbc.ca/canada/toronto/story/2010/08/15/ontario-wifi.html&quot;&gt;it&apos;s
radio waves&lt;/a&gt;.&lt;/p&gt;
</description></item>
</channel></rss>

