<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>Ataraxia Consulting</title>
<link>http://iki.atxconsulting.com//</link>
<description>Ataraxia Consulting</description>
<item>

	<title>Giganews VyprVpn on Linux with IPSEC and L2TP</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Giganews_VyprVpn_on_Linux_with_IPSEC_and_L2TP/</guid>

	<link>http://iki.atxconsulting.com//posts/Giganews_VyprVpn_on_Linux_with_IPSEC_and_L2TP/</link>


	<category>tags/giganews</category>

	<category>tags/ipsec</category>

	<category>tags/l2tp</category>

	<category>tags/l2tpd</category>

	<category>tags/linux</category>

	<category>tags/ubuntu</category>

	<category>tags/vpyvpn</category>

	<category>tags/xl2tpd</category>


	<pubDate>Sun, 01 May 2011 12:58:00 -0400</pubDate>
	<dcterms:modified>2012-01-13T17:31:16Z</dcterms:modified>

	<description>&lt;p&gt;I&#39;m not a fan of PPTP, but unfortunately that&#39;s the only listed configuration option for giganews&#39; VpyVpn service (&lt;a href=&quot;http://www.giganews.com/vyprvpn/setup/linux/pptp.html&quot;&gt;http://www.giganews.com/vyprvpn/setup/linux/pptp.html&lt;/a&gt;). So the following are a few configuration files you can use to connect to vyprvpn using ipsec and l2tp. I tested with Ubuntu 10.04, OpenSWAN, and xl2tpd.&lt;/p&gt;

&lt;p&gt;The /etc/ipsec.conf stanza&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;conn giganews
        authby=secret
        pfs=no
        rekey=yes
        keyingtries=3
        type=transport
        left=%defaultroute
        leftprotoport=17/1701
        right=us1.vpn.giganews.com
        rightid=&amp;#64;us1.vpn.giganews.com
        rightprotoport=17/1701
        auto=add&lt;/pre&gt;

&lt;p&gt;The /etc/ipsec.secrets stanza&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;%any us1.vpn.giganews.com: PSK &amp;quot;thisisourkey&amp;quot;&lt;/pre&gt;

&lt;p&gt;The /etc/xl2tpd/xl2tpd.conf stanza, be sure to replace giganews_username with your username&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;[lac giganews]
lns = us1.vpn.giganews.com
require chap = yes
refuse pap = yes
require authentication = yes
; Name should be your giganews username
name = giganews_username
ppp debug = no
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes&lt;/pre&gt;

&lt;p&gt;The /etc/ppp/chap-secrets stanza, be sure to replace giganews_username and giganews_password with your username and password respectively&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;giganews_username us1.vpn.giganews.com &amp;quot;giganews_password&amp;quot; *&lt;/pre&gt;

&lt;p&gt;The /etc/ppp/options.l2tpd.client file&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;ipcp-accept-local
ipcp-accept-remote
refuse-eap
noccp
noauth
crtscts
idle 1800
mtu 1410
mru 1410
defaultroute
debug
lock
#proxyarp
connect-delay 5000&lt;/pre&gt;

&lt;p&gt;You can replace us1.vpn.giganews.com with any of the following end points, just make sure you replace all instances in the previous&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;us1.vpn.giganews.com for Los Angeles, CA&lt;/li&gt;
&lt;li&gt;us2.vpn.giganews.com for Washington, DC&lt;/li&gt;
&lt;li&gt;eu1.vpn.giganews.com for Amsterdam&lt;/li&gt;
&lt;li&gt;hk1.vpn.giganews.com for Hong Kong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To connect you run the following commands &lt;code&gt;ipsec auto --up giganews&lt;/code&gt; when that&#39;s successful connect l2tp &lt;code&gt;echo &quot;c giganews&quot; &amp;gt; /var/run/xl2tpd/l2tp-control&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If that&#39;s successful ppp will have replaced your default route to go out over ppp0 which represents your vpn connection.&lt;/p&gt;

&lt;p&gt;Most of the instructions adapted from &lt;a href=&quot;http://www.jacco2.dds.nl/networking/linux-l2tp.html&quot;&gt;http://www.jacco2.dds.nl/networking/linux-l2tp.html&lt;/a&gt;&lt;/p&gt;
</description>


