<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Andrew E. Bruno</title>
	<atom:link href="http://left.subtree.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://left.subtree.org</link>
	<description>A sourceful of secrets</description>
	<lastBuildDate>Sun, 15 Jan 2012 04:16:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='left.subtree.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/e14c799c6e8030a8abefcb495c0b0e17?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Andrew E. Bruno</title>
		<link>http://left.subtree.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://left.subtree.org/osd.xml" title="Andrew E. Bruno" />
	<atom:link rel='hub' href='http://left.subtree.org/?pushpress=hub'/>
		<item>
		<title>Questions about Software Engineering</title>
		<link>http://left.subtree.org/2012/01/14/questions-about-software-engineering/</link>
		<comments>http://left.subtree.org/2012/01/14/questions-about-software-engineering/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 04:16:50 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=442</guid>
		<description><![CDATA[I was going through some old emails yesterday and came across one from a student at RIT who interviewed me for an introductory course he was taking. The interview consisted of questions regarding software engineering and my experience working in the field and at the Center for Computational Research. The questions were good and made [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=442&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was going through some old emails yesterday and came across one from a student at RIT who interviewed me for an introductory course he was taking. The interview consisted of questions regarding software engineering and my experience working in the field and at the <a href="http://www.ccr.buffalo.edu">Center for Computational Research</a>. The questions were good and made me think back through my career about some things I&#8217;ve learned along the way. I thought a few of them were worth sharing and if you&#8217;re so inclined, feel free to leave how you might have answered the questions in the comments. Here&#8217;s an excerpt of the interview with a few questions and my responses:</p>
<p><em>Q: What skills are important for your job?</em></p>
<blockquote><p>I think having a strong foundation in computer science is important. We work across several disciplines and being able to apply computer science concepts to help solve the various problems in a particular research area is important.</p>
<p>Managing expectations. It&#8217;s often the case that you work with users who don&#8217;t have a firm grasp of the technology and being able to explain the various components of a system in such a way that they understand both the capabilities and limitations is an important skill.</p>
<p>Problem solving. I think as a programmer you&#8217;re often confronted with a vast array of problems, whether they be bugs in code, design choices (what implications does a particular design choice have on the overall system?), reverse engineering legacy systems, data processing (how do you efficiently process terabytes of data?). Your ability to adapt to these problems and come up with effective solutions is a very important skill to develop. I&#8217;m not sure it&#8217;s a skill you ever really master but one that you are constantly fine tuning.</p></blockquote>
<p><em>Q: What is your typical process for designing and developing software?</em></p>
<blockquote><p>We tend to follow an Agile approach to software development (iterative approach: design, code, test, feedback, repeat). For any given project we first start with a requirements gathering phase. This includes meeting with the various groups involved in the project and getting a solid understanding of the scope. We then meet internally and come up with an initial design and set various milestones for the project. The next phase depends on the main focus of the project, because we are a research focused group we are often times working on a grant application or an already funded grant. In the first case we usually build a prototype of the system which serves as proof of concept should the grant get funded. In the case of an already funded project we follow a more rigorous development cycle involving a more formal design specification and development/staging/production environments for releasing versions of the system.</p></blockquote>
<p><em>Q: What makes working for a university unique (as opposed to a private company)?</em></p>
<blockquote><p>In a university setting (specifically research) there&#8217;s obviously more focus on cutting edge research areas. We&#8217;re exploring new topics that aren&#8217;t always well defined so there&#8217;s quite a bit of room for creativity. We also support researchers across many disciplines and sometimes you work on a project that doesn&#8217;t always end up getting funded. So there&#8217;s times when you put quite a bit of work into something that never gets off the ground.</p>
<p>In contrast, working for a private company ultimately comes down to being profitable. So design decisions tend to be heavily influenced by customers/investors and what effects the bottom line. In my experience the private sector is much more deadline driven as well. Usually there&#8217;s a strict release schedule to meet and a never ending list of features to be implemented.</p></blockquote>
<p><em>Q: What do you like most and like least about your job?</em></p>
<blockquote><p>I very much enjoy the problem solving aspects of programming. Tackling hard problems is something I enjoy and in this field there&#8217;s definitely no shortage of them. I would have to say the thing I like least about my job is having to occasionally work with Microsoft technologies :) I&#8217;m a big advocate of free software and I cringe at the thought of having to implement a piece of JavaScript code so that it works in I.E.</p></blockquote>
<p><em>Q: What skills have you learned from being a software engineer? What has the job taught you?</em></p>
<blockquote><p>I think one of the best skills I&#8217;ve learned from being a software engineer is system administration. I&#8217;ve always had a passion for tinkering around with different technologies and in doing so spent quite a bit of time building systems so that I could develop on. In the process I&#8217;ve learned a lot about system administration which has helped me out tremendously in various projects throughout my career. As a programmer it helps to know more than just how to write code.</p></blockquote>
<p><em>Q: Any additional thoughts or comments?</em></p>
<blockquote><p>Random advice: One of the most important tools for a programmer is a good editor. There&#8217;s a lengthy debate as to which editor is the best (I personally prefer Vim) but whatever one works for you, learn it inside and out.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/442/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/442/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/442/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=442&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2012/01/14/questions-about-software-engineering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>passtab &#8211; store passwords in your wallet</title>
		<link>http://left.subtree.org/2011/07/01/passtab-store-passwords-in-your-wallet/</link>
		<comments>http://left.subtree.org/2011/07/01/passtab-store-passwords-in-your-wallet/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 04:15:21 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[passtab]]></category>
		<category><![CDATA[passwords]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=334</guid>
		<description><![CDATA[Here&#8217;s a quote from Bruce Schneier that essentially sums up the motivation for this post: We&#8217;re all good at securing small pieces of paper. I recommend that people write their passwords down on a small piece of paper, and keep it with their other valuable small pieces of paper: in their wallet. I recently read [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=334&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quote from <a href="http://www.schneier.com/blog/archives/2005/06/write_down_your.html">Bruce Schneier</a> that essentially sums up the motivation for this post:</p>
<blockquote><p>
We&#8217;re all good at securing small pieces of paper. I recommend that people write<br />
their passwords down on a small piece of paper, and keep it with their other<br />
valuable small pieces of paper: in their wallet.
</p></blockquote>
<p>I recently read an excellent <a href="http://blog.jgc.org/2010/12/write-your-passwords-down.html">blog post</a> by John Graham-Cumming in which he presents a elegant system for writing down your passwords using a <a href="http://en.wikipedia.org/wiki/Tabula_recta">Tabula Recta</a>. I was inspired by this concept so I created a tool called <a href="https://github.com/aebruno/passtab">passtab</a> which aims to provide a light-weight system for managing passwords based on his idea. This post is about the general usage of passtab and presents some of the password management capabilities. This is not your grandmothers password manager so if you&#8217;re looking for a nice GUI point and click application that&#8217;s easy to use you can stop reading right here. This is for hardcore folks who enjoy looking up their passwords in archaic <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Tabula_recta">tablets</a> invented by ancient cryptographers with last names like <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Johannes_Trithemius">Trithemius</a>. For the impatient, you can grab a copy of the latest version on <a href="https://github.com/aebruno/passtab/archives/master">github</a>.  </p>
<p><strong>Introducing passtab</strong></p>
<p><a href="https://github.com/aebruno/passtab">passtab</a> is a light-weight system for managing passwords using a Tabula Recta. passtab has two main features: 1. generating random Tabula Recta&#8217;s in PDF format for printing and storing in your wallet 2. fetching passwords from the Tabula Recta (password managment). These features are independent and you can use passtab to only generate PDFs or optionally make use of the password management features. One unique benefit is the ability to have both an electronic and paper copy of your passwords. You can download the binary release of passtab at github <a href="https://github.com/aebruno/passtab/archives/master">here</a>. Unpack the distribution and run <code>./bin/passtab --help</code> for a list of options. If the startup shell script doesn&#8217;t work you can run <code>java -jar lib/passtab-uber.jar --help</code>. The following sections illustrate some use cases of passtab.</p>
<p><strong>Generate a random Tabula Recta in PDF</strong></p>
<p>passtab can generate random Tabula Recta&#8217;s in PDF format. </p>
<p><pre class="brush: plain;">
$ ./bin/passtab --format pdf --output passtab.pdf
Jun 12, 2011 11:16:29 AM org.qnot.passtab.PassTab generate
INFO: Generating a random Tabula Recta (might take a while)...
$ ls *.pdf
passtab.pdf
</pre></p>
<p>Here&#8217;s an <a href='http://qnot.files.wordpress.com/2011/06/passtab.pdf'>example PDF</a> generated from passtab. You can now print this PDF out and store in your wallet!</p>
<p><strong>How to use the Tabula Recta</strong></p>
<p>Here&#8217;s a simple example (taken directly from the <a href="https://github.com/aebruno/passtab/blob/master/README">README</a>), suppose we have the following Tabula Recta:</p>
<pre>

    | A B C D E F G H I J K L M N
  --|----------------------------
  A | _ u } I ` } R ) a &lt; L : a A
  B | - o ( : p # O % . _ ; ' j L
  C | w c ( c y 2 h y ~ N O * &gt; w
  D | o : R m L % V , d H r Y B j
  E | 9 , &lt; 0 J p a o ) O w 0 w #
  F | C j i } i z 2 $ O R 5 @ T I
  G | Q - E m 8 N c / + u W Y V &gt;
  H | , y } U Y i j i q w q c - 4
  I | K j W H e ; I ? E 7 H v 2 +
  J | g * 7 4 E } a h Y z &lt; " : w
  K | . _ } I / J k 1 a D ^ ; p K
  L | ` &lt; A L c z } } I P ? 4 y T
  M | F D &lt; 8 &lt; 0 R B t 9 X o B 2
  N | I r O E m o a + Y W w ; : 7
</pre>
<p></p>
<p>And suppose we want to get our password for logging into webmail at acme.com. We decide to use the first and last letter of the domain name as the start row/column of the password and we want a password 8 characters in length. So we start at the intersection of &#8216;A&#8217; and &#8216;E&#8217; and read off 8 characters diagonally resulting in the password: <code>'#h,)RWc</code></p>
<p>Defining a scheme for selecting the starting row/column for a given password is completely up to the user and can be as simple or as complex as one desires. The direction for reading the password is also up to the user to define (left, right, diagonally, etc.). See John Graham-Cumming&#8217;s excellent <a href="http://blog.jgc.org/2010/12/write-your-passwords-down.html">blog post</a> for more examples. </p>
<p>This method is slightly more complex than just writing down your passwords on a sheet of paper but the added complexity offers some advantages:</p>
<ol>
<li>Can store <i>all</i> your passwords on a single sheet of paper</li>
<li>If someone steals this sheet of paper they&#8217;ll have a harder time figuring out what your passwords are</li>
<li>Allows you to use strong random passwords</li>
<li>If you want to change your passwords just re-generate a new Tabula Recta. Your scheme for selecting passwords can stay the same</li>
</ol>
<p>passtab makes no assumptions about how passwords are read nor does it know anything about your scheme (unless you configure it). Now that you don&#8217;t have to remember long random passwords anymore what <i>do</i> you need to remember when using a Tabula Recta? Well first, you need to come up with a method for finding the starting position for a given password. In the example above this can be as simple as using characters from a domain/host name. But the beauty is you can be as creative as you want. A scheme that works for most of your passwords would probably be ideal but you can certainly generate multiple Tabula Recta&#8217;s if you like. Once you have a way of coming up with a starting location you need to define a method for reading off the password. In passtab this is called a <code>sequence</code>. In the example above we simply read 8 characters diagonally. But again you can be creative here. You could read 8 characters diagonally skipping every 3rd character, etc. Lastly, you&#8217;ll need to remember what to do if you hit the edge of the Tabula Recta before the end of the password. For example, if you start at Z:Z and want to read 8 characters diagonally you can&#8217;t because you reached the end of the Tabula Recta. In passtab this is called a <code>collision</code>. In this case we could just continue reading following the edge.</p>
<p>Using the Tabula Recta allows you to make use of long secure random passwords and only have to remember three simple things. You also have <i>all</i> your passwords on a single sheet of paper that fits in your wallet.</p>
<p><strong>Custom Alphabets</strong></p>
<p>In passtab, a Tabula Recta consists of two alphabets. The header alphabet and the data alphabet. The header alphabet is used for the row and column heading of the Tabula Recta and forms the basis for finding the starting location of the passwords. The data alphabet is used to generate the contents of the Tabula Recta and passtab will randomly pick characters from this alphabet using a cryptographically secure random number generator. By default, passtab uses a header alphabet of <code>0-9A-Z</code> and a data alphabet consisting of all printable ASCII characters. It&#8217;s important to keep in mind that the data alphabet directly effects the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Password_strength#Entropy_as_a_measure_of_password_strength">entropy</a> of your passwords. passtab allows you to customize these alphabets allowing you to generate any kind of Tabula Recta, for example:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -b A,B,C,D -a 'a,b,c,d,1,2,3,4,!,@,#'
Jun 12, 2011 10:24:26 PM org.qnot.passtab.PassTab generate
INFO: Generating a random Tabula Recta (might take a while)...
  A B C D 
A d 1 @ 4 
B c 4 @ 2 
C b 3 3 ! 
D 1 a @ 4 
</pre></p>
<p>Here&#8217;s a Tabula Recta using greek symbols as the header alphabet (here&#8217;s the <a href='http://qnot.files.wordpress.com/2011/06/passtab-greek.pdf'>example PDF</a>):</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -b 'Σ,Τ,Π,ρ,ϋ,ψ' -a 'a,b,c,d,1,2,3,4,!,@,#'
Jun 12, 2011 11:26:00 PM org.qnot.passtab.PassTab generate
INFO: Generating a random Tabula Recta (might take a while)...
  Σ Τ Π ρ ϋ ψ 
Σ 1 2 1 d d c 
Τ 1 2 b b @ c 
Π 1 # c 3 2 @ 
ρ 4 2 d 2 @ 3 
ϋ 2 3 b 1 ! b 
ψ d @ # c ! a
</pre></p>
<p><b>Password Management</b></p>
<p>So this is all well and great, but in reality it can be a huge pain to have to look up your webmail password in a Tabula Recta that&#8217;s on a sheet of paper in your wallet <i>every time you login</i>. For this reason, passtab has some optional features to help read passwords from the Tabula Recta. This allows you to have both a hard copy of the Tabula Recta in your wallet and an electronic version stored on your hard drive for quick access to your passwords. This obviously comes with some security considerations and care must be taken to protect the passtab database as you would any ssh private key for example. If someone got a hold of the passtab database file they could brute force your Tabula Recta. I ended up creating an encrypted thumb drive and store my passtab configuration and database files on it. You could also use gpg to encrypt it or any other method to protect it from the bad guys. This next section discusses the password management features of passtab.</p>
<p>First some definitions:</p>
<ul>
<li><strong>Direction</strong>: a <code>direction</code> to move on the Tabula Recta. Valid values are <code>N,S,E,W,NE,NW,SE,SW</code></li>
<li><strong>Sequence Item</strong>: a <code>sequence item</code> consists of a <code>length</code> and <code>direction</code>. For example, <code>12:SE</code> would mean move 12 characters in the SE direction (diagonally)</li>
<li><strong>Sequence</strong>: a <code>sequence</code> is a list of <code>sequence items</code>. This allows you to define arbitrary sequences for reading passwords. For example, <code>4:SE,3:N,1:S</code> would mean read 4 characters SE (diagonally) followed by 3 characters N (up) followed by 1 character S (down)</li>
<li><strong>Collision</strong>: a <code>collision</code> defines what directions to move if we hit the edge of the Tabula Recta before the end of the password. You can define more than one direction and they will be tried in order. For example, N,NE,E,SE,S,SW,W,NW would mean if we hit a wall try those directions in order until we&#8217;re able to move again</li>
</ul>
<p><strong>Generate a Tabula Recta in PDF and save to a passtab database</strong></p>
<p>passtab can generate a Tabula Recta in PDF along with storing it in a passtab database. The passtab database is stored in <a href="http://json.org/">JSON</a> format and can be easily accessed outside of passtab (any language that can read JSON files). Again, you&#8217;ll want to store that JSON file someplace safe. For example:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab --dbsave --name mypasstab
Jun 12, 2011 10:48:33 PM org.qnot.passtab.PassTab generate
INFO: Generating a random Tabula Recta (might take a while)...
$ ls mypasstab.*
mypasstab.json  mypasstab.pdf
</pre></p>
<p><strong>Reading passwords from the passtab database</strong></p>
<p>Once we&#8217;ve created our passtab database we can now fetch passwords by telling passtab the starting location and the sequence to read. For example, suppose we want to read a password starting at row &#8216;B&#8217; and column &#8216;N&#8217; and we want a password 10 characters in length reading diagonally:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -i mypasstab.json --getpass B:N --sequence 9:SE
o6,ZzH{e$@
</pre></p>
<p>Copy the password to the clipboard using xclip:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -i mypasstab.json --getpass B:N --sequence 9:SE --chomp | xclip
</pre></p>
<p>We used <code>9:SE</code> as our sequence because passtab includes the character at the start location in the password. If we didn&#8217;t want to include this character we can optionally skip it like so:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -i mypasstab.json --getpass B:N --sequence 10:SE --skipstart
6,ZzH{e$@_
</pre></p>
<p>Define a list of directions to try in the event of a collision. This will try the directions N,S,E,W in order until we can move again. Here we start at Z:Z and can&#8217;t move SE (diagonally) so we try N (up) which works so we move N (up) until we hit another collision:</p>
<p><pre class="brush: plain;">
$ ./bin/passtab -i mypasstab.json --getpass Z:Z --sequence 9:SE --collision N,S,E,W
a((vy&amp;0bV&amp;
</pre></p>
<p><strong>Conclusion</strong></p>
<p>This post introduced a new tool called passtab for managing passwords using a Tabula Recta. I&#8217;m sure it has plenty of bugs so use at your own risk and if by chance you find it somewhat useful I&#8217;d be very interested in any feedback.   </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/334/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=334&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2011/07/01/passtab-store-passwords-in-your-wallet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>WordPress Blog to Print Book &#8211; A Case Study</title>
		<link>http://left.subtree.org/2011/04/09/wordpress-blog-to-print-book-a-case-study/</link>
		<comments>http://left.subtree.org/2011/04/09/wordpress-blog-to-print-book-a-case-study/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 05:05:18 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=257</guid>
		<description><![CDATA[In this post I discuss my experience converting a WordPress blog into a print book. This is by no means a generic how-to guide but more along the lines of a case study. There&#8217;s a number of ways one could tackle this problem however I wasn&#8217;t able to find any existing methods that fit my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=257&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post I discuss my experience converting a WordPress blog into a print book. This is by no means a generic how-to guide but more along the lines of a case study. There&#8217;s a number of ways one could tackle this problem however I wasn&#8217;t able to find any existing methods that fit my needs. Specifically, I wanted to convert the content of a WordPress blog into a high quality print ready PDF book (complete with chapters, sections, table of contents, images, figures, page numbering, index, etc.) which could then be sent to various <a href="http://en.wikipedia.org/wiki/Print_on_demand">POD</a> publishers such as <a href="http://www.lulu.com/">Lulu</a> for printing. I wanted to streamline as much of the process as possible to allow for regenerating the PDF book as new posts are made. Ideally there would be a WordPress plugin for this but to make such a plugin generic enough would be tricky and require many assumptions to be made regarding the structure of your blog (i.e. what constitutes a chapter or a section?, etc.). In this post I describe how I ended up creating a PDF book from WordPress and discuss a few challenges I encountered along the way. A brief disclaimer: this post is intended for folks who are familiar with *nix command line and enjoy mucking around in code (and don&#8217;t mind slinging around some XML here and there). It&#8217;s not for the faint of heart but hopefully it will be useful to others interested in a similar outcome.</p>
<p>If you&#8217;d rather skip this epic post and dive right into the code you can browse it all over on <a href="https://github.com/aebruno/wp2print">github</a>. There&#8217;s a <a href="https://github.com/aebruno/wp2print/blob/master/README">README</a> file and a <a href="https://github.com/aebruno/wp2print/blob/master/Makefile">Makefile</a> which details how to run wp2print and includes a simple example. </p>
<p><strong>Background and Assumptions</strong></p>
<p>The idea for this project came about as my family has been writing a private blog that I want to be able to share with my children some day. I&#8217;ve often thought about giving them a copy of the blog when their much older and wondered what would be the best way to preserve the content ensuring it&#8217;s viewable years down the road. I thought by creating a physical copy of the blog I could have something tangible to pass down through the generations. Using the services provided by companies like Lulu and Blurb printing a book is as simple as uploading a PDF and designing a cover. Having <a href="http://oreilly.com/">worked</a> in the publishing industry in a former life I had some experience generating PDF books so I looked forward to the challenge. </p>
<p>As my goal was to create a book I needed to convert the content of the blog into an intermediate format which represented the book and could then be used to generate a PDF file. As I had a good amount of experience slinging around <a href="http://www.docbook.org/">DocBook</a>, my general idea was to export the content from WordPress and convert it into DocBook. Then converting DocBook into a PDF is fairly straightforward using the wonderful <a href="http://docbook.sourceforge.net/">DocBook stylesheets</a> and <a href="http://xmlgraphics.apache.org/fop/">Apache FOP</a>. </p>
<p>The first obvious challenge when converting a blog into a book is deciding how to go about organizing the blog posts into chapters and sections. Our family blog was authored in such a way that each post had only one tag (category) and most importantly all posts were tagged chronologically. Meaning that all posts in a given category were sequential. For example, posts 0-5 are all tagged with &#8220;tag1&#8243;, posts 6-10 are all tagged with &#8220;tag2&#8243;, and so on. You can probably see where this is going. Having authored the blog in this format allowed me to easily use each tag as a Chapter and each post appeared as a section within that chapter. If your unable to make these assumptions about your blog (and most likely you won&#8217;t be able to) just keep this in mind as we delve into the code later on. You would need to modify the script I wrote and add in the appropriate logic to slice your blog posts up into chapters/sections or however you&#8217;d like to structure your DocBook file. I experimented with just making each post a chapter (and even a series of DocBook <a href="http://www.docbook.org/tdg5/en/html/article.html">articles</a>) which isn&#8217;t a bad option however depending on the number of posts you may want to consider omitting the table of contents.</p>
<p>A few other assumptions I made:</p>
<ul>
<li>All posts were written by the same author so I omitted displaying any author information. Easy enough to add in if needed</li>
<li>All comments were excluded from the book. Comments are an important part of any blog but in this case my blog didn&#8217;t have very many comments. I was most interested in the content of the post only and decided to omit any and all comments. These could certainly be added in but some thought would be needed on which DocBook element to use for structuring them within the book.</li>
<li>There was one page (not a post) with the title &#8220;About&#8221; that I used as the preface for the book. This can be any post/page or omitted completely if desired.</li>
<li>Access to the WordPress code that runs the blog. This won&#8217;t work if your blog is hosted for example at WordPress.com. You&#8217;ll need to export your blog and run it on your own server.</li>
</ul>
<p>Here&#8217;s a brief outline of the entire process. I&#8217;ll go over each step in detail in the next section. </p>
<ol>
<li>Convert WordPress content to DocBook &#8211; using PHP and some XSLT</li>
<li>Convert DocBook to <a href="https://secure.wikimedia.org/wikipedia/en/wiki/XSL_Formatting_Objects">XSL-FO</a> &#8211; using DocBook stylesheets</li>
<li>Convert XSL-FO to PDF &#8211; using Apache FOP</li>
<li>Upload PDF file to Lulu and order print book</li>
</ol>
<p><strong>Convert WordPress content to DocBook</strong></p>
<p>First step was to convert the blog into DocBook. This was by far the most challenging step. My first attempt was to use the <a href="https://en.support.wordpress.com/export/">Export</a> feature in WordPress which dumps the entire contents of your blog in XML format (WordPress eXtended RSS) and write an XSLT to convert into DocBook. This turned out to be slightly harder than I anticipated because of how the content of each post was formatted in the WordPress XML dump. It appeared to be in the native format WordPress uses to store the post in the database and I didn&#8217;t want to have to write a custom WordPress post renderer for DocBook. I decided to instead write a fairly simple PHP script which used the WordPress API to render each post in HTML just like it normally would if someone visited the site, then convert the HTML to DocBook. I found converting the HTML to DocBook was slightly easier than having to parse the native WordPress format. I did this in two steps, first I wrote a PHP script to generate a quasi-DocBook file which uses the WordPress API to embed the HTML content of each post within a <code>&lt;section/&gt;</code>. Then I wrote an XSLT which transforms the quasi-DocBook and embedded HTML into a final valid DocBook file. The main PHP code is <a href="https://github.com/aebruno/wp2print/blob/master/lib/export-docbook.php">here</a>. You&#8217;ll need to change the include paths in <a href="https://github.com/aebruno/wp2print/blob/master/lib/config.php">config.php</a> to point to your WordPress installation (see the <a href="https://github.com/aebruno/wp2print/blob/master/Makefile">Makefile</a> for a complete example).  The XSLT is <a href="https://github.com/aebruno/wp2print/blob/master/wp-html2docbook.xsl">here</a>. It looks for various HTML tags that appear in my blog and converts those to valid DocBook elements. I built up the XSLT by trial and error. I first just rendered the quasi-DocBook generated from the PHP script as PDF. The DocBook stylesheets have a nice feature in that any invalid DocBook elements it encounters are highlighted in red in the resulting PDF. By iterating through the invalid elements I was able to add the correct templates to my XSLT to account for all HTML tags found in my blog posts. You&#8217;ll most certainly need to modify this XSLT file to suite your specific needs but should serve as a decent starting point. Here&#8217;s an example of the HTML generated by WordPress for an image included in a blog post:</p>
<p><pre class="brush: xml;">
&lt;div id=&quot;attachment_155&quot; class=&quot;wp-caption aligncenter&quot; style=&quot;width: 310px&quot;&gt;
  &lt;a href=&quot;/wp-content/media/2008/11/image.jpg&quot;&gt;
        &lt;img class=&quot;size-medium wp-image-155&quot; title=&quot;image title&quot; src=&quot;/wp-content/media/2008/11/image-300x218.jpg&quot; alt=&quot;image alt&quot; width=&quot;300&quot; height=&quot;218&quot;/&gt;
  &lt;/a&gt;
  &lt;p class=&quot;wp-caption-text&quot;&gt;This is a description of the image&lt;/p&gt;
&lt;/div&gt;
</pre></p>
<p>Which then gets converted to a DocBook <a href="http://www.docbook.org/tdg5/en/html/mediaobject.html">mediaobject</a> element:</p>
<p><pre class="brush: xml;">
&lt;para&gt;
  &lt;mediaobject&gt;
    &lt;imageobject&gt;
       &lt;imagedata align=&quot;center&quot; fileref=&quot;images/2008/11/image.jpg&quot; width=&quot;4.0in&quot; depth=&quot;3.0in&quot; scalefit=&quot;1&quot; format=&quot;JPG&quot;/&gt;
    &lt;/imageobject&gt;
    &lt;caption&gt;&lt;para&gt;This is a description of the image&lt;/para&gt;&lt;/caption&gt;
  &lt;/mediaobject&gt;
&lt;/para&gt;
</pre></p>
<p><strong>A note about images&#8230;</strong></p>
<p>Care must be taken to ensure any images you want included in the book are print ready. I ended up having quite a few images in my blog that I wanted to include in the final PDF which required some extra work to get them ready for printing. For best results you&#8217;ll want make to be sure the resolution of your images are at least 300ppi (<a href="https://secure.wikimedia.org/wikipedia/en/wiki/Dots_per_inch#DPI_or_PPI_in_digital_image_files">pixels per inch</a>). See <a href="http://connect.lulu.com/t5/Interior-Formatting/What-resolution-DPI-should-my-images-have-to-achieve-optimum/ta-p/31434">this post on Lulu</a>. For example, if your image is 600x600px and you set the resolution to be 300ppi, the printed image will be roughly 2x2in. In my case I was printing a 6&#215;9 book and after factoring in margins/spine/bleed etc. I calculated the maximum print size I wanted each image was 4x3in (as defined in the DocBook XML element <code>&lt;imagedata width="4.0in" height="3.0in"/&gt;</code> in the above example). As most of the images were pictures, this print size ended up being large enough so the photo was still viewable but small enough to allow for 2 images per page. This meant that the minimum size (in pixels) each image had to be was 1200x900px. The problem was when we uploaded pictures to our blog we had WordPress resize them to 500x400px (from their original size of 2816x2112px from the camera). Fortunately, I still had the original image files which I collected and used in the final PDF. Something to keep in mind if you have images (especially photographs) in your blog that you want printed. I ran into another edge case with the images which required a little bit of <a href="http://www.imagemagick.org">imagemagick</a>. I had a few important pictures that were taken with photo booth on a mac in which the original size image was a mere 640x480px. I knew the print version of the images would look dreadful so my only option was to resample them to a higher resolution. This can easily be accomplished using imagemagick&#8217;s <a href="http://www.imagemagick.org/script/command-line-options.php#resample">convert command</a>:</p>
<p><pre class="brush: plain;">
$ convert -resample 300x orig.jpg hires.jpg
</pre></p>
<p>In summary, be sure your images are high enough resolution for printing. It&#8217;s definitely worth the extra work. I had roughly 100 images in my blog and all of them turned out really nice in the final print book. I was quite impressed with the quality of Lulu&#8217;s printers. </p>
<p><strong>DocBook &#8211;&gt; XSL-FO &#8211;&gt; PDF</strong></p>
<p>Converting DocBook to PDF was fairly straightforward using two excellent projects <a href="http://docbook.sourceforge.net/">DocBook stylesheets</a> and <a href="http://xmlgraphics.apache.org/fop/">Apache FOP</a>. I won&#8217;t cover how to install them on your platform and refer you to the excellent INSTALL guides at the <a href="http://docbook.sourceforge.net/release/xsl/current/INSTALL">respective</a> <a href="http://xmlgraphics.apache.org/fop/quickstartguide.html">sites</a>. If you happen to be running Ubuntu using the stock packages should work fine. Simply run <code>aptitude install fop docbook-xsl</code> and you should be all set. The basic goal for this step was to use the DocBook XSL FO stylesheets to convert the DocBook created from the previous step into XSL-FO which can be fed into Apache FOP for conversion into PDF. This step required that an XSLT processor be installed such as xsltproc (libXML), Saxon, Xalan, etc. I used xsltproc and can easily be installed on Ubuntu <code>aptitude install xsltproc</code>. After running xsltproc I passed the resulting XSL-FO output into Apache FOP to generate the final PDF. For more details see the <a href="https://github.com/aebruno/wp2print/blob/master/Makefile">Makefile</a>. Here&#8217;s the basic commands:</p>
<p><pre class="brush: plain;">
$ xsltproc /path/to/docbook-xsl/fo/docbook.xsl docbook-final.xml &gt; book.fo
$ fop book.fo book.pdf
</pre></p>
<p>The DocBook XSL FO stylesheets provide a <a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/index.html">generous number of parameters</a> for customizing the resulting FO. The default parameter settings produce a very nice looking PDF but if you like to tweak things there&#8217;s no shortage of knobs to turn. As I ended up printing my book with Lulu there were a few specific customizations that were required. First I was interested in printing a US Trade 6&#215;9 inch hard cover book so the default page <a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/page.width.html">width</a>/<a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/page.height.html">height</a> needed to be set accordingly. Some other tweaks I made included adjusting the <a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/page.margin.inner.html">margins</a> slightly to provide some extra room on the <a href="http://connect.lulu.com/t5/Interior-Formatting/How-big-should-my-margins-be/ta-p/31404">spine edge</a> of the book, customizing the <a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/generate.toc.html">table of contents</a> to only include the chapter/sections, and <a href="http://docbook.sourceforge.net/release/xsl/current/doc/fo/body.start.indent.html">customizing the indentation</a> of chapters and sections (in this case I didn&#8217;t want any indentation). Here&#8217;s the resulting xsltproc command with the custom parameter settings:</p>
<p><pre class="brush: plain;">
    xsltproc \
    --stringparam page.width 6in \
    --stringparam page.height 9in \
    --stringparam page.margin.inner 1.0in \
    --stringparam page.margin.outer 0.8in \
    --stringparam body.start.indent 0pt \
    --stringparam body.font.family  Times \
    --stringparam title.font.family Times \
    --stringparam dingbat.font.family Times \
    --stringparam generate.toc 'book toc title' \
    --stringparam hyphenate false \
    /path/to/docbook-xsl/fo/docbook.xsl \
    docbook-final.xml &gt; book.fo
</pre></p>
<p><strong>A note about Fonts..</strong></p>
<p>The last and most important configuration I made was with fonts. Lulu requires fonts to be fully <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Portable_Document_Format#Fonts">embedded</a> which means any font you use in your PDF <a href="http://www.lulu.com/help/embed_fonts">must be embedded</a> (the font files are included directly in the PDF file) or else they will reject the PDF. Embedding fonts is supported by Apache FOP but requires some custom configuration. First I had to decide which font to use. Fonts can be really tricky and I didn&#8217;t want to get too fancy. Using a single font for the entire book was fine with me and I decided to stick with a traditional Times New Roman font. I ended up using the FreeSerif TrueType font from <a href="http://www.gnu.org/software/freefont/">GNU FreeFont</a>. It was already installed on my Ubuntu machine and very easy to embed with Apache FOP. By default these fonts are installed in <code>/usr/share/fonts/truetype/freefont/</code>.There&#8217;s lots of other free fonts out there that you could use including the <a href="https://fedorahosted.org/liberation-fonts/">Liberation Fonts</a> and even the <a href="http://packages.ubuntu.com/lucid/ttf-mscorefonts-installer">Micro$oft True Type Core Fonts</a> which can be installed on Ubuntu by running <code>aptitude install msttcorefonts</code>. To configure Apache FOP to use GNU Free Fonts and embed them into the final PDF I created a file called <code>userconf.xconf</code> with the following lines:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;fop version=&quot;1.0&quot;&gt;
&lt;renderers&gt;
   &lt;renderer mime=&quot;application/pdf&quot;&gt;
      &lt;!-- Full path to truetype fonts to be embedded in PDF file --&gt;
      &lt;fonts&gt;
        &lt;font embed-url=&quot;file:///usr/share/fonts/truetype/freefont/FreeSerif.ttf&quot;&gt;
          &lt;font-triplet name=&quot;Times&quot; style=&quot;normal&quot; weight=&quot;normal&quot;/&gt;
        &lt;/font&gt;
        &lt;font embed-url=&quot;file:///usr/share/fonts/truetype/freefont/FreeSerifBold.ttf&quot;&gt;
          &lt;font-triplet name=&quot;Times&quot; style=&quot;normal&quot; weight=&quot;bold&quot;/&gt;
        &lt;/font&gt;
        &lt;font embed-url=&quot;file:///usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf&quot;&gt;
          &lt;font-triplet name=&quot;Times&quot; style=&quot;italic&quot; weight=&quot;normal&quot;/&gt;
        &lt;/font&gt;
        &lt;font embed-url=&quot;file:///usr/share/fonts/truetype/freefont/FreeSerifBoldItalic.ttf&quot;&gt;
          &lt;font-triplet name=&quot;Times&quot; style=&quot;italic&quot; weight=&quot;bold&quot;/&gt;
        &lt;/font&gt;
      &lt;/fonts&gt;
   &lt;/renderer&gt;
&lt;/renderers&gt;
&lt;/fop&gt;
</pre></p>
<p>Then ran fop passing the -f option like so: <code>fop -f userconf.xconf book.fo book.pdf</code>. Note the <code>&lt;font-triplet <strong>name="Times"</strong> /&gt;</code> attribute must match the <code>body.font.family Times</code> XSLT parameter passed to xsltproc command. </p>
<p><strong>Simple Example</strong></p>
<p>All the code described in this post is available on <a href="https://github.com/aebruno/wp2print">github</a>. I also include a simple example to demonstrate the entire conversion process and provide some sample PDFs to see how final book renders. I created a simple test blog consisting of Shakespeare&#8217;s Sonnets I thru X and exported the content in WordPress eXtended RSS so you can then import into a fresh install of WordPress. I tested using the latest version of WordPress at the time of this writing (v3.1). To try it out yourself download the code for wp2print and read thru the <a href="https://github.com/aebruno/wp2print/blob/master/README">README</a> file which outlines all the gory details. The <a href="https://github.com/aebruno/wp2print/blob/master/Makefile">Makefile</a> outlines the general process and should provide a good starting point for experimenting. Here&#8217;s some sample PDFs that were rendered from the example Shakespeare blog:</p>
<ul>
<li><a href="http://qnot.files.wordpress.com/2011/04/book-with-chapters.pdf">Book with Chapters and Sections</a></li>
<li><a href="http://qnot.files.wordpress.com/2011/04/book-with-articles.pdf">Book with all posts as DocBook Articles</a></li>
<li><a href="https://github.com/aebruno/wp2print/blob/master/sample/sample-docbook.xml">Raw DocBook output</a></li>
</ul>
<p><strong>Conclusion</strong></p>
<p>With the help of a few simple scripts it&#8217;s possible to create a high quality print ready PDF book from a WordPress blog. Depending on the content of the blog you&#8217;ll most certainly need to tailor these scripts to suite your specific requirements. The main challenges are figuring out how you want to organize your blog posts into the framework of a book and then modifying the XSLT templates to convert the WordPress html markup of your blog into valid DocBook elements. The services offered by print on demand publishers such as Lulu provide an easy way to turn the resulting PDF into a high quality paper book.  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=257&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2011/04/09/wordpress-blog-to-print-book-a-case-study/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>Logging out without killing a process</title>
		<link>http://left.subtree.org/2010/09/14/logging-out-without-killing-a-process/</link>
		<comments>http://left.subtree.org/2010/09/14/logging-out-without-killing-a-process/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 04:29:59 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=219</guid>
		<description><![CDATA[Here&#8217;s the scenario, you&#8217;re logged into your favorite *nix box and are using bash as your shell. You fired off some process which is going to take a while to run (and forgot to run screen) and you want to logout without killing that process. The command to use is disown. Here&#8217;s a really simple [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=219&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the scenario, you&#8217;re logged into your favorite *nix box and are using bash as your shell. You fired off some process which is going to take a while to run (and forgot to run <code><a href="http://www.gnu.org/software/screen/">screen</a></code>) and you want to logout without killing that process. The command to use is <code><a href="http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Builtins">disown</a></code>. Here&#8217;s a really simple example:</p>
<p><pre class="brush: plain;">
$ ssh some-host
$ perl script-that-chugs-along.pl
$ Ctrl-Z (suspend)
$ bg (put it in background)
$ disown -h
$ logout
</pre>  </p>
<p>The <code>disown</code> command allows you to remove jobs from the list of active jobs associated with your login shell. Here&#8217;s an excerpt from the bash man page: </p>
<blockquote><p>Without options, each <em>jobspec</em> is removed from the table of active jobs. If the <code>-h</code> option is given, the job is not removed from the table, but is marked so that <code>SIGHUP</code> is not sent to the job if the shell receives a <code>SIGHUP</code>.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=219&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2010/09/14/logging-out-without-killing-a-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>No more moko for me</title>
		<link>http://left.subtree.org/2010/09/13/no-more-moko-for-me/</link>
		<comments>http://left.subtree.org/2010/09/13/no-more-moko-for-me/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 02:28:17 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[FreeRunner]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=86</guid>
		<description><![CDATA[Well it&#8217;s been just over 2 years now since I picked up my Neo Freerunner and unfortunately I have nothing good to report back. When I first got my hands on the Freerunner I had great expectations as can be seen in my previous posts however it turns out I was little too optimistic. My [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=86&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well it&#8217;s been just over 2 years now since I picked up my <a href="http://wiki.openmoko.org/wiki/Neo_FreeRunner">Neo Freerunner</a> and unfortunately I have nothing good to report back. When I first got my hands on the Freerunner I had great expectations as can be seen in my <a href="http://left.subtree.org/2008/07/22/neo-freerunner-freedom/">previous</a> <a href="http://left.subtree.org/2008/08/13/freerunner-first-boot/">posts</a> however it turns out I was little too optimistic. </p>
<p>My hope was to write about my experience developing applications for the device but it seems as though I was one of the unlucky users who suffered from the infamous <a href="http://markmail.org/thread/vpq2onob27fsz4bc">buzz</a>. And I don&#8217;t mean buzz in a good way :) Apparently this didn&#8217;t effect every user and was more prevalent when using certain GSM bands. However random it may have been for some users it was an absolute show stopper for me and rendered the device pretty much unusable as a phone. Anytime I placed a call, the person on the other end heard a horrible loud buzzing sound. After a while Openmoko finally tracked down the <a href="http://lists.openmoko.org/pipermail/hardware/2008-August/000415.html">source of the buzzing</a> to a hardware problem and <a href="http://people.openmoko.org/joerg/GSM_EMI_noise/">published some instructions</a> on how to mod the device (known as the <a href="http://people.openmoko.org/joerg/GSM_EMI_noise/big-C_rework_SOP_rc2.pdf">big-C rework</a>). Unfortunately it requires some fairly advanced SMD-soldering skills and is way out of my league. As far as I know, Openmoko never really offered much help in resolving the issue for people who had already purchased the device with the hardware flaw (rev A5/A6) and were unable to preform the necessary surgery. </p>
<p>Despite the lacking phone functionality the Freerunner itself is still pretty cool.  I&#8217;m sure I&#8217;ll be able to think of some other fun projects to use it for especially since it <a href="http://wiki.openmoko.org/wiki/Debian">runs Debian</a>. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=86&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2010/09/13/no-more-moko-for-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>Freerunner First Boot</title>
		<link>http://left.subtree.org/2008/08/13/freerunner-first-boot/</link>
		<comments>http://left.subtree.org/2008/08/13/freerunner-first-boot/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 03:42:31 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[FreeRunner]]></category>
		<category><![CDATA[Neo]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=39</guid>
		<description><![CDATA[Here&#8217;s some notes on my initial experience setting up the Neo Freerunner. I&#8217;ve been meaning to write this post for a while now and most of this is already old stuff but I&#8217;m posting it anyhow for reference. I purchased the Neo Freerunner fully aware that it was a developer phone but my hope was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=39&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some notes on my initial experience setting up the <a href="http://wiki.openmoko.org/wiki/FreeRunner_Overview">Neo Freerunner</a>. I&#8217;ve been meaning to write this post for a while now and most of this is already old stuff but I&#8217;m posting it anyhow for reference. I purchased the Neo Freerunner fully aware that it was a developer phone but my hope was that I could at least ssh into the device and make/receive a few phone calls. I&#8217;m happy to report that after first booting I was able to get most things functioning within a few hours.</p>
<p><strong>First Boot</strong></p>
<p>There&#8217;s several <a href="http://wiki.openmoko.org/wiki/Distributions">distributions</a> for the Freerunner which can get quite confusing but the one that comes stock with the Freerunner is referred to as <a href="http://wiki.openmoko.org/wiki/Om_2007.2">2007.2</a>. First time booting up the Freerunner you&#8217;re presented the home screen for 2007.2. You can also <a href="http://wiki.openmoko.org/wiki/Boot">boot</a> into NAND and NOR flash which allows you to update the kernel, root filesystem and the boot loader (U-Boot).</p>
<p>My first mission was to ssh into the device. Followed the instructions on the wiki for setting up <a href="http://wiki.openmoko.org/wiki/USB_Networking">USB networking</a>.  By default the IP address of the Freerunner is 192.168.0.202. On the desktop side you first have to ifconfig the usb0 interface and setup the correct routes. Here&#8217;s the script I run on my desktop after connecting the Freerunner:</p>
<p><pre class="brush: bash;">
#!/bin/bash

/sbin/ifconfig usb0 192.168.0.200 netmask 255.255.255.0
/sbin/route add -host 192.168.0.202/32 dev usb0
</pre></p>
<p>One extra step I had to do was configure my firewall to allow connections to/from usb0. I&#8217;m running Ubuntu hardy 8.04 and using Firestarter. Open up Firestarter:</p>
<ul>
<li>Preferences -&gt; Firewall -&gt; Network Settings</li>
<li>Set &#8216;Local network connected device&#8217; to:  Unknown device (usb0)</li>
<li>Check &#8216;Enable internet connection sharing&#8217;</li>
</ul>
<p>Verified usb0 network connections:</p>
<p><pre class="brush: plain;">
$ ping -I usb0 192.168.0.202
$ ssh root@192.168.0.202
</pre></p>
<p>Once connected to the Freerunner next step was to get the date to display on the home screen. To do this I just followed the <a href="http://wiki.openmoko.org/wiki/Today/2007.2#Adjust_UI_components_at_runtime">instructions on the wiki</a> for customizing the today page (run these commands on the Neo):</p>
<p><pre class="brush: plain;">
# dbus-launch gconftool-2 -t boolean -s /desktop/poky/interface/reduced false
# /etc/init.d/xserver-nodm restart
</pre></p>
<p>Here&#8217;s a screenshot of the home screen:</p>
<p style="text-align:center;"><img class="size-full wp-image-124 aligncenter" title="neo-clock" src="http://qnot.files.wordpress.com/2008/08/neo-clock.png?w=700" alt=""   /></p>
<p><strong>Upgrade Software</strong></p>
<p>Once I was able to successfully ssh into the Neo and verifed that I could also connect to the internet from the Neo I wanted to upgrade to the latest software release. To do this you use <a href="http://wiki.openmoko.org/wiki/Opkg">opgk</a> (package management system based on Ipkg). The first time you upgrade from the software release shipped with the Neo you have to first upgrade dropbear (ssh server) from the terminal on the Neo, then you can ssh back into the Neo and upgrade the rest of the software:</p>
<p><pre class="brush: plain;">
# opkg update
On the Neo, open Terminal and run: # opkg install dropbear
Then ssh to neo and run: # opkg upgrade
</pre></p>
<p>At this point I rebooted and inserted my T-Mobile sim card and microSD card. Once back at the home screen it showed I was registered to the T-Mobile network and I opened up the dialer app and placed my first call!</p>
<p><strong>Set up Timezone and correct date/time</strong></p>
<p>To fix the timezone run this from the Neo:<br />
<pre class="brush: plain;">
# opkg install tzdata tzdata-americas
# ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# /etc/init.d/xserver-nodm restart
</pre></p>
<p>To set the correct time using ntp run:<br />
<pre class="brush: plain;">
# opkg install ntpclient
# ntpclient -s -h pool.ntp.org
# hwclock --systohc
</pre></p>
<p><strong>WLAN</strong></p>
<p>Next up was connecting the Neo to my wireless LAN. The wireless interface on the Neo is eth0. First have to make sure WLAN device is turned on which it seemed to be by default when you first boot. You can check this by holding down the power button for a few seconds which should pop up a menu showing the state of the various devices. Here&#8217;s the script I use to connect the Neo to my WLAN:<br />
<pre class="brush: bash;">
#!/bin/sh

/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 up
/sbin/iwconfig eth0 key restricted 'xxxxx'
/sbin/iwconfig eth0 essid 'xxxx'
/sbin/udhcpc eth0
</pre></p>
<p><strong>GPS</strong></p>
<p><a href="http://www.tangogps.org/">tangoGPS</a> rocks. This app is amazing and it worked right out of the box. Followed the <a href="http://wiki.openmoko.org/wiki/Getting_Started_with_your_Neo_FreeRunner#Use_the_GPS">directions on the wiki</a> to get it up and running. There was an <a href="http://wiki.openmoko.org/wiki/GPS_Problems">issue</a> getting a fix with the SD card installed but by the time I tried this out they already had a kernel update which fixed the issue. I had no problem getting a fix and my TTFF was 35s with the SD card in. Here&#8217;s some screenshots of tangoGPS in action:</p>
<table style="border:none;">
<tbody>
<tr>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/08/screenshot-1.png?w=700" alt="" title="Screenshot-1"   class="alignnone size-full wp-image-125" /></td>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/08/screenshot-2.png?w=700" alt="" title="Screenshot-2"   class="alignnone size-full wp-image-126" /></td>
</tr>
</tbody>
</table>
<p>I also installed and ran <a href="http://wiki.openmoko.org/wiki/Howto_Test_Your_GPS_with_agpsui">AGPS Test</a> which is a program for testing out GPS on the Neo. It shows some nice graphs of the various satellites you&#8217;re currently connected to and their signal strengths:</p>
<table style="border:none;">
<tbody>
<tr>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/08/screenshot-4.png?w=700" alt="" title="Screenshot-4"   class="alignnone size-full wp-image-127" /></td>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/08/screenshot-5.png?w=700" alt="" title="Screenshot-5"   class="alignnone size-full wp-image-128" /></td>
</tr>
</tbody>
</table>
<p><strong>Bugs/Issues</strong></p>
<p>Overall I was impressed by how much I was able to get working the first time around however there&#8217;s definitely a few issues I came across. The most concerning was the <a href="http://wiki.openmoko.org/wiki/Freerunner_Hardware_Issues#Poor_Audio_Quality">GSM buzzing</a> during phone calls. On the Neo side everything sounds fine but the person on the other end hears a very loud buzzing noise. Here&#8217;s the <a href="http://lists.openmoko.org/pipermail/hardware/2008-August/000288.html">latest update</a> from the hardware list regarding the issue. I tried tweaking the various alsa settings in <code>/usr/share/openmoko/scenarios/gsmhandset.state</code> with some luck but still wasn&#8217;t able to find the right balance to completely eliminate the buzzing. Still trying to wrap my head around which alsa settings do what but I found playing with alsamixer during a live call to be helpful. The basic procedure goes something like this:</p>
<ol>
<li>ssh to FreeRunner</li>
<li>Make a phone call</li>
<li>While call is in progress run alsamixer</li>
<li>Tweak settings to minimize buzzing/echo</li>
<li>While call is still in progress run: <code>$ alsactl store -f gsmhandset-test1.txt</code></li>
</ol>
<p>Now you can diff this new file against the original (/usr/share/openmoko/scenarios/gsmhandset.state) and see which settings were changed. This is really the only thing holding me back from using the Neo as my primary phone so I look forward to a possible fix.</p>
<p>I found using the Terminal on the Neo rather clunky due to the lack of characters available on the keyboard. For example there&#8217;s no &lt;TAB&gt; or &#8216;/&#8217;. I&#8217;m sure there&#8217;s ways to customize the keyboard. Looks like only vi is available by default on the Neo so I plan on seeing if I can find a vim package (.ipk) or figuring out how to compile vim for the Neo.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/qnot.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/qnot.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=39&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2008/08/13/freerunner-first-boot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/08/neo-clock.png" medium="image">
			<media:title type="html">neo-clock</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/08/screenshot-1.png" medium="image">
			<media:title type="html">Screenshot-1</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/08/screenshot-2.png" medium="image">
			<media:title type="html">Screenshot-2</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/08/screenshot-4.png" medium="image">
			<media:title type="html">Screenshot-4</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/08/screenshot-5.png" medium="image">
			<media:title type="html">Screenshot-5</media:title>
		</media:content>
	</item>
		<item>
		<title>Neo FreeRunner = Freedom</title>
		<link>http://left.subtree.org/2008/07/22/neo-freerunner-freedom/</link>
		<comments>http://left.subtree.org/2008/07/22/neo-freerunner-freedom/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 03:22:40 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[FreeRunner]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Neo]]></category>
		<category><![CDATA[OpenMoko]]></category>

		<guid isPermaLink="false">http://left.subtree.org/?p=23</guid>
		<description><![CDATA[Open. Mobile. Free. That was the tag line printed on the side of the box which housed my shiny new Neo FreeRunner. I finally had some time to sit down and play with this new device and so far it&#8217;s blown me away. If you&#8217;re a Linux geek and haven&#8217;t checked this out yet I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=23&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Open. Mobile. Free.</strong> That was the tag line printed on the side of the box which housed my shiny new <a href="http://wiki.openmoko.org/wiki/FreeRunner_Overview">Neo FreeRunner</a>. I finally had some time to sit down and play with this new device and so far it&#8217;s blown me away. If you&#8217;re a Linux geek and haven&#8217;t checked this out yet I highly recommend <a href="http://www.openmoko.com/product.html">getting one</a>. It&#8217;s a truly open platform with a thriving community and is supported by a company which has basically open sourced their internal development. Where else could you get the complete <a href="http://wiki.openmoko.org/wiki/CAD_models">CAD files</a> for your phone? There&#8217;s a good post about why you might <a href="http://www.fsf.org/blogs/community/5-reasons-to-avoid-iphone-3g">think twice before buying an iPhone</a> and picking up a FreeRunner instead.</p>
<p>Here&#8217;s a few pics of what the Neo looks like all boxed up..</p>
<table style="width:100%;border:none;">
<tr>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/07/neo-box.jpg?w=237&#038;h=300" alt="" title="neo-box" width="237" height="300" class="alignnone size-medium wp-image-137" /></td>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/07/neo-box2.jpg?w=300&#038;h=225" alt="" title="neo-box2" width="300" height="225" class="alignnone size-medium wp-image-138" /></td>
</tr>
</table>
<p>
The Neo came bundled with a USB cable, a nifty stylus + laser pen, AC adapter, battery, and a 512mb microSD card.</p>
<div style="text-align:center;">
<img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/07/neo-accessories.jpg?w=300&#038;h=225" alt="" title="neo-accessories" width="300" height="225" class="aligncenter size-medium wp-image-139" />
</div>
<p>
The <a href="http://wiki.openmoko.org/wiki/Neo_FreeRunner_GTA02_Hardware">hardware specs</a> for the Neo (GTA02) are impressive, GSM, WiFi, Bluetooth, GPS. All that packed into a full blown Linux distro that fits in the palm of your hand.</p>
<div style="text-align:center;">
<img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/07/neo-hand.jpg?w=700" alt="" title="neo-hand"   class="aligncenter size-full wp-image-140" />
</div>
<div style="text-align:center;">
<img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2008/07/neo-back.jpg?w=700" alt="" title="neo-back"   class="aligncenter size-full wp-image-141" />
</div>
<p>I&#8217;ll be posting more about my experiences using the Neo as my daily phone. More to come..</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/qnot.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/qnot.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=23&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2008/07/22/neo-freerunner-freedom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/07/neo-box.jpg?w=237" medium="image">
			<media:title type="html">neo-box</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/07/neo-box2.jpg?w=300" medium="image">
			<media:title type="html">neo-box2</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/07/neo-accessories.jpg?w=300" medium="image">
			<media:title type="html">neo-accessories</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/07/neo-hand.jpg" medium="image">
			<media:title type="html">neo-hand</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2008/07/neo-back.jpg" medium="image">
			<media:title type="html">neo-back</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating executable jars with Maven</title>
		<link>http://left.subtree.org/2008/01/24/creating-executable-jars-with-maven/</link>
		<comments>http://left.subtree.org/2008/01/24/creating-executable-jars-with-maven/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 04:53:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://left.subtree.org/2008/01/24/creating-executable-jars-with-maven/</guid>
		<description><![CDATA[After wrestling with Maven assemblies for while I finally figured out how to build executable jars. The Maven assembly plugin allows you to define ways to package up your project for distribution by creating various assembly descriptor files. Here&#8217;s a quick example of a Maven assembly for building an executable jar (uberjar). For this example [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=18&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After wrestling with <a href="http://maven.apache.org/plugins/maven-assembly-plugin/">Maven assemblies</a> for while I finally figured out how to build executable jars. The Maven assembly plugin allows you to define ways to package up your project for distribution by creating various assembly descriptor files. Here&#8217;s a quick example of a Maven assembly for building an executable jar (uberjar). For this example we&#8217;ll create a brand new project from scratch but it should be easy to see how to integrate into an existing project.</p>
<p>First step lets create a test project:</p>
<p><pre class="brush: plain;">
$ mvn archetype:create -DgroupId=org.qnot.example -DartifactId=hello-world
$ cd hello-world
</pre></p>
<p>Next add a few dependencies to the project. In this example we&#8217;ll add a few libraries from jakarta commons. The &lt;dependencies/&gt; section in the pom.xml should now look like this:</p>
<p><pre class="brush: xml;">
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;3.8.1&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;commons-cli&lt;/groupId&gt;
      &lt;artifactId&gt;commons-cli&lt;/artifactId&gt;
      &lt;version&gt;1.1&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;commons-lang&lt;/groupId&gt;
      &lt;artifactId&gt;commons-lang&lt;/artifactId&gt;
      &lt;version&gt;2.3&lt;/version&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
</pre></p>
<p>Create a META-INF/ directory to store the MANIFEST.MF file which defines the main class in the executable jar.</p>
<p><pre class="brush: plain;">
$ mkdir -p src/main/resources/META-INF/
$ echo 'Main-Class: org.qnot.example.App' &gt; MANIFEST.MF 
</pre></p>
<p>Create a src/assemble directory to store the assembly descriptor files</p>
<p><pre class="brush: plain;">
$ mkdir src/assemble
</pre></p>
<p>Next we&#8217;ll create the actual assembly descriptor file which defines how to package up the jar. Create the file src/assemble/exe.xml with the following xml:</p>
<p><pre class="brush: xml;">
&lt;assembly&gt;
  &lt;id&gt;exe&lt;/id&gt;
  &lt;formats&gt;
    &lt;format&gt;jar&lt;/format&gt;
  &lt;/formats&gt;
  &lt;includeBaseDirectory&gt;false&lt;/includeBaseDirectory&gt;
  &lt;dependencySets&gt;
    &lt;dependencySet&gt;
      &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
      &lt;outputFileNameMapping&gt;&lt;/outputFileNameMapping&gt;
      &lt;unpack&gt;true&lt;/unpack&gt;
      &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;includes&gt;
        &lt;include&gt;commons-lang:commons-lang&lt;/include&gt;
        &lt;include&gt;commons-cli:commons-cli&lt;/include&gt;
      &lt;/includes&gt;
    &lt;/dependencySet&gt;
  &lt;/dependencySets&gt;
  &lt;fileSets&gt;
    &lt;fileSet&gt;
      &lt;directory&gt;target/classes&lt;/directory&gt;
      &lt;outputDirectory&gt;&lt;/outputDirectory&gt;
    &lt;/fileSet&gt;
  &lt;/fileSets&gt;
&lt;/assembly&gt;
</pre></p>
<p>Inside the <code>&lt;dependecySets/&gt;</code> is where you can add all the libraries you&#8217;d like to include in the uberjar. These must also be defined in your pom.</p>
<p>Finally, add the maven-assembly-plugin to the pom:<br />
<pre class="brush: xml;">
  &lt;build&gt;
    &lt;finalName&gt;hello-world&lt;/finalName&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;descriptors&gt;
            &lt;descriptor&gt;src/assemble/exe.xml&lt;/descriptor&gt;
          &lt;/descriptors&gt;
          &lt;archive&gt;
            &lt;manifestFile&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
          &lt;/archive&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
</pre></p>
<p>To run the assembly and build the executable jar:</p>
<p><pre class="brush: plain;">
$ mvn assembly:assembly
$ java -jar target/hello-world-exe.jar
Hello World! 
</pre></p>
<p>I tested the hello-world example using the latest Maven release (2.0.8) and maven-assembly-plugin-2.2-beta-1. If you run into any issues try and update your Maven plugins by running:</p>
<p><pre class="brush: plain;">
$ mvn -U compile
</pre></p>
<p>You can download the example hello-world project <a href="http://www.qnot.org/code/hello-world.tar.gz">here</a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/qnot.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/qnot.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=18&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2008/01/24/creating-executable-jars-with-maven/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Design with Dia</title>
		<link>http://left.subtree.org/2007/12/05/database-design-with-dia/</link>
		<comments>http://left.subtree.org/2007/12/05/database-design-with-dia/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 05:23:48 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://left.subtree.org/2007/12/05/database-design-with-dia/</guid>
		<description><![CDATA[In this post I&#8217;m going to give a quick how-to on creating database schemas with a wonderful tool called Dia. I&#8217;ve often found having a nice visual representation of a database to be quite helpful but can&#8217;t stand keeping it up to date. As soon as you add a new column or change the design [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=14&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;m going to give a quick how-to on creating database schemas with a wonderful tool called <a href="http://live.gnome.org/Dia">Dia</a>. I&#8217;ve often found having a nice visual representation of a database to be quite helpful but can&#8217;t stand keeping it up to date. As soon as you add a new column or change the design around you end up having to sync your visual diagram with your SQL files. It&#8217;s tedious having to  manage the various SQL for building the database and this can be a larger pain when trying to support different database platforms each with their own SQL syntax. So before you create your next database read on and see how Dia can make your life a bit easier.</p>
<p><a href="http://live.gnome.org/Dia">Dia</a> is a program for creating diagrams and for this exercise we&#8217;ll be creating UML diagrams from within Dia. We&#8217;re also going to use a perl script called <a href="http://tedia2sql.tigris.org/">tedia2sql</a> which will transform our Dia files directly to SQL for our target database. What&#8217;s also nice about creating database schemas this way is that you can generate SQL for multiple target databases without the maintenance overhead.</p>
<p>First off, install a copy of Dia as well as tedia2sql. You can download tedia2sql <a href="http://tedia2sql.tigris.org/servlets/ProjectDocumentList">here</a> and download Dia <a href="http://live.gnome.org/Dia/Download">here</a>. I&#8217;m not going to cover the install in this post but there should be packages available for most Linux distro&#8217;s and if your not running Linux now is a great time to start!</p>
<p>Fire up Dia, create a new diagram and save it as &#8220;employee.dia&#8221;. Select the UML sheet from the drop down list. We&#8217;ll be using various UML objects to represent tables and definitions that make up our database. Here&#8217;s a quick overview of the main UML objects and their usage:</p>
<table style="width:100%;border:none;">
<tr>
<td style="border:none;"><img style="border:1px solid #ccc;" src="http://qnot.files.wordpress.com/2007/12/dia_menu.jpg?w=700" alt="" title="dia_menu"   class="aligncenter size-full wp-image-154" /></td>
<td style="border:none;">
<div style="margin-bottom:20px;">
   <img src="http://qnot.files.wordpress.com/2007/12/dia_class.png?w=700" alt="" title="dia_class"   class="size-full wp-image-155" style="float:left;padding:4px;" /> <span style="font-weight:bold;">Class</span> represents a table in the database. A Class has a name which corresponds to the name of the table and attributes which map to the columns of the table. Attributes in classes can have visibility (public, private, protected). Protected attributes are primary keys. More on classes later.
</div>
<div style="margin-bottom:20px;">
   <img src="http://qnot.files.wordpress.com/2007/12/dia_component.png?w=700" alt="" title="dia_component"   class="alignnone size-full wp-image-158" style="float:left;padding:4px;" /> <span style="font-weight:bold;">Component</span> is a special object that lets you define a list of default values to be inserted into a table. These are equivalent to hard coding &#8220;insert into ..&#8221; statements in your SQL files.
</div>
<div>
   <img src="http://qnot.files.wordpress.com/2007/12/dia_small_package.png?w=700" alt="" title="dia_small_package"   class="alignnone size-full wp-image-159" style="float:left;padding:4px;" /> <span style="font-weight:bold;">Small Package</span> represents a typemap. Typemaps are used for adding custom SQL types such as MySQL tinyint.
</div>
</td>
</tr>
</table>
<p>Now lets create our first table. Select the &#8220;Class&#8221; object icon from the UML sheet and click inside the diagram editor window. This will add the class to your diagram. Now right click on the new class and select &#8220;Show Properties&#8221;. This will bring up a rather large and complex property window for the UML class you&#8217;ve just created. We&#8217;re only going to customize a few properties outlined below.</p>
<p>First, under the &#8220;Class&#8221; tab enter the name of the table (employee) in the &#8220;Class Name: &#8221; field. Next click on the &#8220;Attributes&#8221; tab and enter in the columns of the table as attributes. In the &#8220;Name: &#8221; field enter in the column name. In the &#8220;Type: &#8221; field enter in the SQL type for the column. If you want to support multiple database platforms try to be generic here and only use ANSI SQL 1992 or else use a typemap. More on typemaps later. In the &#8220;Value: &#8221; field enter any default values for the column. For example, this is where you could add in &#8220;not null&#8221;. If the column your adding is a primary key then don&#8217;t put &#8220;not null&#8221; here and instead select &#8220;Protected&#8221; for the &#8220;Visibility: &#8221; field. Not null will automatically get added to all primary keys on output generation. The screen shot below is an example of the Class property editor window.</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_attributes.jpg?w=700" alt="" title="dia_attributes"   class="aligncenter size-full wp-image-161" style="border:1px solid #ccc;" /></p>
<p>Next, repeat the process for as many tables as you need in your database. For this example, create two tables &#8220;employee&#8221; and &#8220;department&#8221; with the columns as shown in the screenshot below (note the &#8216;#&#8217; in front of an attribute indicates that it&#8217;s visibility is &#8220;Protected&#8221; thus making it a Primary Key):</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_employee.jpg?w=700" alt="" title="dia_employee"   class="aligncenter size-full wp-image-162" style="border:1px solid #ccc;" /></p>
<p>This is a simple example of a database which stores employee data along with the department they belong to. Now suppose we have a default list of departments that we&#8217;d like to load into the department table when our database is created. To do this we&#8217;ll use the &#8220;Component&#8221; object from the UML sheet. Select the &#8220;Component&#8221; object and add it to your diagram editor window. Right click and select &#8220;Properties&#8221;.</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_comp_prop.jpg?w=700" alt="" title="dia_comp_prop"   class="aligncenter size-full wp-image-163" style="border:1px solid #ccc;" /></p>
<p>In the &#8220;Stereotype: &#8221; field you basically enter in the first part of an &#8220;insert into ..&#8221; SQL statement. For this example, to insert a default list of departments we&#8217;d normally write the following SQL:</p>
<p><pre class="brush: sql;">
insert into department (department_id, name) values (1, 'Marketing');
insert into department (department_id, name) values (2, 'Production');
insert into department (department_id, name) values (3, 'Design');
</pre></p>
<p>So in this case, for the &#8220;Stereotype: &#8221; field we&#8217;d enter in &#8220;department (department_id, name)&#8221;. Click OK to close the properties dialog. Now in the Component object box enter in the values you&#8217;d like to insert, one per line. Here&#8217;s what our diagram should look like now:</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_employee2.jpg?w=700" alt="" title="dia_employee2"   class="aligncenter size-full wp-image-164" style="border:1px solid #ccc;" /></p>
<p>Now lets add in a typemap. Typemaps are used for when you&#8217;d like to configure custom types which are specific to a database platform. A good example of this is MySQL auto_increment. This is a feature specific to MySQL and not supported in all databases. Lets suppose we&#8217;d like to have a primary key column which gets auto incremented upon each insert. But we also want to support both MySQL and Apache Derby without having to maintain separate SQL files. To achieve this we&#8217;ll create a custom typemap and define the specific SQL for each target db.</p>
<p>Typemaps are created using a Small Package so select the &#8220;Small Package&#8221; object and add it to your diagram editor window. Right click and select &#8220;Properties&#8221;.</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_type_prop.jpg?w=700" alt="" title="dia_type_prop"   class="aligncenter size-full wp-image-165" style="border:1px solid #ccc;" /></p>
<p>In the &#8220;Stereotype: &#8221; field you enter in the target database. So for example &#8220;mysql: typemap&#8221;.  For a list of supported target databases see tedia2sql &#8211;help. Some common ones are: postgres, mysql, sybase, oracle, db2, and innodb. Click OK to close the properties dialog. Now inside the Small package box you can enter custom types one per line. For this example we&#8217;ll create a custom type with a name of &#8220;identity&#8221;. This means that when we generate our SQL files, tedia2sql will replace the column type with our custom type. Here&#8217;s a few examples:</p>
<table style="width:100%;border:none;">
<tr>
<td style="border:none;">
MySQL typemaps<br />
<pre class="brush: plain; light: true; wrap-lines: false;">
identity: int unsigned auto_increment
bigid: bigint unsigned auto_increment
</pre>
</td>
<td style="border:none;">Apache Derby typemaps<br />
<pre class="brush: plain; light: true; wrap-lines: false;">
identity: int generated by default as identity
bigid: long generated by default as identity
</pre></td>
</tr>
</table>
<p>Repeat the process for Apache Derby using &#8220;db2: typemap&#8221;.  Now that we&#8217;ve defined our custom identity typemap we can change the employee_id column from type &#8220;int&#8221; to type &#8220;identity&#8221;. We can also do the same for our department table. Now these columns will be auto incrementing columns and depending on which target database we select on output the correct SQL will be generated. Our diagram should now look like this:</p>
<p><img src="http://qnot.files.wordpress.com/2007/12/dia_employee3.jpg?w=700" alt="" title="dia_employee3"   class="aligncenter size-full wp-image-166" style="border:1px solid #ccc;" /></p>
<p>At this point we have created our database schema and defined a default list of departments to be inserted. We also created a typemap called &#8220;identity&#8221; which defines auto incrementing columns for both MySQL and Apache derby. Now lets generate the SQL files to create the database using tedia2sql. Before we run tedia2sql we need to apply a small patch to the tedia2sql script. This fixes a very small formatting issue in tedia2sql related to the typemaps we created. Edit the tedia2sql script (/usr/bin/tedia2sql) and comment out the line inside the parseTypeMap(..) subroutine that looks like this:</p>
<p><pre class="brush: perl; highlight: [3]; light: true;">
$defStr =~ s/s//g; # ignore spaces
     -- change to --
#   $defStr =~ s/s//g; # ignore spaces
</pre></p>
<p>or just apply the patch I created <a href="http://www.qnot.org/code/tedia2sql-typemap-1.2.12.patch">here</a> (works for version 1.2.12):</p>
<p><pre class="brush: plain; light: true;">
$ patch /usr/bin/tedia2sql &amp;lt; tedia2sql-typemap-1.2.12.patch
</pre></p>
<p>Now we can generate the SQL files for our target databases:<br />
<pre class="brush: plain; light: true;">
$ tedia2sql -i employee.dia -o employee-mysql.sql -t mysql -d
$ tedia2sql -i employee.dia -o employee-derby.sql -t db2 -d
</pre></p>
<p>This will generate two SQL files for building the database in both MySQL and Apache derby. If you view these files you can see how tedia2sql handled our typemaps for the auto incrementing columns in each target database:</p>
<p>MySQL<br />
<pre class="brush: sql;">
-- employee
create table employee (
  employee_id                int unsigned auto_increment not null,
  department_id             int not null,
  first_name                varchar(255) not null,
  last_name                 varchar(255),
  start_date                date,
  constraint pk_Employee primary key (employee_id)
) ;
</pre></p>
<p>Apache Derby<br />
<pre class="brush: sql;">
-- employee
create table employee (
  employee_id                int generated by default as identity  not null,
  department_id             int not null,
  first_name                varchar(255) not null,
  last_name                 varchar(255),
  start_date                date,
  constraint pk_Employee primary key (employee_id)
) ;
</pre></p>
<p>You can download the files generated as well as the employee.dia file I used in this tutorial here:</p>
<ul>
<li><a href="http://www.qnot.org/code/employee.dia">employee.dia</a></li>
<li><a href="http://www.qnot.org/code/employee-mysql.sql">employee-mysql.sql</a></li>
<li><a href="http://www.qnot.org/code/employee-derby.sql">employee-derby.sql</a></li>
</ul>
<p>You can test the SQL files generated by tedia2sql and create the employee database as follows:</p>
<p>MySQL<br />
<pre class="brush: plain; light: true;">
$ mysql -u user -p dbname &amp;lt; employee-mysql.sql
</pre></p>
<p>Apache Derby<br />
<pre class="brush: plain; light: true;">
$ java -cp derby.jar:derbytools.jar \
       -Dderby.system.home=/path/to/dbroot \
       -Dij.protocol=jdbc:derby: \
       -Dij.database='employee;create=true'
    org.apache.derby.tools.ij employee-derby.sql
</pre></p>
<p>A quick Makefile will help out a lot in testing out your database schema:</p>
<p><pre class="brush: plain; light: true;">
all:
      tedia2sql -i employee.dia -o employee-mysql.sql -t mysql -d
      tedia2sql -i employee.dia -o employee-derby.sql -t db2 -d
clean:
      rm -f *.sql
</pre></p>
<p>I&#8217;ve found that for small to moderate size projects creating database schemas in Dia and using tedia2sql for SQL generation to be a lifesaver. You can also make use of Dia&#8217;s export feature to export your database schema to a number of different formats such as jpg, png, eps, tiff, etc. I really only scratched the surface of what can be done using these great tools. tedia2sql has support for lots of cool features like indexes, foreign key constraints, views and much more. For more information check out <a href="http://tedia2sql.tigris.org/usingtedia2sql.html">using tedia2sql</a>  and <a href="http://dia-installer.de/doc/en/index.html">Dia&#8217;s manual</a>.</p>
<p>Happy <span style="font-weight:bold;">Dia</span>gramming!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/qnot.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/qnot.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=14&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2007/12/05/database-design-with-dia/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_menu.jpg" medium="image">
			<media:title type="html">dia_menu</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_class.png" medium="image">
			<media:title type="html">dia_class</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_component.png" medium="image">
			<media:title type="html">dia_component</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_small_package.png" medium="image">
			<media:title type="html">dia_small_package</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_attributes.jpg" medium="image">
			<media:title type="html">dia_attributes</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_employee.jpg" medium="image">
			<media:title type="html">dia_employee</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_comp_prop.jpg" medium="image">
			<media:title type="html">dia_comp_prop</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_employee2.jpg" medium="image">
			<media:title type="html">dia_employee2</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_type_prop.jpg" medium="image">
			<media:title type="html">dia_type_prop</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/12/dia_employee3.jpg" medium="image">
			<media:title type="html">dia_employee3</media:title>
		</media:content>
	</item>
		<item>
		<title>Xplanet view of Hurricane Dean</title>
		<link>http://left.subtree.org/2007/08/20/xplanet-view-of-hurricane-dean/</link>
		<comments>http://left.subtree.org/2007/08/20/xplanet-view-of-hurricane-dean/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 02:16:30 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://left.subtree.org/2007/08/20/xplanet-view-of-hurricane-dean/</guid>
		<description><![CDATA[I&#8217;m a big fan of Xplanet and every year during the hurricane season there&#8217;s no better way to liven up your desktop than to download the latest cloud maps and watch the path of the storm. Here&#8217;s a screenshot of my desktop showing hurricane dean (larger view): I cron a script to download the latest [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=21&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a big fan of <a href="http://xplanet.sourceforge.net/">Xplanet</a> and every year during the hurricane season there&#8217;s no better way to liven up your desktop than to download the latest <a href="http://xplanet.sourceforge.net/clouds.php">cloud maps</a> and watch the path of the storm. Here&#8217;s a screenshot of my desktop showing <a href="http://en.wikipedia.org/wiki/Hurricane_Dean_(2007)">hurricane dean</a> (<a href="http://qnot.files.wordpress.com/2007/08/dean_xplanet_large.jpg">larger view</a>):</p>
<p><a href="http://qnot.files.wordpress.com/2007/08/dean_xplanet_large.jpg"><img src="http://qnot.files.wordpress.com/2007/08/dean_xplanet_large.jpg?w=300&#038;h=196" alt="" title="dean_xplanet_large" width="300" height="196" class="aligncenter size-medium wp-image-168" /></a></p>
<p>I cron a script to download the latest cloud maps every 4 hours or so. The xplanet command I run is as follows:</p>
<p><pre class="brush: plain;">
xplanet -origin sun -north orbit \
        -config xplanet.conf -label \
        -marker_file brightStars \
        -target earth \
        -latitude 22 \
        -longitude -78 \
        -radius 30 \
        -labelpos +30+30
</pre></p>
<p>Here&#8217;s my xplanet.conf:</p>
<p><pre class="brush: plain;">
[earth]
cloud_map=clouds_2048.jpg
magnify=20

[moon]
magnify=20
</pre></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/qnot.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/qnot.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/qnot.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/qnot.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/qnot.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=left.subtree.org&amp;blog=13566420&amp;post=21&amp;subd=qnot&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://left.subtree.org/2007/08/20/xplanet-view-of-hurricane-dean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">sigma110</media:title>
		</media:content>

		<media:content url="http://qnot.files.wordpress.com/2007/08/dean_xplanet_large.jpg?w=300" medium="image">
			<media:title type="html">dean_xplanet_large</media:title>
		</media:content>
	</item>
	</channel>
</rss>
