<?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>τεχνοσοφια &#187; Linux</title>
	<atom:link href="http://lackoftalent.org/michael/blog/category/systems/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://lackoftalent.org/michael/blog</link>
	<description>The occasional rambling of a digital library artisan</description>
	<lastBuildDate>Sun, 24 Jan 2010 18:30:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Command-line shuffle</title>
		<link>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/</link>
		<comments>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 20:50:05 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=500</guid>
		<description><![CDATA[
Being a nerd, I tend to like the command-line.  When I&#039;m working on my laptop at home, I tend to like listening to music.  Before I discovered that mplayer had a really convenient shuffle idiom, I would invoke it thusly (to listen to all my Pavement tracks in shuffle mode):

export IFS=$'\n'
for track in [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:500"><!-- &nbsp; --></abbr>
<p>Being a nerd, I tend to like the command-line.  When I&#039;m working on my laptop at home, I tend to like listening to music.  Before I discovered that <a href="http://en.wikipedia.org/wiki/MPlayer">mplayer</a> had a really convenient shuffle idiom, I would invoke it thusly (to listen to all my Pavement tracks in shuffle mode):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">IFS</span>=$<span style="color: #ff0000;">'\n'</span>
<span style="color: #000000; font-weight: bold;">for</span> track <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>upnp<span style="color: #000000; font-weight: bold;">/</span>MediaTomb<span style="color: #000000; font-weight: bold;">/</span>Audio<span style="color: #000000; font-weight: bold;">/</span>Artists<span style="color: #000000; font-weight: bold;">/</span>Pavement <span style="color: #660033;">-name</span> \<span style="color: #000000; font-weight: bold;">*</span>.mp3 <span style="color: #000000; font-weight: bold;">|</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>shuffle.py<span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #007800;">$track</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>And the wee shuffle script I whipped together looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># shuffle.py</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">random</span>
&nbsp;
args = <span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">random</span>.<span style="color: black;">shuffle</span><span style="color: black;">&#40;</span>args<span style="color: black;">&#41;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">writelines</span><span style="color: black;">&#40;</span>args<span style="color: black;">&#41;</span></pre></div></div>

<p>And here&#039;s the convenient shuffle idiom that renders my arg-shuffling script somewhat useless:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>upnp<span style="color: #000000; font-weight: bold;">/</span>MediaTomb<span style="color: #000000; font-weight: bold;">/</span>Audio<span style="color: #000000; font-weight: bold;">/</span>Artists<span style="color: #000000; font-weight: bold;">/</span>Pavement <span style="color: #660033;">-name</span> \<span style="color: #000000; font-weight: bold;">*</span>.mp3 <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #660033;">-playlist</span> - <span style="color: #660033;">-shuffle</span> <span style="color: #660033;">-loop</span> <span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2009/09/26/command-line-shuffle/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lynx and HTTPS/SSL on Ubuntu (8.10)</title>
		<link>http://lackoftalent.org/michael/blog/2009/01/12/lynx-and-httpsssl-on-ubuntu-810/</link>
		<comments>http://lackoftalent.org/michael/blog/2009/01/12/lynx-and-httpsssl-on-ubuntu-810/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 17:46:15 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=269</guid>
		<description><![CDATA[
Dear Future Me,
It has been a while, hasn&#039;t it?  Yes, it has[1].
Did you try to view an HTTPS/SSL URL in Lynx[2] again, only to be met, most cruelly, with the following error message?

$ lynx https://example.org/resource/[3]

Alert!: This client does not contain support for HTTPS URLs.

Well, have no fear!  The lynx package, at least within [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:269"><!-- &nbsp; --></abbr>
<p>Dear Future Me,</p>
<p>It has been a while, hasn&#039;t it?  Yes, it has[1].</p>
<p>Did you try to view an HTTPS/SSL URL in Lynx[2] again, only to be met, most cruelly, with the following error message?<br />
<blockquote>
$ lynx https://example.org/resource/[3]<br />
<br/><br />
Alert!: This client does not contain support for HTTPS URLs.
</p></blockquote>
<p>Well, have no fear!  The lynx package, at least within the aptitude repositories for Ubuntu 8.10 (Intrepid Ibex), has no SSL support as you have just witnessed.  The lynx-cur package, on the other hand[4], does!  Support SSL, that is.  Fix yourself thusly:<br />
<blockquote>
$ sudo apt-get install lynx-cur
</p></blockquote>
<p><em>N.B.</em> the new lynx looks for its configuration in a different place than the old lynx, so you may need to fiddle with things if you&#039;ve tricked out lynx with bells and whistles and racing stripes and nitrous boosts.  Otherwise, huzzah!</p>
<h5>Notes</h5><ol class="footnotes"><li id="footnote_0_269" class="footnote">In the future you will have evolved beyond answering your own questions, no doubt, but here in the past, in this quaint and backwards era, it is quite common to hold conversations with yourself.  Or myself.  But I (i.e., you) digress!  (We digress in the past as well!  Quite the confusing state of affairs, conversationally speaking!) </li><li id="footnote_1_269" class="footnote">Do they even have Lynx in that brave new world of the future?  Does the lynx <a href="http://en.wikipedia.org/wiki/Lynx" target="_blank">species</a> still exist?  Did the polar ice caps melt and wipe out all non-domesticated felines?  Inquiring, unevolved minds of the past want to know! </li><li id="footnote_2_269" class="footnote">I am assuming that in the future <a href="http://en.wikipedia.org/wiki/Example.com" target="_blank">example.org</a> remains a reserved dummy domain.</li><li id="footnote_3_269" class="footnote">I hear that in the future hands will be replaced by hooks and detachable chainsaws and the like?</li></ol><br/>
<hr/>]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2009/01/12/lynx-and-httpsssl-on-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Get Twhirl 0.8.7 working on Ubuntu</title>
		<link>http://lackoftalent.org/michael/blog/2008/12/16/howto-get-twhirl-087-working-on-ubuntu/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/12/16/howto-get-twhirl-087-working-on-ubuntu/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:22:49 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=222</guid>
		<description><![CDATA[
I use the Adobe AIR-based Twhirl as a Twitter and identi.ca client on my Ubuntu box.  Twitter recently made some changes to their authentication API, apparently, which prevented Twhirl from connecting as of version 0.8.6.  The fine folks over at Twhirl pushed out 0.8.7 in a jiffy but it included some AIR 1.5 [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:222"><!-- &nbsp; --></abbr>
<p>I use the Adobe AIR-based <a href="http://twhirl.org/">Twhirl</a> as a <a href="http://twitter.com/">Twitter</a> and <a href="http://identi.ca/">identi.ca</a> client on my Ubuntu box.  Twitter recently made some changes to their authentication API, apparently, which prevented Twhirl from connecting as of version 0.8.6.  The fine folks over at Twhirl pushed out 0.8.7 in a jiffy but it included some AIR 1.5 dependencies.  The problem was that Adobe AIR for Linux only comes in 1.0 and 1.1 versions.</p>
<p>I was a tad frustrated that such a seemingly minor Twitter API upgrade resulted in a fundamentally different (and broken) version of Twhirl, but I couldn&#039;t fault them for trying to respond quickly.  I followed the <a href="http://twitter.com/twhirl">twhirl</a> user on Twitter when this went down, and I was pleased to find out that they&#039;ve whipped up a special AIR 1.1 Twhirl client for us Linux users.</p>
<p>I ran into some problems trying to install the client.  The first problem I ran into was due to a corrupt download.  If the file is less than 997K or so, you should try to download it again.  If Firefox fails you, there&#039;s always wget.  Want to make sure you&#039;ve got a good file?  Run unzip against it (an .air file is a .zip file underneath its raincoat).  If it succeeds, you&#039;re golden.</p>
<p>The other problem was an old version of Adobe AIR.  You want adobeair_linux_b1_091508.bin installed, not adobeair_linux_a1_033108.bin.  Here&#039;s how you &#034;upgrade&#034; AIR from the alpha to the beta (1.1) and get Twhirl 0.8.7-air11 installed:</p>
<ol>
<li><code>sudo adobeair_linux_a1_033108.bin -uninstall</code></li>
<li><code>sudo apt-get remove adobeair-enu</code> (This step was not necessary on another box I tested.  It could be that the original box I tried these steps on was munted up.)</li>
<li><em>This may be optional</em>!  Clean out /opt/Adobe Air/, ~/.adobe/AIR/, and /root/.adobe/AIR/.  Note that this step will wipe your settings for all your AIR applications.
<li>Download the <a href="http://labs.adobe.com/downloads/air_linux.html">AIR 1.1 beta for Linux</a></li>
<li><code>adobeair_linux_b1_091508.bin</code>  (Some report that Firefox and other browsers must be closed during this step, but I couldn&#039;t reproduce that.)</li>
<li>Download the latest <a href="http://www.twhirl.org/files/twhirl-0.8.7-air11.air">AIR 1.1 Twhirl for Linux</a></li>
<li>Then navigate to the twhirl-0.8.7-air11.air via Nautilus and double-click it.</li>
</ol>
<p>Worked for me, at least.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/12/16/howto-get-twhirl-087-working-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Windows shortcuts into Ubuntu shortcuts</title>
		<link>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 23:40:43 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=173</guid>
		<description><![CDATA[
[Update: Feel free to grab the code via bzr with bzr branch http://lackoftalent.org/bzr/shortcut_converter.]
Here&#039;s another entry in the &#034;dumb little scripts that work for me and may or may not be helpful to other folks&#034; department&#8230;
I use both Windows and Ubuntu at home, gradually transitioning from the former to the latter.  I&#039;ve accumulated a bunch [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:173"><!-- &nbsp; --></abbr>
<p>[<strong>Update</strong>: Feel free to grab the code via bzr with <code>bzr branch http://lackoftalent.org/bzr/shortcut_converter</code>.]</p>
<p>Here&#039;s another entry in the &#034;dumb little scripts that work for me and may or may not be helpful to other folks&#034; department&#8230;</p>
<p>I use both Windows and Ubuntu at home, gradually transitioning from the former to the latter.  I&#039;ve accumulated a bunch of Windows URL shortcuts, mostly things I wanted to read once so instead of bookmarking them, I dragged their links to my desktop.  This creates .URL files which are simple little plain-text two-liners.  It turns out that on Ubuntu, and probably similar *nix systems, web shortcuts are also simple little plain-text files.  These files have the .desktop extension (though you won&#039;t see the extension by looking at the desktop).  </p>
<p>I wanted a way to convert my .URL files to .desktop files so that I can just toss them on my Ubuntu desktop and double-click them the same way I would if I were on Windows.  This cruddy little Python script does the trick.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># shortcut_converter.py</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">__future__</span> <span style="color: #ff7700;font-weight:bold;">import</span> with_statement 
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
TEMPLATE = <span style="color: #483d8b;">&quot;&quot;&quot;[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=%(basename)s
Type=Link
URL=%(url)s
Icon=gnome-fs-bookmark
&quot;&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> convert<span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot; Takes a full filepath to a .URL file, converts it to a .desktop file 
        in the same directory &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Converting %s&quot;</span> <span style="color: #66cc66;">%</span> f
    <span style="color: black;">&#40;</span>filepath, filename<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
    <span style="color: black;">&#40;</span>basename, extension<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> urlfile:
        lines = <span style="color: black;">&#91;</span>line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> urlfile.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
    url = lines<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'URL='</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
    dtfname = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>filepath, <span style="color: #483d8b;">'%s.desktop'</span> <span style="color: #66cc66;">%</span> basename<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>dtfname, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> dtfile:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Writing %s&quot;</span> <span style="color: #66cc66;">%</span> dtfile.<span style="color: black;">name</span>
        dtfile.<span style="color: black;">write</span><span style="color: black;">&#40;</span>TEMPLATE <span style="color: #66cc66;">%</span> <span style="color: #008000;">locals</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    <span style="color: #ff7700;font-weight:bold;">for</span> arg <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">isfile</span><span style="color: black;">&#40;</span>arg<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> arg<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">3</span>:<span style="color: black;">&#93;</span>.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'url'</span>:
            convert<span style="color: black;">&#40;</span>arg<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;*** %s is not a URL file&quot;</span> <span style="color: #66cc66;">%</span> arg</pre></td></tr></table></div>

<p>I used scp to pull over all my .URL files and then invoked the script thusly:</p>
<p><code>python shortcut_converter.py *.URL</code></p>
<p>worksforme!</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/10/29/convert-windows-shortcuts-into-ubuntu-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash, For loop, Files with spaces</title>
		<link>http://lackoftalent.org/michael/blog/2008/09/27/bash-for-loop-files-with-spaces/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/09/27/bash-for-loop-files-with-spaces/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 19:08:53 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=154</guid>
		<description><![CDATA[
Dear Future Me,
Are you trying to iterate over filenames with spaces in them using a bash &#039;for&#039; loop?  And instead of iterating over the filenames, you wind up seeing a list of filename parts split by said spaces?  Use case: you want to print out a list of unique extensions for all files in the [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:154"><!-- &nbsp; --></abbr>
<p>Dear Future Me,</p>
<p>Are you trying to iterate over filenames with spaces in them using a bash &#039;for&#039; loop?  And instead of iterating over the filenames, you wind up seeing a list of filename parts split by said spaces?  Use case: you want to print out a list of unique extensions for all files in the current directory and below:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<code>for file in `find . -type f`; do echo ${file##*.}; done | sort | uniq</code></p>
<p>If any filenames have spaces in them, you may see odd results.   The answer?  Set the input field separator (IFS) environment variable to the newline character (rather than the default space character):</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<code>export IFS=$'\n'</code></p>
<p>And <em>voila</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/09/27/bash-for-loop-files-with-spaces/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Stupid terminal tricks</title>
		<link>http://lackoftalent.org/michael/blog/2008/06/08/stupid-terminal-tricks/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/06/08/stupid-terminal-tricks/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 05:19:05 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=128</guid>
		<description><![CDATA[
Sometimes I find it useful to keep long-running processes in a session of screen.  And sometimes I launch one of said processes outside of screen, and then I yell something like &#034;doh!&#034; or an expletive, because, as I said, I do find screen useful.  Depending on how far the process has gotten, whether it was [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:128"><!-- &nbsp; --></abbr>
<p>Sometimes I find it useful to keep long-running processes in a session of <a href="http://en.wikipedia.org/wiki/GNU_Screen" target="_blank">screen</a>.  And sometimes I launch one of said processes outside of screen, and then I yell something like &#034;doh!&#034; or an expletive, because, as I said, I do find screen useful.  Depending on how far the process has gotten, whether it was the sort of operation that would not run happily again, or how much cleanup a second run would require, I either kill the process and restart it or I suspend it with Ctrl+z and send it to the background with <code>bg %</code> so that it doesn&#039;t die when I log off.  The latter is a decent option.  But, darn it, I like screen.</p>
<p>Well, perhaps I&#039;m the last to know, but there&#039;s this neat little tool called <a href="http://pasky.or.cz/~pasky/dev/retty/" target="_blank">retty</a> that allows you to attach running processes to your terminal.  I installed it in Ubuntu Hardy the typical way (<code>sudo apt-get install retty</code>).  So, the next time I screw up, I&#039;ll Ctrl+z, bg it, and then <code>screen retty {PID}</code>.  <i>Voila</i>!</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/06/08/stupid-terminal-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hiccup-y Hardy Heron</title>
		<link>http://lackoftalent.org/michael/blog/2008/04/29/hiccup-y-hardy-heron/</link>
		<comments>http://lackoftalent.org/michael/blog/2008/04/29/hiccup-y-hardy-heron/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 18:40:20 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/?p=126</guid>
		<description><![CDATA[
In spite of how irksome I find &#034;oh hai i upgrayded!&#034; posts, I&#039;m about to be guilty of same.
I upgraded my Optiplex GX620 from Gutsy to Hardy yesterday afternoon and it seemed to go as smoothly as it did on my HP box at home.  All looked a-okay this morning until, upon returning from a [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:126"><!-- &nbsp; --></abbr>
<p>In spite of how irksome I find &#034;oh hai i upgrayded!&#034; posts, I&#039;m about to be guilty of same.</p>
<p>I upgraded my Optiplex GX620 from Gutsy to <a target="_blank" href="https://wiki.ubuntu.com/HardyHeron">Hardy</a> yesterday afternoon and it seemed to go as smoothly as it did on my HP box at home.  All looked a-okay this morning until, upon returning from a meeting, my display was all funky and jerky and laggy.  The right edges of my windows were uniformly screwy &#8212; I would have to click about an inch to the left of whatever I wanted to click on &#8212; and the right and left edges of the screen caused visual trails when I dragged windows around.  (And this has nothing to do with my usual breakfast of bacon and psychedelics.)  This wasn&#039;t the first time I&#039;ve run into problems with compiz/beryl and Ubuntu and so I was hopeful that things could be easily remedied.</p>
<p>I was still able to get around a bit and I found a <a href="http://wiki.cchtml.com/index.php/Ubuntu_Hardy_Installation_Guide#Removing_Mesa_drivers" target="_blank">Hardy installation guide</a> that fixed me all up (I hope).</p>
<p>I should probably note that the Optiplex in question has an ATI Radeon X600 series video card.</p>
<p>Pining for the visual trails,</p>
<p>Mike from Arlington</p>
<p>P.S. Ubuntu, I still &hearts; you.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2008/04/29/hiccup-y-hardy-heron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Linux to fix Windows</title>
		<link>http://lackoftalent.org/michael/blog/2007/10/13/using-linux-to-fix-windows/</link>
		<comments>http://lackoftalent.org/michael/blog/2007/10/13/using-linux-to-fix-windows/#comments</comments>
		<pubDate>Sat, 13 Oct 2007 20:30:00 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/2007/10/13/using-linux-to-fix-windows/</guid>
		<description><![CDATA[
The hard drive on my laptop is slowly failing and a combination of being busy, lazy, and cheap is preventing me from replacing it.  About once every two weeks over the past couple months, one of the Windows registry files becomes corrupted and the XP disk is unable to repair it.  And the [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:109"><!-- &nbsp; --></abbr>
<p>The hard drive on my laptop is slowly failing and a combination of being busy, lazy, and cheap is preventing me from replacing it.  About once every two weeks over the past couple months, one of the Windows registry files becomes corrupted and the XP disk is unable to repair it.  And the HD fails basic manufacturer-provided diagnostics.  But I&#039;m stubborn.  So I&#039;ve been routinely resuscitating this box and I decided to post the process I use.</p>
<p>If you boot and see a message like</p>
<blockquote><p>Windows could not start because the following file is missing or corrupt<br />
C:\windows\system32\config\system</p></blockquote>
<p>then you may be interested in this.<br />
<span id="more-109"></span><br />
I should note that there are <a href="http://xphelpandsupport.mvps.org/how_do_i_repair_a_missing_or_cor1.htm" target="_blank">more</a> <a href="http://www.help2go.com/Tutorials/Windows/C:%5Cwindows%5Csystem32%5Cconfig%5Csystem_missing_or_corrupt.html" target="_blank">Windows-y</a> ways to fix this.  But I have an Ubuntu Edgy disc on hand, and so these instructions are for using Ubuntu Edgy as <del datetime="2007-10-13T19:50:57+00:00">a band-aid</del> <ins datetime="2007-10-13T19:50:57+00:00">an adhesive bandage</ins> for a dying hard drive or a screwy Windows installation.  The ntfs-3g and ntfs-config packages are necessary to mount your local hard drive in read-write mode, otherwise these instructions would be much shorter.</p>
<p>I&#039;m assuming you have a good backup from which to restore the missing or corrupt files that are preventing you from booting Windows off your hard drive.  My backups are available via a networked Samba mount.  If yours are on a secondary internal hard drive, an external hard drive, a CD or floppy or thumb drive, some of these steps won&#039;t apply to you.</p>
<ol>
<li>Get a copy of <a href="http://www.ubuntu.com/getubuntu/download" target="_blank">Ubuntu</a> and burn it to a bootable medium.  I&#039;m using a Ubuntu 6.10 (Edgy) on a CD-R.</li>
<li>Insert your bootable medium into the crappy computer.  Boot said crappy computer from the medium.  You may need to fiddle with your BIOS to get it to boot from removable media, but hopefully not.</li>
<li>At the Ubuntu boot menu, chose &#034;Start or Install Ubuntu.&#034;  Don&#039;t worry: it won&#039;t write over your hard drive or touch any of your data.</li>
<li>When the operating system is done loading, click on the Applications menu, and choose Accessories, then Terminal.</li>
<li>Since my backups are available on a Samba mount, and the Edgy CD does not have Samba installed, I first must install the Samba FS and its dependencies: <code><br />
sudo apt-get install smbfs</code></li>
<li>Create a directory for mounting the Samba share:<br />
<code>sudo mkdir /mnt/remote</code></li>
<li>Mount the share, substituting appropriate values for the IP address and the share name:<br />
<code>sudo smbmount //192.168.1.5/backups /mnt/remote</code></li>
<li>If not running Edgy, see this <a href="https://help.ubuntu.com/community/MountingWindowsPartitions/ThirdPartyNTFS3G" target="_blank">guide</a> to mounting local Windows drives in read-write mode.  Otherwise, first open the aptitude sources list:<br />
<code>sudo nano -wc /etc/apt/sources.list</code><br />
and add the following three lines at the bottom of the file:</p>
<blockquote><p>deb http://flomertens.free.fr/ubuntu/ edgy main main-all<br />
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ edgy main main-all<br />
deb http://flomertens.keo.in/ubuntu/ edgy main main-all</p></blockquote>
<p>Save and close the file.</li>
<li>Let aptitude update its list of sources:<br />
<code>sudo apt-get update</code></li>
<li>Install necessary packages:<br />
<code>sudo apt-get install ntfs-3g ntfs-config libfuse2</code></li>
<li>Launch the ntfs-config utility:<br />
<code>sudo ntfs-config</code><br />
Call the mount point &#034;windows&#034;, which will live at /media/windows.  Click the Add checkbox next to the device corresponding to your local drive (/dev/hda1 for me).  Click Apply.  Make sure the checkbox next to &#034;Enable write support for internal drive&#034; is clicked on the next dialog, and click Ok.</li>
<li>Copy over backed up versions of missing or corrupt files: <code><br />
sudo cp /mnt/remote/repair/system* /media/windows/WINDOWS/system32/config/</code><br />
is an example I&#039;ve used a couple times.</li>
<li>Shutdown, remove the Ubuntu CD when prompted, and boot off your hard drive.  Cross fingers.  And you should be back in action.</li>
</ol>
<p><em>Voila?</em></p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2007/10/13/using-linux-to-fix-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Services: From Red Hat to Debian</title>
		<link>http://lackoftalent.org/michael/blog/2006/04/19/managing-services-from-red-hat-to-debian/</link>
		<comments>http://lackoftalent.org/michael/blog/2006/04/19/managing-services-from-red-hat-to-debian/#comments</comments>
		<pubDate>Wed, 19 Apr 2006 17:03:09 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/2006/04/19/managing-services-from-red-hat-to-debian/</guid>
		<description><![CDATA[
A note for Linux sysadmins who&#039;re scouring Google for answers to this issue: 
Having administered Red Hat servers for years at prior places of work, I&#039;d gotten quite used to doing things the Red Hat Way™, e.g., using the chkconfig and setup tools to manage services and the runlevels at which they are enabled.  These tools apparently aren&#039;t [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:31"><!-- &nbsp; --></abbr>
<p>A note for Linux sysadmins who&#039;re scouring Google for answers to this issue: </p>
<p>Having administered Red Hat servers for years at prior places of work, I&#039;d gotten quite used to doing things the Red Hat Way™, e.g., using the <em>chkconfig</em> and <em>setup</em> tools to manage services and the runlevels at which they are enabled.  These tools apparently aren&#039;t used in Debian, which is the preferred distro at MPOW.  Instead, I&#039;ve used <em>update-rc.d </em>and <em>rcconf</em>, respectively, to manage services on Debian.  They work similar to the aforementioned Red Hat tools, but I&#039;m not yet that familiar with them; I&#039;m inclined to say that the RH tools are more intuitive to use, but I may have some recall bias.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2006/04/19/managing-services-from-red-hat-to-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home and End keys &#8211; PuTTY &#8211; bash &#8211; Linux</title>
		<link>http://lackoftalent.org/michael/blog/2005/11/30/home-and-end-keys-putty-bash-linux/</link>
		<comments>http://lackoftalent.org/michael/blog/2005/11/30/home-and-end-keys-putty-bash-linux/#comments</comments>
		<pubDate>Thu, 01 Dec 2005 01:30:00 +0000</pubDate>
		<dc:creator>Michael Giarlo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://lackoftalent.org/michael/blog/2005/11/30/home-and-end-keys-putty-bash-linux/</guid>
		<description><![CDATA[
Here&#039;s a simple one. But first, some backstory.
I&#039;d been using the tcsh shell on my Linux servers for years, but I am now working in an environment where bash is the preferred shell. I view it as an opportunity to poke around in a shell that&#039;s relatively unfamiliar to me as a dyed-in-the-wool tcsh user[1]. [...]]]></description>
			<content:encoded><![CDATA[<abbr class="unapi-id" title="oai:lackoftalent.org:technosophia:8"><!-- &nbsp; --></abbr>
<p>Here&#039;s a simple one. But first, some backstory.</p>
<p>I&#039;d been using the tcsh shell on my Linux servers for years, but I am now working in an environment where bash is the preferred shell. I view it as an opportunity to poke around in a shell that&#039;s relatively unfamiliar to me as a dyed-in-the-wool tcsh user[<a href="http://www.lackoftalent.org/michael/blog/wp-admin/post.php#one">1</a>]. I&#039;d also been used to connecting to my Linux servers with the SSH Communications Security version of the Secure Shell client. Unfortunately, the newest version of this client, which <em>is</em> available to me, will not connect to our department&#039;s boxes due to the version (or configuration) of the OpenSSH libraries that have been installed. I&#039;m new to this job, so I&#039;m accepting this more or less on the authority of comments made by coworkers; I haven&#039;t independently verified this, though I can confirm that I can&#039;t connect with the SSH client. I switched to the <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty">PuTTY</a> SSH client, since it&#039;s free, widely used, and supported by my colleagues. And, oh yeah, it connects to our Linux boxes.</p>
<p>One of the neat features of the SSH Communications Security client is the ability map keys to certain other keys. For instance, I used to map the Home and End keys to &lt;Ctrl-a&gt; and &lt;Ctrl-e&gt; for ease of navigation on the command-line; sometimes the command strings I have to type are, to put it technically, <em>really frickin&#039; long</em> and it&#039;s nice to be able to make edits to the beginning and end of these command strings without holding down the left and right arrow keys for an hour. PuTTY does not have a key-mapping feature, so I was wondering how to get my Home and End keys to do more than just generate the &#039;~&#039; character. (Though such a feature is on PuTTY&#039;s wish-list.)</p>
<p>It turns out there&#039;s a <em>simple fix</em>: just set the environment variable, TERM, to the value of &#034;linux&#034; in ~/.bash_profile (or .bashrc).</p>
<p><code>export TERM=linux</code></p>
<p>should do the trick. Make sure you logout and login again, or just source your bash config files. It&#039;s possible that other TERM values do the trick as well, but &#034;linux&#034; has worked for me. Prior to that, the TERM variable was set to the value &#034;xterm&#034;.</p>
<p>For some more shell-based key mapping geared toward the Backspace and Delete keys, see the <a href="http://www.ibb.net/~anne/keyboard.html">Consistent BackSpace and Delete Configuration</a> page.</p>
<p><a name="one"></a>1. While I&#039;ve used tcsh as my default shell for years, I do acknowledge the argument that <a href="http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/">csh programming is considered harmful</a>. I use the Bourne shell and Perl for scripting, though primarily the latter.</p>
]]></content:encoded>
			<wfw:commentRss>http://lackoftalent.org/michael/blog/2005/11/30/home-and-end-keys-putty-bash-linux/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