</item>
<item>

	<title>Steve Earle -- Every Part Of Me</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Steve_Earle_--_Every_Part_Of_Me/</guid>

	<link>http://iki.atxconsulting.com//posts/Steve_Earle_--_Every_Part_Of_Me/</link>


	<category>tags/chords</category>

	<category>tags/tabs</category>


	<pubDate>Fri, 29 Apr 2011 23:55:00 -0400</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Steve_Earle&quot;&gt;Steve Earle&lt;/a&gt; recently released a new album entitled &lt;a href=&quot;http://www.amazon.com/Ill-Never-This-World-Alive/dp/B004N5DHGM&quot;&gt;&quot;I&#39;ll Never Get Out of This World Alive&quot;&lt;/a&gt; (the title of an old Hank Williams song). I&#39;m particularly infatuated with this album. Mostly for its simplicity. All the songs were recorded live, with little overdubbing. Just reinforcing that music doesn&#39;t have to be complicated and layered to be enjoyable and moving. The song that represents this ethos the best is &quot;Every Part Of Me&quot;, the following are the lyrics and chords as I interpret them. &lt;a href=&quot;http://www.youtube.com/watch?v=onxGMaIDxi0&quot;&gt;Here&#39;s a video with him performing it&lt;/a&gt; and a brief &lt;a href=&quot;http://xm.atxconsulting.com/every-part-of-me.m4a&quot;&gt;audio clip&lt;/a&gt; of me playing the two major themes.&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;Every Part Of Me
Steve Earle
I&#39;ll Never Leave This World Alive
C

[C] [G] [Am] [G] [C]
[C]I love you with all my heart
[G]all my soul [Am]every [G]part of me
[C]it&#39;s all I can do to mark
[G]where you end and [Am]where I [G]start you see

[Am]living long in [G/B]my travails
I [C]left a trail of [G/B]tears behind me
[Am]been in love so [G]many times
didn&#39;t [F]think this kind would [Am]ever [G]find me

[C]I love you with everything
[G]all my weakness [Am]all my [G]strength
[C]I can&#39;t promise anything
[G]except that my last [Am]breath will [G]bear your name

[Am]and when I&#39;m gone they&#39;ll [G/B]sing a song
a[C]bout a lonely [G/B]fool who wandered
[Am]around the world and [G]back again
[F]but in the end he [Am]finally [G]found her

[C]I love you with all my heart
[G]all my soul and [Am]every [G]part of me
[C] [G] [Am] [G]
[C] [G] [Am] [G]

[Am]cross the univer[G/B]se I&#39;ll spin
un[C]til the ending and [G/B]then I wonder
[Am]if we should get a[G]nother chance
could [F]I have that dance
for[Am]ever [G]under

[C]a double moon and sky lit stars
[G]shining down on [Am]where you [G]are
[C]and I love you with all my heart
[G]all my soul and [Am]every [G]part of me
[C] [G] [Am] [G] [C]&lt;/pre&gt;
</description>


</item>
<item>

	<title>Linsides - LinCached - 3rd Party Linode Service</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Linsides_-_LinCached_-_3rd_Party_Linode_Service/</guid>

	<link>http://iki.atxconsulting.com//posts/Linsides_-_LinCached_-_3rd_Party_Linode_Service/</link>

	<pubDate>Thu, 24 Mar 2011 19:01:00 -0400</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;Prior to today I had considered this site, while not terribly popular (or frequently updated), to be relatively quick with little effort on my part. I may not host many high traffic sites, but I have my personal sites and a handful of others. I have a server specifically to handle the HTTP traffic, and a server to handle RDBMS. They use the private network afforded to me by &lt;a href=&quot;http://www.linode.com/?r=983312bf0b4eb3f4b57cd1fc2cd5bca2047cb87e&quot;&gt;Linode.com&lt;/a&gt; (my VPS provider of choice) so communication between the two servers is quick and doesn&#39;t count against my monthly bandwidth quota. It&#39;s worked for years, so I&#39;ve had little desire to muck with the formula.&lt;/p&gt;

