<?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>Digivation Hack Central &#187; linux</title>
	<atom:link href="http://blog.digivation.com.au/category/category/nifty-hacks/linux-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.digivation.com.au</link>
	<description>Tech Information about various subjects</description>
	<lastBuildDate>Sat, 17 Sep 2011 02:57:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Git Tricks and Tips</title>
		<link>http://blog.digivation.com.au/category/nifty-hacks/git-tricks-and-tips</link>
		<comments>http://blog.digivation.com.au/category/nifty-hacks/git-tricks-and-tips#comments</comments>
		<pubDate>Fri, 19 Nov 2010 01:34:11 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Nifty Hacks]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=166</guid>
		<description><![CDATA[Maintaining Vendor Branches For the case where you have a vendor tarball or zip source bundle, these are effectively managed in a branch. If the vendor releases a new version, the update process is: git co vendor mkdir zzz mv * zzz/ mv .* zzz/ mv zzz/.git . rm -rf zzz git commit -a Now [...]]]></description>
			<content:encoded><![CDATA[<h1>Maintaining Vendor Branches</h1>
<p>For the case where you have a vendor tarball or zip source bundle, these are effectively managed in a branch.</p>
<p>If the vendor releases a new version, the update process is:<br />
<code><br />
git co vendor<br />
mkdir zzz<br />
mv * zzz/<br />
mv .* zzz/<br />
mv zzz/.git .<br />
rm -rf zzz<br />
git commit -a<br />
</code><br />
Now you can merge or rebase your development tree to the new vendor release.</p>
<h1>Some useful Git links.</h1>
<p>Refs:<br />
<a href="http://cheat.errtheblog.com/s/git">http://cheat.errtheblog.com/s/git</a><br />
<a href="http://sourceware.org/frysk/build/git-fu.html">http://sourceware.org/frysk/build/git-fu.html</a><br />
<a href="http://sandofsky.com/blog/git-workflow.html">http://sandofsky.com/blog/git-workflow.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/nifty-hacks/git-tricks-and-tips/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mapping special names to multiple USB serial adapters</title>
		<link>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters</link>
		<comments>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:34:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Solar]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[current cost]]></category>
		<category><![CDATA[currentcost]]></category>
		<category><![CDATA[device driver]]></category>
		<category><![CDATA[envi]]></category>
		<category><![CDATA[gci]]></category>
		<category><![CDATA[mains power monitor]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[watts clever]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=125</guid>
		<description><![CDATA[The watts clever envi has a USB serial adapter which is a Prolific pl2303. When inserted it is assigned /dev/ttyUSB0 by udev, among a few other symlinks. I have now obtained an RS485 serial adapter on ebay for A$13.98 delivered which uses the exact same chip, which makes it indistiguishable from the envi&#8217;s port. What [...]]]></description>
			<content:encoded><![CDATA[<p>The watts clever envi has a USB serial adapter which is a Prolific pl2303. When inserted it is assigned /dev/ttyUSB0 by udev, among a few other symlinks. I have now obtained an RS485 serial adapter on ebay for A$13.98 delivered which uses the exact same chip, which makes it indistiguishable from the envi&#8217;s port. What I needed was a way to guarantee uniqueness regardless of the enumeration order on boot or random hot plugin. Naturally, this is for the Aurora GCI which will be installed when they become available in May.</p>
<p>Researching udev a bit, I found /lib/udev/rules.d/60-persistent-serial.rules (mine is a debian system). This file shows how the standard symlinks are done. Since each USB port is unique, I should be able to use that uniqueness to map another symlink to the device.</p>
<p>Firstly plug in the device in the chosen USB port and issue<br />
<code>udevadm info --query=all --name=/dev/ttyUSB1</code></p>
<p>This shows a heap of stuff but mainly we are interested in<br />
<code>P: /devices/pci0000:00/0000:00:1a.0/usb2/2-1/2-1:1.0/ttyUSB1/tty/ttyUSB1</code></p>
<p>Create a file in <code>/etc/udev/rules.d/70-persistent-serial.rules</code> which contains</p>
<blockquote><p>
#see /lib/udev/rules.d/60-persistent-serial.rules</p>
<p>ACTION!=&#8221;add|change&#8221;, GOTO=&#8221;persistent_serial_end&#8221;<br />
SUBSYSTEM!=&#8221;tty&#8221;, GOTO=&#8221;persistent_serial_end&#8221;<br />
KERNEL!=&#8221;ttyUSB[0-9]*|ttyACM[0-9]*&#8221;, GOTO=&#8221;persistent_serial_end&#8221;</p>
<p>IMPORT=&#8221;usb_id &#8211;export %p&#8221;<br />
#IMPORT=&#8221;path_id %p&#8221;</p>
<p>ENV{ID_SERIAL}==&#8221;", GOTO=&#8221;persistent_serial_end&#8221;</p>
<p># usb nearest ethernet connector<br />
ENV{DEVPATH}==&#8221;*usb2/2-2/2-2:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/envi&#8221;<br />
#bottom front connector<br />
ENV{DEVPATH}==&#8221;*usb7/7-1/7-1:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/rs485&#8243;<br />
# usb below nearest ethernet connector<br />
ENV{DEVPATH}==&#8221;*usb2/2-1/2-1:1.0*&#8221;, SYMLINK+=&#8221;serial/by-name/rs485&#8243;</p>
<p>LABEL=&#8221;persistent_serial_end&#8221;
</p></blockquote>
<p>Replug and voila you get <code>/dev/serial/by-name/rs485</code> which will always be the correct device.</p>
<p>Now I just have to run the wire to where the GCI will be installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/solar/mapping-special-names-to-multiple-usb-serial-adapters/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Funny Characters for gcc/g++ errors and warnings</title>
		<link>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings</link>
		<comments>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings#comments</comments>
		<pubDate>Thu, 01 Apr 2010 03:15:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.digivation.com.au/?p=117</guid>
		<description><![CDATA[I have found that on some linux systems when you compile with gcc and g++ the error messages have funny characters like test.c: In function â: test.c:6: warning: unused variable â This is due to the default locale being set to something other than the default. in /etc/default/locale you will have a line like LANG="en_AU.UTF-8" [...]]]></description>
			<content:encoded><![CDATA[<p>I have found that on some linux systems when you compile with gcc and g++ the error messages have funny characters like</p>
<p><code>test.c: In function â:<br />
test.c:6: warning: unused variable â<br />
</code></p>
<p>This is due to the default locale being set to something other than the default.</p>
<p>in <strong>/etc/default/locale</strong> you will have a line like</p>
<p><code>LANG="en_AU.UTF-8"</code></p>
<p>add</p>
<p><code>LC_CTYPE=C</code></p>
<p>Restart the shell and compile again and the errors are now meaningful.</p>
<p><code>test.c: In function 'main':<br />
test.c:6: warning: unused variable 'x'<br />
</code></p>
<p>Naturally you could set it in the local shell for the session, but then you would have to do it every time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.digivation.com.au/category/nifty-hacks/linux-hacks/funny-characters-for-gccg-errors-and-warnings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

