<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Miggy's Blog</title>
	<atom:link href="http://miggysmith.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://miggysmith.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 17 Oct 2011 17:54:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='miggysmith.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Miggy's Blog</title>
		<link>http://miggysmith.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://miggysmith.wordpress.com/osd.xml" title="Miggy&#039;s Blog" />
	<atom:link rel='hub' href='http://miggysmith.wordpress.com/?pushpress=hub'/>
		<item>
		<title>XMonad, Gnome, Ubuntu 11.10</title>
		<link>http://miggysmith.wordpress.com/2011/10/17/xmonad-gnome-ubuntu-11-10/</link>
		<comments>http://miggysmith.wordpress.com/2011/10/17/xmonad-gnome-ubuntu-11-10/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 17:54:43 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=106</guid>
		<description><![CDATA[Here&#8217;s how I have xmonad and gnome playing nicely on Ubuntu 11.10. First, we&#8217;ll make a file for a new session in the log in manager. Xmonad probably ships with /usr/share/xsessions/xmonad.desktop. You should make /usr/share/xsessions/xmonad-gnome.desktop: #/usr/share/xsessions/xmonad-gnome.desktop [Desktop Entry] Name=XMonad GNOME Comment=This session logs you into GNOME with the traditional panel Exec=gnome-session --session=xmonad-gnome TryExec=gnome-session Icon= Type=Application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=106&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I have xmonad and gnome playing nicely on Ubuntu 11.10.</p>
<p>First, we&#8217;ll make a file for a new session in the log in manager.   Xmonad probably ships with /usr/share/xsessions/xmonad.desktop.  You should make /usr/share/xsessions/xmonad-gnome.desktop:</p>
<p><code><br />
#/usr/share/xsessions/xmonad-gnome.desktop<br />
  [Desktop Entry]<br />
Name=XMonad GNOME<br />
Comment=This session logs you into GNOME with the traditional panel<br />
Exec=gnome-session --session=xmonad-gnome<br />
TryExec=gnome-session<br />
Icon=<br />
Type=Application<br />
X-Ubuntu-Gettext-Domain=gnome-session-3.0<br />
</code></p>
<p>So, this points the log in manager to a gnome session called xmonad-gnome.  We&#8217;ll define that session in the file /usr/share/gnome-session/sessions/xmonad-gnome.session:</p>
<p><code><br />
#/usr/share/gnome-session/sessions/xmonad-gnome.session<br />
[GNOME Session]<br />
Name=Xmonad session<br />
RequiredComponents=gnome-panel;gnome-settings-daemon;<br />
RequiredProviders=windowmanager;<br />
DefaultProvider-windowmanager=xmonad-gnome<br />
DefaultProvider-notifications=notify-osd<br />
</code></p>
<p>The line <code>DefaultProvider-windowmanager=xmonad-gnome</code> is to use a custom start script.  Instead of xmonad-gnome, you could just use xmonad and you&#8217;d be done.  If you want this custom script, you need to make another file /usr/share/applications/xmonad-gnome.desktop</p>
<p><code><br />
[Desktop Entry]<br />
Type=Application<br />
Encoding=UTF-8<br />
Name=Xmonad<br />
Exec=xmonad-start<br />
NoDisplay=true<br />
X-GNOME-WMName=Xmonad<br />
X-GNOME-Autostart-Phase=WindowManager<br />
X-GNOME-Provides=windowmanager<br />
X-GNOME-Autostart-Notify=true<br />
</code></p>
<p>The line <code>Exec=xmonad-start</code> is calling my custom script.  For me, I have xmonad-start in ~/bin/ which is part of my path.  </p>
<p>In xmonad-start should be something like:</p>
<p><code><br />
#!/bin/bash<br />
conky -c configfile &amp;<br />
otherstartupstuff.sh &amp;<br />
xmonad<br />
</code></p>
<p>Personally, I can&#8217;t get conky to work correctly right now.  If you are using gnome and xmonad in ubuntu 11.10 and have conky working, let me know what you did!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=106&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2011/10/17/xmonad-gnome-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>XMonad and Gnome</title>
		<link>http://miggysmith.wordpress.com/2010/10/03/xmonad-and-gnome/</link>
		<comments>http://miggysmith.wordpress.com/2010/10/03/xmonad-and-gnome/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 01:41:23 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[tiling window manager]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=82</guid>
		<description><![CDATA[Hey there. This is how I am setting up XMonad to run with Gnome on my Ubuntu 10.04 install. Presumably, this will work with most Gnome set-ups. My desire is to have a session available from GDM that uses Gnome but with XMonad as my window manager. I&#8217;ll also be using xmobar. If you want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=82&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey there.  This is how I am setting up XMonad to run with Gnome on my Ubuntu 10.04 install.</p>
<p>Presumably, this will work with most Gnome set-ups.  </p>
<p>My desire is to have a session available from GDM that uses Gnome but with XMonad as my window manager.  I&#8217;ll also be using xmobar.  If you want to use xmonad and xmobar, you should be able to figure out how to install them on your own distribution.</p>
<p>So, I have everything installed.  First thing I&#8217;m going to do is create a new session that is available in my GDM login.  If you have installed XMonad, you likely have an xmonad.desktop in /usr/share/xsessions.  This will just run an XMonad session.  I want to run XMonad with Gnome so I&#8217;m going to copy this file to xmonad-gnome.desktop and edit it slightly so that it looks like this:</p>
<p><code>[Desktop Entry]<br />
Encoding=UTF-8<br />
Name=XMonad-Gnome<br />
Comment=Lightweight tiling window manager<br />
Exec=xmonad-gnome<br />
Icon=xmonad.png<br />
Type=XSession<br />
</code></p>
<p>The difference is that the name is XMonad-Gnome.  That&#8217;s what I&#8217;ll select at the sessions option at the GDM login.  Another good name could be Gonad.  Also, the Exec is now xmonad-gnome.  xmonad-gnome is the name of an executable that I have to create.  It will tell xmonad and gnome how to play together.  We have to create this script ourselves and make sure it&#8217;s executable and somewhere in our path.  </p>
<p>A safe place to put the xmonad-gnome script is in /usr/local/bin.  I&#8217;m going to put mine in ~/bin because that&#8217;s where I sometimes keep little scripts.  Also, if I ever need to change things I won&#8217;t need root access to edit it.  Just make sure it&#8217;s in your path somewhere.  </p>
<p>Here&#8217;s my xmonad-gnome file:</p>
<p><code><br />
#!/bin/bash<br />
export WINDOW_MANAGER=xmonad<br />
gconftool-2 -u /desktop/gnome/session/required_components/windowmanager<br />
urxvtd -f -o &amp;<br />
gnome-session<br />
</code></p>
<p>Be careful here, &#8220;gconftool-2 -u /desktop/gnome/session/required_components/windowmanager&#8221; should be all on one line.  WordPress may be trying to be pretty here and I don&#8217;t want to take the time to figure out how to keep this all on one line.  Tell me in the comments!</p>
<p>The line <code>urxvtd -f -o &amp;</code> is an example of a start up program.  If you don&#8217;t have any that you know about, just ignore that line.  If you have start up things (conky maybe?) you&#8217;ll probably want to call them here, or put them all in a start up file and then call that file here.  </p>
<p>Ok.  We are at the home stretch.  Now we need to make our xmonad configuration.  Your configuration should live in ~/.xmonad/xmonad.hs.  This file, at minimum should look like this:</p>
<p><code>import XMonad<br />
import XMonad.Util.EZConfig<br />
import XMonad.Config.Gnome<br />
main = xmonad $ gnomeConfig<br />
  { terminal = "gnome-terminal" }<br />
</code></p>
<p>(IMPORTANT NOTE:  It seems that wordpress is not interested in preserving white space.  If you try these configs and they don&#8217;t work, try putting in some spaces where it makes sense.  Or if you get stuck, write me in the comments and I&#8217;ll do my best to help you out.)</p>
<p>Feel free to try this out, now.  Log out and log back in.  Don&#8217;t forget to select XMonad-Gnome session at the log in.  To get a terminal, hit Alt-Shift-Enter.  It will be the typical gnome-terminal.  You&#8217;ll also still have your panels.  At this point you should look up XMonad&#8217;s default key bindings or make up your own configuration.  I might eventually post my xmonad.hs especially if I get requests.</p>
<p>I don&#039;t know anything about haskell.  I just picked up stuff here and there and recognized patterns.<br />
This should be more than enough to get you started.  Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=82&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2010/10/03/xmonad-and-gnome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>How to make animations with Gnuplot</title>
		<link>http://miggysmith.wordpress.com/2009/06/07/how-to-make-animations-with-gnuplot/</link>
		<comments>http://miggysmith.wordpress.com/2009/06/07/how-to-make-animations-with-gnuplot/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 18:20:26 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[gnuplot]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=68</guid>
		<description><![CDATA[This is how you do it: set terminal gif animate delay 10 The delay 10 means 10*0.01 seconds between each image. Then, you just plot each subsequent image until your done. I normally write a bash script to do this sort of thing automatically, so here&#8217;s an example. #!/bin/bash MAX=100 echo "clear" &#62; plot.gpi echo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=68&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is how you do it:</p>
<p><code>set terminal gif animate delay 10</code></p>
<p>The delay 10 means 10*0.01 seconds between each image.  Then, you just plot each subsequent image until your done.  I normally write a bash script to do this sort of thing automatically, so here&#8217;s an example.</p>
<p><code><br />
#!/bin/bash<br />
MAX=100<br />
echo "clear" &gt; plot.gpi<br />
echo "reset" &gt;&gt; plot.gpi<br />
echo "set terminal gif animate delay 10" &gt;&gt; plot.gpi<br />
echo "set output \"animate.gif\"" &gt;&gt; plot.gpi<br />
echo "set isosample 40" &gt;&gt; plot.gpi<br />
echo "set hidden3d" &gt;&gt; plot.gpi<br />
for i in `seq 0 ${MAX}`<br />
do<br />
	echo "splot sin(${i}*x/${MAX})*cos(${i}*y/${MAX})" \<br />
&gt;&gt; plot.gpi<br />
done<br />
</code></p>
<p>So what I&#8217;m doing here is letting a bash script create a gnuplot script for me.  Instead of writing out about a hundred different splots by hand, I let a for loop do that for me.  Additionally, I specify a few things at the beginning.<br />
So, put that code in a file somwhere.<br />
Make it executable:<code>chmod +x <em>file</em></code><br />
Then run it: <code>./<em>file</em></code><br />
Now, you should have a file plot.gpi that contains all the gnuplot commands.<br />
Now open gnuplot: <code>gnuplot</code><br />
Then run the plot.gpi script: <code>gnuplot&gt; load 'plot.gpi'</code><br />
And now you should have an animated gif creatively titled animation.gif.</p>
<p>When I do this in real life, I normally have a data file (perhaps generated with octave/matlab) with each time step separated by two blank lines.  After two blank lines, gnuplot says we are on a new index so I can make my repeated plot line as something like:<br />
<code>for i ...; do echo "plot 'datafile' using 1:2 index ${i} with lines"; done </code> etc&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=68&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/06/07/how-to-make-animations-with-gnuplot/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>biking and hiking in hyalite</title>
		<link>http://miggysmith.wordpress.com/2009/05/10/biking-and-hiking-in-hyalite/</link>
		<comments>http://miggysmith.wordpress.com/2009/05/10/biking-and-hiking-in-hyalite/#comments</comments>
		<pubDate>Mon, 11 May 2009 02:49:08 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[outside]]></category>
		<category><![CDATA[bozeman]]></category>
		<category><![CDATA[hiking]]></category>
		<category><![CDATA[hyalite]]></category>
		<category><![CDATA[showshoeing]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=61</guid>
		<description><![CDATA[After calling and wishing my mother a happy mother&#8217;s day, I went down to Hyalite for some snowshoeing. Hyalite canyon road is closed to motor vehicles from April 1st to May 15th for spring break up. The good part is if you go up there you practically have the whole place to yourself. Concordantly, you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=61&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After calling and wishing my mother a happy mother&#8217;s day, I went down to Hyalite for some snowshoeing.  Hyalite canyon road is closed to motor vehicles from April 1st to May 15th for spring break up.</p>
<p>The good part is  if you go up there you practically have the whole place to yourself.  Concordantly, you can bike on a nice road without worrying about cars.</p>
<p>The bad part is that it has snowed appreciably on half the days the road has been car free making getting up there on a bike not always reasonable. </p>
<p>I went up once earlier, April 12.  At that time, I didn&#8217;t have a blog so I couldn&#8217;t tell the internet about it.  So, here is a quick synopsis.  I had to do a significant amount of bike pushing to the reservoir and then I hiked back to grotto falls which was just a pile of snow at the time.  I had really wanted to hike a bit up wildhorse creek trail because I think it has the signature Hyalite view, but I was post-holing to my waist every step.  So I decided that I would bring snowshoes next time.</p>
<p>So today, I biked up with my snowshoes.  It got cloudy eventually but I had gotton up there early enough to beat the clouds.  The road was totally clear up to the reservoir and spotty past.  I got up wildhorse to my view, snapped a few shots then came back down and headed off towards pallisade falls.  The road that goes off to emerald lake trailhead does not get vehicle traffic/plowing over winter so the snow&#8217;s deep.  I put my shoes back on and made it out to pallisade.  </p>
<p>I was the only one out beyond the reservoir.  On my way back, I saw two people at the reservoir and a good number of people making their way up.  It&#8217;s kind of funny to see them all in their bike jersey&#8217;s and I have on boots and snowshoes on my back.</p>
<p>Here&#8217;s a picture from wildhorse and one of pallisade falls.
<a href='http://miggysmith.wordpress.com/2009/05/10/biking-and-hiking-in-hyalite/img_1006/' title='img_1006'><img data-attachment-id='62' data-orig-size='3264,2448' data-liked='0'width="150" height="112" src="http://miggysmith.files.wordpress.com/2009/05/img_1006.jpg?w=150&#038;h=112" class="attachment-thumbnail" alt="img_1006" title="img_1006" /></a>
<a href='http://miggysmith.wordpress.com/2009/05/10/biking-and-hiking-in-hyalite/img_1040/' title='img_1040'><img data-attachment-id='63' data-orig-size='3264,2448' data-liked='0'width="150" height="112" src="http://miggysmith.files.wordpress.com/2009/05/img_1040.jpg?w=150&#038;h=112" class="attachment-thumbnail" alt="img_1040" title="img_1040" /></a>
</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=61&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/05/10/biking-and-hiking-in-hyalite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>

		<media:content url="http://miggysmith.files.wordpress.com/2009/05/img_1006.jpg?w=150" medium="image">
			<media:title type="html">img_1006</media:title>
		</media:content>

		<media:content url="http://miggysmith.files.wordpress.com/2009/05/img_1040.jpg?w=150" medium="image">
			<media:title type="html">img_1040</media:title>
		</media:content>
	</item>
		<item>
		<title>Cool Bash Prompt &#8211; Smiley</title>
		<link>http://miggysmith.wordpress.com/2009/05/08/cool-bash-prompt-smiley/</link>
		<comments>http://miggysmith.wordpress.com/2009/05/08/cool-bash-prompt-smiley/#comments</comments>
		<pubDate>Sat, 09 May 2009 03:40:05 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash prompt]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=41</guid>
		<description><![CDATA[Here&#8217;s what my prompt looks like: [mike@esme ~] :) echo "smiley bash prompt is cool" &#124; grep -q smiley [mike@esme ~] :) echo "smiley bash prompt is cool" &#124; grep -q frowny [mike@esme ~] :( not_a_real_command -bash: not_a_real_command: command not found [mike@esme ~] :( echo "echo is a real command" echo is a real command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=41&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what my prompt looks like:</p>
<p><code><br />
[mike@esme ~] <FONT COLOR="#39e239">:)</FONT> echo "smiley bash prompt is cool" | grep -q smiley<br />
[mike@esme ~] <FONT COLOR="#39e239">:)</FONT> echo "smiley bash prompt is cool" | grep -q frowny<br />
[mike@esme ~] <FONT COLOR="#e43333">:(</FONT> not_a_real_command<br />
-bash: not_a_real_command: command not found<br />
[mike@esme ~]  <FONT COLOR="#e43333">:(</FONT> echo "echo is a real command"<br />
echo is a real command<br />
[mike@esme ~] <FONT COLOR="#39e239">:)</FONT><br />
</code></p>
<p>Above, grep looked for smiley and found it so it returned sucessfully and I got a happy smiley.  Next, grep did not find any &#8220;frowney&#8221; so it returned &#8220;unsuccesfully&#8221; and I got a frowney.  My prompt really does have color but I had to cheat and put it in the html for this demonstration.</p>
<p>To use this prompt, if you are using bash (if you don&#8217;t know, you probably are) you can put this into your .bashrc.  That is in your home folder, there should be a file called .bashrc and if there&#8217;s not just create it.  Make sure to comment any other definitions of the prompt (PS1) or just put this at the bottom of the file.</p>
<p>First you may as well define some colors to make it easy on you for playing around:</p>
<p><code><br />
#Regular text color<br />
BLACK='\[\e[0;30m\]'<br />
#Bold text color<br />
BBLACK='\[\e[1;30m\]'<br />
#background color<br />
BGBLACK='\[\e[40m\]'<br />
RED='\[\e[0;31m\]'<br />
BRED='\[\e[1;31m\]'<br />
BGRED='\[\e[41m\]'<br />
GREEN='\[\e[0;32m\]'<br />
BGREEN='\[\e[1;32m\]'<br />
BGGREEN='\[\e[1;32m\]'<br />
YELLOW='\[\e[0;33m\]'<br />
BYELLOW='\[\e[1;33m\]'<br />
BGYELLOW='\[\e[1;33m\]'<br />
BLUE='\[\e[0;34m\]'<br />
BBLUE='\[\e[1;34m\]'<br />
BGBLUE='\[\e[1;34m\]'<br />
MAGENTA='\[\e[0;35m\]'<br />
BMAGENTA='\[\e[1;35m\]'<br />
BGMAGENTA='\[\e[1;35m\]'<br />
CYAN='\[\e[0;36m\]'<br />
BCYAN='\[\e[1;36m\]'<br />
BGCYAN='\[\e[1;36m\]'<br />
WHITE='\[\e[0;37m\]'<br />
BWHITE='\[\e[1;37m\]'<br />
BGWHITE='\[\e[1;37m\]'<br />
</code></p>
<p>Now tell bash you want to run a particular function everytime it goes to write the prompt</p>
<p><code><br />
PROMPT_COMMAND=smile_prompt<br />
</code></p>
<p>Now, define the function smile_prompt</p>
<p><code><br />
function smile_prompt<br />
{<br />
	if [ "$?" -eq "0" ]<br />
	then<br />
#smiley<br />
		SC="${GREEN}:)"<br />
	else<br />
#frowney<br />
		SC="${RED}:("<br />
	fi<br />
	if [ $UID -eq 0 ]<br />
	then<br />
#root user color<br />
		UC="${RED}"<br />
	else<br />
#normal user color<br />
		UC="${BWHITE}"<br />
	fi<br />
#hostname color<br />
	HC="${GREEN}"<br />
#regular color<br />
	RC="${BWHITE}"<br />
#default color<br />
        DF='\[\e0m\]'<br />
	PS1="[${UC}\u${RC}@${HC}\h ${RC}\W${DF}] ${SC}${DF} "<br />
}<br />
</code><br />
In addition to the colored smileys, my hostname and user are also colored with root being red.  If you want root to use this, you can put it in /root/.bashrc as well.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=41&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/05/08/cool-bash-prompt-smiley/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>How to set up Gmail Mutt and OfflineIMAP with multiple accounts part 3</title>
		<link>http://miggysmith.wordpress.com/2009/05/03/gmail3/</link>
		<comments>http://miggysmith.wordpress.com/2009/05/03/gmail3/#comments</comments>
		<pubDate>Mon, 04 May 2009 02:22:42 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[offlineimap]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=24</guid>
		<description><![CDATA[This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts. This third part is how to set up mutt. Part 1: Gmail Part 2: offlineIMAP Part 3: mutt Setting up msmtp Mutt is an interface for browsing mail. You can create mail in the program [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=24&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts.</p>
<p>This third part is how to set up mutt.</p>
<p><a href="http://miggysmith.wordpress.com/2009/05/02/gmail1/">Part 1: Gmail</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail2/">Part 2: offlineIMAP</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail3/">Part 3: mutt</a></p>
<h3>Setting up msmtp</h3>
<p>Mutt is an interface for browsing mail.  You can create mail in the program but mutt needs another program like msmtp to actually send the mail.  In your home directory, we&#8217;ll need to create the file .msmtprc to specify the accounts from which we will be sending mail.  Let me recall what accounts we have:</p>
<p>Accounts used under personal@gmail.com:</p>
<ul>
<li>personal@gmail.com</li>
<li>student@school.edu</li>
<li>student@physics.school.edu</li>
</ul>
<p>Accounts used under net@gmail.com</p>
<ul>
<li>net@gmail.com</li>
</ul>
<p>I&#8217;m mostly going to steal the config found in the <a href="http://wiki.archlinux.org/index.php/Msmtp">Arch Linux Wiki</a>.</p>
<p>In .msmtp we&#8217;ll start with our personal account:</p>
<p><code><br />
account personal<br />
host smtp.gmail.com<br />
port 587<br />
protocol smtp<br />
auth on<br />
from personal@gmail.com<br />
user personal@gmail.com<br />
password <em>mypassword</em><br />
tls on<br />
tls_starttls on<br />
tls_trust_file /etc/ssl/certs/ca-certificates.crt<br />
</code></p>
<p>That last line I don&#8217;t know anything about.  I know it works for me, but if it doesn&#8217;t for you check your files in that same directory or /usr/share/ca-certificates or check out <a href="http://msmtp.sourceforge.net/doc/msmtp.html">this page</a>.</p>
<p>Now, since we are also using that gmail account to send mail from student@school.edu we put into .msmtprc</p>
<p><code><br />
account school : personal<br />
from student@school.edu<br />
</code></p>
<p>Essentially, that says inherit all defaults form the account personal but change the from field to student@school.edu</p>
<p>It should be easy enough to figure out the rest of your .msmtprc file.</p>
<h3>Setting up Mutt</h3>
<p>By default, mutt will look for $HOME/.muttrc or $HOME/.mutt/muttrc files.  I like to use the latter because I have a few other mutt files that I&#8217;d like to keep together.  Ok, let&#8217;s see what we need to put in our muttrc file.</p>
<p>First, we&#8217;ll need to specify the type of mail system we are using.  As we set up with offlineIMAP we use Maildir</p>
<p><code><br />
set mbox_type=Maildir<br />
</code></p>
<p>Now we need to say where we keep the mail:</p>
<p><code><br />
set folder=$HOME/.mail<br />
</code></p>
<p>Now, it might make sense to visit that folder to see how our mail is stored.  Inside $HOME/.mail, we should have two folders, net and personal.  Inside each of those two folders there are all the gmail mailboxes with their own folders: INBOX,[Gmail].All Mail,&#8230;,personal (and any other labels that we may have).  Each of these folders is a mailbox.</p>
<p>So now we want to specify where mutt should start when it opens up</p>
<p><code><br />
set spoolfile=+"personal/[Gmail].All Mail"<br />
</code></p>
<p>I&#8217;ve written this relative to the folder specified earlier and I put it in quotes because it has some weird characters and a space.</p>
<p>Now, it&#8217;s called spoolfile because it&#8217;s supposed to be like a dumping ground where things will get moved from later.  However, I let gmail do all my filtering and labeling so I don&#8217;t want anything to move be default:</p>
<p><code><br />
set move=no<br />
</code></p>
<p>It is supposed to improve speed by making a cache of the headers:</p>
<p><code><br />
set header_cache=$HOME/.mail/.hcache<br />
</code></p>
<p>Naturally, you can put this wherever you want.</p>
<p>Here&#8217;s a bunch of things that you&#8217;ll want to put in, they should all make sense:</p>
<p><code><br />
set realname='Miggy Smith'<br />
set from=personal@gmail.com<br />
set sendmail="/usr/bin/msmtp"<br />
set envelope_from=yes<br />
set edit_headers=yes<br />
</code></p>
<p>I don&#8217;t edit my headers when I&#8217;m writing my emails, but I like to be able to see them.  I like vim for writing my emails</p>
<p><code><br />
set editor="vim +/^$"<br />
</code></p>
<p>This will launch vim with the cursor at the first blank line (so right after the header).</p>
<p>At this point, we should be good to go, but here are a few things that you shouldn&#8217;t have to live without.</p>
<p>Here&#8217;s what I think is the best sorting algorithm:</p>
<p><code><br />
set sort=threads<br />
set sort_aux=reverse-last-date-received<br />
</code></p>
<p>To look at mail in different folders, we can browse for the folders by using &#8216;c&#8217; but we can do this better by setting up some mailboxes.  We will get a list of them in mutt by pressing &#8216;y&#8217; and mutt will say if they have new mail or not.  To set up mailboxes, we just specify the folders in muttrc:</p>
<p><code><br />
mailboxes +"personal/[Gmail].All Mail" +personal/personal +personal/school +net/INBOX<br />
</code></p>
<p>Obviously, set up whichever ones you want.  (Okay so that looks weird above but those are just single spaces after each folder name&#8230;wordpress is trying to make it look pretty)</p>
<p>Lastly, if we are going to be in a certain folder/mailbox, we are likely going to want to send from a corresponding account.</p>
<p>We can set up commands like this in muttrc:</p>
<p><code><br />
macro generic "1" ":set from=student@physics.school.edu"<br />
macro generic "2" ":set from=personal@gmail.com"<br />
</code></p>
<p>So that if we type the escape key and then number 1 it will set the from field to student@physics.montana.edu.  Then if you write a mail, it will use that as the from field.</p>
<p>But we can also do this automatically depending on what folder we are in:</p>
<p><code><br />
folder-hook personal/personal set from=personal@gmail.com<br />
folder-hook personal/physics set from=student@physics.school.edu<br />
folder-hook personal/school set from=student@school.edu<br />
folder-hook net/* set from=net@gmail.com<br />
</code></p>
<p>(Again wordpress is trying to make the above look pretty&#8230;those are just single spaces)</p>
<p>Further, when replying to emails, you&#8217;ll probably want to reply from the account they sent to you.  Do this with reverse_name, but you&#8217;ll also have to tell mutt your default account and other accounts it may use:</p>
<p><code><br />
set reverse_name=yes<br />
set from=personal@gmail.com<br />
alternates student@school.edu|student@physics.school.edu|net.gmail.com<br />
</code></p>
<p>All right.  Enjoy gmail mutt and offlineIMAP.</p>
<p>Part 4 will be a few more tips and tricks when I get around to it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=24&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/05/03/gmail3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>How to set up Gmail Mutt and OfflineIMAP with multiple accounts part 2</title>
		<link>http://miggysmith.wordpress.com/2009/05/03/gmail2/</link>
		<comments>http://miggysmith.wordpress.com/2009/05/03/gmail2/#comments</comments>
		<pubDate>Sun, 03 May 2009 21:20:42 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[offlineimap]]></category>

		<guid isPermaLink="false">http://miggysmith.wordpress.com/?p=9</guid>
		<description><![CDATA[This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts. This second part is how to set up offlineIMAP. Part 1: Gmail Part 2: offlineIMAP Part 3: mutt Why do you want to use offlineimap? Check out offlineimap&#8217;s website. Essentially, you get the benefits of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=9&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts.</p>
<p>This second part is how to set up offlineIMAP.</p>
<p><a href="http://miggysmith.wordpress.com/2009/05/02/gmail1/">Part 1: Gmail</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail2/">Part 2: offlineIMAP</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail3/">Part 3: mutt</a></p>
<h3>Why do you want to use offlineimap?</h3>
<p>Check out offlineimap&#8217;s <a href="http://software.complete.org/software/projects/show/offlineimap">website</a>.  Essentially, you get the benefits of both pop and imap.</p>
<p>Offlineimap&#8217;s job is to download your email locally and make sure everything stays in sync.  That is, if you make a change on gmail, it will be reflected automatically in the files on your computer.  Likewise, if you move or delete an email on your home computer it will be propogated to gmail and therefore any other computer you may be monitering your email on.  So, my emails are the same on my home computer and work computer without having to directly interface with gmail because offlineimap does that for me.  </p>
<h3>Setting up offlineIMAP</h3>
<p>Here&#8217;s a great webpage for setting up offlineIMAP: <a>full conf</a> but I&#8217;ll go through the basic necessary configuration.</p>
<p>The default configuration file for offlineIMAP is $HOME/.offlineimaprc so create that file.  I&#8217;m going to explain the things we need and put into code blocks the actual configuration that goes into that file.  I&#8217;m only going to go through the necessary configuration to get this working well.  There&#8217;s obviously a whole lot more configuration that&#8217;s available.</p>
<p>First, we need to set up the general information.  </p>
<p><code>[general]</code></p>
<p>Now, let&#8217;s tell offlineimap we are using two accounts.  We can call them whatever we want but it make sense to name them after our gmail accounts we are syncing with:</p>
<p><code>accounts = personal,net</code></p>
<p>Now, we need to lett offlineimap know it has to sync more than one account</p>
<p><code>maxsyncaccounts = 4</code></p>
<p>We only really needed to set this to 2 but it doesn&#8217;t hurt to make it 4 especially if we were to set up more accounts in the future and could forget to change this number.</p>
<p>Next, I want to tell offlineimap to go ahead and give up if it can&#8217;t get a connection within 60 seconds.</p>
<p><code>socktimeout = 60</code></p>
<p>Lastly, I can tell offlineimap what I want it&#8217;s interface to look like.  From <a href="http://software.complete.org/software/repositories/entry/offlineimap/offlineimap.conf">this site</a> the choices are:</p>
<p># Curses.Blinkenlights &#8212; A text-based (terminal) interface similar to Tk.Blinkenlights<br />
# TTY.TTYUI &#8212; a text-based (terminal) interface<br />
# Noninteractive.Basic &#8212; Noninteractive interface suitable for cronning<br />
# Noninteractive.Quiet &#8212; Noninteractive interface, generates no output except for errors.<br />
# Machine.MachineUI &#8212; Interactive interface suitable for machine parsing.</p>
<p>I think Curses.Blinkenlights looks good but it doesn&#8217;t let go of my terminal cleanly when it exits, so I&#8217;m using TTY.TTYUI.</p>
<p><code>ui = TTY.TTYUI</code></p>
<p>You can easily override this choice with the command line option u.  In running this periodically in a cron job, I&#8217;ll use something like <code>offlineimap -u Noninteractive.Basic</code> (do not put this in your config file!)</p>
<p>The general section is done, we now need to make the account information, one for each account.</p>
<p><code>[Account personal]</code></p>
<p>We can set up specifics such as how frequently to sync and whether or not to do quick syncs for full in this section, but I prefer to do just do that in a cron job, so all I&#8217;ll do here is create identifiers for the local (on this computer) and remote (on gmail) repositories.</p>
<p><code><br />
localrepository = local-personal<br />
remoterepository = remote-personal<br />
</code></p>
<p>local-personal and remote-personal are simply identifiers for a later section.</p>
<p>I&#8217;ll do something similar for my other account</p>
<p><code><br />
[Account net]<br />
localrepository = local-net<br />
remoterepository = remote-net<br />
</code></p>
<p>Now I&#8217;ll say where my mail is to be saved on my computer.  Also, I want to use the standard Maildir system.</p>
<p><code><br />
[Repository local-personal]<br />
type = Maildir<br />
localfolders = /home/me/.mail/personal<br />
</code></p>
<p><code><br />
[Repository local-net]<br />
type = Maildir<br />
localfolders = /home/me/.mail/net<br />
</code></p>
<p>Naturally, you can store your mail wherever you want.  I like it in a hidden mail folder in my home directory.  Before you can use offlineimap, these destination folders have to exist: <code>mkdir -p ~/.mail/{personal,net}</code></p>
<p>Now, I&#8217;ll set up the interface with gmail.  OfflineIMAP provides a custom Gmail type connection.  I&#8217;ll use this.  It&#8217;s possible that some of the information I have here is redundant using the gmail type but I haven&#8217;t experimented too much because it works no problem.</p>
<p><code><br />
[Repository remote-personal]<br />
type = Gmail<br />
remotehost = imap.gmail.com<br />
remoteuser = personal@gmail.com<br />
remotepass = <em>mypassword</em><br />
ssl = yes<br />
realdelete = no<br />
</code></p>
<p><code><br />
[Repository remote-net]<br />
type = Gmail<br />
remotehost = imap.gmail.com<br />
remoteuser = net@gmail.com<br />
remotepass = <em>mypassword2</em><br />
ssl = yes<br />
realdelete = no<br />
</code></p>
<p>Here, I&#8217;ve just straight up typed in my password into this file.  I believe there are better ways to encrypt this information, but I guess I&#8217;m just not as paranoid as I should be.  </p>
<p>I believe that realdelete = no is the default but it&#8217;s worth putting in there so that I can mention it.  </p>
<p>Gmail puts your mail into your inbox and/or your labels but it also stores a copy in All Mail.  If we were to delete a message on the local computer with this config, when offlineimap syncs, it will just strip the email of all labels and will leave the copy in All Mail.  If we had set realdelete to yes, then offlineimap would even empty the email from All Mail and move it to the Trash folder.  With the massive size of Gmail mailboxes, I don&#8217;t have the need to really delete things, so I set realdelete to no.</p>
<p>Okay, so let&#8217;s look at the whole file:</p>
<p><code><br />
[general]<br />
metadata = ~/.offlineimap<br />
accounts = personal,net<br />
maxxyncaccounts = 4<br />
socktimeout = 60<br />
ui = TTY.TTYUI<br />
</code></p>
<p><code><br />
[Account personal]<br />
localrepository = local-personal<br />
remoterepository = remote-personal<br />
</code></p>
<p><code><br />
[Account net]<br />
localrepository = local-net<br />
remoterepository = remote-net<br />
 </code></p>
<p><code><br />
[Repository local-personal]<br />
type = Maildir<br />
localfolders = /home/me/.mail/personal<br />
</code></p>
<p><code><br />
[Repository remote-personal]<br />
type = Gmail<br />
remotehost = imap.gmail.com<br />
remoteuser = personal@gmail.com<br />
remotepass = <em>mypassword</em><br />
ssl = yes<br />
realdelete = no<br />
</code></p>
<p><code><br />
[Repository local-net]<br />
type = Maildir<br />
localfolders = /home/me/.mail/net<br />
 </code></p>
<p><code><br />
[Repository remote-net]<br />
type = Gmail<br />
remotehost = imap.gmail.com<br />
remoteuser = net@gmail.com<br />
remotepass = <em>mypassword2</em><br />
ssl = yes<br />
realdelete = no<br />
</code></p>
<p>Okay, let&#8217;s go ahead and sync for the first time.  Depending on how much stuff you already have on gmail, this may take a while.  Run the command <code>offlineimap -o</code> the -o says run once, which is probably what it would do anyway because I didn&#8217;t set any refreshing since I&#8217;ll let a cronjob do that.</p>
<p>If everything seemed to have went well, you can set up a cronjob.  You can do this however you want, this is what I do: <code>contrab -e</code> to edit my crons with vi</p>
<p><code><br />
*/10 * * * * * offlineimap -o -q -u Noninteractive.Basic<br />
* */1 * * * * offlineimap -o -u Noninteractive.Basic<br />
</code></p>
<p>The first line does one quick update with the noninteractive interface every 10 minutes.  The second line does a full update every hour.  Full syncs will change the flags of emails, as in read/not read etc, where as quick syncs will only check for new/moved emails.  I&#8217;m not sure it&#8217;s really worthwhile doing quick syncs over full syncs.</p>
<p>Okay that should be everything to get offlineIMAP working, next will be setting up mutt.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=9&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/05/03/gmail2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
		<item>
		<title>How to set up Gmail Mutt and OfflineIMAP with multiple accounts part 1</title>
		<link>http://miggysmith.wordpress.com/2009/05/02/gmail1/</link>
		<comments>http://miggysmith.wordpress.com/2009/05/02/gmail1/#comments</comments>
		<pubDate>Sat, 02 May 2009 07:20:31 +0000</pubDate>
		<dc:creator>miggysmith</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[offlineimap]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts. This first part is a statement of the problem and how to set up gmail. Part 1: Gmail Part 2: offlineIMAP Part 3: mutt The Scenario I have three gmail accounts I want to work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=1&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This shall be an in depth look at how to set gmail with mutt and offlineimap using multiple gmail accounts.</p>
<p>This first part is a statement of the problem and how to set up gmail.</p>
<p><a href="http://miggysmith.wordpress.com/2009/05/02/gmail1/">Part 1: Gmail</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail2/">Part 2: offlineIMAP</a><br />
<a href="http://miggysmith.wordpress.com/2009/05/03/gmail3/">Part 3: mutt</a></p>
<h3>The Scenario</h3>
<p>I have three gmail accounts I want to work with.  First is my school account.  My school recently set up gmail for all the students which is where the official college correspondence goes.  I also have an email account with my academic department.  I am forwarding this email to my schools gmail account.  They use an alias rather than the typical username@gmail.com it looks like student@school.edu; so let&#8217;s refer to this account as student@school.edu.</p>
<p>At the moment, POP and IMAP do not work with this account and I want to use mutt to work with my email so I forward everything to another gmail account where I also receive personal email.  Let&#8217;s call this account personal@gmail.com</p>
<p>Lastly, I have a third account which I use for internet things.  As in, I use this account when I sign up for a forum or use online stores or sign up for wordpress :) and that sort of thing.  Let&#8217;s call this account net@gmail.com</p>
<h3>Setting up GMail</h3>
<p>Since I&#8217;m going to be receiving my school email at my personal account, I will prepare my personal account to receive this email cleanly.  Logging in to my personal@gmail.com account I&#8217;ll go to settings then labels and make a new label called school.  I want everything going to my school account to have this label.  In mutt, these labels will show up as independant folders or mailboxes.  So with my school label created, in settings I now select filters and make a new filter.  I want anything going to student@school.edu to go to my school label so I type in that email in the &#8220;To&#8221; field click next and apply label: school.  Since my departmental email is addressed to something like student@physics.school.edu I&#8217;ll apply a similar filter to also go to school or maybe a new phyiscs label.  If you want all your email to stay in one pile, then you should just ignore the above instructions and everything will stay together in the inbox.</p>
<p>Now, I&#8217;m ready to send my student@school.edu email to personal@gmail.com</p>
<p>In my student@school.edu account, I go to settings then Forwarding/POP/IMAP.  Here, I select forward a copy to personal@gmail.com and keep gmail&#8217;s copy in the inbox, as gmail says: so much storage, never delete another email again.</p>
<p>Now, I&#8217;m going to go back to my personal@gmail.com and set up the ability to send from different addresses.  Specifically, since mail from 3 different accounts will be arriving in personal@gmaill.com, I want to be able to send and reply using each of them.  In personal@gmail.com, under settings-&gt;accounts I&#8217;ll add an email address that I own.  I&#8217;ll type in student@school.edu and send the verification email.  Now, I&#8217;ll be able to check to make sure that the email is forwarded correctly and the label is applied correctly.  I&#8217;ll do this for my student@physics.school.edu account as well.</p>
<p>My net@gmail.com account doesn&#8217;t require any special work.  Obviously, you can make labels as you see fit.</p>
<p>Though I think it may be enabled by default, the last thing that needs to be done is to enable IMAP under my accounts: personal@gmail.com and net@gmail.com.  Since I&#8217;ve forwarded all my school mail to personal I don&#8217;t need to enable IMAP under that account.  To turn on IMAP I go to settings Forwarding/POP/IMAP and select enable IMAP</p>
<p>Next post will be on how to set up offlineIMAP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/miggysmith.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/miggysmith.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/miggysmith.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=miggysmith.wordpress.com&amp;blog=7585007&amp;post=1&amp;subd=miggysmith&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://miggysmith.wordpress.com/2009/05/02/gmail1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cf8a442988dd3aad75fa2ffaf82ea877?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">miggysmith</media:title>
		</media:content>
	</item>
	</channel>
</rss>