&lt;p&gt;That is until I learned about &lt;a href=&quot;http://linsides.com&quot;&gt;Linsides.com&lt;/a&gt; -- a company that offers services specifically for Linodes over the private network.&lt;/p&gt;

&lt;p&gt;The offering is young, but the service is delivered with slick ease. They currently offer NTP, APT Caching, and LinCached (a memcached frontend). The services are only available over the private network, so that means you have to be a Linode.com customer before you can take advantage. NTP and APT caching are offered for free and are conveniences to provide fast responses and to keep load on public mirrors low. That is you get the same quality as if you were connecting to them publicly but they&#39;re generally delivered faster and don&#39;t count against your monthly bandwidth quota.&lt;/p&gt;

&lt;p&gt;LinCached is a private network memcached instance, which you can configure to be one of the following sizes: 32MB, 64MB, 96MB, or 128MB. Linsides uses a prepaid credit system for managing payments. Each size memcache instance costs a certain amount of credits per day, a 32MB instance is 1 credit, 64MB are 2 credits and so on. When you sign up you get 5 free credits, so you can get a free trial for 5 days of a 32MB instance. There&#39;s a dashboard that lets you see how many instances you have, what their sizes are, and your current usage on that instance. If you drill down further you can even see a snazzy progress bar to that gives you a visual way to identify how much of your instance you&#39;re using. You can even quickly flush the specific instance.&lt;/p&gt;

&lt;p&gt;After you&#39;ve created your LinCached instance, you simply need to add the private IP address of the node that you want to grant access to and boom, you&#39;re done. All in all it took about 10 or 15 seconds of simple data entry on Linsides.com clean site to add a new instance, and it was instantly available to me. I made the necessary changes so this site would take advantage of memcache and just as instantly I started to see the usage appear on the Linsides dashboard.&lt;/p&gt;

&lt;p&gt;Simple, dead easy. A perfect no hassle way for me to increase performance of my site in under 15 minutes (realistically under a minute).&lt;/p&gt;

&lt;p&gt;Now I&#39;m perfectly capable of running my own memcached instances. But what&#39;s key here is that it&#39;s not using memory on my web servers or my database server, and I didn&#39;t have to spin up yet another node to achieve that. Pricing is affordable as well, credits come in packages that range from $10 for 100, to $300 for 6K. They are also planning on offering more services in the future. I&#39;m excited!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.linode.com/?r=983312bf0b4eb3f4b57cd1fc2cd5bca2047cb87e&quot;&gt;Linode.com&lt;/a&gt; and &lt;a href=&quot;http://linsides.com&quot;&gt;Linsides.com&lt;/a&gt; -- A match made in heaven!&lt;/p&gt;
</description>


</item>
<item>

	<title>Automatically generate AirPrint Avahi service files for CUPS printers</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Automatically_generate_AirPrint_Avahi_service_files_for_CUPS_printers/</guid>

	<link>http://iki.atxconsulting.com//posts/Automatically_generate_AirPrint_Avahi_service_files_for_CUPS_printers/</link>

	<pubDate>Sun, 21 Nov 2010 00:13:00 -0500</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;Last weekend I read Ryan Finnie&#39;s excellent article about getting CUPS printers to work with AirPrint (&lt;a href=&quot;http://www.finnie.org/2010/11/13/airprint-and-linux/&quot;&gt;http://www.finnie.org/2010/11/13/airprint-and-linux/&lt;/a&gt;). I got a bit angry at Ubuntu/avahi/CUPS/Apple regarding some silliness involving the APIs that are used by CUPS internally for DNSSD announcement (like the fact it&#39;s broken in 10.04 and 10.10 because Apple changed APIs and the new API calls weren&#39;t packaged (yet?)). So after I finished ranting to myself I created the service file and boom, I could print from my iPhone.&lt;/p&gt;

&lt;p&gt;Neat.&lt;/p&gt;

