<?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>Professional Geekism &#187; Linux</title>
	<atom:link href="http://www.ninjabadger.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ninjabadger.net</link>
	<description>Ninjas. Badgers. Linux. Me.</description>
	<lastBuildDate>Fri, 05 Aug 2011 13:49:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Source routing with OpenVZ &amp; Linux</title>
		<link>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/</link>
		<comments>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 13:43:18 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[openvz]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=147</guid>
		<description><![CDATA[If, like me, you have to run lots of OpenVZ-based virtual server hosts, you will likely have encountered the fun that is reverse-path filtering, or &#8216;rp_filter&#8217;. This is the function of the kernel that rejects &#8216;martian&#8217; IP addresses arriving on any given interface. This is usually a good thing, until you wish to connect your [...]]]></description>
			<content:encoded><![CDATA[<p>If, like me, you have to run lots of OpenVZ-based virtual server hosts, you will likely have encountered the fun that is reverse-path filtering, or &#8216;rp_filter&#8217;. This is the function of the kernel that rejects &#8216;martian&#8217; IP addresses arriving on any given interface. This is usually a good thing, until you wish to connect your OpenVZ host to two separate networks and have it route IP addresses from both subnets to &amp; from your guests via the VENET-style interfaces.</p>
<p>Essentially, despite differing source addresses, only one default gateway exists to send traffic to IPs not within the connected subnets and thus, traffic on any &#8220;secondary&#8221; subnet is rejected as a martian when leaving the host&#8217;s interface that is connected to its default gateway.</p>
<p>Some people would use bridged intefaces, although this is sadly not an option for me right now. Whilst the performance of VENET is supposedly better, we also have a large install-base of VENET guests that do not wish to be disturbed. So for now I still need a way to make this work with VENET interfaces (and also VETH if required later).</p>
<p>There are two methods around the return_path filtering, with the first being a terrible hack that should only be used temporarily, if at all&#8230; If you echo &#8217;1&#8242; to /proc/sys/net/ipv4/conf/all/log_martians, you will be able to see which interface is filtering martian packets. With that information you can then simply disable the rp_filter function by echoing &#8217;0&#8242; to /proc/sys/net/ipv4/conf/INTERFACE/rp_filter and martians won&#8217;t be filtered.</p>
<p>However, this isn&#8217;t a sensible option. A better solution is to actually create a routing rule to alter the default gateway used, based on the source subnet. It took me a little bit of digging, but I eventually managed to get this working after combing a few sources (including, but not limited to, the iproute2 man file).</p>
<p>For reference, here&#8217;s my routing table showing two networks and two /32 IPs assigned to a guest&#8217;s VENET interface (note that the networks are /23&#8242;s, not /24&#8242;s!):</p>
<pre>Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.9.159      0.0.0.0         255.255.255.255 UH    0      0        0 venet0
10.0.125.53     0.0.0.0         255.255.255.255 UH    0      0        0 venet0
10.0.8.0        0.0.0.0         255.255.254.0   U     0      0        0 br0
10.0.124.0      0.0.0.0         255.255.254.0   U     0      0        0 br1
0.0.0.0         10.0.9.1        0.0.0.0         UG    0      0        0 br0</pre>
<p>Start by opening /etc/iproute2/rt_tables in your favourite editor. You&#8217;ll need to append a line to the bottom to create a new routing table:</p>
<pre># cat /etc/iproute2/rt_tables
#
# reserved values
#
255    local
254    main
253    default
0    unspec
#
# local
#
#1    inr.ruhep
100    vlan4</pre>
<p>As you can see, I&#8217;ve appended a new table named &#8216;vlan4&#8242; (picking a sensible name <em>helps</em>, in my case this is the VLAN name for 10.0.124.0/23)  and given it a priority of 100. As per my understanding, the priority should be decremented for each subsequent table defined.</p>
<p>Now you need to use ip to define the new rules &amp; routing behaviour, taking advantage of the new table we&#8217;ve defined. First, create a rule matching traffic from your secondary subnet:</p>
<pre>ip rule add from 10.0.124.0/23 iif venet0 table vlan4</pre>
<p>For reference, the &#8216;iif&#8217; attribute is not a mistake; &#8220;iif&#8221; not &#8220;if&#8221;. This was also a key part of the setup, as it <em>only</em> classifies traffic originating from the VENET interfaces, no-where else.</p>
<p>Now add a route to define the new default gateway for our new table of classified traffic and apply it:</p>
<pre>ip route add default via 10.0.125.1 dev br1 table vlan4
ip route flush cache</pre>
<p>You should now find that guest traffic from either network is routed correctly without having to change any rp_filter settings. At any time you can use the following two commands to see your configuration:</p>
<pre>ip rule show</pre>
<pre>ip route show table vlan4</pre>
<p>Be sure to re-apply the &#8216;ip rule&#8217; and &#8216;ip route&#8217; statements on your next reboot; under Scientific Linux 6.0 I&#8217;ve used the /etc/rc.local file, but you can just as easily apply them on ifup in Debian&#8217;s network configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2011/08/05/source-routing-with-openvz-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Firefox search add-ons in Ubuntu</title>
		<link>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/</link>
		<comments>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 13:42:08 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=138</guid>
		<description><![CDATA[I booted up my work machine today (a fully-patched Ubuntu 10.10 x86_64 installation) to find that most of my search engine add-ons in Firefox had disappeared. Anyone that&#8217;s had this happen to them will notice that you literally cannot find/retrieve these basic add-ons with via the Add-ons store, and most searches online bring back results [...]]]></description>
			<content:encoded><![CDATA[<p>I booted up my work machine today (a fully-patched Ubuntu 10.10 x86_64 installation) to find that most of my search engine add-ons in Firefox had disappeared.</p>
<p>Anyone that&#8217;s had this happen to them will notice that you literally cannot find/retrieve these basic add-ons with via the Add-ons store, and most searches online bring back results related to the Google toolbar (not helpful).</p>
<p>Eventually I tracked-down <a href="http://support.mozilla.com/en-US/questions/751010#answer-146360">this post</a> and I am eternally grateful to the poster because, not only did it it allow me to fix the issue myself (copy the missing .xml files from /usr/lib/firefox-addons/searchplugins/en-US/ to the corresponding &#8216;en-GB&#8217; folder) but I have also finally found a method to send my queries to google.co.uk instead of google.com&#8230; Just edit the appropriate .xml file, changing .com to .co.uk.</p>
<p>So no more having to deal with American shopping results!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2011/03/16/fixing-firefox-search-add-ons-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 on m0n0wall</title>
		<link>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/</link>
		<comments>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 23:05:18 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[m0n0wall]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=124</guid>
		<description><![CDATA[I finally got around to sending my first ping6 echos! Who knew I&#8217;d get replies on my first go?! My ADSL provider Andrews &#038; Arnold have provided me with a /48 IPv6 subnet, which seems somewhat wasteful at 2^80 addresses (throw that in your calculator) but certainly useful for testing nevertheless. Whilst slowly getting my [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to sending my first ping6 echos! Who knew I&#8217;d get replies on my first go?!</p>
<p>My ADSL provider <a href="http://aaisp.net">Andrews &#038; Arnold</a> have provided me with a /48 IPv6 subnet, which seems somewhat wasteful at 2^80 addresses (throw that in your calculator) but certainly useful for testing nevertheless. Whilst slowly getting my head around the task that is variable-length subnetting of IPv6 ranges &#8211; painful at best &#8211; I decided to just throw in a /64 subnet and set a static gateway address on <a href="http://m0n0.ch/wall">m0n0wall</a>&#8216;s LAN interface to see if it would &#8216;just work&#8217;.</p>
<p>The result, is a working IPv6 LAN by simply enabling autoconfig from the m0n0wall box and telling Ubuntu&#8217;s Network Manager to use it. Et voila:</p>
<p><code>teh@desktop:~$ ifconfig eth0<br />
eth0      Link encap:Ethernet  HWaddr 00:01:29:fc:37:1d<br />
          inet addr:81.187.xxx.xxx  Bcast:81.187.xxx.xxx  Mask:255.255.255.240<br />
          inet6 addr: 2001:8b0:ff87:1:201:29ff:fefc:371d/64 Scope:Global<br />
          inet6 addr: fe80::201:29ff:fefc:371d/64 Scope:Link<br />
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1<br />
          RX packets:1616524 errors:0 dropped:0 overruns:0 frame:0<br />
          TX packets:2224946 errors:0 dropped:0 overruns:0 carrier:0<br />
          collisions:0 txqueuelen:1000<br />
          RX bytes:277202062 (277.2 MB)  TX bytes:519498762 (519.4 MB)<br />
          Interrupt:18</code></p>
<p>You&#8217;ll notice that the last 80 bits of my IPv6 address on this host were assigned via autoconfig, using part of my MAC address (the part that doesn&#8217;t correspond to a certain manufacturer, IIRC) as well as some randomly-generated bits, too.</p>
<p>And to make my night, ping6 worked straight away, too:</p>
<p><code>teh@desktop:~$ ping6 2001:08B0:FF88:0001::1<br />
PING 2001:08B0:FF88:0001::1(2001:8b0:ff88:1::1) 56 data bytes<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=1 ttl=64 time=3.81 ms<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=2 ttl=64 time=0.130 ms<br />
64 bytes from 2001:8b0:ff88:1::1: icmp_seq=3 ttl=64 time=0.132 ms</code></p>
<p><code>--- 2001:08B0:FF88:0001::1 ping statistics ---<br />
3 packets transmitted, 3 received, 0% packet loss, time 2000ms<br />
rtt min/avg/max/mdev = 0.130/1.358/3.813/1.735 ms</code></p>
<p>Now to plan how I&#8217;m going to roll this out at work&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2010/02/17/ipv6-on-m0n0wall/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Optical drive firmware updating in Linux</title>
		<link>http://www.ninjabadger.net/2009/12/10/optical-drive-firmware-updating-in-linux/</link>
		<comments>http://www.ninjabadger.net/2009/12/10/optical-drive-firmware-updating-in-linux/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 21:17:01 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=110</guid>
		<description><![CDATA[I recently needed to burn a copy of Windows 7 Pro but realisd that I&#8217;d unfortunately run out of blank DVD-Rs long ago. Fear not, for I live near an Aldi supermarket, whom sell everything dirt cheap. DVD-R&#8217;s a DVD-R, right? Wrong. I tried at least three of the twenty I purchased (for a few [...]]]></description>
			<content:encoded><![CDATA[<p>I recently <a href="http://www.youtube.com/watch?v=pT9LFlWaSec">needed to burn a copy of Windows</a> 7 Pro but realisd that I&#8217;d unfortunately run out of blank DVD-Rs long ago. Fear not, for I live near an Aldi supermarket, whom sell everything dirt cheap. DVD-R&#8217;s a DVD-R, right?</p>
<p>Wrong. I tried at least three of the twenty I purchased (for a few quid) and none of them would even begin writing. Brasero/K3B both complained about incompatible media types.</p>
<p>Remembering that my DVD drive, a trusty NEC 3500A, was designed, built and purchased somewhere between 2004 and 2005 (4-5 years ago at this point) and that I hadn&#8217;t <em>ever</em> updated the firmware, I set about researching ways and means into doing this.</p>
<p>I came across <a href="http://liggydee.cdfreaks.com/page/en/">this website</a>, run by a pair of firmware hackers named <a href="http://liggydee.cdfreaks.com/blog/">Liggy and Dee</a> whom have (between them) released, and continue to host, many firmware releases (both official and unofficial) for a wide variety of NEC optical drives.</p>
<p>What&#8217;s more, their <a href="http://binflash.cdfreaks.com/">binflash</a> (or &#8216;necflash&#8217;) utility was even released as a Linux binary and it <em>even</em> provides compatibility for reading the official NEC .exe firmware releases! I was sceptical that it would work under Ubuntu 9.10 at first, but much to my delight it worked perfectly. With a little reading, I was able to dump my current firmware (2.16) to file and subsequently flash two different firmware releases: 2.58 (an OEM firmware release) and the latest, official NEC firmware 2.1A release.</p>
<p>The full output of my escapades for anyone curious:</p>
<p><code><br />
~$ sudo ./necflash -flash -v -s Desktop/NECND350_v21A.exe /dev/sg2<br />
Binflash - NEC version - (C) by Liggy and Herrie<br />
Visit http://binflash.cdfreaks.com</code></p>
<p><code>Identified drive: 4 - 3031<br />
Detected drive from Firmware: 4</code></p>
<p><code>You are about to flash your drive with the following firmware:</code></p>
<p><code>Vendor: _NEC<br />
Identification: DVD_RW ND-3500AG<br />
Version: 2.1A</code></p>
<p><code>Remember no one can be held responsible for any kind of failure!<br />
Are you sure you want to proceed? (y/n) y</code></p>
<p><code>Entering safe mode<br />
Sending firmware to drive at 0x006000<br />
Sending firmware to drive at 0x00e000<br />
Sending firmware to drive at 0x016000<br />
Sending firmware to drive at 0x01e000<br />
Sending firmware to drive at 0x026000<br />
Sending firmware to drive at 0x02e000<br />
Sending firmware to drive at 0x036000<br />
Sending firmware to drive at 0x03e000<br />
Sending firmware to drive at 0x046000<br />
Sending firmware to drive at 0x04e000<br />
Sending firmware to drive at 0x056000<br />
Sending firmware to drive at 0x05e000<br />
Sending firmware to drive at 0x066000<br />
Sending firmware to drive at 0x06e000<br />
Sending firmware to drive at 0x076000<br />
Sending firmware to drive at 0x07e000<br />
Sending firmware to drive at 0x086000<br />
Sending firmware to drive at 0x08e000<br />
Sending firmware to drive at 0x096000<br />
Sending firmware to drive at 0x09e000<br />
Sending firmware to drive at 0x0a6000<br />
Sending firmware to drive at 0x0ae000<br />
Sending firmware to drive at 0x0b6000<br />
Sending firmware to drive at 0x0be000<br />
Sending firmware to drive at 0x0c6000<br />
Sending firmware to drive at 0x0ce000<br />
Sending firmware to drive at 0x0d6000<br />
Sending firmware to drive at 0x0de000<br />
Sending firmware to drive at 0x0e6000<br />
Sending firmware to drive at 0x0ee000<br />
Sending firmware to drive at 0x0f6000<br />
Sending firmware to drive at 0x0fe000<br />
Sending checksum to drive<br />
Erasing flash block 2<br />
Erasing flash block 3<br />
Erasing flash block 4<br />
Erasing flash block 5<br />
Erasing flash block 6<br />
Erasing flash block 7<br />
Erasing flash block 8<br />
Erasing flash block 9<br />
Erasing flash block 10<br />
Erasing flash block 11<br />
Erasing flash block 12<br />
Erasing flash block 13<br />
Erasing flash block 14<br />
Erasing flash block 15<br />
Erasing flash block 16<br />
Erasing flash block 17<br />
Erasing flash block 18<br />
Writing flash block 2<br />
Writing flash block 3<br />
Writing flash block 4<br />
Writing flash block 5<br />
Writing flash block 6<br />
Writing flash block 7<br />
Writing flash block 8<br />
Writing flash block 9<br />
Writing flash block 10<br />
Writing flash block 11<br />
Writing flash block 12<br />
Writing flash block 13<br />
Writing flash block 14<br />
Writing flash block 15<br />
Writing flash block 16<br />
Writing flash block 17<br />
Writing flash block 18<br />
Leaving safe mode<br />
</code><br />
Whilst the 2.58 OEM release didn&#8217;t fix my problems, 2.1A did and I now have a freshly-burnt copy of Windows 7 Pro to go and play games with. Nice one, Liggy &#038; Dee. <img src='http://www.ninjabadger.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2009/12/10/optical-drive-firmware-updating-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Google Go on Ubuntu</title>
		<link>http://www.ninjabadger.net/2009/11/13/testing-google-go-on-ubuntu/</link>
		<comments>http://www.ninjabadger.net/2009/11/13/testing-google-go-on-ubuntu/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 10:39:42 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ninjabadger.net/?p=103</guid>
		<description><![CDATA[Yesterday a few of you will have heard the news that Google recently launched a new programming language, named &#8216;Go&#8216;. Whilst I&#8217;m not a programmer, and exist far from the plain of ever pretending to be one &#8211; I do have some professional interests in playing with this. I&#8217;ll probably update this post a little [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday a few of you will have heard the news that <a href="http://www.bit-tech.net/news/bits/2009/11/12/googles-go-an-open-source-language/1">Google recently launched a new programming language</a>, named &#8216;<a href="http://golang.org/">Go</a>&#8216;.</p>
<p>Whilst I&#8217;m not a programmer, and exist far from the plain of ever pretending to be one &#8211; I do have some professional interests in playing with this. I&#8217;ll probably update this post a little later with some more, specific information when all can be revealed, but for now here&#8217;s a little taster:<br />
<code><br />
root@gotest:~# 6g hello.go<br />
root@gotest:~# 6l hello.6<br />
root@gotest:~# ./6.out<br />
hello, world<br />
</code><br />
It works! This machine is an openvz container, running Ubuntu 9.04 x86_64 and it works a treat, with the only exception that I couldn&#8217;t build Go with the standard &#8216;all.bash&#8217; make script. I had to use the &#8216;make.bash&#8217; script, instead for it to work &#8211; something about probing the network devices not working with the former script. Thanks go to Rob Pike from Google, whom seems to have been working pretty darn hard in the #go-wild IRC channel on Freenode recently!</p>
<p><strong>Update:</strong> <a href="http://34sp.com">34SP.com</a> are now offering <a href="http://www.34sp.com/blog/official-news/google-go-development-servers-available-from-34spcom/">Google Go development</a> environments, for those wishing to dabble!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ninjabadger.net/2009/11/13/testing-google-go-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

