<?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/"
	>

<channel>
	<title>The Flow of Consciousness &#187; howto</title>
	<atom:link href="http://cad.cx/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://cad.cx/blog</link>
	<description>Meanderings and punditry by a computer scientist with penchant for journalism, education, and politics</description>
	<lastBuildDate>Sat, 10 Dec 2011 19:20:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to rapidly expunge Facebook&#8217;s Friend Suggestions</title>
		<link>http://cad.cx/blog/2009/10/03/how-to-rapidly-expunge-facebooks-friend-suggestions/</link>
		<comments>http://cad.cx/blog/2009/10/03/how-to-rapidly-expunge-facebooks-friend-suggestions/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 14:13:49 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=513</guid>
		<description><![CDATA[I really admire Facebook&#8217;s Friend Suggestions feature. It has on rare occasion shown someone to whom I&#8217;d really like to connect. Most of the time, though, it shows people who I don&#8217;t know at all and have maybe one mutual friend. So, it&#8217;s largely useless to me. However, being the often mindless user, when I [...]]]></description>
			<content:encoded><![CDATA[<p>I really admire Facebook&#8217;s Friend Suggestions feature. It has on rare occasion shown someone to whom I&#8217;d really like to connect. Most of the time, though, it shows people who I don&#8217;t know at all and have maybe one mutual friend. So, it&#8217;s largely useless to me.</p>
<p>However, being the often mindless user, when I see a suggestion that may be relevant to my interests, I do visit the full friend suggestion page and see if there are any others. Rarely am I presented with anyone to whom I find a dreadful desire to connect. I still feel obligated to click that damned little [X] as if to say, &#8220;I don&#8217;t know this person.&#8221; Unfortunately, <em>I have to repeat this approximately 25 times in order to full expunge this list of people</em>.</p>
<p>So, I decided to write a little script which takes care of clicking that button for me. Navigate to the <a href="http://www.facebook.com/find-friends/">Find Friends</a> page on Facebook and execute this script in your <a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a> console. Or, prefix it with <code>javascript:</code> and execute it in the URL bar.</p>
<div class="codeblock">
<pre><code>d = document.getElementsByClassName("fg_action_hide"); for (var i in d){ d[i].onclick() }</code></pre>
</div>
<p>The first part gets an array (a list) of all of the clickable elements with that class, the class used to denote the [X]. The next part loops over them and executes each&#8217;s onclick() function just like as if you&#8217;d clicked it yourself.</p>
<p>Please note that I tested this ONLY on Firefox and Chromium, but it should work on any modern browser (read: anything but IE).</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2009/10/03/how-to-rapidly-expunge-facebooks-friend-suggestions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Add CACert Root Certificates to Chromium</title>
		<link>http://cad.cx/blog/2009/08/11/howto-add-cacert-root-certificates-to-chromium/</link>
		<comments>http://cad.cx/blog/2009/08/11/howto-add-cacert-root-certificates-to-chromium/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:41:02 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[cacert]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=457</guid>
		<description><![CDATA[+ I&#8217;ve recently begun using Chromium for most of my day-to-day browsing tasks. It recently gained support for Adobe Flash and other plugins. I&#8217;ll be excited to when it picks up Java, as well&#8212;then I&#8217;ll have little reason to use Firefox except for development. I&#8217;ve enjoyed watching the daily builds go from a virtually a [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align:center"><img src="http://cad.cx/blog/wp-content/uploads/2009/08/cacert4.png" alt="CACert Logo" title="CACert Logo" width="270" height="62" class="size-full wp-image-460" style="vertical-align:middle"/> <span style="font-size: 64px;font-weight:bold;vertical-align:middle"> + </span> <img src="http://cad.cx/blog/wp-content/uploads/2009/08/chromium.png" alt="Chromium Logo" title="Chromium Logo" width="64" height="64" class="size-full wp-image-459" style="vertical-align:middle" /></div>
<p>I&#8217;ve recently begun using <a href="http://code.google.com/chromium/">Chromium</a> for most of my day-to-day browsing tasks. It recently gained support for Adobe Flash and other plugins. I&#8217;ll be excited to when it picks up Java, as well&mdash;then I&#8217;ll have little reason to use Firefox except for development. I&#8217;ve enjoyed watching the <a href="https://launchpad.net/~chromium-daily">daily builds</a> go from a virtually a crash-on-click shell to the wonderfully quick tool I&#8217;m using right now to type this post.</p>
<p>However, I&#8217;m a <a href="http://www.cacert.org">CACert</a> user (and assurer!) and have several sites and/or utilities which rely on CACert-issued <a href="http://www.cacert.org">free SSL certificates</a>.</p>
<p>Chromium on Linux doesn&#8217;t have its own certificate management system, but instead uses <a href="http://www.mozilla.org/projects/security/pki/nss/">Mozilla&#8217;s Network Security Services (NSS) Public Key Infrastructure (PKI)</a>. The <a href="http://code.google.com/p/chromium/wiki/LinuxCertManagement">LinuxCertManagement</a> article on Chromium&#8217;s wiki gives some instructions on how to import certificates.</p>
<p>I&#8217;ve reproduced these instructions for Ubuntu with some of my own additions below.</p>
<div class="codeblock">
<pre><code>sudo apt-get install libnss3-tools
wget http://www.cacert.org/certs/root.crt
wget http://www.cacert.org/certs/class3.crt
certutil -d sql:$HOME/.pki/nssdb -A -t "TCu,Cu,Tuw" -n "CACert Class 1 Root Certificate" -i root.crt
certutil -d sql:$HOME/.pki/nssdb -A -t "TCu,Cu,Tuw" -n "CACert Class 3 Root Certificate" -i class3.crt
rm root.crt class3.crt
</code></pre>
</div>
<p>You&#8217;ll now be able to log in to sites using CACert SSL certificates without needing to click through the red screen of hate.</p>
<p>Note that as of the daily build for August 11, 2009, it is not yet possible to accept and/or present a certificate for use with certificate login. Hopefully, this won&#8217;t be too far off. Fortunately, I don&#8217;t use this login style very often.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2009/08/11/howto-add-cacert-root-certificates-to-chromium/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HOWTO buy music on-line, Android and Linux style</title>
		<link>http://cad.cx/blog/2009/01/23/howto-buy-music-on-line-android-and-linux-style/</link>
		<comments>http://cad.cx/blog/2009/01/23/howto-buy-music-on-line-android-and-linux-style/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 05:05:41 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[amazon mp3]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[g1]]></category>
		<category><![CDATA[t-mobile]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=373</guid>
		<description><![CDATA[I have joined a new group of people: those who have paid for music downloads. I&#8217;ve had a T-Mobile G1 since November. It came with the Amazon MP3 application for Android pre-installed. This little application allows G1 users to search Amazon&#8217;s fast music catalog, then purchase and download DRM-less music. One of my New Year&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div style="float:left; margin-right: 10px; margin-bottom: 10px"><iframe src="http://rcm.amazon.com/e/cm?t=colingrad-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=B001IDCP2E&#038;md=10FE9736YVPPT7A0FBG2&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" frameborder="0"></iframe></div>
<p>I have joined a new group of people: those who have paid for music downloads.</p>
<p>I&#8217;ve had a T-Mobile G1 since November. It came with the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FMP3-Music-Download%2Fb%3Fie%3DUTF8%26node%3D163856011%26ref%255F%3Dce%255Frd%255Fdl&#038;tag=colingrad-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">Amazon MP3</a><img src="https://www.assoc-amazon.com/e/ir?t=colingrad-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> application for Android pre-installed. This little application allows G1 users to search Amazon&#8217;s fast music catalog, then purchase and download <acronym title="Digital Rights Management, or Digital Restrictions Management, depending on if you're the RIAA or anyone else">DRM</acronym>-less music.</p>
<p>One of my New Year&#8217;s Resolutions was to go a <a href="http://www.yearwithoutdrm.com">year without DRM</a>. This makes <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FMP3-Music-Download%2Fb%3Fie%3DUTF8%26node%3D163856011%26ref%255F%3Dce%255Frd%255Fdl&#038;tag=colingrad-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">Amazon MP3</a><img src="https://www.assoc-amazon.com/e/ir?t=colingrad-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> quite attractive to me as I try to stay legal in my music acquisitions now that I have a job. I&#8217;ve avoided iTunes primarily because of its DRM-encumbered formats, but Apple recently decided to go DRM-less. However, personally identifiable information is still embedded in the download, raising privacy concerns. There&#8217;s also not a Linux version of iTunes&mdash;there is a Linux version of the Amazon MP3 downloader, which was recently updated to work on Ubuntu 8.10. I&#8217;ve included a little tutorial at the end of this entry to get Amazon MP3 Downloader for Linux working on Ubuntu 8.10 64-bit.</p>
<p>An important thing to note is that when I first added <a href="http://www.amazon.com/gp/product/B001IDCP2E?ie=UTF8&#038;tag=colingrad-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B001IDCP2E">Festival Thyme</a><img src="http://www.assoc-amazon.com/e/ir?t=colingrad-20&#038;l=as2&#038;o=1&#038;a=B001IDCP2E" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> to my download list, it didn&#8217;t complete, and I didn&#8217;t notice it for more than three weeks! When I tried again, the application said that the downloads had expired. Unhappy with my first digital download experience, I called Amazon just a few minutes ago, and the CSR was happy to reimburse me so I could try again.</p>
<p>This is the new best way to enjoy music. If I&#8217;m on the go, I search Amazon&#8217;s catalog using my T-Mobile G1 via EDGE or 3G service, add tracks or an entire album to my downloads list, then watch the songs download when next I connect to the Internet via Wi-Fi. This is the way music downloading should be: inexpensive, available everywhere, and, most of all, free of restrictions of DRM.</p>
<p>And now, the tutorial on installing Amazon MP3 Download for Linux on Ubuntu 8.10 64-bit.</p>
<p>First, download the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fdmusic%2Fhelp%2Famd.html%3Fie%3DUTF8%26ref%255F%3Ddm%255Fdp%255Famd&#038;tag=colingrad-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=390957">Amazon MP3 Downloader</a><img src="https://www.assoc-amazon.com/e/ir?t=colingrad-20&#038;l=ur2&#038;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> package to your Desktop.</p>
<p>Second, install some packages from the command line, or by clicking on <a href="apt://libgtkmm-2.4-1c2a,libboost-thread1.34.1,libboost-iostreams1.34.1,libboost-signals1.34.1,libboost-date-time1.34.1,libcurl3,libssl0.9.8,xdg-utils">this apt-url link</a>: <code>sudo apt-get install libgtkmm-2.4-1c2a libboost-thread1.34.1 libboost-iostreams1.34.1 libboost-signals1.34.1 libboost-date-time1.34.1 libcurl3 libssl0.9.8 xdg-utils</code>.</p>
<p>Third, do <code>sudo dpkg --force-architecture -i amazonmp3.deb</code> to install the package.</p>
<p>Fourth, ensure that the 32-bit libraries are installed by first installing <a href="http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb">getlibs</a> (click to download and install with GDebi), then going to a command line and doing <code>sudo getlibs $(which amazonmp3)</code>. This will download the 32-bit libraries which Amazon MP3 Downloader needs.</p>
<p>Amazon MP3 Downloader will be available in the Applications &gt; Internet menu.</p>
<p>Good luck, and happy downloading.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2009/01/23/howto-buy-music-on-line-android-and-linux-style/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HOWTO: Install Gears on 64-bit Linux</title>
		<link>http://cad.cx/blog/2009/01/04/howto-install-gears-on-64-bit-linux/</link>
		<comments>http://cad.cx/blog/2009/01/04/howto-install-gears-on-64-bit-linux/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 21:52:05 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[gears]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=366</guid>
		<description><![CDATA[I recently noticed that WordPress added support for Gears, as have a few other sites, including ZohoOffice and MySpace. Gears is essentially offline storage for rich Internet application data. GoogleOS has a list of Gears-enabled sites/applications. Read more on Gears at Wikipedia. Much to my dismay, the only officially-available Firefox extension supports only 32-bit operating [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cad.cx/blog/wp-content/uploads/2009/01/gearslogo.gif"><img src="http://cad.cx/blog/wp-content/uploads/2009/01/gearslogo.gif" alt="" title="Gears logo" width="181" height="53" class="alignright size-full wp-image-367" /></a>I recently noticed that WordPress added support for <a href="http://gears.google.com/">Gears</a>, as have a few other sites, including ZohoOffice and MySpace. </p>
<p>Gears is essentially offline storage for rich Internet application data. GoogleOS has a list of <a href="http://googlesystem.blogspot.com/2008/04/list-of-applications-that-use-google.html">Gears-enabled sites/applications</a>. Read more on <a href="http://en.wikipedia.org/wiki/Gears_(software)">Gears at Wikipedia</a>.</p>
<p>Much to my dismay, the only officially-available Firefox extension supports only 32-bit operating systems. I&#8217;m a 64-bit Linux user. Specifically, I use Ubuntu 8.10 Intrepid with my ASUS M3A32-MVP motherboard and 8 GB of DDR2 RAM (4GB of Geil and 4 GB of OCZ).</p>
<p>Fortunately, <a href="http://code.google.com/intl/eo/apis/gears/" title="Gears developer site">Gears</a> is an <a title="Gears project site" href="http://code.google.com/p/gears/">open source project</a> and one intrepid developer made a <a title="Post where 64-bit Gears is discussed" href="http://groups.google.com/group/gears-users/browse_thread/thread/4584842dd14a4882/65508e996210ec8d">Gears Firefox extension package which supports 64-bit Linux</a>.</p>
<p>I downloaded and installed the package by dragging and dropping it onto the Firefox Addons dialog, then restarting Firefox when prompted. I <a href="http://cad.cx/oss/gears-linux-opt-0.4.9.0.xpi" title="Open source software archive at cad.cx">archived the Gears extension package</a> on my own site in the event the package is suddenly no longer available. Be sure to check for new versions though, since this package may be out of date if you&#8217;re reading this post more than a few days after publication (though unlikely).</p>
<p>Huzzah for open source.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2009/01/04/howto-install-gears-on-64-bit-linux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adobe releases Flash 10 beta for Windows, Mac OS X, and Linux</title>
		<link>http://cad.cx/blog/2008/05/15/adobe-releases-flash-10-beta-for-windows-mac-os-x-and-linux/</link>
		<comments>http://cad.cx/blog/2008/05/15/adobe-releases-flash-10-beta-for-windows-mac-os-x-and-linux/#comments</comments>
		<pubDate>Thu, 15 May 2008 22:59:38 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[32-bit]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[tar.gz]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=275</guid>
		<description><![CDATA[Adobe released today beta packages for the upcoming version of its Flash player. The Flash 10 packages are available for download at Adobe Labs. Users have reported a serious speed increase and far less CPU usage, as much a 20% less. Check out the Flash 10 release notes for more information. There is an RPM [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe released today beta packages for the upcoming version of its Flash player. The <a href="http://labs.adobe.com/downloads/flashplayer10.html">Flash 10 packages are available for download</a> at Adobe Labs. Users have reported a serious speed increase and far less CPU usage, as much a 20% less. Check out the <a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html">Flash 10 release notes</a> for more information.</p>
<p>There is an RPM and a tar.gz for we Linux folks. Red Hat and Fedora users are fine with the RPM, but Ubuntu users will have a little more to do. <a href="<a href="http://labs.adobe.com/downloads/flashplayer10.html">Download the Flash 10 tar.gz</a>, then continue.</p>
<p>Iinstalling it is easy. If you&#8217;re running 32-bit Ubuntu, simply make sure that <code>flashplugin-nonfree</code> is installed and copy the <code>libflashplayer.so</code> file in the tar.gz to <code>.mozilla/plugins</code> or to <code>/usr/lib/flashplugin-nonfree</code>. If you&#8217;re using 64-bit Ubuntu like I am, then you&#8217;ll have to do the latter and run <code>nspluginwrapper -i /usr/lib/flashplugin-nonfree/libflashplayer.so</code> to relink everything.</p>
<p>This release is on the heels of the <a href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200804/050108AdobeOSP.html">recent announcement of the Open Screen Project</a>, a project aims to put Flash on basically everything by opening up many of the workings of the proprietary format. To begin, Adobe will &#8220;[lift] restrictions on use of the SWF and FLV/F4V specifications, publish the device porting layer APIs for Adobe Flash Player, publish the Adobe Flash Cast protocol and the AMF protocol for robust data services, and [lift] licensing fees, making next major releases of Adobe Flash Player and Adobe AIR for devices free.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/05/15/adobe-releases-flash-10-beta-for-windows-mac-os-x-and-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Social engineering on The Daily WTF</title>
		<link>http://cad.cx/blog/2008/05/01/social-engineering-on-the-daily-wtf/</link>
		<comments>http://cad.cx/blog/2008/05/01/social-engineering-on-the-daily-wtf/#comments</comments>
		<pubDate>Thu, 01 May 2008 14:41:50 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[social engineering]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=267</guid>
		<description><![CDATA[The Daily WTF has a story about social engineering at its finest. Read The Super Hacker at The Daily WTF.]]></description>
			<content:encoded><![CDATA[<p>The Daily WTF has a story about social engineering at its finest.</p>
<p>Read <a href="http://thedailywtf.com/Articles/The-Super-Hacker.aspx">The Super Hacker</a> at The Daily WTF.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/05/01/social-engineering-on-the-daily-wtf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO Add btnx repository to sources</title>
		<link>http://cad.cx/blog/2008/04/30/howto-add-btnx-repository-to-sources/</link>
		<comments>http://cad.cx/blog/2008/04/30/howto-add-btnx-repository-to-sources/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 21:00:58 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[events]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[btnx]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=265</guid>
		<description><![CDATA[Olli Salonen made a PPA on Launchpad yesterday, following my request for btnx in a PPA. There are two ways to get the repository configured: the GUI way and the command line way. I think the command line way is a little quicker, but I&#8217;ll give you both. Remember, if you are not running Hardy, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/">Olli Salonen</a> made a <acronym title="Personal Package Archive">PPA</acronym> on Launchpad yesterday, following <a href="https://answers.launchpad.net/btnx-config/+question/31298">my request for btnx in a PPA</a>.</p>
<p>There are two ways to get the repository configured: the GUI way and the command line way. I think the command line way is a little quicker, but I&#8217;ll give you both. Remember, if you are <em>not</em> running Hardy, you will need to change all instances of <b>hardy</b> throughout these instructions to <b>feisty</b> or <b>gutsy</b>, whichever you are using. Olli did packages for all three versions. If you don&#8217;t know which you&#8217;re running, go to <b>System > About Ubuntu</b> and read the window that spawns. Your version will be in there somewhere.</p>
<p>First the command line way.</p>
<div class="codeblock">
<pre><code>echo -e "deb http://ppa.launchpad.net/daou/ubuntu hardy main\ndeb-src http://ppa.launchpad.net/daou/ubuntu hardy main" | sudo tee /etc/apt/sources.list.d/btnx.list
sudo apt-get update &#038;&#038; sudo apt-get install btnx btnx-config</code></pre>
</div>
<p>Then, I&#8217;d recommend using btnx-config from <b>Applications > System Tools > btnx</b> to configure the tool. You could also do <code>gksu btnx-config</code> at the command line to bring it up.</p>
<p>Next, the GUI way. </p>
<p>If you already have btnx installed, go to <b>System > Administration > Software Sources</b>. Go to the <b>Third Party Software</b> tab. Click <b>+Add</b> and paste the line for each of the two APT lines: <b>deb http://ppa.launchpad.net/daou/ubuntu hardy main</b> and <b>deb-src http://ppa.launchpad.net/daou/ubuntu hardy main</b>. When you click <b>Close</b>, it will ask if you want to reload the sources. Confirm the reload.</p>
<p>If you do not already have btnx installed, go to <b>System > Administration > Synaptic Package Manager</b>. Go to <b>Settings > Repositories</b> and follow the above instructions. One the list finishes reloading, <b>Search</b> for &#8220;btnx&#8221; and the two packages will be shown in the main screen. Click each to mark it for installation, then click <b>Apply</b>. When it&#8217;s finished, you can access btnx-config through <b>Applications > System Tools > btnx</b> from the top panel.</p>
<p>Check out my <a href="http://cad.cx/blog/2008/04/29/update-on-btnx-howto/">prior updates on btnx</a> for more information, including <a href="http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/">how to compile btnx and btnx-config from source</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/04/30/howto-add-btnx-repository-to-sources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update on btnx HOWTO</title>
		<link>http://cad.cx/blog/2008/04/29/update-on-btnx-howto/</link>
		<comments>http://cad.cx/blog/2008/04/29/update-on-btnx-howto/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 05:18:02 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[esperanto]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[btnx]]></category>
		<category><![CDATA[gutsy]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=261</guid>
		<description><![CDATA[Olli Salonen, author of btnx, has released new versions of btnx and btnx-config, along with debs for Ubuntu 64-bit. While they&#8217;ve been officially tested on Gutsy, I&#8217;m using them on Hardy without a problem. Now, Olli or someone just needs to get these into a PPA on Launchpad or get them added to the repos [...]]]></description>
			<content:encoded><![CDATA[<p>Olli Salonen, author of <a href="http://www.ollisalonen.com/btnx/">btnx</a>, has released new versions of btnx and btnx-config, along with debs for Ubuntu 64-bit. While they&#8217;ve been officially tested on Gutsy, I&#8217;m using them on Hardy without a problem. Now, Olli or someone just needs to get these into a PPA on Launchpad or get them added to the repos for 8.04.1.</p>
<p>Se vi parolas esperantan linvgon, bonvolu helpas traduki btnx-on ĉe Launchpad! <a href="https://translations.launchpad.net/btnx-config/trunk/+pots/btnx-config/eo/+translate">Iru kaj traduku btnx-config!</a> Mi komencis traduki, sed ĝi estas granda projekto por unu persono.</p>
<p>I originally posted instructions on how to compile from source in the article <a href="http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/">HOWTO Install btnx for better mouse control in Ubuntu Hardy</a>. If you want to continue to compile it yourself, simply switch to the newest tag using subversion and recompile.</p>
<div class="codeblock">
<pre><code>cd btnx-0.4.9
svn sw http://svn.ollisalonen.com/btnx/tags/btnx-0.4.10/
./configure &#038;&#038; make &#038;&#038; sudo make install
cd ../btnx-config-0.4.8
svn sw http://svn.ollisalonen.com/btnx-config/tags/btnx-config-0.4.9/
./configure &#038;&#038; make &#038;&#038; sudo make install
</code></pre>
</div>
<p>Now might be a good time to rename those directories, dropping the version numbers, or check out the source to a different directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/04/29/update-on-btnx-howto/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HOWTO Install btnx for better mouse control in Ubuntu Hardy</title>
		<link>http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/</link>
		<comments>http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:56:43 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[btnx]]></category>
		<category><![CDATA[hardy]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=257</guid>
		<description><![CDATA[When I installed Hardy, I forgot to copy my awesome xorg.conf which held the configuration to enable all 12 buttons of my Logitech MX1000. Lo and behold, a new method of configuring it has come about, albeit it was around prior to Gutsy. btnx is the work of Olli Salonen. The program runs as a [...]]]></description>
			<content:encoded><![CDATA[<p>When I installed Hardy, I forgot to copy my awesome xorg.conf which held the configuration to enable all 12 buttons of my Logitech MX1000.</p>
<p>Lo and behold, a new method of configuring it has come about, albeit it was around prior to Gutsy.</p>
<p><a href="http://www.ollisalonen.com/btnx/">btnx</a> is the work of Olli Salonen. The program runs as a daemon, catching mouse events and turning them into either key presses or proper mouse events which the system can interpret. This eases the configuration one must do in order to enjoy the full potential of the high-end Logitech mice&mdash;a potential which, in my opinion, Windows cannot reach.</p>
<p>The installation process for btnx is pretty easy.</p>
<p>First, I replaced the mouse section of my <code>/etc/X11/xorg.conf</code> with this section. This may not be necessary, but I did it before discovering btnx.</p>
<div class="codeblock">
<pre><code>Section "InputDevice"
        Identifier      "Logitech MX1000"
        Driver          "evdev"
        Option          "Name"          "Logitech USB RECEIVER"
        Option          "HWHEELRelativeAxisButtons" "7 6"
EndSection</code></pre>
</div>
<p>Next, open a terminal and <code>cd</code> to the location where you keep your sources. I keep mine in <code>~/Source</code>. This next section prepares the libraries required to build btnx and its support program, btnx-config, as well as subversion if you don&#8217;t already have it installed. I prefer to use subversion and checkout tags if they are available. It makes switching to a new version just a <code>svn sw</code> away. Last, it checks out the source for the two programs.</p>
<div class="codeblock">
<pre><code>sudo apt-get install subversion libgtk2.0-dev libglade2-dev libdaemon-dev
svn co http://svn.ollisalonen.com/btnx/tags/btnx-0.4.9/
svn co http://svn.ollisalonen.com/btnx-config/tags/btnx-config-0.4.8/
</code></pre>
</div>
<p>Next, do a simple <acronym title="./configure &#038;&#038; make &#038;&#038; sudo make install">cm&#038;smi</acronym> for each program.</p>
<div class="codeblock">
<pre><code>cd btnx-0.4.9
./configure &#038;&#038; make &#038;&#038; sudo make install
cd ../btnx-config-0.4.8
./configure &#038;&#038; make &#038;&#038; sudo make install
</code></pre>
</div>
<p>Now that both programs are installed, you must first configure btnx using btnx-config. Start it as root using the command below or go to <b>Applications > System Tools > btnx</b>. Click &#8220;Detect Mouse and Buttons&#8221;. You&#8217;ll probably be able to figure it out from there.</p>
<div class="codeblock">
<pre><code>gksu btnx-config</code></pre>
</div>
<p>I have the middle thumb button on my MX1000 configured to activate the Rotate Cube plugin of Compiz. I have it configured as Button10 in Compiz and BUTTON_9 in btnx. Remeber: Compiz and many other programs start counting buttons at 1, but btnx starts at 0.</p>
<p><b>Update:</b> There is a <a href="http://ubuntuforums.org/showthread.php?p=2727025">post on Ubuntu Forums about building btnx</a>, too.</p>
<p><b>Update 2008-04-29 01:18:</b> I&#8217;ve posted an update. <a href="http://cad.cx/blog/2008/04/29/update-on-btnx-howto/">New versions of btnx and btnx-config are available</a> and so are debs for both 32-bit and 64-bit Ubuntu.</p>
<p><b>Update 2008-11-05 20:56:</b> As Christopher <a href="http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/#comment-17229">pointed out</a>, Btnx is useless in Intrepid. Olli, the author of btnx, <a href="http://www.ollisalonen.com/btnx/">remarks</a> that the way btnx interacted with the kernel is no longer available, so all development on btnx has ceased. However, he says, evdev is able to recognize all of the buttons on the <a href="http://www.amazon.com/gp/product/B000HCT12O?ie=UTF8&#038;tag=colingrad-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B000HCT12O">Logitech MX Revolution</a><img src="http://www.assoc-amazon.com/e/ir?t=colingrad-20&#038;l=as2&#038;o=1&#038;a=B000HCT12O" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. Folks who might be willing to decode the cryptic xevents system and figure out how to assign mouse events to other keypresses and such should contact him.</p>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/04/25/howto-install-btnx-for-better-mouse-control-in-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>HOWTO Update Twitter from the console or GUI</title>
		<link>http://cad.cx/blog/2008/04/15/howto-update-twitter-from-the-console-or-gui/</link>
		<comments>http://cad.cx/blog/2008/04/15/howto-update-twitter-from-the-console-or-gui/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 19:32:27 +0000</pubDate>
		<dc:creator>Colin Dean</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[zenity]]></category>

		<guid isPermaLink="false">http://cad.cx/blog/?p=254</guid>
		<description><![CDATA[I&#8217;ve gone and added to the script, checking for errors and making it more slick. Check it out at twitter-gx or read the code contained herein. #!/bin/bash #@Name: twitter-gx #@Author: Colin Dean &#60;cad@cad.cx&#62; #@URL: http://cad.cx/twitter #CHANGE THESE EMAIL=you@yours.com PASSWORD=lolz #PATHS ZENITY=/usr/bin/zenity CURL=/usr/bin/curl ICON=/usr/share/pixmaps/gnome-irc.png #can someone suggest a better icon? #STRINGS--someone want to localize? WHAT=&#34;What are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gone and added to the script, checking for errors and making it more slick.</p>
<p>Check it out at <a href="http://cad.cx/twitter/">twitter-gx</a> or read the code contained herein.</p>
<div class="codeblock">
<pre><code>
<span class="Comment">#!/bin/bash</span>
<span class="Comment">#@Name: twitter-gx</span>
<span class="Comment">#@Author: Colin Dean &lt;cad@cad.cx&gt;</span>
<span class="Comment">#@URL: <a href="http://cad.cx/twitter">http://cad.cx/twitter</a></span>
<span class="Comment">#CHANGE THESE</span>
<span class="Identifier">EMAIL</span>=you@yours.com
<span class="Identifier">PASSWORD</span>=lolz
<span class="Comment">#PATHS</span>
<span class="Identifier">ZENITY</span>=/usr/bin/zenity
<span class="Identifier">CURL</span>=/usr/bin/curl
<span class="Identifier">ICON</span>=/usr/share/pixmaps/gnome-irc.png
<span class="Comment">#can someone suggest a better icon?</span>
<span class="Comment">#STRINGS--someone want to localize?</span>
<span class="Identifier">WHAT</span>=<span class="Statement">&quot;</span><span class="Constant">What are you doing? </span><span class="Statement">&quot;</span>
<span class="Identifier">SORRY</span>=<span class="Statement">&quot;</span><span class="Constant">Sorry, that was too long.</span><span class="Statement">&quot;</span>
<span class="Identifier">UPDATED</span>=<span class="Statement">&quot;</span><span class="Constant">Tweet submitted:</span><span class="Statement">&quot;</span>
<span class="Identifier">FAILED</span>=<span class="Statement">&quot;</span><span class="Constant">Tweet failed. Check output for why.</span><span class="Statement">&quot;</span>

<span class="Identifier">CURL_MISSING</span>=<span class="Statement">&quot;</span><span class="Constant">curl was not found at </span><span class="PreProc">${</span><span class="PreProc">CURL</span><span class="PreProc">}</span><span class="Constant">. Please install curl.</span><span class="Statement">&quot;</span>
<span class="Identifier">ZENITY_MISSING</span>=<span class="Statement">&quot;</span><span class="Constant">zenity was not found at </span><span class="PreProc">${</span><span class="PreProc">ZENITY</span><span class="PreProc">}</span><span class="Constant">. Please install zenity.</span><span class="Statement">&quot;</span>
<span class="Comment">#-------Woe to those who make changes below unless they know what it does------#</span>

<span class="Comment">#META</span>
<span class="Identifier">NAME</span>=<span class="Statement">&quot;</span><span class="Constant">twitter-gx</span><span class="Statement">&quot;</span>
<span class="Identifier">VERSION</span>=<span class="Statement">&quot;</span><span class="Constant">1.0</span><span class="Statement">&quot;</span>
<span class="Identifier">URL</span>=<span class="Statement">&quot;</span><span class="Constant"><a href="http://cad.cx/twitter/twitter.xml">http://cad.cx/twitter/twitter.xml</a></span><span class="Statement">&quot;</span>
<span class="Comment">#functions galore</span>
<span class="Identifier">function</span> check_for_deps <span class="Special">{</span>

<span class="Comment">#I'm not going to bother checking for awk. Does any sane distro omit it?</span>
  <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">!</span> <span class="Statement">-x</span> <span class="PreProc">${</span><span class="PreProc">CURL</span><span class="PreProc">}</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

    <span class="Identifier">CURL</span>=<span class="Special">`which curl`</span>
    <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">$?</span><span class="Statement">&quot;</span> <span class="Statement">=</span> <span class="Constant">1</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

      warn_user <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">CURL_MISSING</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
      <span class="Statement">exit</span> <span class="Constant">1</span>
    <span class="Statement">fi</span>
  <span class="Statement">fi</span>

  <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">!</span> <span class="Statement">-x</span> <span class="PreProc">${</span><span class="PreProc">ZENITY</span><span class="PreProc">}</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

    <span class="Identifier">ZENITY</span>=<span class="Special">`which zenity`</span>
    <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">$?</span><span class="Statement">&quot;</span> <span class="Statement">=</span> <span class="Constant">1</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

      warn_user <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">ZENITY_MISSING</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
      <span class="Statement">exit</span> <span class="Constant">1</span>
    <span class="Statement">fi</span>
  <span class="Statement">fi</span>

<span class="Special">}</span>

<span class="Identifier">function</span> getinput <span class="Special">{</span>
  <span class="Statement">if</span> <span class="Statement">[</span> <span class="PreProc">${</span><span class="PreProc">TERM</span><span class="PreProc">}</span> <span class="Statement">=</span> <span class="Constant">&quot;xterm&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> <span class="Statement">echo</span><span class="Constant"> -n </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">WHAT</span><span class="PreProc">}</span><span class="Statement">&quot;;</span> <span class="Statement">read</span> TWEET
    <span class="Statement">else</span> <span class="Identifier">TWEET</span>=<span class="PreProc">$(</span><span class="PreProc">${</span><span class="PreProc">ZENITY</span><span class="PreProc">}</span><span class="Special"> --entry --</span><span class="Identifier">text</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">WHAT</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="Special"> --entry-</span><span class="Identifier">text</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">1</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="PreProc">)</span>

  <span class="Statement">fi</span>
<span class="Special">}</span>

<span class="Identifier">function</span> check_length <span class="Special">{</span>
  <span class="Identifier">TWEETLENGTH</span>=<span class="PreProc">$(</span><span class="Special">echo -n </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="Special"> </span><span class="Statement">|</span><span class="Special"> wc -m</span><span class="PreProc">)</span>

  <span class="Statement">if</span> <span class="Statement">[</span> <span class="PreProc">${</span><span class="PreProc">TWEETLENGTH</span><span class="PreProc">}</span> <span class="Statement">-gt</span> <span class="Constant">140</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

    warn_user <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">SORRY</span><span class="PreProc">}</span><span class="Constant"> (</span><span class="PreProc">${</span><span class="PreProc">TWEETLENGTH</span><span class="PreProc">}</span><span class="Constant"> &gt; 140)</span><span class="Statement">&quot;</span>
    getinput <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span>

    check_length
  <span class="Statement">fi</span>
<span class="Special">}</span>

<span class="Identifier">function</span> warn_user <span class="Special">{</span>
  <span class="Statement">if</span> <span class="Statement">[</span> <span class="PreProc">${</span><span class="PreProc">TERM</span><span class="PreProc">}</span> <span class="Statement">=</span> <span class="Constant">&quot;xterm&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> <span class="Statement">echo</span><span class="Constant"> </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">1</span><span class="PreProc">}</span><span class="Statement">&quot;</span>

    <span class="Statement">else</span> <span class="PreProc">${</span><span class="PreProc">ZENITY</span><span class="PreProc">}</span> --warning --<span class="Identifier">text</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">1</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
  <span class="Statement">fi</span>

<span class="Special">}</span>

<span class="Identifier">function</span> urlencode <span class="Statement">()</span> <span class="Special">{</span>
<span class="Comment">#one day, I will understand awk</span>
<span class="Comment">#got this from somewhere</span>
  <span class="Statement">echo</span><span class="Constant"> </span><span class="Statement">&quot;</span><span class="PreProc">$@</span><span class="Statement">&quot;</span><span class="Constant"> </span><span class="Statement">|</span> awk <span class="Statement">'</span>

<span class="Constant">  BEGIN {</span>
<span class="Constant">   # with inspiration from Heiner Steven and Rick Richardson</span>
<span class="Constant">      split (&quot;1 2 3 4 5 6 7 8 9 A B C D E F&quot;, hexit, &quot; &quot;)</span>
<span class="Constant">      hexit [0] = 0 # setup the hex values we will use..</span>
<span class="Constant">      for (i = 1 ; i &lt;= 255 ; ++i) ord[ sprintf (&quot;%c&quot;, i) &quot;&quot; ] = i + 0</span>

<span class="Constant">    } {</span>
<span class="Constant">      encoded = &quot;&quot;</span>
<span class="Constant">      for (i = 1 ; i &lt;= length ($0) ; ++i) {</span>
<span class="Constant">        c = substr ($0, i, 1)</span>
<span class="Constant">        if ( c ~ /[a-zA-Z0-9.-]/ ) { # allow only basic chrs</span>
<span class="Constant">          encoded = encoded c</span>

<span class="Constant">        } else { # encode everything else..</span>
<span class="Constant">          lo = ord[c] % 16</span>
<span class="Constant">          hi = int (ord[c] / 16);</span>
<span class="Constant">          encoded = encoded &quot;%&quot; hexit [hi] hexit [lo]</span>
<span class="Constant">        }</span>

<span class="Constant">      }</span>
<span class="Constant">#printf encoded</span>
<span class="Constant">    }</span>
<span class="Constant">  END {</span>
<span class="Constant">    printf (&quot;%s&quot;, encoded)</span>
<span class="Constant">  }</span>

<span class="Statement">'</span>
<span class="Special">}</span>

<span class="Identifier">function</span> submit_tweet <span class="Special">{</span>
  <span class="Identifier">OUTFILE</span>=<span class="Statement">&quot;</span><span class="Constant">/tmp/twitter_response-</span><span class="Special">`date +%Y%m%d%H%M%S`</span><span class="Constant">.txt</span><span class="Statement">&quot;</span>

  <span class="PreProc">${</span><span class="PreProc">CURL</span><span class="PreProc">}</span> -s \
       -u <span class="PreProc">${</span><span class="PreProc">EMAIL</span><span class="PreProc">}</span>:<span class="PreProc">${</span><span class="PreProc">PASSWORD</span><span class="PreProc">}</span> \
       -o <span class="PreProc">${</span><span class="PreProc">OUTFILE</span><span class="PreProc">}</span> \
       -d <span class="Statement">status</span><span class="Statement">=&quot;</span><span class="PreProc">$(</span><span class="Special">urlencode </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="PreProc">)</span><span class="Statement">&quot;</span> \
       -H <span class="Statement">&quot;</span><span class="Constant">X-Twitter-Client: </span><span class="PreProc">${</span><span class="PreProc">NAME</span><span class="PreProc">}</span><span class="Statement">&quot;</span> \
       -H <span class="Statement">&quot;</span><span class="Constant">X-Twitter-Client-Version: </span><span class="PreProc">${</span><span class="PreProc">VERSION</span><span class="PreProc">}</span><span class="Statement">&quot;</span> \
       -H <span class="Statement">&quot;</span><span class="Constant">X-Twitter-Client-URL: </span><span class="PreProc">${</span><span class="PreProc">URL</span><span class="PreProc">}</span><span class="Statement">&quot;</span> \
       <a href="http://twitter.com/statuses/update.xml">http://twitter.com/statuses/update.xml</a>

<span class="Special">}</span>

<span class="Identifier">function</span> notify_user <span class="Special">{</span>
  <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">1</span><span class="PreProc">}</span><span class="Statement">&quot;</span> <span class="Statement">=</span> <span class="Constant">&quot;success&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

    <span class="Identifier">TERM_MESSAGE</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">UPDATED</span><span class="PreProc">}</span><span class="Constant"> </span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
    <span class="Identifier">GUI_MESSAGE</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">UPDATED</span><span class="PreProc">}</span><span class="Special">\n\n</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span>

    <span class="Identifier">ICON_STR</span>=<span class="Statement">&quot;</span><span class="Constant">--window-icon=</span><span class="PreProc">${</span><span class="PreProc">ICON</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
  <span class="Statement">fi</span>
  <span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">1</span><span class="PreProc">}</span><span class="Statement">&quot;</span> <span class="Statement">=</span> <span class="Constant">&quot;failed&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span>

    <span class="Identifier">TERM_MESSAGE</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">FAILED</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
    <span class="Identifier">GUI_MESSAGE</span>=<span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">FAILED</span><span class="PreProc">}</span><span class="Statement">&quot;</span>
    <span class="Identifier">ICON_STR</span>=<span class="Statement">&quot;&quot;</span>

  <span class="Statement">fi</span>

  <span class="Statement">if</span> <span class="Statement">[</span> <span class="PreProc">${</span><span class="PreProc">TERM</span><span class="PreProc">}</span> <span class="Statement">=</span> <span class="Constant">&quot;xterm&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> <span class="Statement">echo</span><span class="Constant"> </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TERM_MESSAGE</span><span class="PreProc">}</span><span class="Statement">&quot;</span>

    <span class="Statement">else</span>
      <span class="Statement">exec</span> <span class="Constant">3</span><span class="Statement">&gt;</span> <span class="Statement">&gt;</span><span class="Statement">(</span><span class="PreProc">${</span><span class="PreProc">ZENITY</span><span class="PreProc">}</span> --notification --listen <span class="PreProc">${</span><span class="PreProc">ICON_STR</span><span class="PreProc">}</span><span class="Statement">)</span>

      <span class="Statement">echo</span><span class="Constant"> </span><span class="Statement">&quot;</span><span class="Constant">message: </span><span class="PreProc">${</span><span class="PreProc">GUI_MESSAGE</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="Constant"> </span><span class="Statement">&gt;</span><span class="Statement">&amp;</span><span class="Constant">3</span>
      <span class="Statement">sleep</span> <span class="Constant">10</span>
      <span class="Statement">exec</span> <span class="Constant">3</span><span class="Statement">&gt;</span><span class="Statement">&amp;</span>-
  <span class="Statement">fi</span>

<span class="Special">}</span>

<span class="Identifier">TWEET</span>=<span class="PreProc">$@</span> <span class="Comment">#see if it was supplied on the command line</span>
<span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span> <span class="Statement">=</span> <span class="Constant">&quot;-v&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> <span class="Statement">echo</span><span class="Constant"> </span><span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">NAME</span><span class="PreProc">}</span><span class="Constant"> </span><span class="PreProc">${</span><span class="PreProc">VERSION</span><span class="PreProc">}</span><span class="Statement">&quot;</span><span class="Constant"> </span><span class="Statement">&amp;&amp;</span> <span class="Statement">exit</span><span class="Statement">;</span> <span class="Statement">fi</span>

check_for_deps
<span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">-z</span> <span class="Statement">&quot;</span><span class="PreProc">${</span><span class="PreProc">TWEET</span><span class="PreProc">}</span><span class="Statement">&quot;</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> getinput<span class="Statement">;</span> <span class="Statement">fi</span> <span class="Comment">#if it wasn't, prompt for it</span>

check_length <span class="Comment">#make sure it's less than 140 characters</span>
submit_tweet <span class="Comment">#submit it since we got past the check</span>

<span class="Statement">if</span> <span class="Statement">[</span> <span class="Statement">&quot;</span><span class="PreProc">$?</span><span class="Statement">&quot;</span> <span class="Statement">==</span> <span class="Constant">0</span> <span class="Statement">]</span><span class="Statement">;</span> <span class="Statement">then</span> notify_user success <span class="Statement">&amp;&amp;</span> <span class="Statement">exit</span> <span class="Constant">0</span><span class="Statement">;</span>

<span class="Statement">else</span> notify_user fail <span class="Statement">&amp;&amp;</span> <span class="Statement">exit</span> <span class="Constant">1</span><span class="Statement">;</span> <span class="Statement">fi</span>

</code></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://cad.cx/blog/2008/04/15/howto-update-twitter-from-the-console-or-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