&lt;p&gt;Sucks to have to create these .service files manually though, if only something could just talk to CUPS and spit out these files for me. So this weekend I decided to whip up a small script to do just that.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/tjfontaine/airprint-generate&quot;&gt;https://github.com/tjfontaine/airprint-generate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It&#39;s a small python script that can talk to a CUPS server (by default the local socket) and write out some xml suitable for use with avahi. It doesn&#39;t do much special, just grabs all configured printers that are marked shared and create files that when avahi exports them will make the printers visible from an iOS device. You are responsible to make sure your printer is configured properly in CUPS. You should make sure CUPS can send and print a test page, if it can&#39;t do that it&#39;s unlikely that the print you send it from your iOS device will work either. Your CUPS server should also have a working PDF filter, since most times that&#39;s what the iOS device will send.&lt;/p&gt;

&lt;p&gt;Without any options, it will communicate with your local CUPS instance (or that is to say, will do what ever the cups client library will do by default, there may be environment variables at play here), after it learns about each printer it will generate an xml file AirPrint-[name of printer in CUPS].service, putting this file somewhere where avahi knows to load it will automagically make the printer available to iOS devices (the directory in my experience is /etc/avahi/services). You can also specify -p [PREFIX] if you aren&#39;t a fan of AirPrint-. There is also -d [TARGET DIRECTORY] if you wanted to specify the avahi services directory, if you supply this parameter all the xml files will be generated in that directory, otherwise they will be generated in the current working directory.&lt;/p&gt;

&lt;p&gt;DNSSD has a limit of 255 characters for a txt-record entry, currently not all fields are verified for this, the one place where it is checked is the entry that generates the &quot;pdl=&quot; record, this is the hint record that specifies what content-types the printer will accept. There is an internal priority list (in the future you will be able to influence this) that keeps important content-types at the head and experimental/unnecessary ones out all together. The resulting entry is truncated to fit into 255 (without also creating malformed entries). If you&#39;re curious to see what will be truncated make sure to run the script with the rather ugly --verbose option.&lt;/p&gt;

&lt;p&gt;In the future (with proper motivation) I will add the other hint fields that include things like duplexing, but it wasn&#39;t immediately obvious to me which CUPS printer attributes store that information in a consistent way.&lt;/p&gt;

&lt;p&gt;It would also be trivial to take this script and instead of generating avahi service files directly, use a python binding for dnssd/avahi/bonjour to do the announcements directly (at least as a stop gap until CUPS &gt;= 1.4 + Debian (and derivatives) get the packaging solidified [and add airprint announcments]).&lt;/p&gt;
</description>


</item>
<item>

	<title>Linode API Python3 and GitHub</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Linode_API_Python3_and_GitHub/</guid>

	<link>http://iki.atxconsulting.com//posts/Linode_API_Python3_and_GitHub/</link>

	<pubDate>Thu, 05 Aug 2010 13:01:00 -0400</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;Josh Wright today contributed a Python3 branch of the API. I&#39;ve pushed this to the repo and cherry picked a few of the commits that apply to master as well. I&#39;ve also created a &lt;a href=&quot;http://github.com/tjfontaine/linode-python&quot;&gt;github repo&lt;/a&gt; that will serve as the main access point for the repo from here on out. Please if you have issues, &lt;a href=&quot;http://github.com/tjfontaine/linode-python/issues&quot;&gt;file them&lt;/a&gt;. Also you hopefully will find the examples useful, I&#39;ll be moving those over to the &lt;a href=&quot;http://wiki.github.com/tjfontaine/linode-python/&quot;&gt;wiki&lt;/a&gt; as well. If you want to contribute please don&#39;t hesitate, Josh already identified the need for unit tests. Thanks to Linode for being a great resource, and thanks to everyone who has used and/or contributed to the bindings!&lt;/p&gt;
</description>


</item>
<item>

	<title>Updated Linode API</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Updated_Linode_API/</guid>

	<link>http://iki.atxconsulting.com//posts/Updated_Linode_API/</link>

	<pubDate>Tue, 09 Feb 2010 16:39:00 -0500</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;I&#39;ve updated the python bindings to support the new &lt;a href=&quot;http://blog.linode.com/2010/02/09/introducing-stackscripts/&quot;&gt;Linode StackScripts&lt;/a&gt; method calls. An excellent feature to aid in the deployment of your new nodes. The &lt;a href=&quot;http://atxconsulting.com/linode-python-api.html&quot;&gt;documentation&lt;/a&gt; is also up to date, albeit in need of some verbosity. You can browse the source at my gitweb, or as usual you can access the source directly with git
