<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Hive Archive</title>
    <link>http://hivearchive.com</link>
    <description>Matt Michie's Musings</description>
    <pubDate>Sun, 28 Nov 2010 04:10:02 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Chinese Citation</title>
      <link>http://hivearchive.com/2008/12/11/chinese-citation/</link>
      <pubDate>Thu, 11 Dec 2008 01:14:05 PST</pubDate>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/?p=173</guid>
      <description>Chinese Citation</description>
      <content:encoded><![CDATA[
I came across<a href="http://cyberwarfaremag.wordpress.com/2008/12/05/china-red-flag-linux/">someone citing an article</a> I wrote for Linux.com back in 2002 about China's Red Flag Linux.  It's weird reading stuff I wrote back then now.  Back in the day, I thought I was pretty knowledgeable.  These days I actually know more, and feel like I know less.  In fact, it's hard to find anything worthwhile to write about as I don't feel like I can do it justice.

One of these days I'm going to have to chronicle some of the event surrounding Linux.com.  I made a lot of good friends working on that site, made a little bit of money for college, and learned a ton.  Still, there were some decisions made by VA/OSDN that weren't in the best interest of the community or the people that volunteered their time, energy and passion to trying to spread open source and evangelize Linux.

Maybe some day I will, but not tonight :)

Happy Holidays everyone!]]></content:encoded>
    </item>
    <item>
      <title>Why does Ubuntu have so many forks?</title>
      <link>http://hivearchive.com/2008/11/10/why-does-ubuntu-have-so-many-forks/</link>
      <pubDate>Mon, 10 Nov 2008 01:20:05 PST</pubDate>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/?p=167</guid>
      <description>Why does Ubuntu have so many forks?</description>
      <content:encoded><![CDATA[
Why do you need to fork an entire distribution to change the window manager, like Xubuntu, or to make the default KDE like Kubuntu?  

Ummm, could you just make it user configurable instead of duplicating this amount of effort?

Guys, really?

Really? Really?]]></content:encoded>
    </item>
    <item>
      <title>Bash one liner to randomize lines in file</title>
      <link>http://hivearchive.com/2007/10/18/bash-one-liner-to-randomize-lines-in-file/</link>
      <pubDate>Thu, 18 Oct 2007 11:57:39 PDT</pubDate>
      <category><![CDATA[unix]]></category>
      <category><![CDATA[system administration]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2007/10/18/bash-one-liner-to-randomize-lines-in-file/</guid>
      <description>Bash one liner to randomize lines in file</description>
      <content:encoded><![CDATA[
Discovered that the bash shell has a variable called $RANDOM, which outputs a pseudo-random number every time you call it.  Sweet!  Allowed me to randomize the lines in a file for a process I needed to do, thusly:

<blockquote>for i in `cat unusual.txt`; do echo "$RANDOM $i"; done | sort | sed -r 's/^[0-9]+ //' > randorder.txt</blockquote>

In other words, put a random number on every line, sort the file, then take off the random numbers.  Worked like a charm.]]></content:encoded>
    </item>
    <item>
      <title>Hivearchive Downtime</title>
      <link>http://hivearchive.com/2007/10/05/hivearchive-downtime/</link>
      <pubDate>Fri, 05 Oct 2007 17:45:34 PDT</pubDate>
      <category><![CDATA[system administration]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2007/10/05/hivearchive-downtime/</guid>
      <description>Hivearchive Downtime</description>
      <content:encoded><![CDATA[
Had a bit of hardware trouble, with a hard drive failing today.  However, due to my sysadmin ninja skills, no data was lost and the RAID 1 is rebuilding.

<blockquote>
[root@nexus ~]# cat /proc/mdstat 

Personalities : [raid1] 

md1 : active raid1 hdc1[2] hda1[0]

      79360960 blocks [2/1] [U_]

      [>....................]  recovery =  2.2% (1809408/79360960) finish=25.9min speed=49725K/sec

md0 : active raid1 hdc2[1] hda2[0]

      1052160 blocks [2/2] [UU]

      

unused devices: <none>

</blockquote>

If you need to do this:

<blockquote>
# dd if=/dev/hda of=/dev/hdc bs=512 count=1
# mdadm --manage /dev/md0 --add /dev/hdc2
# mdadm --manage /dev/md1 --add /dev/hdc1
</blockquote>

In other words, copy the master boot record from the good drive to the new drive so you have the same partitions, then hot add the new partitions to your array.  WARNING DANGER DANGER WARNING.  Backup all your data first, and test your backups work.  Change the partitions and drives to match your own situation.  Failure to do so will cause you to hose your system...  That is all.

Now if only Linux could do all this automatically like other sane operating systems.

Update:  I'm getting a little suspicious that just copying the MBR from one hard drive to another, messed up something with Linux's software RAID. Sigh.  This is exactly how I would do it in Solaris, but Linux has no great documentation on how to do it easily.  Lazyweb?

Update, 2 Aug 2008:

I did this again and this time realized that copying the MBR will work fine with DD, but Linux needs to be explicitly told to rescan the partition table.  I simply opened up the device with fdisk, checked the partitions looked how I wanted and then rewrote the partition table.  Fdisk then calls the IOCTL to tell the kernel to rescan the partitions.  Problem solved. :)
]]></content:encoded>
    </item>
    <item>
      <title>Worse is better?</title>
      <link>http://hivearchive.com/2007/06/29/worse-is-better/</link>
      <pubDate>Fri, 29 Jun 2007 00:09:46 PDT</pubDate>
      <category><![CDATA[python]]></category>
      <category><![CDATA[ruby]]></category>
      <category><![CDATA[freebsd]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2007/06/29/worse-is-better/</guid>
      <description>Worse is better?</description>
      <content:encoded><![CDATA[
Linux : FreeBSD :: Ruby : Python

Discuss.]]></content:encoded>
    </item>
    <item>
      <title>NVidia Forcedeth Ethernet Full-Duplex</title>
      <link>http://hivearchive.com/2007/05/25/nvidia-forcedeth-ethernet-full-duplex/</link>
      <pubDate>Fri, 25 May 2007 16:24:07 PDT</pubDate>
      <category><![CDATA[red hat]]></category>
      <category><![CDATA[troubleshooting]]></category>
      <category><![CDATA[system administration]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2007/05/25/nvidia-forcedeth-ethernet-full-duplex/</guid>
      <description>NVidia Forcedeth Ethernet Full-Duplex</description>
      <content:encoded><![CDATA[
Just an FYI, the NVidia Gigabit Forcedeth Ethernet driver in Linux uses the ethtool command to get and set the duplex rate and not the mii-tool like many other web pages erroneously state.]]></content:encoded>
    </item>
    <item>
      <title>Linux Block I/O Scheduler Interview</title>
      <link>http://hivearchive.com/2007/01/31/linux-block-io-scheduler-interview/</link>
      <pubDate>Wed, 31 Jan 2007 13:33:20 PST</pubDate>
      <category><![CDATA[software engineering]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2007/01/31/linux-block-io-scheduler-interview/</guid>
      <description>Linux Block I/O Scheduler Interview</description>
      <content:encoded><![CDATA[
Kernel Trap has a great <a href="http://kerneltrap.org/node/7637">interview with the maintainer of the Linux Block IO layer</a>.  He discusses some of the limitations in the current I/O schedulers, and how they can be swapped out dynamically at runtime.  

I found the following particularly informative: 

"Splice has a host of applications. It can completely replace the bad hack that is sendfile(), which is an extremely limited zero copy interface for sending a file over the network. The neat thing about using pipes as the buffers, is that you have a known interface to work with and a way to tie things together intuitively. A good and easy to understand example is a live TV setup, where you have a driver for your TV encoder (lets call that /dev/tvcapture) and a driver for your TV decoder (lets call that /dev/tvout. Say you want to watch live TV while storing the contents to a file for pausing or rewind purposes, you could describe that as easy as:"

<blockquote> $ splice-in /dev/tvcapture | splice-tee out.mpg | splice-out /dev/tvout</blockquote>

"The first step will open /dev/tvcapture and splice that file descriptor to STDOUT. The second will duplicate the page references from the STDIN pipe, splicing the first to the output file and splicing the second to STDOUT. Finally, the last step will splice STDIN to a file descriptor for /dev/tvout. The data never needs to be copied around, we simply move page references around inside the kernel. It's like building with Lego blocks :-)"]]></content:encoded>
    </item>
    <item>
      <title>Embarrassing Red Hat RPM Bug</title>
      <link>http://hivearchive.com/2006/06/08/embarrassing-red-hat-rpm-bug/</link>
      <pubDate>Thu, 08 Jun 2006 00:23:54 PDT</pubDate>
      <category><![CDATA[red hat]]></category>
      <category><![CDATA[linux]]></category>
      <guid>http://hivearchive.com/2006/06/08/embarrassing-red-hat-rpm-bug/</guid>
      <description>Embarrassing Red Hat RPM Bug</description>
      <content:encoded><![CDATA[
Tonight, I stumbled upon an <a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=119185">embarrassing RPM bug report</a> that puts Red Hat developers in a bad light. I can understand that as a developer you could become frustrated with a report, but instead of trying to explain how the RPM database could go into an inconsistent state, and determine whether that was fixable or not, the developers berated the users.  Is this how you build a community?

Finally, after two years of ignoring the bug, Red Hat finally came around and 'fixed' it, though it isn't clear whether they fixed the general case, or put a work around for the behavior from the original report.  I wasn't aware that RPM or yum had this behavior and it makes me trust the whole mess a lot less.  I wonder how apt-get handles this.

As a system admin, I generally prefer systems with package management.  Being able to do security updates without  hassle is a huge benefit.  However, no matter how much one tries, there are always going to be programs or libraries outside your package manager.  From a philosophical point of view, it is probably better to have all or nothing, so I  sympathize with those who compile and install everything, or use a comprehensive system like BSD ports.

I think a better system could be developed that encompasses the entirety of program management.  It should include installing libraries from scripting languages such as Python Eggs, Ruby Gems or Perl CPAN.  It should probably include hooks into GNU AutoConf/AutoMake, though I imagine the political hurdles of getting so many disparate projects to agree on a standard would be far greater than the technical ones.  I suppose we can all hope.]]></content:encoded>
    </item>
  </channel>
</rss>

