<?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>/var/log/jamescape &#187; linux</title>
	<atom:link href="http://ignore-your.tv/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ignore-your.tv</link>
	<description>Living Without Privacy</description>
	<lastBuildDate>Tue, 27 Jul 2010 04:35:52 +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>Distributing Static Routes with DHCP</title>
		<link>http://ignore-your.tv/2009/07/17/distributing-static-routes-with-dhcp/</link>
		<comments>http://ignore-your.tv/2009/07/17/distributing-static-routes-with-dhcp/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 02:25:09 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[rhel]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=728</guid>
		<description><![CDATA[I’m setting up an isolated network for people to test internal applications on, since the developers all have Sun workstations with a dual-port Gigabit NIC on the motherboard, and we’ve got a bunch of older network equipment that we haven’t gotten around to eBaying yet. What I’m doing is linking the second NICs together with [...]]]></description>
			<content:encoded><![CDATA[<p>I’m setting up an isolated network for people to test internal applications on, since the developers all have Sun workstations with a dual-port Gigabit NIC on the motherboard, and we’ve got a bunch of older network equipment that we haven’t gotten around to eBaying yet. What I’m doing is linking the second NICs together with some virtual machines and the older network equipment to create a separate development network.</p>
<p>The development network is a full Layer-3 network running an IGP between multiple nodes with attached client boxes. This allows me to play around with a decent lab network, and provides developers with a way to discover that Linux sets the TTL of multicast packets to “1” well before they are called to explain why their application didn’t work even after loads of testing, spend 8 hours playing head-desk, and finally start questioning me about firewalls on our internal network, forcing me to claw it out of them that they are driving multicast without a license and explain how to use <code class="executable">tcpdump</code>.</p>
<p><em>Not that I’ve had to do that a dozen times now, or anything…</em><br />
<span id="more-728"></span></p>
<p>This means I have to configure static routes on the developer workstations so they can access things in the lab outside their local subnet. You start off by configuring static routes in your distro’s chosen format (this is RHEL5 at work, so it’s <code class="filename">/etc/sysconfig/network-scripts/route-eth<em>X</em></code>), and then you step it up a notch by writing scripts to distribute these files, then start using <a href="http://fermitools.fnal.gov/abstracts/rgang/abstract.html">rgang</a> or <a href="https://fedorahosted.org/func/">func</a>, and start thinking about using your <a href="http://reductivelabs.com/products/puppet/">systems programming tool</a> to distribute the routes. And then you smack your forehead and figure out that this is all stupid: there is already an IETF standard way to distribute network configuration which you should be using: DHCP.</p>
<p>There’s even <a href="http://tools.ietf.org/html/rfc3442">DHCP option 121</a>, which provides a way to distribute CIDR information (modern static routes) to clients. Unfortunately this standard option isn’t supported out of the box on modern dhclient or <a href="https://www.isc.org/software/dhcp">ISC dhcpd</a>, so you need to configure it and script it in.</p>
<p>First, on the client, <code>/etc/dhclient-exit-hooks</code></p>
<pre class="brush: bash">#!/bin/bash
#
# /etc/dhclient-exit-hooks
#
# This file is called from /sbin/dhclient-script after a DHCP run.
#

#
# parse_option_121:
# @argv: the array contents of DHCP option 121, separated by spaces.
# @returns: a colon-separated list of arguments to pass to /sbin/ip route
#
function parse_option_121() {
        result=""

        while [ $# -ne 0 ]; do
                mask=$1
                shift

                # Is the destination a multicast group?
                if [ $1 -ge 224 -a $1 -lt 240 ]; then
                        multicast=1
                else
                        multicast=0
                fi

                # Parse the arguments into a CIDR net/mask string
                if [ $mask -gt 24 ]; then
                        destination="$1.$2.$3.$4/$mask"
                        shift; shift; shift; shift
                elif [ $mask -gt 16 ]; then
                        destination="$1.$2.$3.0/$mask"
                        shift; shift; shift
                elif [ $mask -gt 8 ]; then
                        destination="$1.$2.0.0/$mask"
                        shift; shift
                else
                        destination="$1.0.0.0/$mask"
                        shift
                fi

                # Read the gateway
                gateway="$1.$2.$3.$4"
                shift; shift; shift; shift

                # Multicast routing on Linux
                #  - If you set a next-hop address for a multicast group, this breaks with Cisco switches
                #  - If you simply leave it link-local and attach it to an interface, it works fine.
                if [ $multicast -eq 1 ]; then
                        temp_result="$destination dev $interface"
                else
                        temp_result="$destination via $gateway dev $interface"
                fi

                if [ -n "$result" ]; then
                        result="$result:$temp_result"
                else
                        result="$temp_result"
                fi
        done

        echo "$result"
}

function modify_routes() {
        action=$1
        route_list="$2"

        IFS=:
        for route in $route_list; do
                unset IFS
                /sbin/ip route $action $route
                IFS=:
        done
        unset IFS
}

if [ "$reason" = "BOUND" -o "$reason" = "REBOOT" -o "$reason" = "REBIND" -o "$reason" = "RENEW" ]; then
        # Delete old routes, if they exist
        if [ -n "$old_classless_routes" ]; then
                modify_routes delete "$(parse_option_121 $old_classless_routes)"
        fi

        # Add new routes, if they exist...
        if [ -n "$new_classless_routes" ]; then
                modify_routes add "$(parse_option_121 $new_classless_routes)"
        fi
fi
</pre>
<p>We use <code class="filename">/etc/dhclient-exit-hooks</code> because the RHEL5 <code class="executable">dhclient-script</code> only calls the up-hooks script on <code class="bash">BOUND</code> and <code class="bash">REBOOT</code>, so if you change your static routes on the server, your client won’t pick them up until the box reboots or the interface is otherwise cycled.</p>
<p>The obvious problem here is that it’s always deleting the old routes and adding the new routes in two stages, a worthwhile enhancement for this script is to diff the old and new routes and determine which ones actually need to be removed/added.</p>
<p>So that will not do anything at first, because <code class="executable">dhclient</code> doesn’t actually read option 121 until you tell it to. For that, you need to edit <code class="filename">/etc/dhclient.conf</code>, and tell it how to handle option 121 in a way that the script above can understand:</p>
<pre class="brush: plain">#
# dhclient.conf
#

option classless-routes code 121 = array of unsigned integer 8;
request;
</pre>
<p>This tells <code class="executable">dhclient</code> to read all options, parse option 121 into an array of numeric bytes, and provide that array as a space-separated string as the <code class="bash">new_classless_routes</code> and <code class="bash">old_classless_routes</code> variables.</p>
<p>So now we’ve gotten all that taken care of, we need to start distributing routes from the DHCP server. For that, you need to update your <code class="filename">/etc/dhcpd.conf</code> file:</p>
<pre class="brush: plain">#
# dhcpd.conf
#

option classless-routes code 121 = array of unsigned integer 8;

subnet 10.23.1.0 netmask 255.255.255.0 {
        [...]
        # Routes for 10.23.0.0/16 via 10.23.1.1, and 224.0.0.0/4 (all IP multicast) via same
        option classless-routes 16,10,23,10,23,1,1,4,224,10,23,1,1
        [...]
}
</pre>
<p>You can also put that option into a host stanza if you’re doing that. Finally, as I’m using <a href="https://fedorahosted.org/cobbler">cobbler</a>, I wanted to be able to have the new “static-routes” interface option end up in my cobbler-managed DHCPd configuration. Here’s a bit of my template that puts that configuration option into the appropriate DHCP option:</p>
<pre class="brush: plain">#
# /etc/cobbler/dhcp.template
#

[...]

#for dhcp_tag in $dhcp_tags.keys()
group {
        #for mac in $dhcp_tags[$dhcp_tag].keys():
                #set iface = $dhcp_tags[$dhcp_tag][$mac]
                #if $iface.dns_name
        host $iface.dns_name {
                hardware ethernet $mac;
                        #if $iface.ip_address
                fixed-address $iface.dns_name;
                        #else
                ddns-hostname "${iface.dns_name.split('.')[0]}";
                        #end if
                        #if $iface.static_routes:
                                #set val121=""
                                #for routespec in $iface.static_routes:
                                        #set gateway=$routespec.split(':')[1]
                                        #set destcidr=$routespec.split(':')[0]
                                        #set destnet=$destcidr.split('/')[0]
                                        #set destmask=$destcidr.split('/')[1]
                                        #
                                        #if val121
                                                #set val121=$val121 + ",$destmask"
                                        #else
                                                #set val121=$destmask
                                        #end if
                                        #
                                        #if int($destmask) > 24
                                                #set val121=$val121 + "," + $destnet.replace('.', ',')
                                        #else if int($destmask) > 16
                                                #set val121=$val121 + "," + $destnet.split('.')[0] + "," + $destnet.split('.')[1] + "," + $destnet.split('.')[2]
                                        #else if int($destmask) > 8
                                                #set val121=$val121 + "," + $destnet.split('.')[0] + "," + $destnet.split('.')[1]
                                        #else
                                                #set val121=$val121 + "," + $destnet.split('.')[0]
                                        #end if
                                        #
                                        #set val121=$val121 + "," + $gateway.replace('.', ',')
                                #end for

                option classless-routes $val121
                        #end if
        }
                #end if
        #end for
}
</pre>
<p>Obviously, there are likely bugs in this script, and I’m only using it on a couple of boxes in my lab network, so feel free to point out any issues in the comments and I’ll update the above accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2009/07/17/distributing-static-routes-with-dhcp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My First JBOD: Introduction</title>
		<link>http://ignore-your.tv/2009/05/23/my-first-jbod-introduction/</link>
		<comments>http://ignore-your.tv/2009/05/23/my-first-jbod-introduction/#comments</comments>
		<pubDate>Sat, 23 May 2009 19:15:14 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[jbod]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[my first jbod]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=710</guid>
		<description><![CDATA[This is me setting up a JBOD for use by one or more XEN hosts, using professional hardware. It’s not a hack, not throwing a shitload of drives into a PC with some “prosumer” SATA RAID cards that require you spend weeks fussing with drivers and firmware to get even a minimal write performance out [...]]]></description>
			<content:encoded><![CDATA[<p>This is me setting up a JBOD for use by one or more XEN hosts, using professional hardware. It’s not a hack, not throwing a shitload of drives into a PC with some “prosumer” SATA RAID cards that require you spend weeks fussing with drivers and firmware to get even a minimal write performance out of their underpowered hardware RAID.</p>
<p>A former roommate of mine once setup such a beast using a 12-port SATA card which ended up delivering a whopping 1 MBps of write speed in a RAID 5 configuration. I simply don’t have time to play around like that these days, so this is me trading capital for time.</p>
<p>The host machine is a Sun Fire X4200M2 server with an internal RAID10, running a RHEL 5.3 XEN installation. None of the services currently running on this box are critical, which means I can take them down for an hour at the end of the day without trouble, provided I can get them back up again. I also have the (Memorial Day) weekend to get the new JBOD up and running on this box.</p>
<p>After it’s up, however, I will be hosting important business-ey things on various virtual machines using this JBOD: e-mail, website(s), internal wiki, NAS, along with primary kerberos, LDAP, cobbler, puppet on the internal RAID; so it’s fairly important that this get up and working, and be stable once it’s going…</p>
<p>The JBOD itself is a Sun StorageTek J4200 array with a single IO module and a PCIe SAS RAID card, running 6x 1TB SATA disks in (eventually) a RAID6 array. I’d like to play around with interesting things like redundant SATA multipathing, but I’m pretty new to the whole storage admin area, so I’m not going to be playing around with those things on *this* setup…</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2009/05/23/my-first-jbod-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu Ruined My Life</title>
		<link>http://ignore-your.tv/2009/01/17/ubuntu-ruined-my-life/</link>
		<comments>http://ignore-your.tv/2009/01/17/ubuntu-ruined-my-life/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 23:07:11 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[revolution]]></category>
		<category><![CDATA[telcos]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=659</guid>
		<description><![CDATA[[There’s a whole bunch of meandering academic pontificating and me taking myself too seriously. About two thirds of the way down it gets really good, though. I promise. Also, the woman is now online and back in school. –JC]
So apparently, someone was trying to take online courses, ordered the cheapest Dell with a CD—which happens [...]]]></description>
			<content:encoded><![CDATA[<p>[There’s a whole bunch of meandering academic pontificating and me taking myself too seriously. About two thirds of the way down it gets really good, though. I promise. Also, the woman is now online and back in school. –JC]</p>
<p>So apparently, someone was trying to take online courses, ordered the cheapest Dell with a CD—which happens to be running Ubuntu—she could find, and then <a href="http://www.wkowtv.com/Global/story.asp?S=9667184&#038;nav=menu1362_8_6">couldn’t get online to her courses</a>. So she withdrew from the University, and the Linux Lusers rushed in—talking about how dumb she was for not being able to slickly navigate Linux through customer support in a Windows-only world, and apparently, this degenerated into people harassing her on Facebook.</p>
<p>There are a couple takeaways to this for the world at large:</p>
<ol>
<li>Facebook works fine on Ubuntu (or the student in question has gotten a different Dell).</li>
<li>If you aren’t raising your kid to be able to handle computers like a nerd, you are handicapping your children’s ability to prosper.</li>
</ol>
<p>Obviously, the second is the controversial opinion. While the new imperialist geek overlords are kinder, gentler overlords than the robber barons of the past, technology is a big ugly mess. The de-facto reality this illustrates is that if you are attempting to live in a modernized country, but are unable to figure out how to purchase and use a computer, you are <em>fucked</em>. Those who cannot figure out how to scam Central Services to get online are destined to be <a href="http://www.pcmag.com/article2/0,2817,1224343,00.asp">crushed underfoot</a> in the information revolution. It’s an <a href="http://blogs.computerworld.com/its_time_to_start_issuing_pc_licenses">ugly, brutal reality</a>. Fortunately, when dealing with economy, reality is what you make of it. There are a couple points for the democratic wing of the new masters:</p>
<ol>
<li>There is a contingent of raving lunatics who have decided to immigrate to Linux as their chosen nationality.</li>
<li>When you smirk at the clueless n00b, you are the sadistic prison guard tormenting the hapless inmate. By making your system difficult for others to use, you are actually <em>hurting</em> them—not only in terms of time and stress, but also in financially measurable ways.</li>
</ol>
<p>But none of that works on the real issue of this story: <em>What was it about the Ubuntu desktop as shipped with Dell that prevented her from going to school?</em> If you haven’t already, find out why our OS didn’t work for her, publicize the problems, and fix them. If it’s a technical problem then it’s completely trivial to fix: we’re all geeks here. If it was a more mushy social reason—the bureaucratic pronouncements of overworked support staff at her Uni and ISP: <em>you must use MS Word on Windows (because we won’t support anything else)</em>—then that’s something we have traditionally sucked at, but something which community growth could address in an indirect way, and B2B schmoozing could address in a direct way. Remember, she’s not the only one going through these difficulties, she’s just the only one who’s difficulties were severe enough to warrant a newspaper article on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2009/01/17/ubuntu-ruined-my-life/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Daemonizing Processes</title>
		<link>http://ignore-your.tv/2008/10/16/daemonizing-processes/</link>
		<comments>http://ignore-your.tv/2008/10/16/daemonizing-processes/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 23:34:50 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=486</guid>
		<description><![CDATA[Update: Commenters have pointed out a few things:

This post is incomplete/incorrect. What I’m doing now is having the daemon function call a script that looks like this:
#!/bin/bash
exec 1&#62;&#38;-
exec 2&#62;&#38;-
exec 3&#62;&#38;-
nohup myPropApp &#038; 2&#62;&#38;1 &#62; thelog.txt
 That code was from another website who’s URL I lost, and I posted the solution below based on another, alternate [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update:</em> Commenters have pointed out a few things:
<ol>
<li>This post is incomplete/incorrect. What I’m doing now is having the <code>daemon</code> function call a script that looks like this:
<pre>#!/bin/bash
exec 1&gt;&amp;-
exec 2&gt;&amp;-
exec 3&gt;&amp;-
nohup myPropApp &#038; 2&gt;&amp;1 &gt; thelog.txt</pre>
<p> That code was from another website who’s URL I lost, and I posted the solution below based on another, alternate method that I hadn’t tried but sounded simpler.</li>
<li>There are other options, like <code><a href="http://www.clapper.org/software/daemonize/">daemonize(1)</a></code>, <code><a href="http://www.cyberciti.biz/tips/howto-runs-linux-unix-program-in-newsession.html">setsid(1)</a></code>, and the bash builtin <code>disown</code> (which I had prematurely rejected as ksh-only).</li>
</ol>
<p>Back when I was using Debian, one of the nicer things about it was their helper tool for startup scripts: <code>start-stop-daemon</code>. Particularly, it’s ability to daemonize any process with the <code>-b</code> flag. You notice how handy things like that end up being when you’ve got an in-house or otherwise proprietary app that can’t daemonize itself properly (e.g. Java-based services).</p>
<p>Somehow I’ve managed to get away with not having to write a script that daemonizes a normally-foreground process on an RH-based distribution yet, mainly because I’ve been using Debian almost exclusively for servers, and have only worked for tiny startups, where luxuries like init scripts are the last thing on anyones’ minds.</p>
<p>Everyone is familiar with the <code>nohup &#038;</code> trick, but that still leaves it associated to a terminal, so after you log out, your terminal/ssh session will just hang because stdin is still open. As it turns out, you can <a href="http://sial.org/howto/shell/background/">close your standard in from bash</a> first by redirecting your standard input from nil (e.g. <code>someapp &lt;&amp;-</code>), and that will let it just work.</p>
<p>Very sweet for writing initscripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2008/10/16/daemonizing-processes/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>More Help Wanted</title>
		<link>http://ignore-your.tv/2008/07/04/more-help-wanted/</link>
		<comments>http://ignore-your.tv/2008/07/04/more-help-wanted/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 02:02:38 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[hiring]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[washington]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=400</guid>
		<description><![CDATA[As it turns out I have need for another Systems Administrator, this time in Washington, DC. This job is for a local administrator to handle the day-to-day support and activities in the Washington office (complete with AD domain, Asterisk server, NAS, and a dozen users), as well as the four branch locations in the DC [...]]]></description>
			<content:encoded><![CDATA[<p>As it turns out I have need for another Systems Administrator, this time in Washington, DC. This job is for a local administrator to handle the day-to-day support and activities in the Washington office (complete with AD domain, Asterisk server, NAS, and a dozen users), as well as the four branch locations in the DC Metro area and (future) datacenter while working together via IM, mail, and phone with the existing tech team in Chicago to plan and implement improvements, and resolve problems. The technological environment is 80% Windows, but the remaining 20% is RHEL5; the branch locations are 100% RHEL5.</p>
<p>So, the requirements are Linux and Windows desktop support, a desire to teach yourself Asterisk, Windows domains, and Cisco networking, and the ability to pass a Federal security check. Experience with open-source web software and Apache (e.g. Wordpress, Joomla!, etc.) is great, but not required.</p>
<p>As before, <a href="mailto:jcape@ignore-your.tv">send your resumé to me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2008/07/04/more-help-wanted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help Wanted</title>
		<link>http://ignore-your.tv/2008/06/22/help-wanted/</link>
		<comments>http://ignore-your.tv/2008/06/22/help-wanted/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 04:35:31 +0000</pubDate>
		<dc:creator>James Cape</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[chicago]]></category>
		<category><![CDATA[help wanted]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/?p=399</guid>
		<description><![CDATA[I’m looking to hire a Linux Administrator in for a position in downtown Chicago. It’s a high-demand, high-stress environment with lots of things going on at any one time: We play with high-end sun servers on an international private network, use Amazon EC2, and have a slew of Asterisk servers forming the joints of a [...]]]></description>
			<content:encoded><![CDATA[<p>I’m looking to hire a Linux Administrator in for a position in downtown Chicago. It’s a high-demand, high-stress environment with lots of things going on at any one time: We play with high-end sun servers on an international private network, use Amazon EC2, and have a slew of Asterisk servers forming the joints of a wide-area VoIP infrastructure. Success and failure is often measured in terms of milliseconds. On the downside, we also do Windows, must support the desktop users (most desktops are Linux, though), and the company isn’t large enough to justify a division of labor yet.</p>
<p>You must be familiar with remote administration techniques, MySQL, apache, VCS, RPM-based distributions, (the basics). Familiarity with bind, dhcpd, ddns, and basic networking is also recommended (at the very least you should be able to figure it out without handholding).</p>
<p>If this still sounds like something you’d like to participate in, send your resume to me and I’ll forward it on to our HR people for processing. Act today and you’ll get your very own number!</p>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2008/06/22/help-wanted/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Xen and The Art of Free Speech</title>
		<link>http://ignore-your.tv/2007/10/01/xen-and-the-art-of-free-speech/</link>
		<comments>http://ignore-your.tv/2007/10/01/xen-and-the-art-of-free-speech/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 02:01:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PlanetGNOME Syndication]]></category>
		<category><![CDATA[administrativa]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[book reviews]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[trolling]]></category>
		<category><![CDATA[war]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://ignore-your.tv/2007/10/01/xen-and-the-art-of-free-speech/</guid>
		<description><![CDATA[Aside from the laughable idea of “militantly” supporting anything with a blog post, Miguel simply noted that these people exist, have written a book, and will be doing the speaking-tour-thing near him. Does he agree with the contents? (shakes eight-ball) Signs point to Yes.
Is he free to do so? Also yes.
Are you free to ignore [...]]]></description>
			<content:encoded><![CDATA[<p>Aside from the laughable idea of <a href="http://en.wikipedia.org/wiki/Partisan">“militantly” supporting anything</a> with a blog post, Miguel simply noted that these people exist, have written a book, and will be doing the speaking-tour-thing near him. Does he agree with the contents? (shakes eight-ball) Signs point to Yes.</p>
<p>Is he free to do so? Also yes.</p>
<p>Are you free to ignore him? Still yes.</p>
<p>Does His Chomskiness actually take the challenge and provide <a href="http://www.zmag.org/content/showarticle.cfm?ItemID=9999">a better rebuttal</a> to the underlying book than politely demanding Miguel STFU? Yep.</p>
<p>Oh, and here’s a patch that will let you do something cool with XEN 3.0.3:</p>
<pre>
--- network-bridge      2007-02-08 09:21:12.000000000 -0600
+++ network-vlans       2007-09-14 09:55:20.000000000 -0500
@@ -26,6 +26,7 @@
 # bridge     The bridge to use (default xenbr${vifnum}).
 # netdev     The interface to add to the bridge (default eth${vifnum}).
 # antispoof  Whether to use iptables to prevent spoofing (default no).
+# vlans      VLANs to add on top of the bridge
 #
 # Internal Vars:
 # pdev="p${netdev}"
@@ -64,18 +65,27 @@
 bridge=${bridge:-xenbr${vifnum}}
 netdev=${netdev:-eth${vifnum}}
 antispoof=${antispoof:-no}
+vlans=$(echo $vlans | sed -e 's/,/ /g')

 pdev="p${netdev}"
 vdev="veth${vifnum}"
 vif0="vif0.${vifnum}"

 get_ip_info() {
-    addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'`
+    addr_pfx=`ip addr show dev $1 | sed -n 's/^ *inet \(.*\) [^ ]*$/\1/p'`
     gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
 }
+
+is_bonding() {
+    [ -f "/sys/class/net/$1/bonding/slaves" ]
+}
+
+is_ifup() {
+    ip link show dev $1 | awk '{ exit $3 !~ /[< ,]UP[,>]/ }'
+}

 do_ifup() {
-    if ! ifup $1 ; then
+    if ! ifup $1 || ! is_ifup $1 ; then
         if [ ${addr_pfx} ] ; then
             # use the info from get_ip_info()
             ip addr flush $1
@@ -206,8 +216,8 @@
        mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
        preiftransfer ${netdev}
        transfer_addrs ${netdev} ${vdev}
-       if ! ifdown ${netdev}; then
-           # If ifdown fails, remember the IP details.
+       if is_bonding ${netdev} || ! ifdown ${netdev}; then
+           # Remember the IP details if necessary.
            get_ip_info ${netdev}
            ip link set ${netdev} down
            ip addr flush ${netdev}
@@ -223,6 +233,18 @@
        add_to_bridge  ${bridge} ${vif0}
        add_to_bridge2 ${bridge} ${pdev}
        do_ifup ${netdev}
+
+       if [ -n "$vlans" ]; then
+               vconfig set_name_type VLAN_PLUS_VID_NO_PAD
+
+               for vlan in $vlans; do
+                       create_bridge xenbr${vlan}
+
+                       vconfig add ${bridge} ${vlan}
+                       setup_bridge_port vlan${vlan}
+                       add_to_bridge xenbr${vlan} vlan${vlan}
+               done
+       fi
     else
        # old style without ${vdev}
        transfer_addrs  ${netdev} ${bridge}
@@ -262,6 +284,20 @@
        ip link set ${netdev} name ${vdev}
        ip link set ${pdev} name ${netdev}
        do_ifup ${netdev}
+
+       if [ -n "$vlans" ]; then
+               for vlan in $vlans; do
+                       if [ -n `ip link show vlan${vlan} | grep '${bridge}\:'` ]; then
+                               ip link delif ${bridge} xenbr${vlan}
+                               ip link set ${bridge} down
+
+                               ip link set vlan${vlan} down
+                               vconfig rem ${bridge} ${vlan}
+                       fi
+               done
+
+               vconfig set_name_type DEV_PLUS_VID_NO_PAD
+       fi
     else
        transfer_routes ${bridge} ${netdev}
        ip link set ${bridge} down
</pre>
<p>It may be buggy, since I haven’t tested it in production. What it does is this: allows you to run an 802.1Q trunk into your XEN server, then put your virtual machines on any VLAN you want with a couple configuration stanzas.</p>
<p>So, your <tt>xend-config.sxp</tt> will have:</p>
<pre>
(network-script 'network-vlans netdev=eth0 vlans=8,9,10,11,13,121,14,15')
</pre>
<p>Which translates to “create bridges for VLAN 8, 9, 11, 13, 121, 14, and 15 with a <tt>xenbr</tt> prefix”. Then you set your DomU vif stanza to be “bridge=xenbr13” and bam! your DomU exists on the VLAN13. The primary limitation of this is that it keeps your Dom0 on the untagged/native VLAN, which isn’t best practice.</p>
<p>The stack of modules a packet traverses to get to a DomU will look like this (with relevant modules):</p>
<pre>
[network] -->
dom0: peth0 (dev) -->
dom0: xenbr0 (bridge) -->
dom0: vlan13 (dot1q attached to xenbr0) -->
dom0: xenbr13 (bridge) -->
dom0: vifX.0 (netloop) -->
domU: xen0 (xennet)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ignore-your.tv/2007/10/01/xen-and-the-art-of-free-speech/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