&lt;code&gt;git clone git://github.com/tjfontaine/linode-python.git&lt;/code&gt;&lt;/p&gt;
</description>


</item>
<item>

	<title>Monitor All Network Traffic On A Virtual Host Within A Virtual Machine On That Host</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Monitor_All_Network_Traffic_On_A_Virtual_Host_Within_A_Virtual_Machine_On_That_Host/</guid>

	<link>http://iki.atxconsulting.com//posts/Monitor_All_Network_Traffic_On_A_Virtual_Host_Within_A_Virtual_Machine_On_That_Host/</link>

	<pubDate>Sat, 12 Dec 2009 17:32:00 -0500</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;Recently I was asked to explore means to monitor/audit network traffic of a virtual host (i.e. all traffic on the Dom0 and DomUs) without the monitoring software running inside the privileged domain (Dom0). If you are ok with running the monitoring software inside the privileged domain then you need not read the rest of this blog.&lt;/p&gt;

&lt;p&gt;Normal network auditing software comes in the form of tcpdump, SNORT, or even a collection of software such as OSSIM. Most of this software gleans its information by setting a network interface into promiscuous mode and then using a hub or port mirroring on your switch to duplicate all packets to that network interface for auditing. Hubs are used in lieu of switches because they operate merely as repeaters, where as a switch tries to limit network congestion by sending packets to only the port that a given destination resides behind. This same switching technology is employed by the bridge interface in Linux and most other virtualization platforms.&lt;/p&gt;

&lt;p&gt;The most common way to achieve network auditing inside of a virtual machine guest (DomU) is to assign the physical interfaces from the bare metal to the guest (pci mapping) such that the guest sees the physical hardware, thus bypassing the bridge normally used at the Host/Hypervisor level. There are a few cons to this approach. In this deployment you can&#39;t just add hardware and use port mirroring on your switch to capture all traffic from the Host. This will only capture traffic from sources and to destinations external to the host you&#39;re monitoring, and won&#39;t capture traffic among the guests running on your host. To get around that obstacle you could use this guest then as the route of all traffic to and from and among the host and virtual machine guests. However you&#39;re then relying on a specific guest to stay available to handle the traffic and audit, and if that guest dies all other guests on the host will be without network connectivity. Some permutation of this solution is probably acceptable if you&#39;re simply interested in monitoring traffic to and from your gateway where rogue traffic is more likely to initiate.&lt;/p&gt;

&lt;p&gt;Another possible solution is to &quot;simply&quot; duplicate all packets in the privileged domain and send them &quot;over the wire&quot; to another virtual machine for auditing. The solution is what I&#39;ll dub virtual port mirroring, and can be achieved with iptables (or probably more suitably ebtables) and extensions from &lt;a href=&quot;http://xtables-addons.sourceforge.net/&quot;&gt;http://xtables-addons.sourceforge.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;iptables -t mangle -A PREROUTING -j TEE --gateway 192.168.0.100&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You&#39;ll probably want to make sure this rule is at the top of your PREROUTING chain and you&#39;re likely going to want to make the rule considerably more specific (not the least of which is preventing a feedback loop from the destination because of its own traffic). For instance, on the network I intend to deploy this on there&#39;s a backend network handling DRBD replication, those are probably packets you&#39;re not going to want to duplicate unless you&#39;re extra paranoid. But this solution is simple, straight forward, and if I do say so myself elegant. Traffic in and out of the host and among the guests are all duplicated and sent to a specific destination and if that destination is down the packets merely drop. I still need to perform some stress testing to see just how far you can push the network stack before it falls over, but it&#39;s certainly advantageous to keep the destination on the same host and not push that traffic external for security and network congestion related issues.&lt;/p&gt;

