<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<?xml-stylesheet type="text/css" href="http://nb.inode.co.nz/styles/feed.css"?>
<title type="html">iNode: Nota Bene</title>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz" />
<link rel="self" type="application/atom+xml" href="http://nb.inode.co.nz/atom.xml" />
<updated>2008-10-21T01:12:46-12:00</updated>
<author>
<name>Jim Cheetham</name>
<uri>http://nb.inode.co.nz</uri>
</author>
<id>http://nb.inode.co.nz/</id>
<generator uri="http://nanoblogger.sourceforge.net" version="3.3">NanoBlogger</generator>
<entry>
<title type="html">Dedicate an Ubuntu console to music playback</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/10/21/index.html#e2008-10-21T01_11_21.txt" />
<id>http://nb.inode.co.nz/archives/2008/10/21/index.html#e2008-10-21T01_11_21.txt</id>
<published>2008-10-21T01:11:21-12:00</published>
<updated>2008-10-21T01:11:21-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>My good speakers are hooked up to an old server machine, which presents through a nice small 15" LCD
monitor on the desk.</P>
<P>The server doesn&#39;t run a GUI of course, so I do music playback from the commandline with programs
like <KBD>mpg123</KBD> and <KBD>mp3blaster</KBD>.</P>
<P>I decided to dedicate the first text console to playback, so I needed to replace the login prompt
with the mp3blaster program. I hadn&#39;t noticed that Ubuntu no longer has an <KBD>/etc/inittab</KBD> file,
because it has switched to the more flexible <A HREF='http://upstart.ubuntu.com/'>Upstart</A> system, so it took
a few minuted to find out how to get this set up.</P>
<H2>Hacking on Upstart</H2>
<P>The first port of call is the <KBD>/etc/event.d/tty1</KBD> file, which by default is running <KBD>getty</KBD> for us.
I&#39;m keeping <KBD>getty</KBD> (although other tty programs are out there and may do the job in a nicer way),
so I need to ask it to run different &ldquo;login&rdquo; program, using the <KBD>-n</KBD>
and <KBD>-l</KBD> options. Just for luck, I also set the TERM type explicitly.</P>
<P><KBD>getty</KBD> doesn&#39;t like to send arguments to the login program, so I had to set up a small script to do
the hard work. Make sure that the filesystem this script lives in is available when Upstart is
started &hellip; however I suspect that Upstart is actually smart enough to figure this out :-)</P>
<P><KBD>/etc/event.d/tty1</KBD></P>
<PRE># tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
#exec /sbin/getty 38400 tty1
exec /sbin/getty -n -l /usr/local/bin/jimp3 38400 tty1 linux</PRE>
<P>
Next, the helper script; I need to invoke <KBD>mp3blaster</KBD> autostarting a playlist, but I also want it
to run as my user, rather than root. Good old <KBD>su</KBD> is a simple way of achieving this.</P>
<P><KBD>/usr/local/bin/jimp3</KBD></P>
<PRE>#!/bin/sh
/bin/su -c '/usr/bin/mp3blaster -a /home/jim/allmusic.lst' -- jim</PRE>
<H2>Do NOT reboot!</H2>
<P>No need to reboot the server to get this all running! Use the <KBD>initctl</KBD> command to find the &lsquo;tty1&rsquo;
job that is currently running a login shell, stop it and then restart it.</P>
<PRE># initctl list
control-alt-delete (stop) waiting
logd (stop) waiting
rc-default (stop) waiting
rc0 (stop) waiting
rc1 (stop) waiting
rc2 (stop) waiting
rc3 (stop) waiting
rc4 (stop) waiting
rc5 (stop) waiting
rc6 (stop) waiting
rcS (stop) waiting
rcS-sulogin (stop) waiting
sulogin (stop) waiting
tty1 (start) running, process 5622
tty2 (start) running, process 4235
tty3 (start) running, process 4236
tty4 (start) running, process 4230
tty5 (start) running, process 4231
tty6 (start) running, process 4238</PRE>
<PRE># initctl stop tty1
tty1 (stop) running, process 5622
tty1 (stop) pre-stop, (main) process 5622
tty1 (stop) stopping, process 5622
tty1 (stop) killed, process 5622
tty1 (stop) post-stop
tty1 (stop) waiting</PRE>
<PRE># initctl start tty1
tty1 (start) waiting
tty1 (start) starting
tty1 (start) pre-start
tty1 (start) spawned, process 6469
tty1 (start) post-start, (main) process 6469
tty1 (start) running, process 6469</PRE>
<P>
Job done! You should now have a copy of mp3blaster running on the first virtual console, playing your playlist for you, as your userid &hellip; and if you quit the program, it&#39;ll restart straight away.</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html"></title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/10/12/index.html#e2008-10-12T21_04_12.txt" />
<id>http://nb.inode.co.nz/archives/2008/10/12/index.html#e2008-10-12T21_04_12.txt</id>
<published>2008-10-12T21:04:12-12:00</published>
<updated>2008-10-12T21:04:12-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[]]>
</div>
</content>
</entry>
<entry>
<title type="html">The WindFire Cursor kite ...</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/10/01/index.html#e2008-10-01T21_05_43.txt" />
<id>http://nb.inode.co.nz/archives/2008/10/01/index.html#e2008-10-01T21_05_43.txt</id>
<published>2008-10-01T21:05:43-12:00</published>
<updated>2008-10-01T21:05:43-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>Tim Elverston&#39;s latest kite appeals to the computer geek &hellip;</P>
<P><A HREF='http://www.windfiredesigns.com/timbofolio_pages/PointerKite.html'>http://www.windfiredesigns.com/timbofolio_pages/PointerKite.html</A></P>
<P><IMG SRC='/images/WindFireOSCursor.jpg' ALT='/images/WindFireOSCursor.jpg' TITLE='/images/WindFireOSCursor.jpg' /></P>
<P>He promises more to come in the OS series of kites &hellip;. probably Windows :-(</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">Goodbye Twitter</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/09/01/index.html#e2008-09-01T09_26_05.txt" />
<id>http://nb.inode.co.nz/archives/2008/09/01/index.html#e2008-09-01T09_26_05.txt</id>
<published>2008-09-01T09:26:05-12:00</published>
<updated>2008-09-01T09:26:05-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>I&#39;ve been using Twitter for a little while; racked up just over 100 tweets. But at the end of the
day, there was nothing of lasting value coming through, no point in telling people what I&#39;m doing,
I&#39;d rather be doing things than talking about doing them.</P>
<P>Well, there&#39;s the point. On Twitter, you&#39;re not really talking about things, it&#39;s too lightweight.
You can&#39;t say anything <EM>subtle</EM>, unless it&#39;s an in-joke. I&#39;d rather have a few high-quality
interactions than a flood of noise.</P>
<P>It&#39;s an interesting experience to look out at a social network of friends of friends, but a touch
voyeuristic. So, my account is now deleted. Perhaps I&#39;ll get round to more blog entries now &hellip;</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">The legal basis for Free Software (and Open Source)</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/08/14/index.html#e2008-08-14T02_42_13.txt" />
<id>http://nb.inode.co.nz/archives/2008/08/14/index.html#e2008-08-14T02_42_13.txt</id>
<published>2008-08-14T02:42:13-12:00</published>
<updated>2008-08-14T02:42:13-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P><A HREF='http://lessig.org/'>Lawrence Lessig</A> is happy &ndash; a US Court of Appeal has provided precedant for the
theory behind <A HREF='http://www.gnu.org/copyleft/'>copyleft</A> ; the basis behind numerous Free Software
licenses such as the <A HREF='http://www.gnu.org/copyleft/gpl.html'>GNU GPL</A> and specifically in the court
ruling, the <A HREF='http://www.perlfoundation.org/artistic_license_2_0'>Artistic License</A>.</P>
<P>The copyleft premise is this: source code has been published in a written form, therefore copyright
law restricts your ability to distribute copies of it. A Free Software license grants you an
additional license, allowing you to distribute copies; but only if you follow certain conditions.</P>
<P>If you fail to follow the conditions, you are not allowed to claim usage of the Free Software
license; therefore full copyright law is in play, and you cannot distribute copies at all.</P>
<P>However, in the US at least, it hasn&#39;t been clear whether the conditions attached to these Free
Software licenses have actually been &ldquo;conditions&rdquo;, and aren&#39;t just &ldquo;contractual covenants&rdquo;. It makes
a big difference when you break them; in the latter case, you are penalised for breaking a contract,
and that&#39;s all. It would probably result in some monetary damages being due, and they&#39;re difficult
to assess when the original product was generally available without charges being made. However,
given that these clauses are now <EM>known</EM> to be &ldquo;conditions&rdquo;, breaking them means that you have no
license at all, and you are infringing copyright &ndash; and there is no confusion here regarding money
or lack of money.</P>
<P>So, a high-quality precedant from the US legal system supporting the copyleft principal.</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">RMS on New Zealand</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/08/11/index.html#e2008-08-11T05_37_36.txt" />
<id>http://nb.inode.co.nz/archives/2008/08/11/index.html#e2008-08-11T05_37_36.txt</id>
<published>2008-08-11T05:37:36-12:00</published>
<updated>2008-08-11T05:37:36-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>I&#39;ve typed up a transcript of Richard Stallman&#39;s recent interview on the Kim Hill Saturday programme
on Radio New Zealand.</P>
<P>See <A HREF='/articles/rmsrnz/index.html'>/articles/rmsrnz/index.html</A> for the full transcript.</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">Early spam references -- 1891</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/07/03/index.html#e2008-07-03T09_42_37.txt" />
<id>http://nb.inode.co.nz/archives/2008/07/03/index.html#e2008-07-03T09_42_37.txt</id>
<published>2008-07-03T09:42:37-12:00</published>
<updated>2008-07-03T09:42:37-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<H1>Early spam references</H1>
<H2>The Picture of Dorian Gray / Oscar Wilde / 1891</H2>
<H3>Chapter VIII</H3>
<P>
&hellip; He sat up, and, having sipped some tea, turned over his letters. One of them was from Lord
Henry, and had been brought by hand that morning. He hesitated for a moment, and then put it aside.
The others he opened listlessly. They contained the usual collection of cards, invitations to
dinner, tickets for private views, programmes of charity concerts, and the like, that are showered
on fashionable young men every morning during the season. There was a rather heavy bill, for a
chased silver Louis Quinze toilet-set, that he had not yet had the courage to send on to his
guardians, who were extremely old-fashioned people and did not realise that we live in an age where
unnecessary things are our only necessities, and there were several rather courteously worded
communications from Jermyn Street money-lenders offering to advance any sum of money at a moment&#39;s
notice and at the most reasonable rates of interest.</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">Bug hunting ...</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/06/25/index.html#e2008-06-25T10_44_08.txt" />
<id>http://nb.inode.co.nz/archives/2008/06/25/index.html#e2008-06-25T10_44_08.txt</id>
<published>2008-06-25T10:44:08-12:00</published>
<updated>2008-06-25T10:44:08-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>I&#39;m feeling a little virtuous at the moment. Worik on the DUNLug mailing list asked how to delete a
user and eradicate all their files. I said &ldquo; <KBD>deluser &ndash;remove-all-files</KBD> &rdquo;. Worik said that didn&#39;t
work.</P>
<P>Rather than assume that he&#39;d made a mistake, I tried it. It doesn&#39;t work, just like he said. A bug!</P>
<P>We&#39;re both using Ubuntu, so I turned to the <A HREF='http://launchpad.net'>Launchpad</A> and checked for bugs on
the adduser package. There was a &ldquo;fixed&rdquo; bug that said it fixed a specific failure, the inability to
remove the Ubuntu default symlink ~/Examples, in 2006. I checked my test machine, and this was
exactly the problem I was seeing &ndash; everything except ~/Examples had been removed OK.</P>
<P>Further testing showed that the <KBD>--remove-home</KBD> option worked just fine. Hmmm &hellip;</P>
<P>Luckily, <KBD>deluser</KBD> isn&#39;t an executable, it&#39;s a perl script. So I was able to do some digging, even
though my perl is quite rusty (thanks <A HREF='http://perldoc.perl.org/'>http://perldoc.perl.org/</A> !) I added some debug comments and
managed to categorise the problem &hellip; which lead to a fix &hellip; and a small patch file, all submitted
onto the <A HREF='https://bugs.launchpad.net/bugs/34299'>launchpad bug</A>.</P>
<P>Usually I stop at the categorise-and-report stage. It&#39;s nice to be able to propose a fix too :-)</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">MS Word fails basic MS Excel integration</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/06/16/index.html#e2008-06-16T23_49_42.txt" />
<id>http://nb.inode.co.nz/archives/2008/06/16/index.html#e2008-06-16T23_49_42.txt</id>
<published>2008-06-16T23:49:42-12:00</published>
<updated>2008-06-16T23:49:42-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>Yeah, I know I like finding fault with MS &hellip; but I have to work with their tools, too.</P>
<P>I have an Excel spreadsheet, with some currency values formatted as &ldquo;Accounting&rdquo;, which provides
nice alignment of the currency symbol and decimal point.</P>
<P>When these cells are cut/paste&#39;d into Word, the presentation of these cells is &ldquo;preserved&rdquo; by
simulating the alignment with
multiple spaces &hellip; but actually these cause the presentation to break, and the cell contents split
onto multiple lines, and no longer align.</P>
<P>So, the hack would be to replace all those extra spaces, wouldn&#39;t it? Except MS Word doesn&#39;t have
greedy matching! You can&#39;t replace, say, 8 spaces with a pattern of &lt;space&gt;&lt;star&gt; &hellip; or even
&lt;space&gt;&lt;at&gt; (which is the &ldquo;one or more&rdquo; operator). You have to <STRONG>manually</STRONG> repeatedly do replace-all
for decreasing <STRONG>explicit</STRONG> numbers of spaces; e.g. repeat &ldquo;replace-all &lt;space&gt;{8} with &lt;space&gt;&rdquo; until there are no matches,
    then repeat &ldquo;replace-all &lt;space&gt;{4} with &lt;space&gt;&rdquo; until there are no matches, then {2} &hellip;</P>]]>
