<?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>Hackdiary &#187; linux</title>
	<atom:link href="http://www.hackdiary.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackdiary.com</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 08:58:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The PL2303 serial-USB adapter and Linux</title>
		<link>http://www.hackdiary.com/2003/09/21/the-pl2303-serial-usb-adapter-and-linux/</link>
		<comments>http://www.hackdiary.com/2003/09/21/the-pl2303-serial-usb-adapter-and-linux/#comments</comments>
		<pubDate>Sun, 21 Sep 2003 18:47:11 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=42</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>A short note to fill in for something I couldn&#8217;t find via google on getting a PL2303-based serial-USB adapter to work with linux&#8230;</p>
<p><span id="more-42"></span><br />
Recently I was trying to connect a <a href="http://www.garmin.com/products/geko201/">Garmin Geko 201</a> GPS unit to <a href="/archives/000025.html">my laptop</a> on a 2.4 series linux kernel using a no-brand generic USB serial port cable bought from Maplin.</p>
<p>I encountered the problem described in this <a href="http://www.google.com/url?sa=U&#038;start=1&#038;q=http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.1/0438.html&#038;e=747">post to linux-kernel</a>: the device would work once after boot, then oops the kernel when it was closed. To use it again, I&#8217;d have to reboot.</p>
<p>The solution, in my case, was to recompile my kernel (or change my choice of loaded kernel modules) to use the usb-uhci.o module as my UHCI controller, instead of the &#8220;alternative (JE)&#8221; driver that I had been using.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2003/09/21/the-pl2303-serial-usb-adapter-and-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Debian on a Dell Latitude X200</title>
		<link>http://www.hackdiary.com/2003/03/09/installing-debian-on-a-dell-latitude-x200/</link>
		<comments>http://www.hackdiary.com/2003/03/09/installing-debian-on-a-dell-latitude-x200/#comments</comments>
		<pubDate>Sun, 09 Mar 2003 20:54:36 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=28</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><i>UPDATE: <a href="http://www.hackdiary.com/archives/000049.html">more notes written recently</a></i></p>