&lt;p&gt;Note that this will not audit the rest of the traffic on your presumably switched network. You&#39;ll want to devise a means to audit on each of your physical hosts and then collect that data in a central location later. I performed all this on the Xen stack provided from Debian in Lenny and unfortunately xtables-addons is only a Squeeze package right now (because it deps on iptables &gt;= 1.4.3) so I ended up building these packages on my own. If there are others out there who would like to implement a similar solution in their Lenny stacks and don&#39;t want to build the packages leave a comment and I&#39;ll create a repo for the packages on i386 and amd64 platforms.&lt;/p&gt;
</description>


</item>
<item>

	<title>Muppet Movie -- Im Going to Go Back There Someday -- Guitar Tabs Chords</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Muppet_Movie_--_Im_Going_to_Go_Back_There_Someday_--_Guitar_Tabs_Chords/</guid>

	<link>http://iki.atxconsulting.com//posts/Muppet_Movie_--_Im_Going_to_Go_Back_There_Someday_--_Guitar_Tabs_Chords/</link>


	<category>tags/chords</category>

	<category>tags/tabs</category>


	<pubDate>Sat, 05 Dec 2009 20:52:00 -0500</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;I&#39;ve been in a Muppet mood recently, as such I&#39;ve found myself playing along with soundtracks. I was quite unsatisfied with the chords I found for Gonzo&#39;s lament from The Muppet Movie so here is my transcription, the end of the bridge may not be 100% but it doesn&#39;t sound terrible&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;G          C   G     Em      A
This looks familiar, vaguely familiar,
G        C     G         Em          A
Almost unreal, yet, it&#39;s too soon to feel yet.
Am          D             Bm     E
Close to my soul, and yet so far away.
    Am          D              G
I&#39;m going to go back there someday

G          C     G      Em            A
Sun rises, night falls, sometimes the sky calls.
G         C    G          Em     A
Is that a song there, and do I belong there?
Am         D               Bm         E
I&#39;ve never been there, but I know the way.
    Am          D              G
I&#39;m going to go back there someday.


Em          A             D
Come and go with me, it&#39;s more fun to share,
Em               A          D
We&#39;ll both be completely at home in midair.
      E           C#m         F#m         F#m/E
We&#39;re flyin&#39;, not walkin&#39;, on featherless wings.
       D         Am/C         Am        G/D    D
We can hold onto love like invisible strings.


G             C    G       Em                 A
There&#39;s not a word yet for old friends who&#39;ve just met.
G            C     G        Em           A
Part heaven, part space, or have I found my place?
Am           D          Bm        E
You can just visit, but I plan to stay.
    Am          D              G
I&#39;m going to go back there someday.
    Am          D              G
I&#39;m going to go back there someday.&lt;/pre&gt;
</description>


</item>
<item>

	<title>Making imaplib simple</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/Making_imaplib_simple/</guid>

	<link>http://iki.atxconsulting.com//posts/Making_imaplib_simple/</link>

	<pubDate>Thu, 23 Jul 2009 17:06:00 -0400</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;Not long ago I wrote an imap polling script for work that used Python&#39;s &lt;a href=&quot;http://docs.python.org/library/imaplib.html&quot;&gt;imaplib&lt;/a&gt;. Shortly after that &lt;a href=&quot;http://blog.hoopycat.com/&quot;&gt;HoopyCat&lt;/a&gt; wrote an excellent &lt;a href=&quot;http://blog.hoopycat.com/index.php/2009/07/04/imap2maildir-a-tool-for-mirroring-imap-t&quot;&gt;imap backup script&lt;/a&gt; that also used imaplib. We exchanged some stories and opined on wanting a simpler mechanism to get imaplib to return an &lt;a href=&quot;http://docs.python.org/library/email.message.html&quot;&gt;email.Message&lt;/a&gt; object (a feature that should be available from the core).&lt;/p&gt;

&lt;p&gt;I happened to have to look at my code again this week and decided to work up a quick example of the interface I expected to actually find in the core imaplib&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;&lt;span class=&quot;hl kwa&quot;&gt;import&lt;/span&gt; imaplib
&lt;span class=&quot;hl kwa&quot;&gt;import&lt;/span&gt; email

