<?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>FOSSline</title>
	<atom:link href="http://kdubois.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://kdubois.net</link>
	<description></description>
	<lastBuildDate>Fri, 15 Jan 2010 17:00:07 +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>Crash Course on Mixing C and Assembly on Linux/x86</title>
		<link>http://kdubois.net/?p=807</link>
		<comments>http://kdubois.net/?p=807#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:00:07 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=807</guid>
		<description><![CDATA[Editor&#8217;s Note: This article is designed to get you thinking a bit about assembly on i386 machines, and to provide an example of x86 convention function calling. Its not really comprehensive enough to serve as a thorough tutorial. Look here, or here for a bit more comprehensive introduction.

Tinkering with assembly code is a great way [...]]]></description>
			<content:encoded><![CDATA[<p><em>Editor&#8217;s Note: This article is designed to get you thinking a bit about assembly on i386 machines, and to provide an example of x86 convention function calling. Its not really comprehensive enough to serve as a thorough tutorial. Look <a href="http://www.faqs.org/docs/Linux-HOWTO/Assembly-HOWTO.html">here,</a> or <a href="http://www.csee.umbc.edu/help/nasm/sample.shtml">here</a> for a bit more comprehensive introduction.</em></p>
<p><img class="alignnone" src="http://kdubois.net/img/asmheader.jpg" alt="" width="501" height="82" /></p>
<p>Tinkering with assembly code is a great way to learn about how code compiles and runs, and provides great insight into writing better code. Its probably easier and [frankly] more useful, to insert some carefully crafted assembly code into a C program at just the right place. However, you learn more about the machine, and the way your code is stitched together if  you call some C code from an assembly program, which is what we&#8217;ll do here.</p>
<p>Let&#8217;s think a bit about what we need to do to mix C code into assembly. As you probably already know, when you compile a C program, the compiler produces binary code that you can run on the CPU. When you assemble an assembly program, the assembler makes the same type of binary code as well. You can pretty easily mix these two types of code to create a coherent program that you can run. Doing this type of stuff is useful for making highly optimized code, dealing with embedded devices, writing device drivers, or developing low-level things in general. Here, we&#8217;re just doing it to tinker. :)</p>
<p>Now, here&#8217;s the basic thing we&#8217;re going to do here:</p>
<ol>
<li><strong>1.</strong> Write some C code that does something useful. I chose to do a simple calculation of the fibonacci sequence.</li>
<li><strong>2.</strong> Write some assembly code that calls the C code we wrote.</li>
<li><strong>3.</strong> Use a compiler to make binary code from the C code.</li>
<li><strong>4.</strong> Use an assembler to make binary code from the assembly code</li>
<li><strong>5. </strong>Use a linker to to stitch these two chunks of binary code together into an executable.</li>
<li><strong>6.</strong> Run the executable!</li>
</ol>
<p>The C code is pretty straightforward.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//filename: fib.c</span>
<span style="color: #993333;">int</span> fib_linear<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> fib_num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">int</span> i<span style="color: #339933;">,</span>a<span style="color: #339933;">,</span>b<span style="color: #339933;">,</span>tmp<span style="color: #339933;">;</span>
    tmp<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    a <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    b <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> fib_num<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        tmp <span style="color: #339933;">=</span> a<span style="color: #339933;">+</span>b<span style="color: #339933;">;</span>
        a<span style="color: #339933;">=</span>b<span style="color: #339933;">;</span>
        b<span style="color: #339933;">=</span>tmp<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> b<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>I&#8217;ve only used 3 instructions, <em>mov</em>, <em>push</em>, and <em>call</em>. <em>mov</em> simply puts an integer value into a register. <em>push</em> simply puts a value in a register onto the stack, a special bit of memory each program needs. <em>call</em> changes the flow of execution, by calling a function. (In case you forgot, assembly code pretty much shuffles data between &lt;a href=&#8221;http://en.wikipedia.org/wiki/Hardware_register&#8221;&gt;registers.&lt;/a&gt; x86 has (essentially) 4 registers most people use for data, called EAX, EBX, ECX, and EDX.)</p>
<p>The last question here is &#8220;how do we call a function from an assembly file?&#8221; By the convention used for all x86 code, the result of the function is returned in the EAX register. According to convention, the function is free to trash EAX, ECX, and EDX, but not EBX. It is common to allow some registers to be trashed (caller-save registers) and some not to be trashed (caller-save) in all architectures. This allows for greater interoperability between code. In order to call the function, we need to load in the arguments to the function, then call the function. So if you want to call foo(x,y,z), you&#8217;d <em>push</em> z, <em>push</em> y, <em>push</em> x, then <em>call</em> foo. When the function finishes, look for the result in EAX. Don&#8217;t count on EAX, ECX, and EDX to be unchanged after the function call. Its just that simple.</p>
<p>So, here&#8217;s the actual assembly code you can look at!</p>

<div class="wp_syntax"><div class="code"><pre class="x86" style="font-family:monospace;">;filename: main.as
extern fib_linear ;extern notifies the assembler that this label exists outside the file
extern printf
&nbsp;
section .data
        msg:    db &quot;eax=%X   ebx=%X   ecx=%X   edx=%X&quot;, 10 ;just a string for printf to use
section .text
        global main
&nbsp;
main:
        mov ebx, 9   ;we will be computing the 9th fib number
        mov eax, 0xbeef ;random values
        mov ecx, 0xdead
        mov edx, 0xface
&nbsp;
        push edx     ;load in 5th arg
        push ecx     ; 4th arg
        push ebx     ; 3rd arg
        push eax     ; 2nd arg
        push msg     ; 1st arg
        call printf ;same as calling &quot;printf(&quot;eax= ...&quot;, eax, ebx, ecx, edx);&quot;
&nbsp;
        push ebx ;load in 1st argument
        call fib_linear ;calls &quot;fib_linear(eax)&quot;
&nbsp;
        push edx
        push ecx
        push ebx
        push eax
        push msg
        call printf     ;print out the values of the 4 registers
&nbsp;
        mov eax, 1      ;stops the program the right way
        mov ebx, 0
        int 80h</pre></div></div>

<p>To test this out, simply run the commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nasm</span> <span style="color: #660033;">-f</span> elf <span style="color: #660033;">-o</span> main.o main.asm  <span style="color: #666666; font-style: italic;">#assemble our asm file</span>
<span style="color: #c20cb9; font-weight: bold;">gcc</span> fib.c main.o <span style="color: #660033;">-o</span> fib_asm     <span style="color: #666666; font-style: italic;">#compile and link in one step</span>
.<span style="color: #000000; font-weight: bold;">/</span>fib_asm                       <span style="color: #666666; font-style: italic;">#run the program you'll see the value of the registers before and after the call</span></pre></div></div>

<p>There you go! You&#8217;ve just made your first hybrid x86 assembly/C code program! I hope I&#8217;ve got you interested in assembly a bit through this short crash article. If you want a full tutorial you can look <a href="http://www.faqs.org/docs/Linux-HOWTO/Assembly-HOWTO.html"> here, or just google around a bit. </a> Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=807</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To Make A Kernel Sandbox using QEMU</title>
		<link>http://kdubois.net/?p=760</link>
		<comments>http://kdubois.net/?p=760#comments</comments>
		<pubDate>Sun, 10 Jan 2010 01:20:19 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=760</guid>
		<description><![CDATA[
Last post, I described a few reasons why a kernel sandbox might boost your ability to tinker with the kernel. Now I&#8217;m going to describe how you can do this!
I use a debian virtual disk image, along with QEMU for the virtualization. Why QEMU? Its open source (always a plus), free, and has been used [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="Sandbox" src="http://kdubois.net/img/sandbox.jpg" alt="" width="495" height="71" /></p>
<p>Last post, I described a few reasons why a kernel sandbox might boost your ability to tinker with the kernel. Now I&#8217;m going to describe how you can do this!</p>
<p>I use a debian virtual disk image, along with QEMU for the virtualization. Why QEMU? Its open source (always a plus), free, and has been used pseudo-extensively by a lot of kernel developers. Furthermore, its controlled by the command line, which makes it easier for the type of development we&#8217;re doing.</p>
<p>First, we have to make the virtual machine&#8217;s system disk image by allocating a hunk of disk space in a big amorphous file. You can do this easily using the tool, &#8220;dd&#8221;. Here I am making a garbage file that is 1 GB (1M * 1M) in size. Make sure you have the space available! We will later fill this with useful data.<br />
<code>dd if=/dev/zero of=vm_disk.img bs=1M count=1024</code><br />
Now that we have a big garbage file to work with, we have to format it with a filesystem. Set up the ext3 filesystem on the image by doing:<br />
<code>mkfs.ext3 vm_disk.img</code><br />
(if prompted, hit &#8216;y&#8217;)</p>
<p>Mount the image in your filesystem, so you can poke around in your file:<br />
<code>mkdir /media/vm<br />
mount -o loop vm_disk.img /media/vm</code></p>
<p>Now we have a file on your computer that is, for all intents and purposes, an empty virtual hard drive. We have to fill it with a minimal system now. Debian has a pretty easy tool that does just this. By running:<br />
<code>debootstrap sid mounted/ http://ftp.us.debian.org/debian/</code><br />
Your computer will put a basic stable debian installation on your virtual disk image. Your Virtual Disk is now ready for use! Let&#8217;s unmount it&#8230;<br />
<code> umount /media/vm </code></p>
<p>Now, its up to you to make the latest awesome change to the kernel source, configure, and compile it. Doing this is beyond the scope of this article, but if you&#8217;re reading this article, there&#8217;s a pretty good chance you&#8217;re already schooled in how to do all this. :). As you know, when you&#8217;re done with this step, you have a kernel disk image as a result.</p>
<p>Alright, now we&#8217;re ready to finally run the kernel you built on the virtual disk you made! Assuming you&#8217;ve installed QEMU using your system&#8217;s package manager, just run:<br />
<code>qemu -hda vm_disk.img -kernel kernel_source/arch/x86/boot/bzImage -append "root=/dev/sda"</code></p>
<p>You&#8217;ll see the system booting up [hopefully], and you&#8217;ll be able to see how great the changes you made to the kernel are (or aren&#8217;t :-) ).</p>
<p>A few warnings: Make sure you have ext3 support compiled /into/ the kernel. You can use these techniques to do a few more advanced features, like rolling a swap file, and using that in qemu. Read qemu&#8217;s manpages to think up things to do. I just listed a few of the warnings that came from the top of my head, if you think of any more, be sure to leave them in the comments!</p>
<p>I hope that this suggestion helps you in your hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=760</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kernel Sandbox</title>
		<link>http://kdubois.net/?p=725</link>
		<comments>http://kdubois.net/?p=725#comments</comments>
		<pubDate>Fri, 08 Jan 2010 22:03:33 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=725</guid>
		<description><![CDATA[
This article is about a suggestion for making kernel work easier. The next article will be about how to implement the suggestions I make.
Kernel coding is a bit of a pain, if you compare it to userspace coding. You loose a lot of nice things in userspace, like segfaults (think you can&#8217;t live with them? [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" src="http://kdubois.net/img/sandbox.jpg" alt="" width="495" height="71" /></p>
<p style="text-align: left;"><em>This article is about a suggestion for making kernel work easier. The next article will be about how to implement the suggestions I make</em>.</p>
<p style="text-align: left;">Kernel coding is a bit of a pain, if you compare it to userspace coding. You loose a lot of nice things in userspace, like segfaults (think you can&#8217;t live with them? try living without them ;) ), and a bad kernel build can easily stop a system cold. These stupid little annoyances can really stop beginners from getting involved! Figuring out how to work around this took me longer than I had hoped, and I&#8217;m going to share some of the things that made kernel work go from an omg-pain-in-the-arse to only marginally more painful than userspace coding :)</p>
<p>Firstly, I&#8217;ve really taken a shine to working in a nice VM sandbox environment for a few reasons:</p>
<li> Stupendously bone-headed kernel hacking can do funny things to your computer, including bricking it, turning off some part somewhere, and having to wade through documentation to figure out what is going on, or simply causing a system crash.</li>
<li> Rebooting into a new kernel each time is very annoying. When coding in the kernel (especially if you&#8217;re just tinkering with things in the core like I&#8217;ve been doing lately), you need to boot into that kernel to test your changes. Waiting the 30 seconds is pretty annoying, and then, all your programs and documentation you had up all have to be re-started. If this sounds like pointless whining, just try spending 40% of the time you are working on rebooting, restoring, and waiting for the machine to do its thing.</li>
<li>Kernel panics are the worst. These are simply caused when something very wrong happens in the kernel. The infamous blue screen of death is the result of a Windows kernel panic. This being said, if you&#8217;re developing or tinkering with a kernel, there&#8217;s a mild chance that you&#8217;re gonna cause a kernel panic at some point or the other. If you&#8217;re testing on a real machine, a kernel panic will lock your computer up, you&#8217;ll lose work you&#8217;ve been doing, etc.</li>
<p></br><br />
How can we avoid these three barriers to kernel coding? Easy. Boot the kernel up in a virtual machine, like qemu. The virtual machine stops you from messing up your physical machine with a (potentially) wonky kernel. Furthermore, if the kernel panics in the virtual machine, you can easily shut it down, and preserve all the programs and documentation you&#8217;re using. If you do run into a panic or crash, the virtual disk image is still there after you power the virtual machine down, allowing you to view any crash logs without booting the system again. Finally, when you have to boot into a new kernel, you don&#8217;t have to kill all your programs you&#8217;re using to get the new build going.</p>
<p><img title="hazard" src="http://kdubois.net/img/redhazard.jpg" alt="Hazard!" width="59" height="59" align="left" /><em>Now, for the warnings! </em>As with most things, there are trade-offs. Working in a sandbox kernel environment under a VM is nice for most of the reasons stated above. However, if you&#8217;re doing things like device driver development, its often very inadequate to just work in a VM. No matter what development you&#8217;re doing, the eventual end-game for your work is to be deployed on a real machine. You don&#8217;t want some flawless latest-and-greatest code you&#8217;ve written to work perfectly in QEMU, and panic &#8216;n crash on a real machine!</p>
<p>All in all, simply working with a virtual machine 80% of the time is <strong><em>a lot</em></strong> nicer than working with a physical machine 100% of the time, and has really allowed me to not exhaust my patience when working with kernel code.</p>
<p>Next article (published tomorrow) will be a brief how-to for how I set up a kernel sandbox.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=725</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Back!</title>
		<link>http://kdubois.net/?p=704</link>
		<comments>http://kdubois.net/?p=704#comments</comments>
		<pubDate>Tue, 29 Dec 2009 06:01:01 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=704</guid>
		<description><![CDATA[If you&#8217;ve been wondering where I&#8217;ve been the last few months, the short answer is simply &#8220;here&#8221;:
View Larger Map
(also known as my school&#8217;s Electrical Engineering Building)
I was working on my Senior Design Project, which was to implement an out-of-order Alpha processor using the Verilog Hardware Description Language. Put simply, me and my 3 team members [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been wondering where I&#8217;ve been the last few months, the short answer is simply &#8220;here&#8221;:</p>
<p><iframe width="425" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=42.29236,-83.714127&amp;num=1&amp;t=h&amp;sll=42.270872,-83.726329&amp;sspn=0.06607,0.128059&amp;ie=UTF8&amp;ll=42.292009,-83.715799&amp;spn=0.003968,0.006437&amp;z=16&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?q=42.29236,-83.714127&amp;num=1&amp;t=h&amp;sll=42.270872,-83.726329&amp;sspn=0.06607,0.128059&amp;ie=UTF8&amp;ll=42.292009,-83.715799&amp;spn=0.003968,0.006437&amp;z=16&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></p>
<p>(also known as <a href="http://www.umich.edu">my school&#8217;s</a> Electrical Engineering Building)</p>
<p>I was working on my Senior Design Project, which was to implement an <a href="http://en.wikipedia.org/wiki/Out-of-order_execution">out-of-order</a> <a href="http://en.wikipedia.org/wiki/DEC_Alpha">Alpha</a> processor using the <a href="http://en.wikipedia.org/wiki/Verilog">Verilog Hardware Description Language</a>. Put simply, me and my 3 team members made a 200MHz processor with roughly the Pentium 4 architecture for our senior design project/thesis. The class is known as a trial-by-fire introduction to hardware description languages, and we came through with good grades (and the fastest clock period in the class). </p>
<p>Point is, I haven&#8217;t had a lot of free time to blog lately. :P Thankfully though, I&#8217;m on (my last undergrad) semester break and have some time to catch up on blogging, and email, job hunting, hacking, and life, so expect some useful posts soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=704</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the Most out of Vim with Filetype Detection</title>
		<link>http://kdubois.net/?p=592</link>
		<comments>http://kdubois.net/?p=592#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:23:44 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=592</guid>
		<description><![CDATA[Customize the appearance of each text file you edit with vim!
It comes in handy to have different filetypes appear differently in your text editor. Perhaps you want tabs turned into spaces automatically in all C files, but you don&#8217;t want that to happen in Makefiles, where the tab character is necessary. Perhaps you like to [...]]]></description>
			<content:encoded><![CDATA[<p><em>Customize the appearance of each text file you edit with vim!</em></p>
<p><img src="http://kdubois.net/img/vim.png" alt="vim logo" align="left" />It comes in handy to have different filetypes appear differently in your text editor. Perhaps you want tabs turned into spaces automatically in all C files, but you don&#8217;t want that to happen in Makefiles, where the tab character is necessary. Perhaps you like to do python coding with a black foreground, and write a text file with a white foreground. Maybe you want html code to have 100 characters per line but have a text file wrap at 80 characters. You get the idea.</p>
<p>Filetype detection is actually not very hard to do with Vim, even though the documentation might you scratching your head about how to do it. Luckily, I&#8217;m here to explain it via examples. :)</p>
<p>First of all, make sure these two lines are anywhere in your vimrc:</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;">filetype on
filetype plugin on</pre></div></div>

<p>This will turn on the filetype detection.</p>
<p>Second of all, create the directory <b> ~/.vimrc/ftplugin </b></p>
<p>In that directory, add the file, <b> [file-type-name].vim </b> where [file-type-name] is the name of the filetype you are customizing. For instance, the customization for C files would be c.vim; python files, python.vim, etc. In Ubuntu 9.04, you can find a list of supported filetypes in /usr/share/vim/vim72/ftplugin.</p>
<p>In the file you just created, add the customization options what you want. When you open a new file, Vim will automatically detect the filetype (its pretty good at this) and apply the settings you specified. Use &#8217;setl&#8217; instead of &#8217;set&#8217; so the customizations only apply to the correct file. For example, here is my file for C text files.<br />
<b> custom C settings file, c.vim </b></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&quot; File: ~/.vim/ftplugin/c.vim
&nbsp;
color default     &quot;use the default colorscheme
setl textwidth=80   &quot;80 character lines
setl nowrap           &quot;don't wrap lines at the end
setl cindent           &quot;use C style indents
setl sw=4        &quot;Use 4 space tabs</pre></div></div>

<p>See, simple as that. You&#8217;ll need a different file for each filetype you want custom settings for. Now you know how to have each filetype do its own thing!</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=592</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Shatner of the Mount</title>
		<link>http://kdubois.net/?p=590</link>
		<comments>http://kdubois.net/?p=590#comments</comments>
		<pubDate>Wed, 23 Sep 2009 15:31:46 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=590</guid>
		<description><![CDATA[&#8220;Picard v. Kirk&#8221; is a classic Holy War, and really part of geek heritage. I&#8217;m not gonna declare my allegiance here, just to keep this important new piece of evidence as pure as possible.
Here it is for your evaluation:

Apparently it is a remix taken from an interview with William Shatner as an &#8220;Extra Feature&#8221; on [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Picard v. Kirk&#8221; is a classic Holy War, and really part of geek heritage. I&#8217;m not gonna declare my allegiance here, just to keep this important new piece of evidence as pure as possible.</p>
<p>Here it is for your evaluation:<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/HU2ftCitvyQ&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HU2ftCitvyQ&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Apparently it is a remix taken from an interview with William Shatner as an &#8220;Extra Feature&#8221; on a Star Trek Movie DVD.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=590</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Best Place In the World (According to Google)</title>
		<link>http://kdubois.net/?p=672</link>
		<comments>http://kdubois.net/?p=672#comments</comments>
		<pubDate>Wed, 09 Sep 2009 16:12:12 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=672</guid>
		<description><![CDATA[Best place in the world (according to Google Maps)]]></description>
			<content:encoded><![CDATA[<p>Google maps is a pretty good distraction during intolerable lectures. Here&#8217;s a little nugget I found today.<br />
<img src="http://kdubois.net/img/bestaccordingtogoogle.jpg" align=center><br />
I guess all those I <3 NY shirts are justified now, eh? One day I'll have to make it out there to see for myself...<br />
(and yes, I had to crop/edit the picture to fit on my blog. You can <a href="http://maps.google.com/maps?f=q&#038;source=s_q&#038;hl=en&#038;geocode=&#038;q=best+place+in+the+world&#038;sll=42.277416,-83.733276&#038;sspn=0.185691,0.345726&#038;ie=UTF8&#038;t=h&#038;z=13">see for yourself</a> if you really don&#8217;t believe me&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=672</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Stock Ticker for XFCE Panel!</title>
		<link>http://kdubois.net/?p=584</link>
		<comments>http://kdubois.net/?p=584#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:40:28 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=584</guid>
		<description><![CDATA[[I decided to write a stock ticker applet for XFCE like the one that was removed from Gnome a couple years ago.]]]></description>
			<content:encoded><![CDATA[<p><img src="http://kdubois.net/img/stock_ticker_photo.jpg" alt="Stock ticker photo" align="right" width=80 height=50> Back in the day, Gnome had a stock ticker panel applet that I really liked. Just a regular ticker, scrolling across the top of the screen, like you&#8217;d see on a financial news channel. Then, (according to some Gnome devs I talked to), the maintainer dropped off the face of the earth, and the applet was removed from the Gnome distribution, much to my dismay. I&#8217;ve missed it ever since.</p>
<p>These days, I use xfce more than I use gnome, and I decided to write a stock ticker applet like the one that was removed from Gnome a couple years ago.</p>
<p>Here it is in action:<br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="322" id="viddler_a6168d53"><param name="movie" value="http://www.viddler.com/player/a6168d53/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/player/a6168d53/" width="437" height="322" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_a6168d53"></embed></object></p>
<p><em>Planet users: <a href="http://www.viddler.com/explore/kdubois/videos/11/">click here to see it</a></em><br />
And, a closeup screenshot:<br />
<img src="http://kdubois.net/img/ticker-ss.jpg" alt="Ticker" width=500 /></p>
<p>Its implemented in C, and uses libcurl to access the Yahoo! Finance API, and uses Clutter to perform the animation. It requires an active internet connection (of course) in order to retrieve the data. All in all, I really liked the mechanisms Xfce provides for implementing panel plugins, especially when compared to gnome-panel.  The plugin is [of course] licensed under the GPL. It is <b>only</b> to be used as a rough estimate of what the price is. Price accuracy is not guaranteed in any way. If any artist out there has some open-source financial icons to donate to the project, make sure to hit me up.</p>
<p>So, if you use Xfce and are interested in the stock ticker applet, grab the source from <a href="http://kdubois.net/src/stock_ticker.tar.gz"> here for now</a>. I&#8217;ll be putting it up on the xfce-goodies svn soon, once I get my account there working. </p>
<p>Its still &#8220;pretty alpha&#8221;, meaning I just got it working, but I plan on improving it to the point that its easily usable, and packaging it into a deb so that people can install it easily. There are also a few things I still want to add, like adjustable width of the plugin and selecting which way the text scrolls, but those should be coming down the pipes soon. Buy low, sell high, and enjoy my ticker program. :D</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=584</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Support for the Saleae Logic Analyzer!</title>
		<link>http://kdubois.net/?p=656</link>
		<comments>http://kdubois.net/?p=656#comments</comments>
		<pubDate>Sun, 30 Aug 2009 09:14:24 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=656</guid>
		<description><![CDATA[I&#8217;ve been looking to set up a microprocessor/robotics type hobbyist lab for a while, and I&#8217;d like to use Linux as much as possible for the tools I&#8217;ll be buying and using. One of the most critical components in any good logic lab is a decent logic analyzer. A logic analyzer is a tool with [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking to set up a microprocessor/robotics type hobbyist lab for a while, and I&#8217;d like to use Linux as much as possible for the tools I&#8217;ll be buying and using. One of the most critical components in any good logic lab is a decent logic analyzer. A logic analyzer is a tool with multiple probes that you attach to various points to monitor the voltage levels at the test points. It&#8217;s pretty much essential if you want to figure out why your digital circuit isn&#8217;t working the right way.</p>
<p><img src="http://kdubois.net/img/saleae-la.jpg" align="left" width="500"><br />
High-end logic analyzers can process data on the GHz level, and cost thousands and thousands of dollars. Luckily, companies have come out with logic analyzers that are a lot cheaper, and work well for pretty much any hobbyist or robotics project you want to do. These cheaper devices typically hook up to USB on computer, and need a program on a computer to run. Saleae released a 8 channel, 24Mhz USB Logic Analyzer for $150 a while ago, along with a Windows program to run it. They promised that equal support for Mac and Linux was coming down the tubes, and I&#8217;m happy that they are delivering. The SDK came out a while ago, and they just released an initial program, that only still lacks a few [albeit critical] features that are coming out in the next release, like working pattern triggering.</p>
<p>Here&#8217;s a screenshot of the program in action (get the alpha program <a href="http://groups.google.com/group/saleae-logic-private-beta">here</a>):<br />
<img src="http://kdubois.net/img/saleae-logic-linux.jpg" alt="logic analyzer software for linux" align="center" width="500" /><br />
As you can see if you look closely, its just a simulation ( I don&#8217;t have the device yet ), but it looks like it has everything I would want out of a $150 logic analyzer. Also, the guys at <a href="http://sparkfun.com"> Sparkfun </a> seem to like it enough to sell it, another good mark in my book. I&#8217;ll be <a href="http://www.saleae.com/logic/">buying a device from here</a> soon! Thanks for the Linux support Salhttp://www.saleae.com/logic/eae. :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=656</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fortune Cookie Signature for Thunderbird</title>
		<link>http://kdubois.net/?p=553</link>
		<comments>http://kdubois.net/?p=553#comments</comments>
		<pubDate>Thu, 16 Jul 2009 17:11:28 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://kdubois.net/?p=553</guid>
		<description><![CDATA[Customize thunderbird to send a unique signature each time!]]></description>
			<content:encoded><![CDATA[<p><img src="http://kdubois.net/img/fortunecookie.jpg" align="left" alt="Credit: http://oygirl.files.wordpress.com">I&#8217;ve been using Thunderbird to take care of my emails lately, I&#8217;ve found I like using a mail client with IMAP slightly better than logging onto web mail interfaces. As such, I&#8217;ve been customizing Thunderbird to be exactly what I like it to be. I decided I wanted my signature to be my name, email address, and a different saying each time.</p>
<p>Here&#8217;s how I customized my signature in Thunderbird to auto-rotate fortunes.</p>
<p>First of all, I wrote a short script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;&lt;big&gt;Kevin DuBois&lt;/big&gt;&quot;</span>
<span style="color: #007800;">EMAIL</span>=<span style="color: #ff0000;">&quot;kdub432@gmail.com&quot;</span>
<span style="color: #007800;">FORTUNE</span>=<span style="color: #ff0000;">&quot;&lt;small&gt;&lt;em&gt;&quot;</span><span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>games<span style="color: #000000; font-weight: bold;">/</span>fortune <span style="color: #660033;">-n</span> <span style="color: #000000;">80</span> -s<span style="color: #000000; font-weight: bold;">`</span><span style="color: #ff0000;">&quot;&lt;/em&gt;&lt;/small&gt;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">&lt;</span>html<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>body<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #ff0000;">&quot;<span style="color: #007800;">${NAME}</span><span style="color: #007800;">${EMAIL}</span><span style="color: #007800;">${FORTUNE}</span>&quot;</span><span style="color: #000000; font-weight: bold;">&lt;/</span>body<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>html<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kdub<span style="color: #000000; font-weight: bold;">/</span>docs<span style="color: #000000; font-weight: bold;">/</span>signature.html</pre></div></div>

<p>This script creates the signature I wanted whenever its run, with a different 80 character or shorter fortune attached to the end. I used the classic program &#8220;fortune&#8221; (included by default on most distributions) to generate the fortune. They&#8217;re all pretty creative fortunes, of equal or higher quality than you&#8217;d find in a fortune cookie. :P</p>
<p>Next, to make this rotate fortunes, I added this script to crontab&#8230;<br />
Run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> crontab <span style="color: #660033;">-e</span></pre></div></div>

<p>next, add</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kdub<span style="color: #000000; font-weight: bold;">/</span>source<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>fortune.sh</pre></div></div>

<p><strong>Note:</strong>For both this, and the script, adjust pathnames accordingly to where you want the signature file to live, and where you want the script to live. As you see, I keep my signature file in ~/docs and my script in the directory I keep my scripts.</p>
<p>Finally, navigate to &#8220;Account Settings&#8221; in Thunderbird&#8217;s menus, and add the html file the script generates as your signature. See screenshot for where this is done. (<em>Click to enlarge</em>) <a href="http://kdubois.net/img/tbird-email.jpg"><img src="http://kdubois.net/img/tbird-email.jpg" alt="Email Screenshot" width="100" height="95" align="left" /></a></p>
<p>With this, every time you write a new email, you&#8217;ll have a new fortune to send, auto-provided for you!</p>
<p><em>Side note: Be careful if you&#8217;ve installed the &#8220;offensive fortunes pack&#8221;. (Debian package &#8216;fortunes-off&#8217;).</em></p>
]]></content:encoded>
			<wfw:commentRss>http://kdubois.net/?feed=rss2&amp;p=553</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
