<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>niasdigital.com</title>
	<atom:link href="http://niasdigital.com/blag/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://niasdigital.com/blag</link>
	<description>BennoBlag</description>
	<lastBuildDate>Wed, 10 Mar 2010 23:22:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Windows and heaps of COM</title>
		<link>http://niasdigital.com/blag/?p=49</link>
		<comments>http://niasdigital.com/blag/?p=49#comments</comments>
		<pubDate>Wed, 10 Mar 2010 23:22:14 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=49</guid>
		<description><![CDATA[Here at Nias Digital we produce a number of products which appear as USB/serial devices.  Each time you plug one in Windows comes over all helpful and caches that particular device&#8217;s VID/PID/serial tuple against the COM number so next time you plug it in it appears in the same place.
The problem comes from the fact [...]]]></description>
			<content:encoded><![CDATA[<p>Here at Nias Digital we produce a number of products which appear as USB/serial devices.  Each time you plug one in Windows comes over all helpful and caches that particular device&#8217;s VID/PID/serial tuple against the COM number so next time you plug it in it appears in the same place.</p>
<p>The problem comes from the fact that many programs, including the Windows hotplug notification mechanism, only provide 7 or 8 bits of storage for the COM number &#8211; as soon as you plug in your 128th device some things break and by the 256th nothing works all that well any more.  The most common response to this problem is to manually change the COM number in the Advanced tab of the port settings dialog however all the numbers which Windows has cached as above are marked as unavailable &#8211; with the right device history there can be no ports left available in the working range!</p>
<p>To get around this some Registry hacking is in order.  First, clear out the unneeded VID/PID/serial cachings.  These are dependent on the manufacturer of the USB/serial bridge hardware but for FTDI parts you&#8217;ll find the mappings in<br />
<code>HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Enum/FTDIBUS</code><br />
Delete all the keys inside that path and you&#8217;ll clear the mappings.  The actual COM numbers though will still be marked as unavailable.  To clear this, find the key<br />
<code>HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/COM Name Arbiter</code><br />
(yes it&#8217;s the only key I know of with spaces in the same) That key has a binary value called &#8220;ComDB&#8221; which is a bitmask of all reserved COM port numbers.  For example, if it reads<br />
<code>ff f0 00 00...</code><br />
Then then COM1 through COM12 will be marked as reserved.  If you&#8217;re running in to the same problems as me then at least the first 127 bits in the string will be set.  All you have to do is go through and 0 out bits corresponding to devices you don&#8217;t care about any more.  In my case I&#8217;ve got 10 internal serial ports (mostly on PCI serial expanders) so I edit my ComDB field to start with ff c0 and the rest 0s.  Be a little careful if you&#8217;ve got Bluetooth serial ports, they take up big chunks and removing their entries can break things.</p>
<p>Once that&#8217;s done, rejoice!  Plugging in new USB/serial adaptors (or old ones whose cachings you&#8217;ve removed) will now have their COM numbering starting down low again.</p>
<p><strong>NOTE: Tested on XP and seems like it should work on later versions; if you have an addendum, post as comments</strong> <img src='http://niasdigital.com/blag/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=49</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Player/Stage/Cold Leopards</title>
		<link>http://niasdigital.com/blag/?p=46</link>
		<comments>http://niasdigital.com/blag/?p=46#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:39:05 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=46</guid>
		<description><![CDATA[So, guess what, a blog post that&#8217;s not only useful, but totally not to do with VCS!  And you didn&#8217;t think it was possible&#8230;
Instead, today we&#8217;ll be installing the Player/Stage robotics server and simulation platform on MacOS 10.6.2 Snow Leopard.
Player
Use macports to install the basic tools of the trade; cmake and pkgconfig.  Don&#8217;t use it [...]]]></description>
			<content:encoded><![CDATA[<p>So, guess what, a blog post that&#8217;s not only useful, but totally not to do with VCS!  And you didn&#8217;t think it was possible&#8230;</p>
<p>Instead, today we&#8217;ll be installing the Player/Stage robotics server and simulation platform on MacOS 10.6.2 Snow Leopard.</p>
<h2>Player</h2>
<p>Use macports to install the basic tools of the trade; cmake and pkgconfig.  Don&#8217;t use it to install libtool, make sure you&#8217;re using the version supplied with the XCode tools (use &#8220;which libtool&#8221; to verify this.</p>
<p>Unpack the player source (I used 3.0.1), make a &#8220;build&#8221; subdirectory, change to it and run<br />
<code>export CXXFLAGS="-arch x86_64"<br />
cmake ../<br />
ccmake ../</code><br />
In the ccmake menu, set &#8220;CMAKE_OSX_ARCHITECTURES&#8221; to &#8220;x86_64&#8243;.  Player doesn&#8217;t seem to automatically install to the SDK so either you can install it to, eg, &#8220;/usr&#8221; and copy it to the SDK later or just set the install path to the SDK path with &#8220;usr&#8221; tacked on the end.</p>
<p>If any of the later stages fail, you might find you need to disable the python bindings as well.</p>
<p>Press &#8216;c&#8217; to configure and &#8216;g&#8217; to generate.  If &#8216;g&#8217; doesn&#8217;t come up immediately, keep pressing &#8216;c&#8217; until it does (or until it gives a sensible error).  For some reason it doesn&#8217;t always work first time.</p>
<p>Once done,<br />
<code>make<br />
sudo make install</code><br />
If you&#8217;ve installed to your SDK then move on, otherwise<br />
<code>sudo cp /usr/lib/libplayer* &lt;SDK DIR&gt;/usr</code></p>
<h2>Stage</h2>
<p>I&#8217;ve heard tell that macports can install a 64-bit version of FLTK for you.  If that works in your case, go for it.  For myself, I had to compile FLTK manually.  The only version I can get to compile on 10.6.2 is the SVN snapshot of the 1.3.x branch.  2.0.x won&#8217;t work, neither do earlier versions from the 1.y branch.</p>
<p>Unpack that and<br />
<code>./configure --prefix=&lt;your favorite prefix&gt;<br />
make<br />
sudo make install</code><br />
I found I had to change src/fl_draw_pixmap.cxx::339 to add an explicit cast, from:<br />
<code>U32* colors = d.byte1[*p++];</code><br />
to<br />
<code>U32* colors = (U32*)d.byte1[*p++];</code><br />
Once again, if you didn&#8217;t use your SDK as your prefix,<br />
<code>sudo cp /usr/lib/libfltk* &lt;SDK PATH&gt;/usr</code><br />
Now Stage is ready to be built.  Make sure CXXFLAGS is still set to force a 64-bit build (otherwise just export it again), unpack Stage, make a build subdir, change to it and run<br />
<code>cmake ../<br />
ccmake ../</code><br />
Once again, set architecture and install paths, configure, generate and exit.  If the configuration doesn&#8217;t find the player installation, make sure that PKG_CONFIG_PATH includes the player installation location&#8217;s pkgconfig dir; eg if you installed to /usr, make sure PKG_CONFIG_PATH includes /usr/lib/pkgconfig.</p>
<p>Once Stage configuration is complete,<br />
<code>make<br />
sudo make install</code><br />
For some reason, Stage doesn&#8217;t give the player plugin the right name.  If running Player fails having not found the libstageplugin, you&#8217;ll need to<br />
<code>sudo ln -s /usr/lib/stageplugin.so /usr/lib/libstageplugin.so</code><br />
(assuming you installed to /usr/lib)</p>
<p>You should be good!  Well, worked for me, YMMV.</p>
<p>G&#8217;luck <img src='http://niasdigital.com/blag/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIT-op 3: Specifying revisions</title>
		<link>http://niasdigital.com/blag/?p=34</link>
		<comments>http://niasdigital.com/blag/?p=34#comments</comments>
		<pubDate>Sat, 17 Oct 2009 01:10:55 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=34</guid>
		<description><![CDATA[Now for the great time-saver of this series of tutes.  You&#8217;re going to spend a lot of time specifying revisions when working with GIT, but it does a great job of easing this for you.
The way most people get revision specifiers is by using git-log to find the commit they&#8217;re looking for and cut-and-pasting the [...]]]></description>
			<content:encoded><![CDATA[<p>Now for the great time-saver of this series of tutes.  You&#8217;re going to spend a lot of time specifying revisions when working with GIT, but it does a great job of easing this for you.</p>
<p>The way most people get revision specifiers is by using git-log to find the commit they&#8217;re looking for and cut-and-pasting the SHA1 hash associated with it.  This hash is the basis of all git specification methods.</p>
<p>Note that the examples I give here relate to a particular command but will work with pretty much any of them.  Most GIT commands pipe their given specifiers through git-rev-list to get the commit IDs out and the docco for that command is a good place to get more info on what I&#8217;m going to say.</p>
<h2>Tags</h2>
<p>The most common form of easy revision specification is tagging.  Tag a version simply by</p>
<p><code>git tag -a tag_name [SHA1 hash of target commit]</code></p>
<p>or just</p>
<p><code>git tag -a tag_name</code></p>
<p>if you&#8217;ve currently got the target commit checked out.</p>
<p>You can use -u &lt;key-id&gt; instead of -a to sign the tag and -v to verify a signed tag.  Once you&#8217;ve got a revision tagged, that tag name simply acts as a synonym for the SHA1 has it&#8217;s linked to.</p>
<h2>Relative</h2>
<p>Relative specification is useful if you&#8217;re working with commits very close to HEAD.  Drop back 1 or 2 revisions with</p>
<p><code>git log HEAD^</code></p>
<p>or</p>
<p><code>git log HEAD^^</code></p>
<p>When going further back this can of course be a pain so instead of</p>
<p><code>git log HEAD^^^^^^^</code></p>
<p>you can use</p>
<p><code>git log HEAD~7</code></p>
<p>to go back 7 commits at once.</p>
<h2>Time-based</h2>
<p>Now GIT starts to get cool.  It keeps a track of at what your tree looked like at different points in time and you can access this information in a jiff.  Say you&#8217;ve just pulled in a bunch of changes and want to look at everything which wasn&#8217;t there when you left work; git does a pretty good job of parsing English-like time specifications so you can simply do</p>
<p><code>git log @{6pm.yesterday}</code></p>
<p>How about what was on some other branch the day before yesterday but not in your branch now</p>
<p><code>gitk other_branch@{day.before.yesterday} ^HEAD</code></p>
<p>Note that a carat before a revision name is logical not, a carat after is one commit before.</p>
<p>As you can see, the @{} specification is very powerful, allowing you to get the status of a tree at a particular time either in normal date specifications or more English-like phrasing.  This is not, however, the same thing as the commits since a particular time.  For example, if you pull in a big old bunch of commits, @{5.minutes.ago} will point to the tree before the pull, not a tree with all but the commits timestamped in the last 5 minutes.  For this you need the &#8211;since specifier</p>
<p><code>gitk --since="5th October"</code></p>
<h2>Other neat specifiers</h2>
<p>There are other things you can use to select commits too.</p>
<p><code>gitk --author="Ben Nizette" --committer="Haavard Skinnemoen"</code></p>
<p>will show all the patches I wrote which went through Haavard.</p>
<p><code>gitk --since="yesterday" --grep="gpio"</code></p>
<p>Will show all patches in the last day which claimed to have something to do with gpio.  We can limit this further</p>
<p><code>gitk --since="yesterday" drivers/gpio/</code></p>
<p>will simply show the last day&#8217;s commits which touched something in the drivers/gpio/ directory.</p>
<p><code>gitk --extended-regexp="^foo.*[0-9]*$"</code></p>
<p>Well that does pretty much as you&#8217;d expect really.</p>
<p><code>gitk --author="Linus Torvalds" --no-merges</code></p>
<p>Shows you how much actual coding (non-merge) work Linus actually does.</p>
<h2>The dots</h2>
<p>There can be some confusion when using GIT as to what a series of dots actually does.  2 dots (&#8220;..&#8221;) is a range specifier</p>
<p><code>git log HEAD~5..HEAD~2</code></p>
<p>shows all commits between the 5th and 2nd newest.  It&#8217;s a shorthand for</p>
<p><code>git log HEAD~2 ^HEAD~5</code></p>
<p>3 dots (&#8220;&#8230;&#8221;) is a symmetric difference, that is</p>
<p><code>git log HEAD~5...HEAD~2</code></p>
<p>will show all commits that are in HEAD~5 or HEAD~2 but not both.  In the case where they&#8217;re just different points on the same branch 2 and 3 dots do the same thing, but suppose you&#8217;re about to merge a pair of branches and you want to see what might conflict,</p>
<p><code>gitk merge_1...merge_2</code></p>
<p>shows the commits which are in one branch or the other but not both &#8211; i.e. it just lists the commits which could possibly conflict.</p>
<p>You can use this during a merge as well to narrow down which commits introduced the conflict, read their changelog and hopefully get a better understanding of the correct conflict resolution.  Say you&#8217;re out at sea with a conflict in complex/subsystem.c; simply</p>
<p><code>gitk merge_1...merge_2 complex/subsystem.c</code></p>
<p>To view all patches which could possibly cause that conflict.</p>
<p>Anyway, that&#8217;s a quick overview of the specifiers that make my life easier.  You can refer to &#8220;man git-rev-list&#8221; for other cool options to try out too.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIT-op 2: Rebase</title>
		<link>http://niasdigital.com/blag/?p=33</link>
		<comments>http://niasdigital.com/blag/?p=33#comments</comments>
		<pubDate>Thu, 15 Oct 2009 05:50:36 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=33</guid>
		<description><![CDATA[Rebase is generally used to move a set of changes started against one base to another.  99% of the time, you&#8217;re developing something against an upstream branch, that branch moves and you want to get the latest and greatest.  You can either merge upstream with you and loose your clean history, or rebase. [...]]]></description>
			<content:encoded><![CDATA[<p>Rebase is generally used to move a set of changes started against one base to another.  99% of the time, you&#8217;re developing something against an upstream branch, that branch moves and you want to get the latest and greatest.  You can either merge upstream with you and loose your clean history, or rebase.  Rebase has grown to be a fairly general way to change history though; you can use it to reorder, change and drop commits and move your development not just further up the same branch but across to somewhere else entirely.</p>
<p>Before I get going, please have a read of the last entry which has some tips about working with rebase; the biggest of these is simply Keep Rebased Trees Private.</p>
<h2>GIT tree storage</h2>
<p>A lot of rebase semantics make more sense if you realize that a GIT commit ID doesn&#8217;t really refer to a commit but rather to the state of your source tree immediately after that commit.  Many people expect</p>
<p><code>git diff abcdef1234</code></p>
<p>to give a unified diff of the changes introduced by that commit, but that commit ID, as above, doesn&#8217;t represent a commit as such but a tree.  What&#8217;s the correct output when you ask for the diff of a tree?  It just doesn&#8217;t make sense.</p>
<p>Branch names really just represent a specific commit ID, the ID of the most recent commit on that branch.  A branch name has no internal concept of where it&#8217;s currently based; this is one of the most common errors when rebasing &#8211; telling GIT the branch to operate on is based on the wrong commit.</p>
<h2>Rebase</h2>
<p>As I mentioned above, the most common use of rebase is simply to shift your commits further up an upstream branch.  If you&#8217;re following my advice about tracking upstream in the &#8220;master&#8221; branch and doing work somewhere else (call it &#8220;my_branch&#8221;) then this is accomplished by</p>
<p><code>git rebase master my_branch</code></p>
<p>or just</p>
<p><code>git rebase master</code></p>
<p>if you&#8217;ve got my_branch checked out.  Because GIT only deals with commits, you have to have committed current work before you run.</p>
<p>But remember branch names are really just commit IDs, so this is read by GIT as &#8220;take all the commits in my_branch which aren&#8217;t in master and move them to the current HEAD of master&#8221;; or else &#8220;squish all the master history in before any my_branch history&#8221;.</p>
<h2>Rebase interactive</h2>
<p>This was described in the previous entry.  By appending the &#8211;interactive flag to the rebase (but otherwise using the same syntax) you get an opportunity to change the commits in my_branch as they get moved to the destination.  Note that the destination head can actually be exactly where my_branch is already based.  While this makes the rebase a no-op usually, in interactive mode you can use it to change commit history at any time.</p>
<h2>onto</h2>
<p>The &#8211;onto switch allows you to move a set of commits from one branch of your repo to somewhere completely different.  Say you&#8217;re developing feature_2 which is based on feature_1 but feature_1 is not yet in the upstream branch.  After a bit of a brainwave you realize feature_2 can be rearranged to not have that dependency and is ready to move upstream by itself.  Do</p>
<p><code>git rebase --onto master feature_1 feature_2</code></p>
<p>This is read by GIT as &#8220;take all the history from feature_2 which isn&#8217;t in feature_1 and stick it on the end of master&#8221;.  Because the &#8211;onto switch has to come before the other 2 branch names the syntax seems backwards; just remember that the last 2 branch IDs are the same no matter what version of the rebase command you&#8217;re using (just &#8220;base&#8221; and &#8220;head&#8221; branches respectively).</p>
<p>Another feature of &#8211;onto rebasing is an alternative way to drop commits from the middle of history.  Suppose you&#8217;re on branch &#8220;my_branch&#8221; and the last 5 commits have names &#8220;commit1&#8243; to &#8220;commit5&#8243; (I&#8217;ll be writing an entry soon on the best ways to specify actual revisions).  Then</p>
<p><code>git rebase --onto commit2 commit4 my_branch</code></p>
<p>Will take the stretch of commits between commit4 and the branch head and move them to be based at commit2 &#8211; i.e. you&#8217;ve just dropped commit3 from your tree.  (note the sloppy naming here, as I&#8217;ve been at pains to point out commit names identify trees, not commits, so actually calling them commitN isn&#8217;t ideal <img src='http://niasdigital.com/blag/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<h2>When all goes wrong</h2>
<p>During a rebase, you may of course get a number of conflicts between your code and the tree on to which you&#8217;re trying to move it.  All such conflicts will be marked with standard merge markers (&#8220;&lt;&lt;&lt;&lt; &gt;&gt;&gt;&gt;&#8221;) which you can grep for, use git diff to see or just read the error log.  Once you&#8217;ve got rid of all these sites, mark them as fixed by</p>
<p><code>git add my-fixed-file.c</code></p>
<p>but instead of committing, run</p>
<p><code>git rebase --continue</code></p>
<p>If you&#8217;re stuck and want to get out of there, run</p>
<p><code>git rebase --abort</code></p>
<p>to undo all rebasing actions.  Finally, if a commit is causing conflicts because it&#8217;s no longer needed,</p>
<p><code>git rebase --skip</code></p>
<p>will skip that particular commit.  Note that this will loose that commit, be careful!</p>
<p>Finally, git rebase is smart enough to recognize commits which introduce the same changes as each other but have different descriptions and skip them.  That is, if you&#8217;ve got a commit in the tree you&#8217;re rebasing but has already been accepted in to the new base, git will automatically skip that patch.</p>
<p>Cool, huh?!  That&#8217;s it for now, next time I&#8217;ll show you the fastest and coolest ways to specify the commits you care about.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIT-op 1; basics</title>
		<link>http://niasdigital.com/blag/?p=29</link>
		<comments>http://niasdigital.com/blag/?p=29#comments</comments>
		<pubDate>Tue, 13 Oct 2009 00:54:31 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=29</guid>
		<description><![CDATA[Version control seems to be one of my favorite subjects for blogging; here&#8217;s a slightly new thing &#8211; a tutorial style thing showing off the coolest bits of GIT I&#8217;ve come across.  This is part 1, offering tips for easy GIT usage especially for people coming from a dissimilar VCS.
Tip 1: Commit Often.  Really Often.
Git [...]]]></description>
			<content:encoded><![CDATA[<p>Version control seems to be one of my favorite subjects for blogging; here&#8217;s a slightly new thing &#8211; a tutorial style thing showing off the coolest bits of GIT I&#8217;ve come across.  This is part 1, offering tips for easy GIT usage especially for people coming from a dissimilar VCS.</p>
<h1>Tip 1: Commit Often.  Really Often.</h1>
<p>Git offers a great number of features, but only for commits.  Unlike other VCSs though, a commit isn&#8217;t final; you can still play with the ordering, combine commits, drop them, move them however you see fit.  There is no down-side to committing often, if you end up with a big commit mess, use interactive rebasing to organise it all again.</p>
<h2>Interactive Rebase</h2>
<p>Suppose you&#8217;re developing your stuff on a branch called my_branch which is based on the master branch shared with others.  You&#8217;ve taken tip 1 and you&#8217;ve ended up with a big mess of commits with no logical ordering or cohesion.  Interactive rebasing allows you to reorder, combine and drop commits.<br />
<code>git rebase -i master my_branch</code><br />
Will bring up $EDITOR with a list of all commits between master and my_branch.  If you change the order of commits in this list, it will change the order of the commits in your branch.  Replace the &#8220;pick&#8221; keyword with &#8220;s&#8221; to squish a commit in to the previous one.  Delete a commit from that list and it will be deleted from your branch.  Save and exit and GIT takes care of the rest.</p>
<p>In this way you can organise, say, a new feature in to a series of logically separated actions for easy review by your peers.</p>
<h1>Tip 2: Pro: Rebase changes history.  Con: Rebase changes history.</h1>
<p>OK so rebasing is great.  You can move your changes on top of a newer base or, like above, you can reorganize your commits to be more useful.  Be very very careful though as you must never rebase something that someone else has access to.</p>
<p>Rebasing changes history but it doesn&#8217;t leave a marker anywhere saying what it has done.  If someone has pulled your branch and you rebase it, their version won&#8217;t be updated to reflect this.  They will have to remove their copy of your branch and pull it again from scratch.</p>
<h1>Tip 3: Branches are cheap; use them for everything</h1>
<p>Unlike some other VCSs, branching is very easy to do and merging back is just as easy.  Separating your working tree in to different branches for each feature for example can allow you to test each feature on a stable base.  You can leave the &#8220;master&#8221; branch for tracking upstream and working in private branches that others aren&#8217;t going to be annoyed if you break.</p>
<p>In particular, if you&#8217;re starting out with GIT and aren&#8217;t sure how to do something, branch off and try it there.  If it works, merge it back, if it fails kill the branch and start again.</p>
<p>Like a lot of things though, use this tip with care.  If you end up with a massive branch, getting it merged back in to the mainline gets harder and harder.  Both because there&#8217;s more likely to be conflict and also because the final version is going to be hard to review.  In short: Big branches eventually have the same problems as any patch bombs; be careful.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gitosis &#8211; easy git security</title>
		<link>http://niasdigital.com/blag/?p=22</link>
		<comments>http://niasdigital.com/blag/?p=22#comments</comments>
		<pubDate>Sun, 30 Aug 2009 03:03:51 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=22</guid>
		<description><![CDATA[OK so maybe it&#8217;s time I write something useful.
Gitosis:

Pros: A fantastic program which simplifies the task of securely hosting git repositories.
Cons: It doesn&#8217;t do read-only unsecured shares

Getting Gitosis
There are gitosis packages for mos major distros but I haven&#8217;t had much luck getting them to work, best to get the latest source:
git clone git://eagain.net/gitosis.git
cd gitosis
python setup.py [...]]]></description>
			<content:encoded><![CDATA[<p>OK so maybe it&#8217;s time I write something useful.</p>
<p>Gitosis:</p>
<ul>
<li>Pros: A fantastic program which simplifies the task of securely hosting git repositories.</li>
<li>Cons: It doesn&#8217;t do read-only unsecured shares</li>
</ul>
<h2>Getting Gitosis</h2>
<p>There are gitosis packages for mos major distros but I haven&#8217;t had much luck getting them to work, best to get the latest source:<br />
<code>git clone git://eagain.net/gitosis.git<br />
cd gitosis<br />
python setup.py install<br />
</code><br />
Don&#8217;t forget to install python setuptools.</p>
<h2>Preparing the System</h2>
<p>Now you have to set up a user for gitosis to run as.  The hosted repos will be stored in this user&#8217;s home dir, so choose wisely.  On my system I did<br />
<code>sudo adduser \<br />
--system \<br />
--shell /bin/sh \<br />
--gecos 'git version control' \<br />
--group \<br />
--disabled-password \<br />
--home /home/git \<br />
git</code><br />
Now, every user who interacts with Gitosis will need an SSH key.  Check ~/.ssh, if you&#8217;ve got id_rsa.pub in there you&#8217;re good otherwise generate one by<br />
<code>ssh-keygen -t rsa</code><br />
Now to initialize a gitosis instance for your created user with your personal user authorised to administer.  Copy your public key to /tmp (so you don&#8217;t have permission problems later on) then<br />
<code>sudo -H -u git gitosis-init &lt; /tmp/id_rsa.pub</code><br />
Now comes the sweet bit of Gitosis &#8211; administration isn&#8217;t actually done on the server, all gitosis hosting configuration is itself hosted by gitosis.  On your personal machine then, clone the admin repository<br />
<code>git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git<br />
cd gitosis-admin</code><br />
Now the administration workflow is</p>
<ol>
<li>Edit gitosis-admin/gitosis.conf</li>
<li>Add user&#8217;s public keys to gitosis-admin/keydir</li>
<li> <code>git add keydir/*</code></li>
<li> <code>git commit -a -m 'Describe your changes'</code></li>
<li> <code>git push</code></li>
</ol>
<h2>Creating a new Repo</h2>
<p>OK so now you&#8217;re set up and authorised for administration, sweet.  Let&#8217;s set up our first repository.  Open gitosis-admin/gitosis.conf and add a section like<br />
<code>[group groupname]<br />
members = usernames<br />
writable = new-repo<br />
</code><br />
Where of course group names should be descriptive, new-repo is the name of, you guessed it, your repository and usernames is a space-separated list of fully qualified usernames allowed to write.  That is, &#8220;user1@somecomp user2@anothercomp&#8221; etc.</p>
<p>Save this and exit.  If there are users other than yourself in the list, copy their keys to gitosis-admin/keydir.  The keyfile filenames should be the fully qualified username with a .pub extension, eg user1@somecomp.pub.</p>
<p>Add and commit any changes and push them back to the server like<br />
<code>git add keydir/*<br />
git commit -a -m 'Added new-repo with users user1, user2'<br />
git push<br />
</code></p>
<p>And that&#8217;s the configuration done.  Now you of course need to give the repo content.  We&#8217;re going to make the repo locally and push it up, so</p>
<p><code>cd ~/code/my-repo<br />
git init<br />
#make some changes, commit<br />
git remote add origin git@SERVER_HOSTNAME:new-repo.git<br />
git push origin master:refs/heads/master</code><br />
Note that the push will fail unless you have at least 1 commit on the master branch.  Once you&#8217;ve done this once, git will remember the local and remote refs so you&#8217;ll only need to<br />
<code>git commit [OPTIONS]<br />
git push</code></p>
<p>And that&#8217;s it!  There are a fair few config options I&#8217;ve left out, like using group names as user names in writable lists, read-only access (but not public access) etc.  Check out example.conf in the directory where you originally cloned gitosis for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=22</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aevercore update</title>
		<link>http://niasdigital.com/blag/?p=20</link>
		<comments>http://niasdigital.com/blag/?p=20#comments</comments>
		<pubDate>Sun, 30 Aug 2009 02:22:59 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=20</guid>
		<description><![CDATA[The excuse: Work&#8217;s got massive so I haven&#8217;t had a good chance to work on Aevercore in ages.  However I&#8217;m still sold on the idea and have a bunch of almost-working scripts so it isn&#8217;t dead, just sleeping.  Stay tuned  
]]></description>
			<content:encoded><![CDATA[<p>The excuse: Work&#8217;s got massive so I haven&#8217;t had a good chance to work on Aevercore in ages.  However I&#8217;m still sold on the idea and have a bunch of almost-working scripts so it isn&#8217;t dead, just sleeping.  Stay tuned <img src='http://niasdigital.com/blag/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I hate browsers</title>
		<link>http://niasdigital.com/blag/?p=16</link>
		<comments>http://niasdigital.com/blag/?p=16#comments</comments>
		<pubDate>Sun, 30 Aug 2009 02:21:38 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=16</guid>
		<description><![CDATA[The browser these days is the centre of a hells of a lot of desktop activities.  I mean, how often do you actually spend &#8220;browsing&#8221; the internet?  I know I spend bugger all.  I go to Facebook, Twitter, LWN, LinuxForDevices, XKCD and a handful of other websites all the time but fairly rarely actually sit [...]]]></description>
			<content:encoded><![CDATA[<p>The browser these days is the centre of a hells of a lot of desktop activities.  I mean, how often do you actually spend &#8220;browsing&#8221; the internet?  I know I spend bugger all.  I go to Facebook, Twitter, LWN, LinuxForDevices, XKCD and a handful of other websites all the time but fairly rarely actually sit down and browse.  And I suspect you&#8217;re the same.</p>
<p>If the regularly visited sites are apps the browser is a complete secondary desktop environment with tabs instead of windowing and a whole lot besides.  Why do I want another desktop when GNOME/KDE work so well?  Why shouldn&#8217;t web apps be Revealed, ALT-Tab&#8217;d and resized like anything else?</p>
<p>There are solutions &#8211; both major Linux desktops have widgets which can bring some sites to my desktop and Twitter&#8217;s well defined API means that I can just use Gwibber.  All well and good where it works but I want to treat every web app this way.</p>
<p>In steps uzbl, a browser conforming to the UNIX philosophy that one program should do one thing and do it well.  In fact, browser may even be overstating it &#8211; let&#8217;s try interactive web renderer.  It uses the WebKit renderer so you get CSS, Javascript, Flash, all the things you need but nothing you don&#8217;t.</p>
<p>Using uzbl and a little bit of BASH we get Page Apps.  Normal apps which can be launched from GNOME-DO, run dialogs or menus but are nothing more or less than the web apps we all know and love.</p>
<div id="attachment_17" class="wp-caption alignnone" style="width: 1034px"><img class="size-large wp-image-17" title="uzbl-screenshot" src="http://niasdigital.com/blag/wp-content/uploads/2009/08/uzbl-screenshot-1024x768.png" alt="page apps in action" width="1024" height="768" /><p class="wp-caption-text">page apps in action</p></div>
<p>OK so maybe people won&#8217;t get it.  What&#8217;s the problem with 1 extra mouse click or a few extra key strokes?  But they&#8217;re missing the point, it isn&#8217;t about that, it&#8217;s about promoting web apps to first class citizens.</p>
<p>By default uzbl is modal, VIM-like, so as yet my PageApps don&#8217;t quite act as you&#8217;d expect.  But they will.  You can get uzbl at http://www.uzbl.org/ and I&#8217;ll release my PageApps scripts just as soon as they&#8217;re ready.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aevercore</title>
		<link>http://niasdigital.com/blag/?p=14</link>
		<comments>http://niasdigital.com/blag/?p=14#comments</comments>
		<pubDate>Mon, 20 Apr 2009 06:16:17 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=14</guid>
		<description><![CDATA[Well it&#8217;s been a while since my last post.  Back to it!
Over the last few weeks I&#8217;ve been playing with the idea of doing my own Linux distribution based, in concept, on Tinycore Linux.  It will target (guess!) the AVR32 family of uCs in the first instance hopefully ARM shortly thereafter.
The working name [...]]]></description>
			<content:encoded><![CDATA[<p>Well it&#8217;s been a while since my last post.  Back to it!</p>
<p>Over the last few weeks I&#8217;ve been playing with the idea of doing my own Linux distribution based, in concept, on Tinycore Linux.  It will target (guess!) the AVR32 family of uCs in the first instance hopefully ARM shortly thereafter.</p>
<p>The working name is Aevercore or avc for short.  For those who don&#8217;t know Tinycore, the idea is that the entire distribution is run from RAM for a few reasons.<br />
1) Increased speed.<br />
2) No bitrot or residue &#8211; the system is at exactly the same state each startup.</p>
<p>Of course not everyone sees 2) as an advantage and indeed some times it isn&#8217;t.  To that end there is a persistence list &#8211; at each shutdown the items on the list are written to persistent storage and at each boot, they&#8217;re extracted again.  In embedded space, we also have<br />
3) Running from RAM means less flash wear.</p>
<p>Tinycore, and avc as well, also support running from persistent storage in the usual manner.  Anything to be run from persistent storage is loopback mounted and symlinked in to place.  This means that all writebacks still hit RAM and you get all of the cleanliness advantages without eating more RAM than needed.</p>
<p>To this end, I&#8217;ve been experimenting with build systems.  Ideal would be T2.  After a good few days hitting it though, I can&#8217;t get the darn thing to build for AVR32 and can&#8217;t be bothered learning what&#8217;s going wrong.  I know a fair bit about Buildroot so I&#8217;ll probably run with that in the first instance.</p>
<p>So, what I need first.  Of course the first thing is just time.  Once a current project at Nias is done I should have a bit more of that.  Second is good compile hardware.  I certainly can&#8217;t go compiling a full operating system on my Laptop and the desktop is creaking arthritically too.</p>
<p>Who knows, if I can break my habit of not following good idea through, I&#8217;ll have an alpha out in 6 weeks or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shouting in the datacentre</title>
		<link>http://niasdigital.com/blag/?p=12</link>
		<comments>http://niasdigital.com/blag/?p=12#comments</comments>
		<pubDate>Thu, 01 Jan 2009 21:30:53 +0000</pubDate>
		<dc:creator>squidgit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://niasdigital.com/blag/?p=12</guid>
		<description><![CDATA[Just saw this interesting little piece of wisdom from the guys at the Sun datacentre in Fyshwick

Cool eh?  I wonder how he discovered that particular effect&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Just saw this interesting little piece of wisdom from the guys at the Sun datacentre in Fyshwick</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/tDacjrSCeq4&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/tDacjrSCeq4&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Cool eh?  I wonder how he discovered that particular effect&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://niasdigital.com/blag/?feed=rss2&amp;p=12</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