&lt;span class=&quot;hl kwa&quot;&gt;class&lt;/span&gt; __simplebase&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;hl kwa&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;get_messages_by_folder&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; folder&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; charset&lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
    ids &lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;get_ids_by_folder&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;folder&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; charset&lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt;charset&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;hl kwa&quot;&gt;for&lt;/span&gt; m &lt;span class=&quot;hl kwa&quot;&gt;in&lt;/span&gt; self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;get_messages_by_ids&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;ids&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
      &lt;span class=&quot;hl kwa&quot;&gt;yield&lt;/span&gt; m

  &lt;span class=&quot;hl kwa&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;get_ids_by_folder&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; folder&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; charset&lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
    self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;folder&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;
    status&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; data &lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;search&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;charset&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl str&quot;&gt;&#39;ALL&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;if&lt;/span&gt; status &lt;span class=&quot;hl sym&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;hl str&quot;&gt;&#39;OK&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;hl kwa&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;hl kwc&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;hl kwa&quot;&gt;return&lt;/span&gt; data&lt;span class=&quot;hl sym&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl num&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;()&lt;/span&gt;

  &lt;span class=&quot;hl kwa&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;get_messages_by_ids&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; ids&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;for&lt;/span&gt; i &lt;span class=&quot;hl kwa&quot;&gt;in&lt;/span&gt; ids&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;hl kwa&quot;&gt;yield&lt;/span&gt; self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;get_message_by_id&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;i&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;

  &lt;span class=&quot;hl kwa&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;get_message_by_id&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;self&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl kwb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
    status&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; data &lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt; self&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl kwb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl str&quot;&gt;&#39;(RFC822)&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;hl kwa&quot;&gt;if&lt;/span&gt; status &lt;span class=&quot;hl sym&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;hl str&quot;&gt;&#39;OK&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;hl kwa&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;hl kwc&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;hl kwa&quot;&gt;return&lt;/span&gt; email&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;message_from_string&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;data&lt;span class=&quot;hl sym&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl num&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;hl num&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;])&lt;/span&gt;

&lt;span class=&quot;hl kwa&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;SimpleImap&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;imaplib&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;IMAP4&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; __simplebase&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
  &lt;span class=&quot;hl kwa&quot;&gt;pass&lt;/span&gt;

&lt;span class=&quot;hl kwa&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;SimpleImapSSL&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;imaplib&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;IMAP4_SSL&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; __simplebase&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
  &lt;span class=&quot;hl kwa&quot;&gt;pass&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;The SimpleImap and SimpleImapSSL classes should be drop in replacements for your existing usage of IMAP4 and IMAP4_SSL. You&#39;ll notice the use of generator objects (the yield keyword), this means that each iteration the message you&#39;re working on is pulled from the server right then. That&#39;s useful when you have a lot of messages that you don&#39;t necessarily want to cache into memory or when they&#39;ll potentially have large attachments. On the other hand, it will result in considerably more imap commands and traffic than if you were to just pull all the messages at once.&lt;/p&gt;

&lt;p&gt;Here&#39;s a sample usage that prints out the subject of every message in your inbox:&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;c &lt;span class=&quot;hl sym&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;hl kwd&quot;&gt;SimpleImap&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl str&quot;&gt;&#39;mail.example.com&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;143&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;
c&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl str&quot;&gt;&#39;someluser&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;hl str&quot;&gt;&#39;stupersekrit&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;hl kwa&quot;&gt;for&lt;/span&gt; m &lt;span class=&quot;hl kwa&quot;&gt;in&lt;/span&gt; c&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;get_messages_by_folder&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl str&quot;&gt;&#39;INBOX&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;):&lt;/span&gt;
  &lt;span class=&quot;hl kwa&quot;&gt;print&lt;/span&gt; m&lt;span class=&quot;hl sym&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;hl str&quot;&gt;&#39;subject&#39;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;]&lt;/span&gt;
c&lt;span class=&quot;hl sym&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl kwd&quot;&gt;logout&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;()&lt;/span&gt;
&lt;/pre&gt;
</description>