<p>My new laptop arrived this week &#8211; a <a href="http://www.euro.dell.com/countries/uk/enu/dhs/products/model_latit_latit_x200.htm">Dell Latitude x200</a>. And it&#8217;s <i>marvellous</i>. Wonderfully lightweight, good battery life for such a small box, good keyboard and a really clear bright screen. After a quick look at Windows XP, which I&#8217;d never seen properly before, I set about installing Linux on it. The <a href="http://www.linux-on-laptops.com/dell.html">Linux on Laptops Dell page</a> has links to some useful bootstrapping information, but there were a few things I found pretty hard to work out. Here are my notes on those things.</p>
<p><span id="more-28"></span><br />
<strong>Re-partitioning the disk</strong><br />
The machine came with Windows XP installed on a single partition that covered the entire 30 gig disk. I didn&#8217;t want to delete it in case it comes in useful for something (games, perhaps), but I did want to scrunch it down to some sort of reasonable size. I used to have a copy of Partition Magic but it&#8217;s a pre-XP version and I couldn&#8217;t find it anyway. The obvious free alternative is <a href="http://www.gnu.org/software/parted/">GNU Parted</a>, but it runs under Linux. The laptop doesn&#8217;t come with a floppy drive, so bootdisks are no use. Even a bootable rescue CD isn&#8217;t that much use as I couldn&#8217;t find any distribution that had firewire drivers in its rescue kernel. The laptop&#8217;s BIOS can boot off the firewire DVD drive, but as soon as Linux takes control the drive effectively disappears and so the boot sequence can&#8217;t be completed.</p>
<p>The answer turns out to be <a href="http://www.knopper.net/knoppix/index-en.html">Knoppix</a>, a fantastic piece of packaging work that gives you a complex Linux system (X, gnome, kde, mozilla, openoffice, etc) that runs entirely off a CD. It can&#8217;t run off a firewire CD either, but it turns out that if you copy the KNOPPIX directory from its CD onto the C: drive inside windows then boot off the CD, the initial ramdisk intelligently searches your hard disk and mounts from the KNOPPIX directory when it can&#8217;t find a CD. Parted is in Knoppix, and it was simple to resize the XP partition down to 5 gig following the documentation on the GNU site. Windows XP still boots fine, and I was able to go ahead with Linux install using a Debian CD copied to the C: drive.</p>
<p><strong>X Windows</strong><br />
The graphics chipset on the x200 is an Intel i830M. There is some support in XFree86 4.2 but it&#8217;s missing the XVideo and RENDER extensions, which are very useful for media playing and pretty fonts. Happily, the recently-released X version 4.3.0 has improved support. I&#8217;m currently using experimental debs while it makes its way into sid. The apt sources are:<br />
<code>deb http://www.penguinppc.org/~daniels/sid/$(ARCH) ./</code><br />
<code>deb-src http://www.penguinppc.org/~daniels/sid/source ./</code><br />
Here&#8217;s my <a href="http://www.hackdiary.com/misc/XF86Config-4.txt">XF86Config-4</a>. There&#8217;s nothing unusual in there.</p>
<p><strong>Firewire DVD+CDRW drive</strong><br />
The drive (&#8220;Vendor: HL-DT-ST  Model: RW/DVD GCC-4240N  Rev: D110&#8243; according to syslog) works with kernel 2.4.20 using the ohci1394 and sbp2 modules. Reading and writing CDs gave no problems, but playing DVDs with mplayer or ogle shows a lot of jerkiness. I haven&#8217;t yet found a hack or firmware update that makes the DVD playback region-free.<br />
<i>Update:</i> I tried playing DVDs again last night and saw good smooth playback. I think this might be due to the automatic power-based CPU speed adjustment. With the default BIOS settings, the laptop switches its speed down to 400Mhz to save power when on batteries. Playing a DVD with power plugged in (and so running at 933Mhz), ogle used around 50% CPU, which implies that 400Mhz wouldn&#8217;t be enough power. I assume that I was running on batteries when I wrote the above. Ogle also didn&#8217;t seem to mind playing Region 1 discs as long as I set the region in /etc/oglerc. All good news. For the moment I&#8217;ve changed the BIOS setting to never slow the CPU, even on batteries. It&#8217;d be nice to have control over the setting at runtime so I could make a choice based on my usage. <a href="http://www.brodo.de/cpufreq/">CPUFreq</a> seems to be the solution but the page says it isn&#8217;t being maintained any more.</p>
<p><strong>Brightness softkeys</strong><br />
The screen&#8217;s brightness can be adjusted using the Fn+Up and Fn+Down keys. Oddly, doing this freezes the machine with the stock Debian 2.4.20 kernel. The solution is to recompile the kernel with the option &#8220;Local APIC support on uniprocessors&#8221; (under &#8220;Processor type and features&#8221;) turned off, and the problem goes away.</p>
<p><strong>Modem</strong><br />
The modem works with the <a href="http://linmodems.technion.ac.il/pctel-linux/">PCTEL linux drivers</a> using the <i>i8xx</i> hal option when compiling.</p>
<p><strong>Battery metering</strong><br />
Using 2.4.20, the APM battery metering seems a little incomplete. Gnome&#8217;s battery status applet reports &#8220;N/A&#8221; rather than showing a percentage battery remaining. The &#8220;apm&#8221; command shows a percentage but no estimated remaining time. I haven&#8217;t found any options that help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2003/03/09/installing-debian-on-a-dell-latitude-x200/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cron is my TiVo</title>
		<link>http://www.hackdiary.com/2003/01/20/cron-is-my-tivo/</link>
		<comments>http://www.hackdiary.com/2003/01/20/cron-is-my-tivo/#comments</comments>
		<pubDate>Mon, 20 Jan 2003 17:09:24 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=21</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>One thing I&#8217;d like to do with a <a href="/archives/000016.html">silent PC</a> is make a homebrew TiVo-alike. Well, I would if I watched any TV. Which I don&#8217;t. But still, the idea interests me beyond any use I&#8217;d actually make of it. Anyway&#8230;</p>
<p>In the past, this idea has been beyond my means since recording analogue TV to MPEG on a hard disk in realtime requires a great deal of CPU (or dedicated encoder hardware). The general availability of digital TV in the UK now means that the MPEG encoding is already done for you by the broadcasters; you just need a way to get it out of the airwaves or cables and into a PC. Happily, there&#8217;s now a range of cheap digital WinTV cards for cable, terrestrial and satellite. I&#8217;ve been checking out a <a href="http://www.hauppauge.co.uk/html/digitaltv_prod.htm#novatpci">NOVA-t</a> (terrestrial) card on a linux box this week.</p>
<p><span id="more-21"></span><br />
The wonderful thing about the drivers and utilities that have been written so far is that they are simple commandline tools, easily pipeable and cronable. There are just two key commands &#8211; dvbtune to tune into a multiplex and dump the &#8216;table of contents&#8217; listing all the channel available, and dvbstream to extract an audio+video mpeg stream or an entire transport stream (the data stream containing all the audio, video and data from all the channels on a mux) and stream it to stdout or multicast it.</p>
<p>Getting the drivers set up is the fiddly bit; this took me a day or two until I stumbled across the right combination of driver, dvbstream and dvbtune versions. <a href="http://www.linuxtv.org/mailinglists/linux-dvb/2003/01-2003/msg00331.html">A post</a> on the linux-dvb list helped me a lot there. Basically you should use the latest CVS version of everything. There are <a href="http://www.linuxdvb.tv/download/">nightly CVS snapshots</a> of the drivers, but the rest will probably have to be dragged direct out of the relevant CVS.</p>
<p>To tune into the 16QAM 506Mhz multiplex containing BBC2 at Crystal Palace and output the service information as XML (<a href="/misc/service_information.xml">looks like this</a>):</p>
<p><em>dvbtune -f 506000000 -i -qam 16 -cr 3_4</em></p>
<p>To capture 10 seconds of audio/video mpeg stream direct from BBC2 (video PID 610, audio PID 611):</p>
<p><em>dvbstream -n 10 -ps -c 0 610 611 -o > out.mpg</em></p>
<p>or pipe it into mplayer to play it directly:</p>
<p><em>dvbstream -n 10 -ps -c 0 610 611 -o | mplayer -cache 2048 -</em></p>
<p>To re-scale and re-encode the video as MPEG4 and the audio as VBR MP3 to save diskspace (but retain quality comparable to the original MPEG):</p>
<p><em>mencoder -o out.avi -vop scale=512:288 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500 -oac mp3lame -lameopts fast:preset=medium out.mpg</em></p>
<p>This results in a <a href="/misc/sample.avi">2 megabyte AVI file</a>. At this bitrate, a complete hour can be recorded in about 700meg, which would fit on a CDR. Since digital terrestrial TV carries a programme guide in the datastream on PID 0&#215;12, it should be possible to extract that, parse it and use it to trigger recordings based on programme names. I haven&#8217;t found anything about how to do so yet.</p>
<p><i>UPDATE:</i> It seems there is more than one variant of card being sold with the WinTV Nova-T PCI name. Someone I know recently bought a card and the chipset used was completely different from the one I have, and wasn&#8217;t supported by the linux-dvb drivers. Unfortunately we haven&#8217;t worked out a way to distinguish supported from unsupported cards without opening the retail pack and inspecting the card itself.</p>
<p><i>FURTHER UPDATE:</i> The linux-dvb drivers now support the new chipset (using the tda1004x driver added earlier this year). The driver requires a copy of a DLL from the Windows driver, as detailed in the <a href="http://www.linuxtv.org/cgi-bin/cvsweb.cgi/DVB/driver/frontends/README.tda1004x?rev=1.2&#038;content-type=text/x-cvsweb-markup">README</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2003/01/20/cron-is-my-tivo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making a silent, tiny, diskless PC</title>
		<link>http://www.hackdiary.com/2003/01/07/making-a-silent-tiny-diskless-pc/</link>
		<comments>http://www.hackdiary.com/2003/01/07/making-a-silent-tiny-diskless-pc/#comments</comments>
		<pubDate>Tue, 07 Jan 2003 10:48:32 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=18</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>For a while I&#8217;ve wanted a home PC that I can leave on all the time without the noise bugging me &#8211; I&#8217;ve become quite sensitive to machine noise over years of working with computers. I&#8217;d use it to play MP3s off my network, then I&#8217;d think up other projects. It wouldn&#8217;t need a monitor or a keyboard. It would just sit attached to the network, appliance-style, in the manner of a <a href="http://www.slimdevices.com">slimp3</a> but with the flexibility of a full linux system. Now the off-the-shelf hardware I need to make such a thing is available.</p>
<p><span id="more-18"></span><br />
The <a href="http://www.viavpsd.com/product/epia_m_spec.jsp?motherboardId=81">Via Eden ME6000</a> motherboard is full of integrated components (TV output, network, firewire, 5.1 sound with digital out, etc) and has a fairly powerful processor that needs no fan on its heatsink. Combined with a stick of memory and a <a href="http://www.mini-itx.com/store/default.asp?c=9#p67">Morex 55W fanless external power supply</a>, and booted diskless off the network, this system has no moving parts.</p>
<p>The bits arrived yesterday and after a bit of setup I got it booting Debian off the network and playing its first MP3 by the end of the evening. It&#8217;s all-but-silent; the DC-DC converter makes a very slight high-pitched noise, a little like the noise a TV makes with the sound off. It&#8217;ll be easily muffled inside some sort of box. The motherboard makes no noise at all. Playing MP3s with mpg123 takes about 7% CPU according to top.</p>
<p>Here&#8217;s a picture:</p>
<p><a href="http://www.hackdiary.com/pics/via1.jpg"><img src="http://www.hackdiary.com/pics/via1_small.jpg" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2003/01/07/making-a-silent-tiny-diskless-pc/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>MAC-address logging/blocking for linux iptables</title>
		<link>http://www.hackdiary.com/2003/01/02/mac-address-loggingblocking-for-linux-iptables/</link>
		<comments>http://www.hackdiary.com/2003/01/02/mac-address-loggingblocking-for-linux-iptables/#comments</comments>
		<pubDate>Thu, 02 Jan 2003 09:55:28 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=15</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a <a href="http://www.picdiary.com/~mattb/wireless/macblock.txt">little script</a> I wrote that checks incoming wireless requests for a known MAC address. I&#8217;ve been using it on my Linux gateway/router/wireless-bridge.</p>
<p>If it doesn&#8217;t know you, it transparent-proxies all your outgoing port 80 traffic to the local webserver&#8217;s port 81, where you could put a redirect to a polite message or something.</p>
<p><span id="more-15"></span><br />
In my case I&#8217;d just like to put some sort of guestbook page that logs your MAC and adds it automatically to the firewall rules after you leave a comment. I don&#8217;t mind sharing my bandwidth from time to time, but I&#8217;d love to know if someone benefitted from it.</p>
<p>I was impressed with the power of iptables, once I got my head round it. I found an <a href="http://www.sibbald.com/unixutil/iptables-firewall.html">ascii-art diagram</a> that helped me understand the flow through the various tables and targets.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2003/01/02/mac-address-loggingblocking-for-linux-iptables/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
