<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" version="2.0">

<channel>
<title>Gnuru.org</title>
<link>http://gnuru.org</link>
<description>Productive Linux</description>
<language>en-gb</language>
<pubDate>Thu, 08 Dec 2011 14:42:55 GMT</pubDate>
<lastBuildDate>Thu, 08 Dec 2011 14:42:55 GMT</lastBuildDate>

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Gnuruorg" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="gnuruorg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">Gnuruorg</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
<title>Is Calibre the most annoying program in the world ever?</title>
<link>http://gnuru.org/article/1600/is-calibre-most-annoying-program-in-world-ever</link>
<description>&lt;p&gt;Like many people I use calibre as my ebook viewer.  Yet, this program is slowly becoming a living nightmare.  First is the &lt;a href="http://www.reddit.com/r/netsec/comments/lzdhy/calibre_ebook_reader_local_root_exploit/"&gt;root exploit&lt;/a&gt;. Second is the way that calibre wants to take over every single file.  Almost all my files were defaulting to being opened in calibre.  Why on Earth would I want an openoffice document opened in calibre?  The creators of calibre think I do.&lt;/p&gt;

&lt;p&gt;This obviously required fixing.&lt;/p&gt;

&lt;p&gt;The file &lt;code&gt;/usr/local/share/applications/defaults.list&lt;/code&gt; looks like this:&lt;/p&gt;

&lt;pre&gt;
application/x-sony-bbeb=calibre-gui.desktop;calibre-lrfviewer.desktop;calibre-ebook-viewer.desktop
application/x-ruby=calibre-gui.desktop;calibre-ebook-viewer.desktop
text/rtf=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/pdf=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/x-cbz=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/x-mobipocket-ebook=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/x-cbr=calibre-gui.desktop;calibre-ebook-viewer.desktop
text/fb2+xml=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/vnd.oasis.opendocument.text=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/epub+zip=calibre-gui.desktop;calibre-ebook-viewer.desktop
text/plain=calibre-gui.desktop;calibre-ebook-viewer.desktop
text/html=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/xhtml+xml=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/ereader=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/oebps-package+xml=calibre-gui.desktop;calibre-ebook-viewer.desktop
&lt;/pre&gt;

&lt;p&gt;This is a nonsense.  It has been setup to open plain text, html and pdfs in calibre.  How totally stupid! It needs editing. This is better:&lt;/p&gt;

&lt;pre&gt;
application/x-sony-bbeb=calibre-gui.desktop;calibre-lrfviewer.desktop;calibre-ebook-viewer.desktop
application/x-cbz=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/x-mobipocket-ebook=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/x-cbr=calibre-gui.desktop;calibre-ebook-viewer.desktop
text/fb2+xml=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/epub+zip=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/ereader=calibre-gui.desktop;calibre-ebook-viewer.desktop
application/oebps-package+xml=calibre-gui.desktop;calibre-ebook-viewer.desktop
&lt;/pre&gt;

&lt;p&gt;Then run &lt;code&gt;sudo update-desktop-database&lt;/code&gt;. That seems to fix it.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1600/is-calibre-most-annoying-program-in-world-ever"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1600/is-calibre-most-annoying-program-in-world-ever#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/lBk845fPSps" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1600/is-calibre-most-annoying-program-in-world-ever</guid>
<pubDate>Thu, 08 Dec 2011 14:42:55 GMT</pubDate>
</item>
<item>
<title>Computer Science Degree: Possibly Useless</title>
<link>http://gnuru.org/article/1596/computer-science-degree-possibly-useless</link>
<description>&lt;p&gt;An educational institution wrote to me recently asking me to finish
my degree. I ordered the prospectus and looked through the courses
that passed themselves off as computer science.  Very little of it was
science and rest was even less about computers. In fact, I can know more
and get better information by reading &lt;a href="http://www.amazon.com/gp/product/0201633612/ref=as_li_tf_tl?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0201633612"&gt;the&lt;/a&gt; &lt;a
href="http://www.amazon.com/gp/product/0070004846/ref=as_li_tf_tl?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0070004846"&gt;right&lt;/a&gt;
&lt;a href="http://www.amazon.com/gp/product/0131103628/ref=as_li_tf_tl?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399369&amp;creativeASIN=0131103628"&gt;books&lt;/a&gt; and &lt;a href="http://dreamsongs.com/WorseIsBetter.html"&gt;blogs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was interesting to see that &lt;a href="http://nydwracu.wordpress.com/2011/10/12/why-im-not-a-computer-science-major/"&gt;others&lt;/a&gt; have a similar take on
computer science education:&lt;/p&gt;

&lt;blockquote&gt;
When I started college, it was as a computer science major. I thought I would use college mostly as a convenient way to learn some programming languages and strategies so I could get a degree and a job in the field. But I arrived already burnt out and ended up switching out after a semester, for two very different reasons.&lt;/blockquote&gt;

&lt;blockquote&gt;The first is the state of technology today. We donât deal with the machine; we donât even deal with abstractions on top of the machine. We deal with layers of abstractions, layers piled so high you canât even see where they end.
&lt;/blockquote&gt;

&lt;blockquote&gt;The other reason, of course, is that technology education is bullshit. I can pinpoint exactly the moment of my burnout: it was when, as a sophomore in high school, I used the conditional operator in a program for my AP Computer Science class and got marked down...
&lt;/blockquote&gt;

&lt;p&gt;The school that asked me to complete my degree wants more
students.  To get them, it has dumbed its courses so that they appeal
to any half-wit on the Interwebs with a pulse. The question for me is
whether it's worth my time and money.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1596/computer-science-degree-possibly-useless"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1596/computer-science-degree-possibly-useless#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/cXrBI9qcbng" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1596/computer-science-degree-possibly-useless</guid>
<pubDate>Mon, 17 Oct 2011 14:11:18 BST</pubDate>
</item>
<item>
<title>Terminal Emulators</title>
<link>http://gnuru.org/article/1594/terminal-emulators</link>
<description>&lt;p&gt;Recently my favourite terminal emulator got deleted from my system, because of the continuing problems I am having due to the non-functioning of KDE.&lt;/p&gt;

&lt;p&gt;I came across &lt;a href="http://superuser.com/questions/80506/what-is-the-best-linux-terminal-emulator"&gt;this interesting discussion&lt;/a&gt; on the best terminal emulators. Here are the favourites:&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;yakuake (depends on kde though)&lt;/li&gt;

&lt;li&gt;tilde (depends on gnome though)&lt;/li&gt;

&lt;li&gt;rxvt or urxvt or mrxvt -  nice and lightweight&lt;/li&gt;

&lt;li&gt;xterm (the basic)&lt;/li&gt;

&lt;li&gt;Guake&lt;/li&gt;

&lt;li&gt;LXTerminal&lt;/li&gt;

&lt;li&gt;yakuake (depends on kde though)&lt;/li&gt;

&lt;li&gt;Terminator&lt;/li&gt;

&lt;li&gt;aterm&lt;/li&gt;

&lt;/ul&gt;&lt;a href="http://gnuru.org/article/1594/terminal-emulators"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1594/terminal-emulators#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/IEPLZyXpYbk" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1594/terminal-emulators</guid>
<pubDate>Mon, 08 Aug 2011 11:45:11 BST</pubDate>
</item>
<item>
<title>Command Line Dictaphone</title>
<link>http://gnuru.org/article/1592/command-line-dictaphone</link>
<description>&lt;p&gt;Here's a simple dictaphone :) you can use from the command line.&lt;/p&gt;

&lt;pre&gt;sudo aptitude install sox&lt;/pre&gt;

&lt;p&gt;To record:&lt;/p&gt;

&lt;pre&gt;rec my_really_important_thoughts.wav&lt;/pre&gt;

&lt;p&gt;To play back:&lt;/p&gt;

&lt;pre&gt;play my_really_important_thoughts.wav&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1592/command-line-dictaphone"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1592/command-line-dictaphone#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/9EVd7sZpXiU" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1592/command-line-dictaphone</guid>
<pubDate>Thu, 21 Jul 2011 10:52:11 BST</pubDate>
</item>
<item>
<title>Fun with sed</title>
<link>http://gnuru.org/article/1591/fun-with-sed</link>
<description>&lt;p&gt;Everyone should learn sed, especially me:&lt;/p&gt;