</div>
</content>
</entry>
<entry>
<title type="html">Dual SIM mobile phones</title>
<author>
<name>Jim Cheetham</name>
</author>
<link rel="alternate" type="text/html" href="http://nb.inode.co.nz/archives/2008/06/09/index.html#e2008-06-09T21_06_30.txt" />
<id>http://nb.inode.co.nz/archives/2008/06/09/index.html#e2008-06-09T21_06_30.txt</id>
<published>2008-06-09T21:06:30-12:00</published>
<updated>2008-06-09T21:06:30-12:00</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<![CDATA[
<P>There has always been a conflict between my personal and working life over the subject of a mobile
phone. My employer needs me to have a mobile phone, and provides it (well, at least the SIM! And a
&lsquo;free&rsquo; handset to a reasonable value too). I also value having a mobile phone of my own; but I don&#39;t
want to carry two.</P>
<P>Therefore I have to use just the one incoming number &ndash; it belongs to work, not me. And my outgoing
personal calls have to be separated out from the work ones for expenses purposes, too.</P>
<P>I&#39;ve been waiting for the sensible option &ndash; a phone that can hold two SIM cards at the same time.
That way, you can differentiate between personal and work calls both incoming and outgoing; and if
you change employer you don&#39;t lose all your contact data and have to change your number!</P>
<P>While reading a post about the <A HREF='http://openmoko.org'>OpenMoko</A> GTA02 getting into production, I
spotted a google ad for &ldquo;Dual SIM phones&rdquo;, and ended up on a page from a Malaysian company,
<A HREF='http://duosim.com/phone.html?gclid=CPG_ibif6JMCFRMYagodmCjbVw'>DuoSIM</A>. It looks like the world is
finally catching up on what people really need from their technology, eh?</P>
<P>(Now, what will be more fun? An <A HREF='http://wiki.openmoko.org/wiki/Neo_FreeRunner'>OpenMoko Neo FreeRunner</A>
or the new iPhone? Both with Wifi, touch screen, bluetooth, GPS, accelerometer, similar battery
life; the iPhone has significant data storage that the Neo doesn&#39;t (but it will take microSD), but has a mostly-closed
development environment &hellip;)</P>]]>
</div>
</content>
</entry>
</feed>