</item>
<item>

	<title>twuuenc the uuencode of web2.0</title>


	<guid isPermaLink="false">http://iki.atxconsulting.com//posts/twuuenc_the_uuencode_of_web2.0/</guid>

	<link>http://iki.atxconsulting.com//posts/twuuenc_the_uuencode_of_web2.0/</link>

	<pubDate>Wed, 01 Jul 2009 19:34:00 -0400</pubDate>
	<dcterms:modified>2012-01-03T18:11:18Z</dcterms:modified>

	<description>&lt;p&gt;For far too long now, you have been limited by those 140 characters of microblogging sites like twitter. I present you with twuuenc, take your tweet that is longer than 140 characters and stuff it into fewer unicode characters.&lt;/p&gt;

&lt;p&gt;Take for instance the beginning of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Gettysburg_Address&quot;&gt;Gettysburg Address&lt;/a&gt;:
Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.&lt;/p&gt;

&lt;p&gt;That&#39;s a total of 175 characters, twitter just won&#39;t have it. But if you run it through twuuenc you get:&lt;/p&gt;

&lt;p&gt;ɹҺξɌǶᖜᘫᓿϧѶ&lt;code&gt;✢Εǚᖣ¼Ј|ᓅɋöᖛӪ❡Ѯ9ᒡ✲ᐑᖨᙃ¥ѰҺΨᙦɖǞᗍʼО;◆ɌɺǪᙃ¦јѺĖ◐ΑȕөŤѐƢᘟ◐ýǪᗌᘋŇğ◆ᘕ˼ᖸᒋӽШѥÛᙵŶᖨ᙮ŰŇ{ᒧɋɸᕰᔋоҀƞ&lt;/code&gt;✲❼ȖᓫᓿѠᑺ◊◡ǹᖰᔌ❚ŇᓹĆ✮Pᖐᕣ°ЈѥĆ✒˘ǒᘫᕀҀƞ`ᘶýᕤᕤᗟ&lt;/p&gt;

&lt;p&gt;That tweet is only 128 characters (130 with markers), there&#39;s still 12 characters left for you to insert a wise crack!&lt;/p&gt;

&lt;p&gt;What&#39;s better is that this allows you send binary data over twitter, imagine the possibilities! Just for starters, let&#39;s add some additional compression to the address through Zlib&lt;/p&gt;

&lt;p&gt;ңᙦ˥ᖐąᒟǐТ;ӤУᗔ○Õ¢Ñ◀ᓫӆᕪ✼ᙜ❉ӆʃ%ᗽᐉᘰҫᑻǧɪȰŠᖔᙱ¯ķ▭ᑜᔨɳĺᘗŐ◇ᔇђʗᑵËᘎᙁᑶʓǿ⟘nΗˀЧЏȜ➒⟘Ɲᖁʉᘧ➳ːȰ✩❈❢✜¨Ȁѣ➫ᗧңᔯᓞϓ❯ᒑȰ❰˒Ӝń&lt;/p&gt;

&lt;p&gt;Now our tweet only takes up 93 characters (95 with markers), You have a full 47 characters to be clever!&lt;/p&gt;

&lt;p&gt;You can also optionally include the markers around the message to signify that the following message should be twuuenc decoded. A message wrapped in ☹ means it is twuuenc encoded but not compressed; while a message wrapped in ☺ means it&#39;s encoded and compressed with zlib.&lt;/p&gt;

&lt;p&gt;The alphabet twuuenc uses only has 2048 characters, but if you can get that up to 4096 that&#39;s another whole bit you can store per character in your tweet.&lt;/p&gt;

&lt;p&gt;You can find the source for the encoding and decoding &lt;a href=&quot;http://git.atxconsulting.com/cgi-bin/gitweb.cgi?p=twuuenc;a=blob_plain;f=tw_uuencode.py;hb=HEAD&quot;&gt;here&lt;/a&gt; with an &lt;a href=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;MIT&lt;/a&gt; license. The code relies on &lt;a href=&quot;http://code.google.com/p/python-bitstring/&quot;&gt;http://code.google.com/p/python-bitstring/&lt;/a&gt; which is also in the git repo (similarly licensed).&lt;/p&gt;
</description>


</item>

</channel>
</rss>