&lt;pre&gt;sed '/use Moose::Policy/ d; /use Moose;/ a \
use MooseX::FollowPBP; \
' lib/interestingfile.pm
&lt;/pre&gt;

&lt;p&gt;and even better:&lt;/p&gt;

&lt;pre&gt;find lib -name '*pm' -exec sed -i '/use Moose::Policy/ d; /use Moose;/ a \
use MooseX::FollowPBP; \
' '{}' \;
&lt;/pre&gt;

&lt;p&gt;In relation to sed the &lt;code&gt;-i&lt;/code&gt; switch means amend the file in place. The 'd' command is delete the line with the preceeding match and the 'a' command means append the following line after the preceeding match.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1591/fun-with-sed"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1591/fun-with-sed#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/YJu3AEu_Hvg" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1591/fun-with-sed</guid>
<pubDate>Wed, 20 Jul 2011 20:34:51 BST</pubDate>
</item>
<item>
<title>Use rsync to copy a directory structure to VFAT</title>
<link>http://gnuru.org/article/1588/use-rsync-copy-directory-structure-vfat</link>
<description>&lt;p&gt;When I use &lt;code&gt;rsync&lt;/code&gt; to copy a directory structure I often use the &lt;code&gt;avz&lt;/code&gt; options.  The &lt;code&gt;a&lt;/code&gt; option is key as it tries to preserve everything.  It is equivalent to &lt;code&gt;-rlptgoD&lt;/code&gt;.&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;r&lt;/dt&gt;&lt;dd&gt;means recurse through subdirectories.&lt;/dd&gt;

&lt;dt&gt;l&lt;/dt&gt;&lt;dd&gt;means recreate symlinks.&lt;/dd&gt;

&lt;dt&gt;p&lt;/dt&gt;&lt;dd&gt;means preserve permissions.&lt;/dd&gt;

&lt;dt&gt;t&lt;/dt&gt;&lt;dd&gt;means transfer modification times.&lt;/dd&gt;

&lt;dt&gt;g&lt;/dt&gt;&lt;dd&gt;means destination group to be same as original group.&lt;/dd&gt;

&lt;dt&gt;o&lt;/dt&gt;&lt;dd&gt;means preserve owner.&lt;/dd&gt;

&lt;dt&gt;D&lt;/dt&gt;&lt;dd&gt;means preserve devices and specials.&lt;/dd&gt;

&lt;/dl&gt;

&lt;p&gt;When you are copying to a usb mounted vfat file system a a lot of these are inappropriate, particular, l, p, g, o and D.&lt;/p&gt;

&lt;p&gt;So, in future when trying to copy a directory structure to a vfat file system I'll try this instead:&lt;/p&gt;

&lt;pre&gt;rsync -rtvz /source/ /destination/&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1588/use-rsync-copy-directory-structure-vfat"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1588/use-rsync-copy-directory-structure-vfat#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/sjF4eEJbBm0" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1588/use-rsync-copy-directory-structure-vfat</guid>
<pubDate>Mon, 27 Jun 2011 13:08:26 BST</pubDate>
</item>
<item>
<title>UDEV - devices mounting twice</title>
<link>http://gnuru.org/article/1587/udev-devices-mounting-twice</link>
<description>&lt;p&gt;The great &lt;a href="http://wiki.debian.org/HALRemoval"&gt;hal-ectomy&lt;/a&gt; is still causing me problems.  I found that usb vfat disks were being mounted twice at two different mount points.&lt;/p&gt;

&lt;p&gt;This fixed the problem:&lt;/p&gt;

&lt;pre&gt;sudo aptitude remove halevt&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1587/udev-devices-mounting-twice"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1587/udev-devices-mounting-twice#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/KInT384GxN0" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1587/udev-devices-mounting-twice</guid>
<pubDate>Mon, 25 Apr 2011 17:14:41 BST</pubDate>
</item>
<item>
<title>Convert m4a to mp3 Script</title>
<link>http://gnuru.org/article/1582/convert-m4a-mp3-script</link>
<description>&lt;p&gt;Some media players can't play protected m4a's.  This script converts the m4a passed on the command line to an mp3 that can then be copied to your selected media player:&lt;/p&gt;

&lt;pre&gt;
#!/usr/bin/bash
#
# copy and convert
#
# Transcode m4a file to mp3
#
# This script is heavily based on the original here:
# http://www.minigeek.org/2007/07/linux-m4a-to-mp3-conversion-script
#
# Naturally, changes are licensed under the GPL
#

orig=$1
temp_wav=`tempfile --directory ~/tmp --suffix=".wav"`

mp3=`echo "$orig"|sed -e 's/\.m4a/\.mp3/'`
temp_trackinfo=`tempfile --directory ~/tmp --suffix=".txt"`

# deal with track info
faad -i ${orig} 2&gt;$temp_trackinfo
sed -i '23s/unknown: /title: /' $temp_trackinfo
sed -i '24s/unknown: /artist: /' $temp_trackinfo

year=`grep 'date: ' $temp_trackinfo|sed -e 's/date: //'`

sed -i 's/unknown: iTunes/iTunes: iTunes/' $temp_trackinfo

genrecount=`grep -c 'genre: ' $temp_trackinfo`
unknowncount=`grep -c 'unknown: ' $temp_trackinfo`

if  &amp;&amp; ; then
    sed -i '25s/unknown: /composer: /' $temp_trackinfo
    sed -i '26s/unknown: /album: /' $temp_trackinfo
    genre=`grep 'genre: ' $temp_trackinfo|sed -e 's/genre: //'`
fi

if  &amp;&amp; ; then
    sed -i '25s/unknown: /album: /' $temp_trackinfo
    genre=`grep 'genre: ' $temp_trackinfo|sed -e 's/genre: //'`
fi

if  &amp;&amp; ; then
    sed -i '25s/unknown: /composer: /' $temp_trackinfo
    sed -i '26s/unknown: /album: /' $temp_trackinfo
    sed -i '27s/unknown: /genre: /' $temp_trackinfo
    genre='other'
fi

if  &amp;&amp; ; then
    sed -i '25s/unknown: /album: /' $temp_trackinfo
    sed -i '26s/unknown: /genre: /' $temp_trackinfo
    genre='other'
fi
	
title=`grep 'title: ' $temp_trackinfo|sed -e 's/title: //'`
artist=`grep 'artist: ' $temp_trackinfo|sed -e 's/artist: //'`
album=`grep 'album: ' $temp_trackinfo|sed -e 's/album: //'`
track=`grep 'track: ' $temp_trackinfo|sed -e 's/track: //'`

## convert to wav

faad -o $temp_wav $orig

## convert to mp3
lame --alt-preset 192 --id3v2-only --tt "$title" --ta "$artist" --tl "$album" --tg "$genre" --tn "$track" --ty "$year" "$temp_wav" "$mp3"

## clean-up

rm $temp_wav
rm $temp_trackinfo

exit 0
&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1582/convert-m4a-mp3-script"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1582/convert-m4a-mp3-script#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/K0-v2z43xQQ" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1582/convert-m4a-mp3-script</guid>
<pubDate>Wed, 20 Apr 2011 13:45:28 BST</pubDate>
</item>
<item>
<title>NFSv4 Really Rocks if You Can Get It Working</title>
<link>http://gnuru.org/article/1580/nfsv4-really-rocks-if-you-can-get-it-working</link>
<description>&lt;p&gt;I've just spent hours trying to get a nfsv4 mount working, and one of
the chief problems was that the documentation is not quite complete.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
You need to use nfs-kernel-server, nfs-user-server don't work.
&lt;/li&gt;
&lt;li&gt;
You need to create a phantom filesystem, in my case &lt;code&gt;/nfs4exports&lt;/code&gt;,
nice and descriptive.
&lt;/li&gt;
&lt;li&gt;
You need to specify the right options in the exports
file. Something like:
&lt;pre&gt;/nfs4exports                   hostname(rw,sync,fsid=0,crossmnt)
&lt;/pre&gt;
should do.

&lt;/li&gt;

&lt;li&gt;
Subdirectories to your exports need to have a different fsid, so:
&lt;pre&gt;/nfs4exports/hotsexyillegallydownloadedmusic                   hostname(rw,sync,fsid=1,crossmnt)&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
 You need to use a bind mount to associate your new nfs4 exports
