<?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>Adam Pierce &#187; Nerd Notes</title>
	<atom:link href="http://www.doctort.org/adam/category/nerd-notes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.doctort.org/adam</link>
	<description>Maker of Finest Quality Digital Things</description>
	<lastBuildDate>Thu, 24 Jun 2010 01:17:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python function is not callable</title>
		<link>http://www.doctort.org/adam/nerd-notes/python-function-is-not-callable.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/python-function-is-not-callable.html#comments</comments>
		<pubDate>Wed, 16 Sep 2009 10:39:12 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=343</guid>
		<description><![CDATA[Here&#8217;s a Python gotcha that got me. Here is my function to print out a range of sinusoidal values:

import math

def cycle(centre, range):
        theta = 4.71
        speed = 0.1
        for i in range(0,80):
   [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a Python gotcha that got me. Here is my function to print out a range of sinusoidal values:</p>
<pre>
import math

def cycle(centre, range):
        theta = 4.71
        speed = 0.1
        for i in range(0,80):
                theta = theta + speed
                value = centre + (range * math.sin(theta))
                print value
</pre>
<p>I got the following error which confused the hell out of me:</p>
<pre>
Traceback (most recent call last):
  File "cycle2.py", line 11, in <module>
    cycle(0.0,10.0)
  File "cycle2.py", line 6, in cycle
    for i in range(0,80):
TypeError: 'float' object is not callable
</pre>
<p>Can you see it? It took me a while. I&#8217;d assigned a variable called <strong>range</strong> and then tried to call the <strong>range()</strong> function. I&#8217;d overloaded a built-in function. Duh!</p>
<p>I just had to rename my variable and it was good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/python-function-is-not-callable.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parallel port control in Python</title>
		<link>http://www.doctort.org/adam/nerd-notes/parallel-port-control-in-python.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/parallel-port-control-in-python.html#comments</comments>
		<pubDate>Mon, 10 Aug 2009 01:11:13 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=330</guid>
		<description><![CDATA[Controlling the parallel port has always been a pain in Windows 2000, XP and later. In DOS or older versions of Windows you could just write a byte directly to port 0&#215;378 and that was it.
Now you can get the same level of simplicity using inpout32.dll and Python. Go here to download the DLL and [...]]]></description>
			<content:encoded><![CDATA[<p>Controlling the parallel port has always been a pain in Windows 2000, XP and later. In DOS or older versions of Windows you could just write a byte directly to port 0&#215;378 and that was it.</p>
<p>Now you can get the same level of simplicity using inpout32.dll and Python. Go <a href="http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html">here</a> to download the DLL and you can access it from Python just as easily as it used to be under DOS. The following example writes the number 5 to the parallel port:</p>
<pre>import ctypes

ctypes.windll.inpout32.Out32(0x378, 5)</pre>
<p></p>
<hr />
<strong>UPDATE:</strong> I have made a simple demo app using this technique. You can download it from my commercial website at <a href="http://siliconsparrow.com/parallel-port-tester-in-python/">http://siliconsparrow.com/parallel-port-tester-in-python/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/parallel-port-control-in-python.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Australian Income Tax Spreadsheet Formula</title>
		<link>http://www.doctort.org/adam/nerd-notes/australian-income-tax-spreadsheet-formula.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/australian-income-tax-spreadsheet-formula.html#comments</comments>
		<pubDate>Wed, 29 Jul 2009 12:47:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=328</guid>
		<description><![CDATA[Just a quick note for my future reference. I&#8217;m setting up my budget spreadsheet for the new financial year and I have converted the Australian 2010 income tax rates into a spreadsheet formula. I use OpenOffice, it should work fine in Excel too.
=if(A1&#60;=6000;0;if(a1&#60;=35000;.15*(a1-6000);if(a1&#60;=80000;4350+(.3*(a1-35000));if(a1&#60;=180000;17850+(.38*(a1-80000));55850+(.45*(a1-180000))))))
]]></description>
			<content:encoded><![CDATA[<p>Just a quick note for my future reference. I&#8217;m setting up my budget spreadsheet for the new financial year and I have converted the Australian 2010 income tax rates into a spreadsheet formula. I use OpenOffice, it should work fine in Excel too.</p>
<pre>=if(A1&lt;=6000;0;if(a1&lt;=35000;.15*(a1-6000);if(a1&lt;=80000;4350+(.3*(a1-35000));if(a1&lt;=180000;17850+(.38*(a1-80000));55850+(.45*(a1-180000))))))</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/australian-income-tax-spreadsheet-formula.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a Debian Kernel Package for v2.6.26</title>
		<link>http://www.doctort.org/adam/nerd-notes/creating-a-debian-kernel-package-for-v2626.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/creating-a-debian-kernel-package-for-v2626.html#comments</comments>
		<pubDate>Thu, 19 Mar 2009 00:47:30 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=317</guid>
		<description><![CDATA[There are so many guides out there on how to make a Linux kernel and so many of them are out of date, I thought I should write down a simple step-by-step of the current way to do it as of early 2009.
My goal here was to compile a new kernel for a Debian 4.0 [...]]]></description>
			<content:encoded><![CDATA[<p>There are so many guides out there on how to make a Linux kernel and so many of them are out of date, I thought I should write down a simple step-by-step of the current way to do it as of early 2009.</p>
<p>My goal here was to compile a new kernel for a Debian 4.0 (Etch) system. You can download pre-built kernels but I wanted to modify some drivers before building it.</p>
<p>Anyway, you will firstly need the source code. Go to the <a href="http://packages.debian.org/etch-backports/">Debian Backports Repository</a> and grab the latest <strong>linux-source</strong> package. Before installing it, you will need to install some tools:</p>
<pre>sudo apt-get install kernel-package fakeroot libncurses5-dev</pre>
<p>Now we can install the source:</p>
<pre>sudo dpkg -i linux-image-2.6.26_dvc.1.2_i386.deb

cd /usr/src

tar jxvf linux-source-2.6.26.tar.bz2

ln -s linux-source-2.6.26 linux

cd linux</pre>
<p>Next you need to configure the kernel. A good way is to simply copy the current kernel configuration:</p>
<pre>cp /boot/config-2.6.18-6-686 ./.config</pre>
<p>Finally, launch the make-kpkg utility. This will configure, compile and package the kernel in a DEB package.</p>
<pre>fakeroot make-kpkg --revision=mycustomkernel-1.0 --config menuconfig --initrd kernel_image</pre>
<p>This will launch the kernel configuration menu first. You can make any configuration changes here but usually the defaults are fine. When it is all done you will have the completed package file in /usr/src.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/creating-a-debian-kernel-package-for-v2626.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reading a single keystroke with C++ on Linux</title>
		<link>http://www.doctort.org/adam/nerd-notes/reading-single-keystroke-on-linux.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/reading-single-keystroke-on-linux.html#comments</comments>
		<pubDate>Sun, 01 Feb 2009 23:03:05 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=309</guid>
		<description><![CDATA[Just say you want to input a single key from your user such as asking &#8220;Would you like to continue [y/n] ?&#8221; without requiring the user to press ENTER. You&#8217;d think you could do it like this:
char c;
cin >> c;
cout ]]></description>
			<content:encoded><![CDATA[<p>Just say you want to input a single key from your user such as asking <em>&#8220;Would you like to continue [y/n] ?&#8221;</em> without requiring the user to press ENTER. You&#8217;d think you could do it like this:</p>
<pre>char c;
cin >> c;
cout << "You pressed " << c << endl;</pre>
<p>But it doesn't work! The user has to press ENTER before the cin function will complete.</p>
<p>I read all sorts of crazy solutions on the web to fix this, most of which involve using NCURSES but I think that is total overkill. I have found a simpler way.</p>
<p>Now it's not the fault of std::cin or even C++. It's the operating system which buffers the keyboard input, only releasing it to your app when the user whacks ENTER. So what you need to do is tell the OS not to buffer keystrokes. You can do this with the <strong><a href="http://linux.die.net/man/3/tcgetattr">termios</a></strong> functions in Linux. Here is an example:</p>
<pre>// Example for inputting a single keystroke in C++ on Linux
// by Adam Pierce &lt;adam@doctort.org&gt;
// This code is freeware. You are free to copy and modify it any way you like.

#include &lt;iostream&gt;
#include &lt;termios.h&gt;

using namespace std;
main()
{
// Black magic to prevent Linux from buffering keystrokes.
    struct termios t;
    tcgetattr(STDIN_FILENO, &amp;t);
    t.c_lflag &amp;= ~ICANON;
    tcsetattr(STDIN_FILENO, TCSANOW, &amp;t);

// Once the buffering is turned off, the rest is simple.
    cout &lt;&lt; "Enter a character: ";
    char c = cin.get();
    cout &lt;&lt; "Your character was " &lt;&lt; c &lt;&lt; endl;

    return 0;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/reading-single-keystroke-on-linux.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Networked Warcraft II under DOSBox</title>
		<link>http://www.doctort.org/adam/nerd-notes/networked-warcraft-ii-under-dosbox.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/networked-warcraft-ii-under-dosbox.html#comments</comments>
		<pubDate>Sun, 07 Dec 2008 10:36:33 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[DOSBOX]]></category>
		<category><![CDATA[ipx]]></category>
		<category><![CDATA[warcraft]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=294</guid>
		<description><![CDATA[This is a guest post contributed by Richard Geoffrion. Thanks for sending this Richard, I hope others will find it useful!
First off, thank you so much, Adam, for the primer on getting Warcraft II working under DOSBOX. The “-t cdrom” option was the piece I was missing to get my game to recognize the CD [...]]]></description>
			<content:encoded><![CDATA[<p>This is a guest post contributed by Richard Geoffrion. Thanks for sending this Richard, I hope others will find it useful!</p>
<hr />First off, thank you so much, Adam, for the primer on getting Warcraft II working under DOSBOX. The “-t cdrom” option was the piece I was missing to get my game to recognize the CD and work.</p>
<p>After I installed my game, I wound up copying my entire Warcraft II CD to my <strong>C:\DOSGAMES\WAR2</strong> directory, then I added “mount d c:\dosgames\war2 -t cdrom” to the [autoexec] section. By copying the CD to the same path as the installed game, I don’t have to duplicate the space to hold the files from the CDROM.</p>
<p>As for playing multiplayer Warcraft II in DOSBOX, it could not be made any easier. There is NOTHING that the user has to configure in Microsoft Windows (or Linux…or OSX) to get IPX gaming working under DOSBOX. The DOSBOX team has built an IPX wrapper right into DOSBOX. Once the Warcraft II game is operational on two or more computers on your network you are ready to setup networking in DOSBOX.</p>
<p><strong>Instructions:</strong><br />
<strong>1)</strong> Identify the IP addresses or names of each computer that will be participating in the gaming session. (Windows users: To display the computer’s IP address click START, click RUN, type in “cmd” and click the OK button. At the prompt, type in the command <strong>ipconfig</strong> and press enter. Write down or remember the number on the <strong>IP ADDRESS</strong> line. If you want to know the name of the computer, you can type in the command ”hostname” and press enter to see the name.) (Linux/OSX users: run ifconfig from a terminal (you may have to sudo the command or su to root)</p>
<p><strong>2)</strong> Once you have identified all of the IP addresses (or names) of the computers on your network that will be playing the game, pick one to designate as your IPX SERVER.</p>
<p><strong>3)</strong> *OPTIONAL STEP* Sometimes the Microsoft Windows firewall is turned on and it could interfere with proper communications between the client and the server. If you want to run a test to make sure that everyone can connect to your server, then go to each computer that will be connecting to your designated server and start a windows command prompt. Once the prompt is open, use the ping command along with the IP address of the server -OR- the server computer’s name to make sure that the server can respond to the clients. [Example: " ping 192.168.1.100 " -or- " ping HP-PAV6330 " ]</p>
<p><strong>4)</strong> Start DOSBOX on your designated server. Run the DOSBOX command:</p>
<pre>ipxnet startserver</pre>
<p>That is IT!! That is ALL YOU NEED TO DO on the server! It is THAT SIMPLE!</p>
<p>–we’re almost done!–</p>
<p><strong>5)</strong> Now start DOSBOX on each client computer that will be joining in the multiplayer fun. Once DOSBOX is running we will be using the DOSBOX command ‘IPXNET CONNECT’ but we’ll be adding something to it. We will either add the IP address of the server or the name. If we were to use the IP address or name from the examples in the optional step 3, our DOSBOX command might look something like this:</p>
<pre>C:\&gt; IPXNET CONNECT 192.168.1.100</pre>
<p>-OR-</p>
<pre>C:\&gt; IPXNET CONNECT HP-PAV6330</pre>
<p>At this point, DOSBOX will handle wrapping the IPX packets in TCP/IP.</p>
<p><strong>6)</strong> Start WAR2 on the server, Select Multiplayer, select the IPX Network connection method and<br />
click <strong>CONNECT</strong> then <strong>CREATE GAME.</strong></p>
<p><strong>7)</strong> Start War2 on each client, Select Multiplayer, select the <strong>IPX Network</strong> connection method and click <strong>CONNECT</strong> then <strong>JOIN GAME</strong>.</p>
<p><strong>8)</strong> Begin your game and race your peons out to the unclaimed gold mines to put walls around them to protect them from any players..especially computer players. Oh..wait….that doesn’t belong in this set of instructions! Now who let that slip by quality control?!!?</p>
<p><em><strong>NOTE 1:</strong> It *IS* possible to play WARCRAFT II with a friend across the internet. The variety of the additional steps needed are a bit beyond anyone’s ability to document in a single document but I can briefly outline the requirements below.</em></p>
<p><strong>A)</strong> The gamer who will be the server ( the server user) will have to know their real-world public IP address. If you don’t know your public IP address, you can visit a site that displays your public IP address. A google search on finding your public IP will reveal many. http://www.whatismyip.com is one. [#]</p>
<p><strong>B)</strong> If the server user is behind a router/firewall, then the server user will also need to..</p>
<p>*) know their private IP address. This is the IP address that was discovered in the ‘ipconfig’ command from step 1 above.</p>
<p>*) configure their router/firewall to forward the UDP port 213 –DOSBOX IPX WRAPPER traffic– from their external interface to UDP port 213 on the private IP Address of the computer that is the DOSBOX IPX server.</p>
<p><em><strong>Note 2:</strong> The DOSBOX command ” <strong>IPXNET help</strong> ” will display a list of available networking commands and a small bit of documentation — like the fact that the DEFAULT port for the IPX wrapper in DOSBOX is UDP port 213</em></p>
<p><em><strong>Note 3:</strong> These same networking steps should work for any IPX DOS game that runs in DOSBOX. These steps have been successfully tested with “One Must Fall”. [Google omf21cd.zip to download this free game.]</em></p>
<p>[#] Please avoid http://moanmyip.com if you are ..oh I don’t know… at work setting up for a Christmas LAN party! Of course using that link as a secondary browser-start-up-home-page can be fun.</p>
<p>Happy Retro-Gaming!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/networked-warcraft-ii-under-dosbox.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Linux Equivalent of the Windows GetTickCount() function</title>
		<link>http://www.doctort.org/adam/nerd-notes/linux-equivalent-of-the-windows-gettickcount-function.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/linux-equivalent-of-the-windows-gettickcount-function.html#comments</comments>
		<pubDate>Mon, 21 Jul 2008 06:08:18 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[win32]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=233</guid>
		<description><![CDATA[GetTickCount() is a real handy function in Windows but does not exist in Linux. This code will give a similar result:

#include &#60;sys/time.h&#62;

unsigned GetTickCount()
{
        struct timeval tv;
        if(gettimeofday(&#038;tv, NULL) != 0)
            [...]]]></description>
			<content:encoded><![CDATA[<p>GetTickCount() is a real handy function in Windows but does not exist in Linux. This code will give a similar result:</p>
<pre>
#include &lt;sys/time.h&gt;

unsigned GetTickCount()
{
        struct timeval tv;
        if(gettimeofday(&#038;tv, NULL) != 0)
                return 0;

        return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/linux-equivalent-of-the-windows-gettickcount-function.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>UDEV swapped my drives!</title>
		<link>http://www.doctort.org/adam/nerd-notes/udev-swapped-my-drives.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/udev-swapped-my-drives.html#comments</comments>
		<pubDate>Tue, 03 Jun 2008 06:18:05 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=230</guid>
		<description><![CDATA[After doing a dist-upgrade on a Debian Etch system, it would no longer boot! It loads the kernel and then stops displaying the following message:
Waiting for root filesystem
I&#8217;ve just spent a few torturous hours trying to get it back up again. It took me a while to figure out what was happening but it seems [...]]]></description>
			<content:encoded><![CDATA[<p>After doing a dist-upgrade on a Debian Etch system, it would no longer boot! It loads the kernel and then stops displaying the following message:</p>
<pre>Waiting for root filesystem</pre>
<p>I&#8217;ve just spent a few torturous hours trying to get it back up again. It took me a while to figure out what was happening but it seems that the updated package for UDEV changes the GRUB configuration so it tries to mount hdb1 instead of hda1 as the root file system. Of course hdb1 does not exist on this single-drive machine so it just sits there like a moron.</p>
<p>Turns out it is not frozen. If you wait about 3 minutes, it will eventually come up with the following prompt:</p>
<pre>(initfs)</pre>
<p>I found that I can kind of get the system running by typing the following commands. These are for a single-partition system on an EXT3 file system on an IDE hard drive. If your system is different, you will need to modify them a bit:</p>
<pre>mkdir /mnt

mount /dev/hda1 -t ext3 /mnt

chroot /mnt

login</pre>
<p>Then log in. The next thing to do is to correct the GRUB configuration:</p>
<pre>nano -w /boot/grub/menu.lst</pre>
<p>Change the <strong>root=/dev/sdb1</strong> entry to <strong>root=/dev/sda1</strong>. Once again, this is for a single IDE drive, you may need to change it if you are booting from SATA or some other kind of device.</p>
<p>Now regenerate the initramfs image:</p>
<pre>dpkg-reconfigure initramfs-tools</pre>
<p>At last we can reboot. The system came up fine for me after this.</p>
<pre>reboot</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/udev-swapped-my-drives.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adaptec 1430SA on Debian Linux &#8220;Etch&#8221;</title>
		<link>http://www.doctort.org/adam/nerd-notes/adaptec-1430sa-on-debian-linux-etch.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/adaptec-1430sa-on-debian-linux-etch.html#comments</comments>
		<pubDate>Mon, 26 May 2008 06:38:37 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/?p=229</guid>
		<description><![CDATA[Well folks, I just got saddled with this Adaptec/Marvel piece of poo and now I have to make it work on a Debian server. The server belongs to my employer and is running Debian &#8220;Etch&#8221;.
The Etch release of Debian does not have a driver for this card built-in and even though Adaptec claim to support [...]]]></description>
			<content:encoded><![CDATA[<p>Well folks, I just got saddled with this Adaptec/Marvel piece of poo and now I have to make it work on a Debian server. The server belongs to my employer and is running Debian &#8220;Etch&#8221;.</p>
<p>The Etch release of Debian does not have a driver for this card built-in and even though Adaptec claim to support Linux, their drivers simply do not work unless you are running some specific outdated versions of Red Hat or SUSE. That&#8217;s not what I call Linux support!</p>
<p>I&#8217;m not the only one discovering this, Brent Norris wrote a wonderful article titled &#8220;<a title="Permanent Link: Adaptec 1420SA is JUNK!" rel="bookmark" href="http://www.brentnorris.net/blog/archives/158">Adaptec 1420SA is JUNK!</a>&#8221; on his blog which describes pretty much the exact situation I find myself in which Adaptec just doesn&#8217;t want to know about Linux.</p>
<p>When are these guys (by whom I mean most major hardware manufacturers) going to realize that Linux is here to stay and is getting real popular, especially in the server room.</p>
<p>Anyway, enough ranting. After a couple of hours Googling around, I see that there is an open source driver available for this card and it is built into Linux kernel version 2.6.22. Debian Etch uses 2.6.18 so all I need to do is upgrade the kernel.</p>
<p>The easiest way to install the upgraded kernel is to get a DEB package from Debian Backports. Go to this page:</p>
<p><a href="http://packages.debian.org/etch-backports/admin/">http://packages.debian.org/etch-backports/admin/</a></p>
<p>and grab a kernel, there are usually a couple of different versions available there.</p>
<p>Install it and reboot. Works great so far.</p>
<p>PS. I notice that the driver for this card was released into the Linux kernel by Red Hat corporation. So it seems even they are fed up with Adaptec&#8217;s poor support for Linux!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/adaptec-1430sa-on-debian-linux-etch.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Debian from a USB Key</title>
		<link>http://www.doctort.org/adam/nerd-notes/installing-debian-from-a-usb-key.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/installing-debian-from-a-usb-key.html#comments</comments>
		<pubDate>Wed, 23 Apr 2008 03:33:31 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/general/installing-debian-from-a-usb-key.html</guid>
		<description><![CDATA[I&#8217;m astonished how quickly CDs and DVDs are going the way of the Fondue Fork. Seems that everyone is downloading stuff these days and USB devices have exceeded DVDs in capacity already.
I can see it won&#8217;t be long before DVD drives will be an optional extra on new PCs (especially laptops) and will eventually disappear [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.doctort.org/adam/wp-content/uploads/2008/04/usbkey2.jpeg" alt="My USB Key" align="right" />I&#8217;m astonished how quickly CDs and DVDs are going the way of the Fondue Fork. Seems that everyone is downloading stuff these days and USB devices have exceeded DVDs in capacity already.</p>
<p>I can see it won&#8217;t be long before DVD drives will be an optional extra on new PCs (especially laptops) and will eventually disappear like floppy drives (remember them ?).</p>
<p>So it&#8217;s time to look at installing from USB on a machine which has no disc drive at all. I&#8217;ve found a few guides out there on the internet but none of them were easy to follow. I had to read several of them and then I still had to guess at stuff that wasn&#8217;t mentioned.</p>
<p>So here is my guide which is a little more comprehensive.</p>
<hr /><em>NOTE 1: I am assuming your USB device is /dev/sdb. If yours is not, you will have to change the examples to suit.</em></p>
<p><em>NOTE 2: I&#8217;m assuming you are logged in as a regular user. if you are logged in as root, just drop &#8220;sudo&#8221; off the beginning of all these commands.</em></p>
<p><strong>Step 1 &#8211; Download the installation image </strong></p>
<p>While there are several &#8220;small&#8221; installs for putting on a credit-card CD and so on, USB sticks are now large enough that you can use a normal install CD image. I am going to use the Debian Net Install which weighs in at around 160MB. This should easily fit on a 256MB device which quite frankly, people throw away these days because it is so uncool to have such a small device dangling from your keyring.</p>
<p>Go to <a href="http://www.debian.org/CD/netinst/">http://www.debian.org/CD/netinst/</a> and download the netinst image for your platfom (if you don&#8217;t know, it&#8217;s probably i386).</p>
<p><strong>Step 2 &#8211; Partition and Format the USB device</strong></p>
<p>Most USB keys come pre-formatted with a FAT16 or FAT32 file system. If this is the case with your stick, just erase all the files on it and proceed to Step 3.</p>
<p>But of course, I had previously formatted mine with EXT3 so I&#8217;ll need to reformat it with a DOS format.</p>
<p>First set the partition type to DOS</p>
<pre>sudo sfdisk -c /dev/sdb 1 c</pre>
<p>Next, format the partition.</p>
<pre>sudo mkdosfs /dev/sdb1</pre>
<p><strong>Step 3 &#8211; Obtain a kernel and RAMdisk image<br />
</strong></p>
<p>Next you need an hd-install kernel and <em>initrd</em> image. You can download these from Debian also. For the current version of the kernel, they should be available from here:</p>
<p><a href="http://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/">http://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/</a></p>
<p>Grab the two files <strong>vmlinuz</strong> and <strong>initrd.gz</strong> then mount your USB device and copy them onto it:</p>
<pre>sudo mount /dev/sdb1 /mnt

sudo cp vmlinuz /mnt/

sudo cp initrd.gz /mnt/</pre>
<p>Then you will need to make a file on the USB device called <strong>syslinux.cfg</strong> &#8211; just create a plain text file. Cut and paste the following two lines into it:</p>
<pre>default vmlinuz
append initrd=initrd.gz</pre>
<p><strong>Step 4 &#8211; Copy the installation image</strong></p>
<p>Next copy the ISO file you downloaded onto the USB device. From the commandline you can do it like this:</p>
<pre>sudo cp debian-40r3-i386-netinst.iso /mnt/</pre>
<p><strong>Step 5 &#8211; Make the device bootable</strong></p>
<p>You will need to have a couple of additional packages installed to do this:</p>
<pre>sudo apt-get install syslinux mtools</pre>
<p>Type these commands to make the stick bootable:</p>
<pre>sudo syslinux /dev/sdb1

sudo install-mbr -r -p 1 /dev/sdb</pre>
<p>Now you can unmount the USB device and you are good to go!</p>
<pre>sudo umount /mnt/usb</pre>
<hr />
<strong>UPDATE &#8211; I corrected an error in this, if you tried following it before 15-Jul-2008, you might have ended up with a non-working installer.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/installing-debian-from-a-usb-key.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross compile for 68000 in C under Windows</title>
		<link>http://www.doctort.org/adam/nerd-notes/cross-compile-for-68000-in-c-under-windows.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/cross-compile-for-68000-in-c-under-windows.html#comments</comments>
		<pubDate>Wed, 27 Feb 2008 11:03:52 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[68000]]></category>
		<category><![CDATA[68k]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[cross]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[m68k]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/cross-compile-for-68000-in-c-under-windows.html</guid>
		<description><![CDATA[This article contains my notes for setting up a m68k cross-compiler using Cygwin. It&#8217;s all free software and gives me a way to create binary images for a 68000 CPU from C code on Windows. Here&#8217;s the step-by-step to set it up:
Step 1. Install Cygwin
Go to http://www.cygwin.com/ and download setup.exe. Run it.
During the setup, you [...]]]></description>
			<content:encoded><![CDATA[<p>This article contains my notes for setting up a m68k cross-compiler using Cygwin. It&#8217;s all free software and gives me a way to create binary images for a 68000 CPU from C code on Windows. Here&#8217;s the step-by-step to set it up:</p>
<p><strong>Step 1. Install Cygwin</strong></p>
<p>Go to <a href="http://www.cygwin.com/" target="_blank">http://www.cygwin.com/</a> and download setup.exe. Run it.</p>
<p>During the setup, you will have the opportunity to select what packages to install. Choose the following:</p>
<ul>
<li>binutils</li>
<li>gcc-core</li>
<li>bzip2</li>
<li>flex</li>
<li>make</li>
</ul>
<p><strong>Step 2. Download the compiler source code</strong></p>
<p>You want binutils and gcc-core from GNU. Go to the <a href="http://www.gnu.org/order/ftp.html" target="_blank">GNU download page</a>, choose a mirror and download the following files. Place them in your Cygwin home directory.</p>
<ul>
<li>binutils-2.15.tar.bz2</li>
<li>gcc-core-3.4.2.tar.bz2</li>
</ul>
<p>Yes there are more up-to-date versions but at the time of writing, the latest gcc versions do not support the 68000 platform. Feel free to try different versions but I know the versions just mentioned will work.</p>
<p><strong>Step 3. Compile and install binutils</strong></p>
<p>Launch Cygwin and type the following commands. Typing this kind of stuff is automatic for me these days. Its a pretty standard GNU setup procedure.</p>
<pre>mkdir /usr/local/m68k

tar jxvf binutils-2.15.tar.bz2

cd binutils-2.15/

./configure --prefix=/usr/local/m68k --target=m68k-coff

make install</pre>
<p><strong>Step 4. Compile and install gcc</strong></p>
<p>Same again for the C compiler.</p>
<pre>cd ~

export PATH=$PATH:/usr/local/m68k/bin

tar jxvf gcc-core-3.4.2.tar.bz2

cd gcc-core-3.4.2/

./configure --prefix=/usr/local/m68k --target=m68k-coff --enable-languages=c

make install</pre>
<p><strong>Step 5. Set up your path</strong></p>
<p>The 68000 compiler will be located in /usr/local/m68k/bin. To make life easier, you might like to add the following to your ~/.bashrc file:</p>
<pre>export PATH=$PATH:/usr/local/m68k/bin</pre>
<p><strong>Step 6. Enjoy</strong></p>
<p>Here&#8217;s the command to compile some C code:</p>
<pre>m68k-coff-gcc -o test.out test.c</pre>
<p>And the command to create a binary image from the compiled code:</p>
<pre>m68k-coff-objcopy -O binary test.out test.bin</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/cross-compile-for-68000-in-c-under-windows.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Setup of RAID5 without losing data</title>
		<link>http://www.doctort.org/adam/nerd-notes/setup-of-raid5-without-losing-data.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/setup-of-raid5-without-losing-data.html#comments</comments>
		<pubDate>Mon, 04 Feb 2008 22:46:02 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[degraded]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/general/setup-of-raid5-without-losing-data.html</guid>
		<description><![CDATA[I have here a server (Debian Linux of course) which is storing its data on a 1TB hard drive. I want to upgrade the storage to a RAID5 using 4x 1TB drives. I&#8217;d like the existing drive to be a part of the RAID array so I only need to buy 3 new drives, but [...]]]></description>
			<content:encoded><![CDATA[<p>I have here a server (Debian Linux of course) which is storing its data on a 1TB hard drive. I want to upgrade the storage to a RAID5 using 4x 1TB drives. I&#8217;d like the existing drive to be a part of the RAID array so I only need to buy 3 new drives, but I don&#8217;t want to lose the 600G or so of data on it.</p>
<p>The solution ? Set up a degraded array, copy the data and then add the original disk to the array.</p>
<p>Put simply, a degraded array is a RAID array with one or more drives missing. RAID5 can operate with any one drive down. This is very useful if a drive fails, you can replace the faulty drive without losing any data. So we are going to pretend the drive with the data on it is &#8216;faulty&#8217; so it won&#8217;t be part of the RAID until later when we miraculously &#8216;fix&#8217; it.</p>
<p>On my machine, the new drives are /dev/sde, /dev/sdf and /dev/sdg. The drive with the data is /dev/sdh1. First we partition the new drives. You&#8217;ll need to type these two commands for each new drive:</p>
<pre>echo ",,L" | sfdisk /dev/sde

sfdisk --change-id /dev/sd1 1 fd</pre>
<p>You don&#8217;t have to use sfdisk, as long as you set up the partitions somehow and set them to type 0xFD (Linux RAID).</p>
<p>Now to create the degraded array. This is the magic bit.</p>
<pre>mdadm --create /dev/md3 --level=5 --raid-devices=4 --spare-devices=0 /dev/sde1 /dev/sdf1 /dev/sdg1 missing</pre>
<p>The magic word <strong>missing</strong> stands in for the drive with the data on it.</p>
<p>Next format the RAID array, mount the data drive and copy the data</p>
<pre>mkfs.xfs /dev/md3

mount /dev/md3 /home/adam

mount /dev/sdh1 /mnt

cp -prv /mnt/* /home/adam/</pre>
<p>This will take a while so you might want to do it in a <a href="http://www.doctort.org/adam/nerd-notes/watch-and-screen.html">screen session</a>.</p>
<p>Finally, after the data is copied, we can add the data drive to the array. This is the bit where we can lose everything if it goes wrong so check your data is all on the RAID before proceeding.</p>
<pre>umount /dev/sdh1

sfdisk --change-id /dev/sdh 1 fd

mdadm --manage /dev/md3 --add /dev/sdh1</pre>
<p>I&#8217;m really pleased at this neat trick. I&#8217;ve now got a shiny RAID array with a total storage of 3TB. It all worked so well, I just had to blog about it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/setup-of-raid5-without-losing-data.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UUIDs in the fstab</title>
		<link>http://www.doctort.org/adam/nerd-notes/uuids-in-the-fstab.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/uuids-in-the-fstab.html#comments</comments>
		<pubDate>Fri, 01 Feb 2008 22:54:06 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[drive]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/uuids-in-the-fstab.html</guid>
		<description><![CDATA[I have a machine with about 8 SATA hard drives in it some of which are connected to a PCI controller card and some are on the motherboard. I have an issue with Debian that it keeps swapping the device nodes around on reboot. Sometimes the first drive will be /dev/sda, other times it will [...]]]></description>
			<content:encoded><![CDATA[<p>I have a machine with about 8 SATA hard drives in it some of which are connected to a PCI controller card and some are on the motherboard. I have an issue with Debian that it keeps swapping the device nodes around on reboot. Sometimes the first drive will be /dev/sda, other times it will be /dev/sde. Somehow the system manages to boot up OK but when it comes time to mount the drives, all hell breaks loose!</p>
<p>My solution is to mount the drives by their UUID rather than by their device node. It took me quite a bit of Googling to find an example of how to do this so I thought I&#8217;d write it here so I will know for next time.</p>
<p>Normally, I&#8217;d put an entry in <strong>/etc/fstab</strong> like this to mount a drive:</p>
<pre>/dev/sdb1  /var/www  ext3  defaults  0  2</pre>
<p>But now I change it like so:</p>
<pre>UUID=bd412298-d540-4e4e-8f31-33ff45644bc4  /var/www  ext3  defaults  0  2</pre>
<p>You&#8217;ll notice it is exactly the same except I have used the UUID instead of /dev/sdb1.</p>
<p>But wait! I hear you ask, how do you find out what your drive&#8217;s UUID is ?</p>
<p>Well, I have the answer for that too:</p>
<pre>ls -l /dev/disk/by-uuid/</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/uuids-in-the-fstab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IVTV Device Node Problems &#8211; Solved</title>
		<link>http://www.doctort.org/adam/nerd-notes/ivtv-device-node-problems-solved.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/ivtv-device-node-problems-solved.html#comments</comments>
		<pubDate>Fri, 01 Feb 2008 03:06:37 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/ivtv-device-node-problems-solved.html</guid>
		<description><![CDATA[I&#8217;ve got a Debian machine here which is set up for TV recording. It is fully stacked with 2 x cx88 DTV cards and 3 x PVR150 cards using the IVTV driver. I&#8217;m running Debian Etch which comes with version 0.8.2 of the ivtv driver at the time of writing.
The problem is that the PVR150 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a Debian machine here which is set up for TV recording. It is fully stacked with 2 x cx88 DTV cards and 3 x PVR150 cards using the IVTV driver. I&#8217;m running Debian Etch which comes with version 0.8.2 of the ivtv driver at the time of writing.</p>
<p>The problem is that the PVR150 cards sometimes register themselves as /dev/video0, 1 and 2 but other times, after a reboot they register themselves as /dev/video2, 3 and 4. I needed some way to make them stay on the same device nodes.</p>
<p>Enter this little UDEV rules file I wrote. It creates new device nodes called /dev/ivtvenc0, /dev/ivtvenc1 etc. up to however many cards you have. These will symlink to the correct device nodes every time. Here&#8217;s the script. Call it <strong>010_ivtv.rules</strong> and put it in <strong>/etc/udev/rules.d/</strong></p>
<pre># Rule to sort out those pesky IVTV cards which never
# seem to load in the correct order when DTV cards are
# also installed.
# by Adam Pierce 01-Feb-2008

ATTR{name}=="ivtv0 encoder MPEG",SYMLINK+="ivtvenc0"
ATTR{name}=="ivtv1 encoder MPEG",SYMLINK+="ivtvenc1"
ATTR{name}=="ivtv2 encoder MPEG",SYMLINK+="ivtvenc2"
ATTR{name}=="ivtv3 encoder MPEG",SYMLINK+="ivtvenc3"
ATTR{name}=="ivtv4 encoder MPEG",SYMLINK+="ivtvenc4"
ATTR{name}=="ivtv5 encoder MPEG",SYMLINK+="ivtvenc5"
ATTR{name}=="ivtv6 encoder MPEG",SYMLINK+="ivtvenc6"
ATTR{name}=="ivtv7 encoder MPEG",SYMLINK+="ivtvenc7"</pre>
<p>Watch it in action. Here it is after one reboot:</p>
<pre># ls -l /dev/ivtv*
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc0 -&gt; video0
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc1 -&gt; video1
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc2 -&gt; video2</pre>
<p>And again after the next reboot</p>
<pre># ls -l /dev/ivtv*
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc0 -&gt; video2
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc1 -&gt; video3
lrwxrwxrwx 1 root root 6 2008-02-01 13:54 /dev/ivtvenc2 -&gt; video4</pre>
<p>Now I can always rely on the ivtvenc device nodes to point at the right cards.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/ivtv-device-node-problems-solved.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solder Reflow with a Frying Pan &#8211; part 2</title>
		<link>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-2.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-2.html#comments</comments>
		<pubDate>Wed, 30 Jan 2008 10:08:24 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Homemade Creations]]></category>
		<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[skillet]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[surface mount]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-2.html</guid>
		<description><![CDATA[Now that my pan is ready, it is time to do this. First I needed a board. I got one of my designs prototyped by Batch PCB who are cheap and did a good job but I had to wait about six weeks which is OK for hobbyists but I wouldn&#8217;t want to be in [...]]]></description>
			<content:encoded><![CDATA[<p>Now that my pan is ready, it is time to do this. First I needed a board. I got one of my designs prototyped by <a href="http://www.batchpcb.com/">Batch PCB</a> who are cheap and did a good job but I had to wait about six weeks which is OK for hobbyists but I wouldn&#8217;t want to be in a hurry.</p>
<p><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/rubberglove.png" alt="rubberglove.png" align="right" />This solder paste stuff is pretty toxic. Perhaps I&#8217;m going overboard here but I thought some rubber gloves would be a good idea.<br />
<br clear="all" /><br />
<img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/solderpaste.png" alt="What a mess!" align="right" />To apply the paste, I just squirted it on the board. It kinda went everywhere at first until I got the hang of it. Next time I&#8217;ll get a smaller tube and perhaps a smaller nozzle. I fixed it up as best I could using a toothpick and cotton tips.  It took quite a lot longer and was much more messy than I anticipated.<br />
<br clear="all" /><br />
<img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/pickandplace2.png" alt="pickandplace2.png" align="right" />Next comes the pick-and-place. I got most of my parts from <a href="http://www.digikey.com/">Digi-key</a> who send them out as &#8220;Cut tape&#8221; which is pretty convenient, you just peel the backing off the tape until you get the quantity of parts you need and the rest are left still attached to the tape so you don&#8217;t lose them in the carpet. I positioned the parts with tweezers since most of them are incredibly teeny.</p>
<p>My board includes both surface-mount and through-hole components. I just placed the SMT stuff at this stage because I need the back of the board to be flat for heat transfer.</p>
<p>Now for the fun bit. I put the loaded board onto the pan cold. Then I increased temperature to around 100°C. I left it at that heat for a minute to get everything nice and warm. Then I cranked up the heat to maximum (in my case, 175°) until the solder melted. It was magic to watch. Everything just blobbed into place. Even components which were not exactly positioned right pulled themselves into line.</p>
<p>After a slow cool-down over 5 minutes, I examined the board. Everything looks good to my eye except for some pretty major bridging between the pins of my ARM chip. I&#8217;ll leave dealing with these to part 3.</p>
<p>In the end though, I&#8217;m pretty pleased with the result. Not bad for my first try!</p>
<p style="text-align: center"><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/reflowshowingsolderbridges.png" alt="A few bridges there!" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-2.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Solder Reflow with a Frying Pan &#8211; part 1</title>
		<link>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-1.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-1.html#comments</comments>
		<pubDate>Sun, 27 Jan 2008 06:46:53 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Homemade Creations]]></category>
		<category><![CDATA[Nerd Notes]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[soldering]]></category>
		<category><![CDATA[surface mount]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-1.html</guid>
		<description><![CDATA[I&#8217;ve been dying to have a go at this ever since I read some hobbyist websites on how to do solder reflow at home. I never even thought this was possible to do on a hobbyist budget.
The idea is to use a frying pan or toaster oven to perform solder reflow for SMT circuit boards. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been dying to have a go at this ever since I read some hobbyist websites on how to do solder reflow at home. I never even thought this was possible to do on a hobbyist budget.</p>
<p align="left"><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/electricskillet.png" alt="Electric Skillet" align="right" />The idea is to use a frying pan or toaster oven to perform solder reflow for SMT circuit boards. I decided to use a skillet thinking that a toaster oven would melt components since it heats both top and bottom.</p>
<p>I managed to find the perfect thing. A pre-owned 9&#8243; electric skillet from the Salvation Army shop for $3.</p>
<p>Believe it or not, this device is not a precision instrument. The temperature dial is simply numbered from 1 to 10. The first thing I need to do is get some idea of what actual temperature this thing gets to.<br />
<br clear="all" /><br />
<img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/skillettemperature.png" alt="Measuring the temperature" align="right" />So I need to do a scientific experiment. Firstly I put some oil in the pan and stuck in a thermometer (the fork is to hold the probe in the oil). Then I turned up the heat slowly making a note of the temperature. Finally I graphed the result. Here are the results in degrees C. That cheap little temperature knob is surprisingly linear.</p>
<ol>
<li>Element not energized</li>
<li>30°</li>
<li>46°</li>
<li>65°</li>
<li>90°</li>
<li>105°</li>
<li>125°</li>
<li>140°</li>
<li>&gt;150°</li>
<li>&gt;150°</li>
</ol>
<p>The last two entries I could not measure since the thermometer only went up to 150°C, but by extrapolation I get 155° and 175°. Yes I did this on paper, it is much quicker than using Excel!<br />
<br clear="all" /></p>
<p style="text-align: center"><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/skillettemperaturegraph.png" alt="The results" /></p>
<p><br clear="all" />I am now ready to use this thing for solder reflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/solder-reflow-with-a-frying-pan-part-1.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Warcraft II on Windows XP, A step-by-step guide</title>
		<link>http://www.doctort.org/adam/nerd-notes/warcraft-ii-on-windows-xp-a-step-by-step-guide.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/warcraft-ii-on-windows-xp-a-step-by-step-guide.html#comments</comments>
		<pubDate>Sat, 26 Jan 2008 11:11:57 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/warcraft-ii-on-windows-xp-a-step-by-step-guide.html</guid>
		<description><![CDATA[Warcraft II &#8211; Tides of Darkness.  I used to love this old DOS game way back when. But now I want to run it on Windows XP. Yes, it is possible. Here&#8217;s how.
DOS Emulation
First you need the very excellent DOSBOX which is a DOS emulator. You can download it from http://www.dosbox.com/.
Once DOSBOX is installed, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Warcraft II &#8211; Tides of Darkness</strong>.  I used to love this old DOS game way back when. But now I want to run it on Windows XP. Yes, it is possible. Here&#8217;s how.</p>
<h4><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/dosboxmount-small.png" alt="DOSBOX" align="right" />DOS Emulation</h4>
<p>First you need the very excellent <strong>DOSBOX </strong>which is a DOS emulator. You can download it from <a href="http://www.dosbox.com/">http://www.dosbox.com/</a>.</p>
<p>Once DOSBOX is installed, we need somewhere to put our DOS games. I created a folder called <strong>C:\DOSGAMES</strong> for this purpose.<br />
<br clear="all" /><br />
Now it is time to run DOSBOX. Once it is going, type the following two commands:</p>
<pre>mount c C:\DOSGAMES\

mount d D:\ -t cdrom</pre>
<p><font color="#c0c0c0"><em>NOTE: If your CD-ROM drive is not D:\, modify this accordingly.</em> </font></p>
<p>Then you can insert your Warcraft II CD. The game can be installed like so:</p>
<pre>D:

SETUP</pre>
<p>Just select all the default options except for the soundcard and music device which you should set to <strong>Soundblaster 16</strong>.<br />
<br clear="all" /></p>
<h4> Making an icon</h4>
<p>At this point you can run the game by typing WAR2. But I don&#8217;t want to stop there. Let&#8217;s now make a pretty icon so you can launch the game with a mouse-click.</p>
<p>Open the folder <strong>C:\Program Files\DOSBox-0.72</strong> and find the file <strong>dosbox.conf</strong>. Copy it to your <strong>C:\DOSGAMES\WAR2</strong> folder.</p>
<p>Edit the copy of <strong>dosbox.conf</strong> and add the following line to the bottom under the [autoexec] section:</p>
<pre>mount d D:\ -t cdrom</pre>
<p>I&#8217;ve found it is also a good idea to reduce the speed of CPU emulation otherwise the map can scroll too fast. Modify the <strong>cycles</strong> entry in dosbox.conf like so:</p>
<pre>cycles=20000</pre>
<p>Now save the changes you made to dosbox.conf.</p>
<p><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/warcraft2icon.png" alt="Warcraft II Icon" align="right" />Copy the DOSBOX icon on your desktop. Rename the copy to &#8220;Warcraft II&#8221;. Now right-click on the icon and select <strong>Properties</strong>.</p>
<p><br clear="all" /><br />
Enter the following text (all on one line) into the <strong>Target </strong>box:</p>
<pre> "C:\Program Files\DOSBox-0.72\dosbox.exe" "C:\DOSGAMES\WAR2\WAR2.EXE"
-conf "C:\DOSGAMES\WAR2\dosbox.conf" -exit -fullscreen</pre>
<p>Then finally click on the <strong>Change Icon</strong> button.</p>
<p>Click Browse and navigate to the folder <strong>C:\DOSGAMES\WAR2</strong>. Double-click the file <strong>WAR2ICON.DLL</strong>.</p>
<p>Choose the WarCraft icon and then click OK. Click OK on the shortcut properties window also.</p>
<p>Now we are done. Click the WarCraft icon and enjoy!</p>
<p style="text-align: center"><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/warcraft2screenshotsmall.png" alt="Warcraft II" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/warcraft-ii-on-windows-xp-a-step-by-step-guide.html/feed</wfw:commentRss>
		<slash:comments>192</slash:comments>
		</item>
		<item>
		<title>TP-Link TL-WN550G PCI Wi-fi card in Ubuntu</title>
		<link>http://www.doctort.org/adam/nerd-notes/tp-link-tl-wn550g-in-ubuntu.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/tp-link-tl-wn550g-in-ubuntu.html#comments</comments>
		<pubDate>Sun, 06 Jan 2008 11:16:51 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/general/tp-link-tl-wn550g-in-ubuntu.html</guid>
		<description><![CDATA[ I finally got rid of that unreliable NetGear Wireless card and replaced it with a TP-Link card which uses the Atheros chipset. It was only $27 at UMart.
I&#8217;ve only had it for a couple of days but in that time I have transferred more than 10GB through it and it has been 100% reliable.
This [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.doctort.org/adam/wp-content/uploads/2008/01/tl-wn550g.jpg" alt="TP-Link TL-WN500G" align="right" /> I finally got rid of that unreliable NetGear Wireless card and replaced it with a TP-Link card which uses the Atheros chipset. It was only $27 at <a href="http://www.umart.net/au">UMart</a>.</p>
<p>I&#8217;ve only had it for a couple of days but in that time I have transferred more than 10GB through it and it has been 100% reliable.</p>
<p>This one was not too difficult to get going on Ubuntu since it is well supported by the <a href="http://madwifi.org/">MadWifi</a> drivers which are built in to Ubuntu.<br />
<br clear="all" /><br />
However there is a little catch if you want to use WEP. You need to add the <strong>iwpriv </strong>command to activate your WEP. Here&#8217;s my /etc/network/interfaces file with the tricky bit highlighted in bold:</p>
<pre># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# TP-Link Wi-fi card
auto ath0
iface ath0 inet dhcp
        wireless-mode Managed
        wireless-essid adamnet
        <strong>pre-up iwpriv ath0 authmode 2</strong>
        wireless-key 1234567890</pre>
<p><em>NOTES: If you are copying this, make sure to change the essid and key to match those of your own network. And if you think this is my real WEP key, you are in for some disappointment. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/tp-link-tl-wn550g-in-ubuntu.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A good VHDL tutorial</title>
		<link>http://www.doctort.org/adam/nerd-notes/a-good-vhdl-tutorial.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/a-good-vhdl-tutorial.html#comments</comments>
		<pubDate>Mon, 19 Nov 2007 23:38:22 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/a-good-vhdl-tutorial.html</guid>
		<description><![CDATA[I had to brush up on my VHDL recently for a project and I discovered the Low-carb VHDL Tutorial by Bryan Mealy.
I really wish I&#8217;d read this one back when I was getting started in VHDL. I wouldn&#8217;t have found it so hard. This document describes the basics of VHDL in a very clear and [...]]]></description>
			<content:encoded><![CDATA[<p>I had to brush up on my VHDL recently for a project and I discovered the <a href="http://ece.gmu.edu/courses/ECE545/viewgraphs_F04/loCarb_VHDL_small.pdf">Low-carb VHDL Tutorial</a> by <a href="http://www.ee.calpoly.edu/~bmealy/">Bryan Mealy</a>.</p>
<p>I really wish I&#8217;d read this one back when I was getting started in VHDL. I wouldn&#8217;t have found it so hard. This document describes the basics of VHDL in a very clear and readable way. It&#8217;s well worth a look if you are wanting to learn VHDL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/a-good-vhdl-tutorial.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Moving a DirectShow window while paused</title>
		<link>http://www.doctort.org/adam/nerd-notes/moving-a-directshow-window-while-paused.html</link>
		<comments>http://www.doctort.org/adam/nerd-notes/moving-a-directshow-window-while-paused.html#comments</comments>
		<pubDate>Thu, 15 Nov 2007 04:26:57 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[Nerd Notes]]></category>

		<guid isPermaLink="false">http://www.doctort.org/adam/nerd-notes/moving-a-directshow-window-while-paused.html</guid>
		<description><![CDATA[I&#8217;ve been writing a lot of DirectX / DirectShow stuff lately and I&#8217;ve come across a problem if I pause a video replay and then move the containing window. The playback window becomes separated from the containing window even though I am handling the WM_MOVE event. 
You&#8217;d think that the following code would work:
void CMyWindow::OnMove()
{
 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.doctort.org/adam/wp-content/uploads/2007/11/directshowmoveproblem.jpeg" alt="directshowmoveproblem.jpeg" align="right" />I&#8217;ve been writing a lot of DirectX / DirectShow stuff lately and I&#8217;ve come across a problem if I pause a video replay and then move the containing window. The playback window becomes separated from the containing window even though I am handling the WM_MOVE event. <br clear="all" /><br />
You&#8217;d think that the following code would work:</p>
<pre>void CMyWindow::OnMove()
{
    CRect r;
    GetClientRect(r);

// _piWindow is a pointer to my filtergraph's IVideoWindow interface.
    _piWindow-&gt;SetWindowPosition(r.left, r.top, r.Width(), r.Height());
}</pre>
<p>It works fine if the video is playing but if the replay is paused, the active movie window will ignore the window move commands.</p>
<p>The solution was to trick DirectShow into thinking that you want to resize the window like so:</p>
<pre>void CMyWindow::OnMove()
{
    CRect r;
    GetClientRect(r);

    _piWindow-&gt;SetWindowPosition(r.left, r.top, r.Width() + 4, r.Height());
    _piWindow-&gt;SetWindowPosition(r.left, r.top, r.Width(), r.Height());
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.doctort.org/adam/nerd-notes/moving-a-directshow-window-while-paused.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