tree with your old nfs3 exports.  Easiest way to do this is to add to your
&lt;code&gt;/etc/fstab&lt;/code&gt;:
&lt;pre&gt;/old/nfs/shares /nfs4exports/hotsexyillegallydownloadedmusic none bind 0 0&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
And most importantly, if you do the step set out in 5, then you
need to add the &lt;code&gt;unhide&lt;/code&gt; option to your &lt;code&gt;/etc/exports&lt;/code&gt; file, so:
&lt;pre&gt;/nfs4exports/hotsexyillegallydownloadedmusic                   hostname(rw,sync,fsid=1,crossmnt,unhide)&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;
The last step is really important otherwise you get a 'stale nfs file
handle error'.  Why doesn't any of the documentation include this?
&lt;/p&gt;&lt;a href="http://gnuru.org/article/1580/nfsv4-really-rocks-if-you-can-get-it-working"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1580/nfsv4-really-rocks-if-you-can-get-it-working#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/Z0C3IISinE8" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1580/nfsv4-really-rocks-if-you-can-get-it-working</guid>
<pubDate>Thu, 14 Apr 2011 14:10:48 BST</pubDate>
</item>
<item>
<title>Convert mp4 video to avi video</title>
<link>http://gnuru.org/article/1577/convert-mp4-video-avi-video</link>
<description>&lt;p&gt;Sometimes it's just too easy:&lt;/p&gt;

&lt;pre&gt;ffmpeg -i infile.mp4 outfile.avi&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1577/convert-mp4-video-avi-video"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1577/convert-mp4-video-avi-video#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/GTi3vB4Jgq8" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1577/convert-mp4-video-avi-video</guid>
<pubDate>Wed, 13 Apr 2011 21:28:29 BST</pubDate>
</item>
<item>
<title>Burn ISO to DVD on the Command Line</title>
<link>http://gnuru.org/article/1574/burn-iso-dvd-on-command-line</link>
<description>&lt;p&gt;Don't mess around with graphical burners that get get in the way of your workspace.  Simpler to use the command line:&lt;/p&gt;

&lt;pre&gt;growisofs -dvd-compat -Z /dev/dvd=/path/to/image.iso&lt;/pre&gt;

&lt;p&gt;And then while it's happening you can get on with your real work.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1574/burn-iso-dvd-on-command-line"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1574/burn-iso-dvd-on-command-line#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/9yNcVEU3R7M" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1574/burn-iso-dvd-on-command-line</guid>
<pubDate>Mon, 04 Apr 2011 12:29:40 BST</pubDate>
</item>
<item>
<title>Scan Network for Local Services with nmap</title>
<link>http://gnuru.org/article/1571/scan-network-for-local-services-with-nmap</link>
<description>&lt;p&gt;Like this:&lt;/p&gt;

&lt;pre&gt;nmap 10.0.0.0/24&lt;/pre&gt;

&lt;p&gt;Depending on your network setup.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1571/scan-network-for-local-services-with-nmap"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1571/scan-network-for-local-services-with-nmap#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/eru6J9-i7PQ" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1571/scan-network-for-local-services-with-nmap</guid>
<pubDate>Fri, 01 Apr 2011 06:52:39 BST</pubDate>
</item>
<item>
<title>Bash One-Liner to Determine Mountpoint from UUID</title>
<link>http://gnuru.org/article/1566/bash-one-liner-determine-mountpoint-uuid</link>
<description>&lt;p&gt;You are not the root user (and therefore do not have access to &lt;code&gt;blkid&lt;/code&gt;), but you want to determine were a particular disk or partition is mounted.  You know it is a particular disk, because you have the UUID, which is the quasi-unique identifier for the disk:&lt;/p&gt;

&lt;pre&gt;mount | grep `readlink -f /dev/disk/by-uuid/xxxxxxxxxxxxxxx` | cut -d ' ' -f 3
&lt;/pre&gt;

&lt;p&gt;Replace the x's with the UUID.&lt;/p&gt;
&lt;a href="http://gnuru.org/article/1566/bash-one-liner-determine-mountpoint-uuid"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1566/bash-one-liner-determine-mountpoint-uuid#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/2DLdhgppsks" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1566/bash-one-liner-determine-mountpoint-uuid</guid>
<pubDate>Wed, 30 Mar 2011 20:09:01 BST</pubDate>
</item>
<item>
<title>Fail: orphaned udev rules make your life difficult</title>
<link>http://gnuru.org/article/1564/fail-orphaned-udev-rules-make-your-life-difficult</link>
<description>&lt;p&gt;Do this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;dpkg --search /etc/udev/rules.d/* | grep 'not found'&lt;/pre&gt;

&lt;p&gt;Get this:&lt;/p&gt;

&lt;pre&gt;dpkg: /etc/udev/rules.d/z60_hdparm.rules not found.
dpkg: /etc/udev/rules.d/025_logitechmouse.rules not found.
dpkg: /etc/udev/rules.d/030_ifplugd.rules not found.
dpkg: /etc/udev/rules.d/60-libsane.rules not found.
dpkg: /etc/udev/rules.d/90-local.rules not found.
&lt;/pre&gt;

&lt;p&gt;Find out that orphaned udev rules are making your life difficult.&lt;/p&gt;

&lt;p&gt;Grrr.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1564/fail-orphaned-udev-rules-make-your-life-difficult"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1564/fail-orphaned-udev-rules-make-your-life-difficult#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/q0JVmlgkzfU" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1564/fail-orphaned-udev-rules-make-your-life-difficult</guid>
<pubDate>Fri, 25 Mar 2011 10:25:47 GMT</pubDate>
</item>
<item>
<title>USB Pen Drives - the UDEV Automounting Secrets</title>
<link>http://gnuru.org/article/1561/usb-pen-drives-udev-automounting-secrets</link>
<description>&lt;p&gt;
You run Debian Sid. You're on the cutting edge.  It's where you like
to be.
&lt;/p&gt;
&lt;p&gt;
Recently, you found that USB pen drives and hard disks weren't being
mounted, or if they were, no user other than root was able to write to
them.
&lt;/p&gt;
&lt;p&gt;
You wonder why. &lt;a href="http://freedesktop.org/wiki/Software/hal"&gt;HAL&lt;/a&gt;, that mainstay of Linux over
the last few years, is gone.  &lt;a href="http://ivman.sourceforge.net/"&gt;ivman&lt;/a&gt; still appears in the package list,
but is not used. The trusty &lt;a href="http://packages.debian.org/search?keywords=gnome-volume-manager"&gt;gnome-volume-manager&lt;/a&gt; too has disappeared.
&lt;/p&gt;
&lt;p&gt;
You know it's all &lt;a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"&gt;udev&lt;/a&gt;. It's shiny. It's new. It controls
the /dev directory and almost all hardware events.
&lt;/p&gt;
&lt;p&gt;
If it's udev that is making your usb disks mount read-only. why?
&lt;/p&gt;
&lt;p&gt;
You turn on 'debug' level logging:
&lt;/p&gt;
&lt;pre&gt;
sudo udevadm control --log-priority=debug
&lt;/pre&gt;
&lt;p&gt;
More information is now reported to &lt;code&gt;/var/log/syslog&lt;/code&gt;. You see lines containing 
&lt;code&gt;/lib/udev/rules.d/60-persistent-storage.rules&lt;/code&gt; and
&lt;code&gt;/lib/udev/rules.d/usbmount.rules&lt;/code&gt;. You conclude that the udev rules
are in  &lt;code&gt;/lib/udev&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
You examine, in particular &lt;code&gt;/lib/udev/rules.d/usbmount.rules&lt;/code&gt; which
calls the &lt;code&gt;usbmount&lt;/code&gt; script to handle the mounting of usb devices. You
become concerned that the &lt;a href="http://usbmount.alioth.debian.org/"&gt;usbmount package&lt;/a&gt; is no longer maintained.
But you check the &lt;a href="http://svn.debian.org/wsvn/usbmount"&gt;source code&lt;/a&gt;. You are relieved to find out that
usbmount is a simple script that even you could maintain. You continue to use it.
&lt;/p&gt;
&lt;p&gt;
You read the usbmount documentation, and the configuration options.
You realise that the problem is VFAT, an extremely limited and quite
rubbish format, that doesn't deal with permissions properly and that,
therefore, no one in their right mind should use.  Unfortunately, pen
drives always use VFAT. You remember the proper way to mount
VFAT disks.
&lt;/p&gt;
&lt;p&gt;
You make the following changes to &lt;code&gt;/etc/usbmount/usbmount.conf&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
You replace the line:
&lt;/p&gt;


&lt;pre&gt;MOUNTOPTIONS="sync,noexec,nodev,noatime,nodiratime"&lt;/pre&gt;

&lt;p&gt;
With this one:
&lt;/p&gt;


&lt;pre&gt;MOUNTOPTIONS="noexec,nodev,noatime,nodiratime"&lt;/pre&gt;

&lt;p&gt;
And you add this line:
&lt;/p&gt;


&lt;pre&gt;FS_MOUNTOPTIONS="-fstype=vfat,gid=plugdev,dmask=0007,fmask=0117"&lt;/pre&gt;

&lt;p&gt;
Users in the plugdev group can now write to pen drives and other usb
VFAT formatted hard drives. You make sure you are in the plugdev group.
&lt;/p&gt;
&lt;a href="http://gnuru.org/article/1561/usb-pen-drives-udev-automounting-secrets"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1561/usb-pen-drives-udev-automounting-secrets#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/fWp2AT9BjG4" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1561/usb-pen-drives-udev-automounting-secrets</guid>
<pubDate>Thu, 24 Mar 2011 14:30:36 GMT</pubDate>
</item>
<item>
<title>iPod touch, iPhone and Linux - Making it All Work</title>
<link>http://gnuru.org/article/1557/ipod-touch-iphone-linux-making-it-all-work</link>
<description>&lt;iframe src="http://rcm.amazon.com/e/cm?t=gnuruorg-20&amp;o=1&amp;p=13&amp;l=ur1&amp;category=electronics&amp;f=ifr" width="468" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"&gt;&lt;/iframe&gt;

&lt;p&gt;
There's nothing like an iPod; sleek, beautiful, pleasing to the eye,
and totally useless thanks to Apple's insistence on trying to stop
you doing what you want with your devices. Are the iPod touch and
iPhone two of the most useless devices ever to come from a tech
company?
&lt;/p&gt;
&lt;p&gt;
I had previously managed iPods using the excellent &lt;a href="http://www.gtkpod.org/wiki/Home"&gt;gtkpod&lt;/a&gt;, but
the iPod touch is a different matter.  Unlike other iPods which just
mount as disks, the iPod touch doesn't.  Apple in their infinite
idiocy decided to encrypt the iPod touch like they do all iPhones.  The
iPod touch and the iPhone are very similar; essentially the iPod touch
is sort of an iPhone without the 'Phone' bit. I guess that just makes
it an 'i'.
&lt;/p&gt;
&lt;p&gt;
Here's what I learned by getting an iPod touch working with Linux.
&lt;/p&gt;


&lt;a href="http://www.amazon.com/gp/product/B001FA1O18?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001FA1O18"&gt;&lt;img border="0" src="http://gnuru.org:8000/images/41dJKIHo2pL._SL160_.jpg"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=gnuruorg-20&amp;l=as2&amp;o=1&amp;a=B001FA1O18" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;

&lt;h3&gt;Mount the iPod touch or iPhone as a fuse device&lt;/h3&gt;

&lt;p&gt;
Before we start, I need to mention that you need the fuse ("Filesystem
in Userspace")  kernel modules.  You also need the
ifuse package, which provides a means of communicating with iPhone
type devices.
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo aptitude install ifuse
&lt;/pre&gt;

&lt;p&gt;
You will probably also need to make a mount point for the iPod touch
or iPhone. Make it somewhere sensible, like under the &lt;tt&gt;/media/&lt;/tt&gt; directory.
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo mkdir /media/iPod
&lt;/pre&gt;

&lt;p&gt;
You must, must, must make sure that the mount point is writable by
the user going to administer the iPod touch.  There are lots of ways to
do this, but I did:
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo chown me /media/iPod
&lt;/pre&gt;

&lt;p&gt;
Now, make sure that your user is in the '&lt;tt&gt;fuse&lt;/tt&gt;' group. If necessary do:
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo adduser me fuse
&lt;/pre&gt;

&lt;p&gt;
Once done log out and log in again. Make sure the iPod touch or iPhone is
connected to the computer and mount it:
&lt;/p&gt;
&lt;pre class="example"&gt;
ifuse /media/iPod/
&lt;/pre&gt;

&lt;p&gt;
You can then unmount it by doing: 
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo umount /media/iPod
&lt;/pre&gt;

&lt;p&gt;
If on the other hand you do: 
&lt;/p&gt;
&lt;pre class="example"&gt;
ifuse --root /media/iPod/
&lt;/pre&gt;

&lt;p&gt;
You get access to the iPod's root directory.  Once you do that, you might be
amazed at the elegance of the BSD base of the iPod's operating
system. It's such a pity Apple cripples it.
&lt;/p&gt;
&lt;p&gt;
It's cool if all that works for you, unfortunately, it didn't work
for me.  Instead I got the following error:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
Failed to start AFC service 'com.apple.afc2' on the device.
This service enables access to the root filesystem of your device.
Your device needs to be jailbroken and have this service installed.
Note that PwnageTool installs it while blackra1n does not.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
Although I could browse the iPod file system, I could neither play,
copy nor save files.  In essence the iPod was useless unless I jailbroke it.
&lt;/p&gt;


&lt;a href="http://www.amazon.com/gp/product/B001F7AHOG?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001F7AHOG"&gt;&lt;img border="0" src="http://gnuru.org/images/41s-vKh2z4L._SL160_.jpg"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=gnuruorg-20&amp;l=as2&amp;o=1&amp;a=B001F7AHOG" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;

&lt;h3&gt;Jailbreaking the iPod touch and iPhone&lt;/h3&gt;

&lt;p&gt;
&lt;b&gt;WARNING: DOING ANY OF THE BELOW MAY VOID YOUR APPLE WARRANTY AND COULD DAMAGE YOUR IPOD OR IPHONE&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
Jailbreaking sounds so cool, unfortunately it is totally legal in the US and
throughout the EU so that little frisson of excitement that I got with
the thought I might perhaps be skirting around the edge of the law, was totally
unjustified.  On the plus side, jailbreaking iPhones and iPod touches
really gets up the nose of Apple, which certainly gave me a mild sense of
satisfaction.  Have I mentioned how much &lt;a href="http://gnuru.org/article/1410/apple-kicks-its-users-in-privates-again"&gt;I hate Apple&lt;/a&gt;?
&lt;/p&gt;
&lt;p&gt;
Most jailbreaking, also known as 'privilege escalation' applications
are for Macs and some for Windows.  But they do exist for Linux. The
one I used was &lt;a href="http://spiritjb.com/"&gt;Spirit&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Spirit_%28iOS_jailbreak%29"&gt;Jailbreak&lt;/a&gt;, which is an amazingly cool piece of
software.  Binaries aren't available only the source code. So it needs
compiling and you need to install relevant developer libraries:
&lt;/p&gt;
&lt;pre class="example"&gt;
sudo aptitude install libgpg-error-dev
sudo aptitude install libimobiledevice-dev
cd ~/src/  # or wherever you like to keep source files
git clone https://github.com/posixninja/spirit-linux.git
cd spirit-linux
make
&lt;/pre&gt;


&lt;p&gt;
Once that is done we have the spirit binary, which you run like this:
&lt;/p&gt;
&lt;pre class="example"&gt;
./spirit
&lt;/pre&gt;

&lt;p&gt;
The jailbreak worked like a dream for me. After running &lt;i&gt;spirit&lt;/i&gt; the &lt;a href="http://cydia.saurik.com/"&gt;Cydia&lt;/a&gt; icon
appears on the iPod desktop. Cydia is the app store for apps that
Apple don't approve of. So, any self-respecting geek needs it.
&lt;/p&gt;
&lt;p&gt;
On the iPod, touch the Cydia icon and navigate around until you
find  'MobileTerminal' which gives you a command line on
the iPod. Install it. Then find 'OpenSSH', which provides ssh software,
obviously, and install that too.
&lt;/p&gt;
&lt;p&gt;
Also, use the Cydia appstore to install afc2add to install the afc
service to the iPod. When this is installed touch the "REBOOT" button.
&lt;/p&gt;
&lt;p&gt;
Now that you have jailbroken the iPod, you need to change both the
root password and the password of the sole user. The name of the user is
'mobile'. The root password is always 'alpine'.
&lt;/p&gt;
&lt;p&gt;
To do this, touch the Terminal icon (which appeared when you installed
MobileTerminal). A command line will appear as will a keyboard. On the
keyboard type 'su' and give the root password ('alpine' if you weren't
paying attention). Now type 'passwd', and you will be prompted to
enter the new password twice.  Now, type &lt;tt&gt;passwd mobile&lt;/tt&gt; and choose a
new password for the user.
&lt;/p&gt;
&lt;p&gt;
At this point, the iPod touch or the iPhone is properly jailbroken and
has been promoted from useless piece of electronic crap to interesting
computing device.
&lt;/p&gt;


&lt;a href="http://www.amazon.com/gp/product/B001UBB9GM?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B001UBB9GM"&gt;&lt;img border="0" src="http://gnuru.org:8000/images/31098fOvj3L._SL160_.jpg"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=gnuruorg-20&amp;l=as2&amp;o=1&amp;a=B001UBB9GM" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;

&lt;h3&gt;Finding and storing the FirewireGuid&lt;/h3&gt;

&lt;p&gt;
There was still a problem.  gtkpod could copy music files across to
the iPod touch, but it couldn't write to the iPod database, so the
iPod couldn't see the music that was on its hard disk.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://gtkpod.wikispaces.com/Sysinfo+File"&gt;The reason for this was&lt;/a&gt;:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
Starting with the 2007 generation of iPods, libgpod needs an
additional configuration step to correctly modify the iPod
content. libgpod needs to know the so-called iPod "firewire id",
otherwise the iPod won't recognize what libgpod wrote to it and will
behave as if it's empty.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
The first step to fixing this was to get the 40-character unique identifier
for the iPod. On your Linux computer do:
&lt;/p&gt;
&lt;pre class="example"&gt;
lsusb -v | grep -i iSerial
&lt;/pre&gt;

&lt;p&gt;
Something like this should appear:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
iSerial                 3 2fffccffda5c69bc16ea3fc1e53537259ff4a514
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
The first 16 digits of this is the FirewireGuid. On the iPod there
should be a Device/SysInfo file.  If not we create it:
&lt;/p&gt;
&lt;pre class="example"&gt;
cd /media/iPod/iTunes_Control
mkdir Device
echo "FirewireGuid: 2fffccffda5c69bc" &amp;gt; Device/SysInfo
&lt;/pre&gt;

&lt;p&gt;
After doing all that, when I restarted gtkpod, everything was be working.
&lt;/p&gt;


&lt;h3&gt;Final Thoughts&lt;/h3&gt;

&lt;p&gt;
Using these steps I was able to get gtkpod to read and write to the
iPod and I can add and delete music from this originally &lt;a href="http://www.defectivebydesign.org/"&gt;defective-by-design&lt;/a&gt;
piece of machinery.
&lt;/p&gt;
&lt;p&gt;
A big thanks to the writer of Spirit Jailbreak, to the developers of
gtkpod, of fuse and of everything on Linux that make it possible to conquer
Apple's products.
&lt;/p&gt;


&lt;a href="http://www.amazon.com/gp/product/B0041E16RC?ie=UTF8&amp;tag=gnuruorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B0041E16RC"&gt;&lt;img border="0" src="http://gnuru.org:8000/images/41NAPsfeVaL._SL160_.jpg"&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=gnuruorg-20&amp;l=as2&amp;o=1&amp;a=B0041E16RC" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;

&lt;p&gt;
&lt;b&gt;TIPS&lt;/b&gt;:
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
make sure you have the latest version of libgpod4
&lt;/li&gt;
&lt;li&gt;
ifuse &amp;ndash;root /media/mountpoint mounts the iPod's root file system
&lt;/li&gt;
&lt;li&gt;
you can backup all the files on the iPod with &lt;tt&gt;rsync -aP /media/iPod /backup/dir&lt;/tt&gt;
&lt;/li&gt;
&lt;li&gt;
reconcile the files on the iPod HD and in the iPod DB with gtkpod's
'Check ipod files' command

&lt;/li&gt;
&lt;/ul&gt;&lt;a href="http://gnuru.org/article/1557/ipod-touch-iphone-linux-making-it-all-work"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1557/ipod-touch-iphone-linux-making-it-all-work#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/_1Bo0aEB4p4" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1557/ipod-touch-iphone-linux-making-it-all-work</guid>
<pubDate>Tue, 08 Mar 2011 21:36:32 GMT</pubDate>
</item>
<item>
<title>Openbox: automounting and autostarting</title>
<link>http://gnuru.org/article/1553/openbox-automounting-autostarting</link>
<description>&lt;p&gt;Remember, remember.&lt;/p&gt;

&lt;p&gt;To autostart applications when you are running OpenBox, put the commands in:&lt;/p&gt;

&lt;pre class="codeblock"&gt;~/.config/openbox/autostart.sh&lt;/pre&gt;

&lt;p&gt;To automount usb drives etc, put:&lt;/p&gt;

&lt;pre class="codeblock"&gt;ivman &amp;&lt;/pre&gt;

&lt;p&gt;in &lt;tt&gt;~/.config/openbox/autostart.sh&lt;/tt&gt;.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1553/openbox-automounting-autostarting"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1553/openbox-automounting-autostarting#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/M1QFXvi-2yQ" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1553/openbox-automounting-autostarting</guid>
<pubDate>Sat, 05 Mar 2011 08:11:05 GMT</pubDate>
</item>
<item>
<title>Locale: Customising and Making Your Own Date and Time</title>
<link>http://gnuru.org/article/1551/locale-customising-making-your-own-date-time</link>
<description>&lt;p&gt;
The 'locale' system on every Linux computer is a way of customising
the way certain things work.
&lt;/p&gt;
&lt;p&gt;
It determines how numbers and currencies should be displayed, sets the
paper size for printing, and the formats for time and date, amongst
other things. In short, the 'locale' is a way to ensure a computer
respects certain practices in certain countries or language
communities.
&lt;/p&gt;
&lt;p&gt;
The 'locale' system forms part of glibc, the GNU C Library, which is
at the base of many pieces of software.
&lt;/p&gt;
&lt;p&gt;
Like everything in Linux, it is possible to change the 'locale' files
to suit particular tastes or practices. You might want to do this if,
for example, you don't like the way dates are displayed.
&lt;/p&gt;
&lt;p&gt;
I found that the information out there about locales and how to change
is fairly sparse. Here I've gathered what I've found.
&lt;/p&gt;
&lt;p&gt;
On Debian systems and perhaps most other forms of Linux, the local
files are in &lt;tt&gt;/usr/share/i18n/locales/&lt;/tt&gt;.  All locales are named in the
following way: &lt;tt&gt;xx_YY&lt;/tt&gt;, where xx is a two character name for a language
and YY is the two character name for a country.  So &lt;tt&gt;en_US&lt;/tt&gt;, will be the
locale for English in the US,  &lt;tt&gt;en_GB&lt;/tt&gt; the locale for
English in Great Britain and &lt;tt&gt;cy_GB&lt;/tt&gt; the locale for Welsh spoken in
Great Britain.
&lt;/p&gt;
&lt;p&gt;
Typing 'locale' at the command prompt will give you a list of certain
environment variables and their locale settings.  The environment
variable &lt;tt&gt;LC_TIME&lt;/tt&gt; determines how the time is displayed, whereas the
environment variable &lt;tt&gt;LC_NUMERIC&lt;/tt&gt; determines how numbers are
displayed, for example, what characters to use for the decimal point
and thousands seperator.
&lt;/p&gt;
&lt;p&gt;
If you use the 'locale' command with the 'k' switch, say &lt;tt&gt;locale -k LC_NUMERIC&lt;/tt&gt;, you will get a list of names and values for select
keywords. For example, if your locale is &lt;tt&gt;en_GB&lt;/tt&gt;, the &lt;tt&gt;decimal_point&lt;/tt&gt;
keyword will be set to '.', whereas if your locale is set to &lt;tt&gt;fr_FR&lt;/tt&gt;,
it will be set to ','.
&lt;/p&gt;
&lt;p&gt;
Why I got interested in locales was because of the way that dates were
being displayed in the &lt;tt&gt;cs_CZ&lt;/tt&gt; locale.
&lt;/p&gt;
&lt;p&gt;
How dates and times are displayed is determined by the &lt;tt&gt;LC_TIME&lt;/tt&gt;
environment variable. The settings can be determined by doing &lt;tt&gt;locale -k LC_TIME&lt;/tt&gt;. The settings that interested me &lt;a href="http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html"&gt;are as follows&lt;/a&gt;:
&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;&lt;tt&gt;date_fmt&lt;/tt&gt;&lt;/dt&gt;&lt;dd&gt;
this determines how the 'date' command without any
arguments dispays the date.

&lt;/dd&gt;
&lt;dt&gt;&lt;tt&gt;d_t_format&lt;/tt&gt;&lt;/dt&gt;&lt;dd&gt;
defines how the date and time are displayed when the
'%c' format sequence is used, as in &lt;tt&gt;date +%c&lt;/tt&gt;

&lt;/dd&gt;
&lt;dt&gt;&lt;tt&gt;d_fmt&lt;/tt&gt;&lt;/dt&gt;&lt;dd&gt;
defines how the date is displayed using the '%x' format as
in &lt;tt&gt;date +%x&lt;/tt&gt;

&lt;/dd&gt;
&lt;dt&gt;&lt;tt&gt;t_fmt&lt;/tt&gt;&lt;/dt&gt;&lt;dd&gt;
defines how the time is displayed as if with the '%X'
format as in &lt;tt&gt;date +%X&lt;/tt&gt;.


&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;The best way to change a locale, at least on my system, is to create a
custom locale, using a file name containing '@'. So, if you want to
amend the &lt;tt&gt;en_GB&lt;/tt&gt; locale you copy it to something like &lt;tt&gt;en_GB@custom&lt;/tt&gt;,
then edit it.
&lt;/p&gt;
&lt;p&gt;
There are a few notes on what to do &lt;a href="http://ccollins.wordpress.com/2009/01/06/how-to-change-date-formats-on-ubuntu/"&gt;here&lt;/a&gt;. These are the steps I recommend:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Test how you would like the date command to display a date by
reference to the date man page, for example, you might like the date
displayed using this format string: "&lt;tt&gt;%A %-e. %b %Y %H.%M:%S %:z&lt;/tt&gt;".
&lt;/li&gt;
&lt;li&gt;
Convert the format string to unicode code points.  A conversion tool is &lt;a href="http://people.w3.org/rishida/tools/conversion/"&gt;here&lt;/a&gt;.
&lt;/li&gt;

&lt;li&gt;
Edit the values of the formats using the string of code points. So
that it looks something like this:
&lt;tt&gt;date_fmt="&amp;lt;U0025&amp;gt;&amp;lt;U0041&amp;gt;&amp;lt;U0020&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U002D&amp;gt;&amp;lt;U0065&amp;gt;&amp;lt;U002E&amp;gt;&amp;lt;U0020&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U0062&amp;gt;&amp;lt;U0020&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U0059&amp;gt;&amp;lt;U0020&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U0048&amp;gt;&amp;lt;U002E&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U004D&amp;gt;&amp;lt;U003A&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U0053&amp;gt;&amp;lt;U0020&amp;gt;&amp;lt;U0025&amp;gt;&amp;lt;U003A&amp;gt;&amp;lt;U007A&amp;gt;"&lt;/tt&gt;

&lt;/li&gt;
&lt;li&gt;
Copy your edited locale file to /usr/share/i18n/locales.
&lt;/li&gt;
&lt;li&gt;
Edit the &lt;tt&gt;/etc/locale.gen&lt;/tt&gt; to make sure that you compile your new
custom locale file, like this &lt;tt&gt;echo en_XX.UTF-8 UTF-8 &amp;gt;&amp;gt; /etc/locale.gen&lt;/tt&gt;
&lt;/li&gt;
&lt;li&gt;
Run &lt;tt&gt;locale_gen&lt;/tt&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, you can set the custom locale as your default or put it in your
profile file on a per user basis, or just at the command line:
&lt;tt&gt;export LC_TIME=en_GB.utf8@custom&lt;/tt&gt;.
&lt;/p&gt;
&lt;p&gt;
More information:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
There is some basic information on fixing a locale &lt;a href="https://www.meganerd.ca/site/node/30"&gt;here&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
IBM has provided some detailed information &lt;a href="http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.files/doc/aixfiles/LC_TIME.htm"&gt;here&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://translate.sourceforge.net/wiki/guide/locales/glibc"&gt;Here is another guide to writing a locale file&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://zaf.svn.sourceforge.net/viewvc/zaf/trunk/locale/locale-escape%3Fview=markup"&gt;Tool to convert utf sources files into escaped ascii&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.avawn.net/"&gt;This web site has a good way of fixing the locale&lt;/a&gt;, however, there is no permalink.
&lt;/li&gt;
&lt;li&gt;
Some info for Solaris is &lt;a href="http://qref.sourceforge.net/quick/ch-tune.en.html"&gt;here&lt;/a&gt;.

&lt;/li&gt;
&lt;/ul&gt;&lt;a href="http://gnuru.org/article/1551/locale-customising-making-your-own-date-time"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1551/locale-customising-making-your-own-date-time#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/u77nbV487W4" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1551/locale-customising-making-your-own-date-time</guid>
<pubDate>Wed, 02 Feb 2011 15:05:24 GMT</pubDate>
</item>
<item>
<title>Extracting aac Audio from a flv File</title>
<link>http://gnuru.org/article/1549/extracting-aac-audio-flv-file</link>
<description>&lt;p&gt;First determine what type of audio is in the flv file:&lt;/p&gt;

&lt;pre class="codeblock"&gt;ffmpeg -i input.flv&lt;/pre&gt;

&lt;p&gt;There should be a line containing something like this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;Stream #0.1: Audio: aac, 44100 Hz, stereo, s16&lt;/pre&gt;

&lt;p&gt;Now extract the audio:&lt;/p&gt;

&lt;pre class="codeblock"&gt;ffmpeg -i input.flv -acodec copy audio.aac&lt;/pre&gt;

&lt;p&gt;Change input.flv and audio.aac appropriately.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1549/extracting-aac-audio-flv-file"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1549/extracting-aac-audio-flv-file#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/yAnaWILgt0w" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1549/extracting-aac-audio-flv-file</guid>
<pubDate>Thu, 27 Jan 2011 09:32:48 GMT</pubDate>
</item>
<item>
<title>Howto convert an avi video to dv</title>
<link>http://gnuru.org/article/1547/howto-convert-avi-video-dv</link>
<description>&lt;pre class="codeblock"&gt;ffmpeg -i video.avi -target ntsc-dv video.dv&lt;/pre&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;pre class="codeblock"&gt;ffmpeg -i video.avi -target pal-dv video.dv&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.misterhowto.com/index.php?category=Computers&amp;subcategory=Video&amp;article=avi_to_dv_with_ffmpeg"&gt;Hat tip&lt;/a&gt;.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1547/howto-convert-avi-video-dv"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1547/howto-convert-avi-video-dv#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/mEHNQZZEKwc" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1547/howto-convert-avi-video-dv</guid>
<pubDate>Tue, 25 Jan 2011 19:44:01 GMT</pubDate>
</item>
<item>
<title>Convert a Unicode Character into its Hex Codepoint</title>
<link>http://gnuru.org/article/1546/convert-unicode-character-into-its-hex-codepoint</link>
<description>&lt;p&gt;Here's how to convert a unicode character into its hexadecimal codepoint in perl:&lt;/p&gt;

&lt;pre class="codeblock"&gt;printf "%04X", ord($char);&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1546/convert-unicode-character-into-its-hex-codepoint"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1546/convert-unicode-character-into-its-hex-codepoint#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/UQzVQBdNiac" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1546/convert-unicode-character-into-its-hex-codepoint</guid>
<pubDate>Tue, 18 Jan 2011 14:49:30 GMT</pubDate>
</item>
<item>
<title>Today I Booted into Windows and Now I'm Mentally Deranged</title>
<link>http://gnuru.org/article/1545/today-i-booted-into-windows-now-i-m-mentally-deranged</link>
<description>&lt;p&gt;
Do all Windows developers think their users are idiots or only the
ones who work for Garmin?
&lt;/p&gt;
&lt;p&gt;
I acquired a Garmin nuvi 1200, an entry-level GPS navigation
device. It works OK, and is cheap; a big advantage.
&lt;/p&gt;
&lt;p&gt;
Garmin like you to receive map updates online, which is fine in this
online, connected world.  I mean why do anything physically when you
can do it from the comfort of your office chair?
&lt;/p&gt;
&lt;p&gt;
The GPS device in question  has a USB
connection and announces itself to the computer as a USB mass storage device.  Therefore, it's
possible to mount it and browse it as you would a disk.
&lt;/p&gt;
&lt;p&gt;
The problem (and it is a big problem) is that the Garmin update software
won't work on Linux.  There are plenty of reports floating around the
internet that many people are able to update their Garmin devices
using wine.  But this won't work for me.
&lt;/p&gt;
&lt;p&gt;
Therefore, I had to boot into Windows for real.  Naturally, the
Windows partition is small because it isn't used for anything.
&lt;/p&gt;
&lt;p&gt;
What is really disturbing is not Windows itself, but the attitude of
people who write software for Windows - in particular the writers of
the Garmin updater. They seem to operate on the
assumption that their users are stupid.
&lt;/p&gt;
&lt;p&gt;
The update file downloaded from Garmin was big - about 8GB. I didn't
have that much space on the Windows partition.  If that happens to
you, you would  normally
download it elsewhere right? Do you
think Garmin would let you download it and then install it later? No.
Do you think Garmin would allow you to select the download directory?
No.  WHY NOT?
&lt;/p&gt;
&lt;p&gt;
What I had to do, was change the Windows temporary folder to somewhere
else (removable USB stick). Once done, the updater worked fine. But
why is such stupid mucking about necessary at all?
&lt;/p&gt;
&lt;p&gt;
Garmin, have a little respect for your users.  They are not all
computer illiterate, virus infested, Explorer-using idiots.  In fact,
I'd say many people who buy GPS devices are reasonable smart.
&lt;/p&gt;
&lt;p&gt;
So, Garmin, what about coding with
respect.  Here's some advice:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
All the downloaded files should be able to be easily copied across to the device
so Linux users can do it with 'cp' or maybe 'rsync'. I mean,
they're only map files, you're special installer is totally
redundant and a complete PITA.
&lt;/li&gt;
&lt;li&gt;
Allow users to download the update file, save it, and install it
later.  This way when downloading humongous 8GB update files you
stop torturing them with dropped connections and having to leave the
computer on all night to complete the download.
&lt;/li&gt;
&lt;li&gt;
Allow users to download the file to a directory of their choice.

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is not asking too much is it?
&lt;/p&gt;
&lt;p&gt;
&amp;lt;/end of rant&amp;gt;
&lt;/p&gt;&lt;a href="http://gnuru.org/article/1545/today-i-booted-into-windows-now-i-m-mentally-deranged"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1545/today-i-booted-into-windows-now-i-m-mentally-deranged#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/ue0f1a_o1TQ" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1545/today-i-booted-into-windows-now-i-m-mentally-deranged</guid>
<pubDate>Fri, 07 Jan 2011 15:02:26 GMT</pubDate>
</item>
<item>
<title>Compiling a Debian Kernel 2</title>
<link>http://gnuru.org/article/1544/compiling-debian-kernel-2</link>
<description>&lt;p&gt;Some time ago, I did a &lt;a href="http://gnuru.org/article/1423/compiling-debian-kernel"&gt;'note to self' on how to compile a debian
kernel&lt;/a&gt;. Here's an updated 'note to self'.&lt;/p&gt;

&lt;p&gt;Assuming I have an old version of the kernel already
installed:&lt;/p&gt;

&lt;pre class="codeblock"&gt;cd /usr/src/linux/
make-kpkg clean&lt;/pre&gt;

&lt;p&gt;Configure the modules I need:&lt;/p&gt;

&lt;pre class="codeblock"&gt;make menuconfig&lt;/pre&gt;

&lt;p&gt;Then compile the kernel and headers. I think it's wise
to build the headers as well as the kernel itself to avoid problems
later if I need to compile extra modules.&lt;/p&gt;

&lt;pre class="codeblock"&gt;fakeroot make-kpkg --initrd --revision=custom.1.0 kernel_image kernel_headers&lt;/pre&gt;

&lt;p&gt;Replacing &lt;tt&gt;custom.1.0&lt;/tt&gt; with a string of my choice.&lt;/p&gt;

&lt;p&gt;Now install:&lt;/p&gt;
&lt;pre class="codeblock"&gt;dpkg -i ../linux-image-2.6.32-custom.1.0_i386.deb
dpkg -i ../linux-headers-2.6.32-custom.1.0_i386.deb
&lt;/pre&gt;

&lt;p&gt;And reboot.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1544/compiling-debian-kernel-2"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1544/compiling-debian-kernel-2#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/--OdaHmuSWA" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1544/compiling-debian-kernel-2</guid>
<pubDate>Sat, 18 Dec 2010 22:14:38 GMT</pubDate>
</item>
<item>
<title>Everyone with More than One Computer Needs This</title>
<link>http://gnuru.org/article/1541/everyone-with-more-than-one-computer-needs-this</link>
<description>&lt;p&gt;Every person with more than one computer needs this.&lt;/p&gt;

&lt;pre class="codeblock"&gt;sudo apt-get install x11vnc&lt;/pre&gt;

&lt;p&gt;This installs a vnc server on one computer. On another computer do this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;sudo apt-get install xtightvncviewer&lt;/pre&gt;

&lt;p&gt;This installs a vnc client.&lt;/p&gt;

&lt;p&gt;On the computer whose desktop you want access to (i.e. on the
server) do something like this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;x11vnc -many -passwd &lt;password&gt; -ncache 10&lt;/pre&gt;

&lt;p&gt;Substitute a suitable password for &amp;lt;password&amp;gt;. The option
represented by the switch -ncache is a way to lessen redundant network
activity.&lt;/p&gt;

&lt;p&gt;Now, you can work on the 'desktop' of one computer from the desktop
of another.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1541/everyone-with-more-than-one-computer-needs-this"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1541/everyone-with-more-than-one-computer-needs-this#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/mWzsMnzCJrw" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1541/everyone-with-more-than-one-computer-needs-this</guid>
<pubDate>Mon, 13 Dec 2010 13:43:20 GMT</pubDate>
</item>
<item>
<title>Blocking a Website with iptables</title>
<link>http://gnuru.org/article/1539/blocking-website-with-iptables</link>
<description>&lt;p&gt;I've been been tring to block a website with
iptables. This iptables rule seems to work:&lt;/p&gt;

&lt;pre class="codeblock"&gt;sudo iptables -A OUTPUT -d www.facebook.com -j REJECT&lt;/pre&gt;&lt;a href="http://gnuru.org/article/1539/blocking-website-with-iptables"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1539/blocking-website-with-iptables#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/8STpe_kPyNw" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1539/blocking-website-with-iptables</guid>
<pubDate>Tue, 07 Dec 2010 13:54:55 GMT</pubDate>
</item>
<item>
<title>Free iTunes Podcasts on Linux</title>
<link>http://gnuru.org/article/1532/free-itunes-podcasts-on-linux</link>
<description>&lt;p&gt;iTunes has become the only way for many people todistribute their audio content. This is a great pity, because iTunes is evil.&lt;/p&gt;

&lt;p&gt;Ridiculously, iTunes only allows people who use the iTunes client to download content.  And iTunes has not seen fit to supply such a client for Linux. This means that Linux users can't listen to some popular free podcasts.&lt;/p&gt;

&lt;p&gt;Fortunately, help is at hand.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://picklemonkey.net/flipper/convert.php"&gt;Feed Flipper&lt;/a&gt; is a nifty little web app written by Adam Schlitt that converts a retarded iTunes feed into a RSS feed that can be read by AmaroK, RhythmBox or your favourite music player.&lt;/p&gt;

&lt;p&gt;It's easy to use, just copy and paste the iTunes URL into the box on the &lt;a href="http://picklemonkey.net/flipper/convert.php"&gt;Feed Flipper convert page&lt;/a&gt; and then copy and paste the URL displayed at the bottom of the page into your music player&lt;/p&gt;

&lt;p&gt;Brilliant!&lt;/p&gt;&lt;a href="http://gnuru.org/article/1532/free-itunes-podcasts-on-linux"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1532/free-itunes-podcasts-on-linux#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/G0-JfWx1Ssw" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1532/free-itunes-podcasts-on-linux</guid>
<pubDate>Tue, 09 Nov 2010 11:31:48 GMT</pubDate>
</item>
<item>
<title>Is almost every popular web content management system just plain wrong?</title>
<link>http://gnuru.org/article/1528/is-almost-every-popular-web-content-management-system-just-plain-wrong</link>
<description>&lt;p&gt;There was an interesting &lt;a href="http://www.perlmonks.org/?node_id=869612"&gt;discussion&lt;/a&gt; on perlmonks about the use of
primary keys in databases.&lt;/p&gt;

&lt;p&gt;The purpose of a primary key is to
identify a row of data (a &lt;i&gt;tuple&lt;/i&gt;) in a unique way. To achieve
this end, many website back-ends identify each
database row with a unique integer that is automatically inserted
every time a new row is saved into the database.&lt;/p&gt;

&lt;p&gt; This is guaranteed to
give each row a unique identifier and therefore, superficially, it sounds like an
good idea. However:
&lt;/p&gt;
&lt;p&gt;
&lt;blockquote&gt;
The essential problem is that an autonumber "id" column contains no
information about the record to which it's connected, and tells you
nothing about that record. It could be a duplicate, it could be
unique, it could have ceased to exist&amp;hellip;
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;p&gt;
That quote is from &lt;a href="http://it.toolbox.com/blogs/database-soup/primary-keyvil-part-i-7327"&gt;here&lt;/a&gt;. &lt;a href="http://it.toolbox.com/blogs/database-soup/primary-keyvil-part-iii-7365"&gt;Here&lt;/a&gt; is a discussion  of reasons often given for using
unique integers to identify database rows. The passage below is 
particularly interesting because the use of integer primary keys is
standard practice on websites and web-based content management systems:
&lt;/p&gt;
&lt;p&gt;
&lt;blockquote&gt;
Bad. Both the SQL Standard and the Design Principles arguments are
based on willful ignorance. Generally the developer using these
rationales heard from a friend of a collegue who read someone's blog
who took a course at the University that ID columns were a good idea,
and is adhering to this piece of pseudo-knowledge like a limpet, lest
he or she be required to go out and get some real education. That some
of these self-blinded designers are also book and article authors is
really tragic. For the record, neither the SQL Standard nor relational
theory compel the use of surrogate keys. In fact, the papers which
established relational theory don't even mention surrogate keys.
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;p&gt;
So, if you aren't supposed to use integer primary keys in a web
application, what are you supposed to use?  Something that really does uniquely
and &lt;b&gt;naturally&lt;/b&gt; identify each and every database row? What might that be?
&lt;/p&gt;
&lt;p&gt;
And if we can't answer that question, perhaps the RDMS is the wrong
solution for serving web pages.
&lt;/p&gt;
&lt;p&gt;
Just a thought.
&lt;/p&gt;&lt;a href="http://gnuru.org/article/1528/is-almost-every-popular-web-content-management-system-just-plain-wrong"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1528/is-almost-every-popular-web-content-management-system-just-plain-wrong#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/WZBmrvLNkuM" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1528/is-almost-every-popular-web-content-management-system-just-plain-wrong</guid>
<pubDate>Mon, 08 Nov 2010 19:54:06 GMT</pubDate>
</item>
<item>
<title>Gnumeric: Change rows into columns</title>
<link>http://gnuru.org/article/1524/gnumeric-change-rows-into-columns</link>
<description>&lt;p&gt;Sometimes, the best tool for a job is a Spreadsheet.  When I have to use a spreadsheet I prefer Gnumeric to the over-bloated OpenOffice.&lt;/p&gt;

&lt;p&gt;Today, I pasted (from a Website) a couple of rows of figures into Gnumeric. However, I didn't want these figures in rows, but in columns.  The solution is easy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select and copy the relevant rows.&lt;/li&gt;
&lt;li&gt;Choose 'Paste Special...' from the 'Edit' menu.&lt;/li&gt;
&lt;li&gt;Click the 'Transpose' box and then 'OK'. &lt;br /&gt;&lt;br /&gt;&lt;img src="/images/pastespecial144x178.png" width="144" height="178" alt="Paste Special Dialogue" style="text-align: center" /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wow! The rows are now columns.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1524/gnumeric-change-rows-into-columns"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1524/gnumeric-change-rows-into-columns#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/Uvw5eM99_W8" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1524/gnumeric-change-rows-into-columns</guid>
<pubDate>Mon, 01 Nov 2010 13:31:07 GMT</pubDate>
</item>
<item>
<title>Copying with scp from STDIN</title>
<link>http://gnuru.org/article/1522/copying-with-scp-stdin</link>
<description>&lt;p&gt;The premier tool for copying a file or two from one machine to another is &lt;tt&gt;scp&lt;/tt&gt;.  It's simple.  It's effective. That's why there's a &lt;a href="https://internal.lboro.ac.uk/mail/public/lulu/2002-10/msg00029.html"&gt;FAQ&lt;/a&gt;, which is will &lt;tt&gt;scp&lt;/tt&gt; accept data from STDIN?&lt;/p&gt;

&lt;p&gt;The answer is 'no'.&lt;/p&gt;

&lt;p&gt;Some people complain about this, but it's not a bug, it's a feature.&lt;/p&gt;

&lt;p&gt;If you want to take a stream of data on a computer and dump it in a file, you don't use the &lt;tt&gt;cp&lt;/tt&gt; command, do you?  Rather, you do something like this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;echo "some text" &gt; afile.txt&lt;/pre&gt;

&lt;p&gt;What's true of an operation on one machine is true of an operation across machines.  So, if you have a stream of data produced by a script on one machine and you want it in a file on another machine, that's not copying the data, it's storing some data produced on one machine in a file on another machine.&lt;/p&gt;

&lt;p&gt;When the problem is reframed like that, a number of solutions become apparent.  Probably the easiest is this:&lt;/p&gt;

&lt;pre class="codeblock"&gt;echo "some text" | ssh user@remote.host "cat &gt; /remote/file"&lt;/pre&gt;

&lt;p&gt; Obviously, &lt;tt&gt;echo "some text"&lt;/tt&gt; should be changed to any command or script that produces a stream of data to STDOUT and the host and file names should be changed as appropriate.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1522/copying-with-scp-stdin"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1522/copying-with-scp-stdin#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/DuCl-09ExpA" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1522/copying-with-scp-stdin</guid>
<pubDate>Sat, 30 Oct 2010 15:44:02 BST</pubDate>
</item>
<item>
<title>Changing Mouse Sensitivity from the Command Line</title>
<link>http://gnuru.org/article/1520/changing-mouse-sensitivity-command-line</link>
<description>&lt;p&gt;If you want to change how fast the mouse goes with out using a Control Panel you can use the &lt;tt&gt;xset&lt;/tt&gt; command:

&lt;pre class="codeblock"&gt;xset m 2 10&lt;/pre&gt;

&lt;p&gt;The above command means the mouse will move twice as fast when it moves 10 or more pixels. From the &lt;tt&gt;xset&lt;/tt&gt; man page:&lt;/p&gt;

&lt;blockquote&gt;The  m option controls the mouse parameters; it may be abbreviated to 'm'.  The parameters for the mouse
               are 'acceleration' and 'threshold'.  The acceleration can be specified as an integer,  or  as  a  simple
               fraction.   The  mouse, or whatever pointer the machine is connected to, will go 'acceleration' times as
               fast when it travels more than 'threshold' pixels in a short time.  This way, the mouse can be used  for
               precise  alignment  when it is moved slowly, yet it can be set to travel across the screen in a flick of
               the wrist when desired.  One or both parameters for the m option can be omitted,  but  if  only  one  is
               given,  it will be interpreted as the acceleration.  If no parameters or the flag 'default' is used, the
               system defaults will be set.&lt;/blockquote&gt;

&lt;p&gt;To make the change permanent add the command to your &lt;tt&gt;.xsession&lt;/tt&gt; file.&lt;/p&gt;&lt;a href="http://gnuru.org/article/1520/changing-mouse-sensitivity-command-line"&gt;Read More&lt;/a&gt; | &lt;a href="http://gnuru.org/article/1520/changing-mouse-sensitivity-command-line#comments"&gt;Comments&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/Gnuruorg/~4/Syc7m8HbQkw" height="1" width="1"/&gt;</description>
<guid isPermaLink="true">http://gnuru.org/article/1520/changing-mouse-sensitivity-command-line</guid>
<pubDate>Thu, 23 Sep 2010 14:05:55 BST</pubDate>
</item>
</channel>
</rss>

