Chinese Citation

December 11, 2008 at 01:14 AM | categories: linux | View Comments

I came acrosssomeone citing an article I wrote for 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 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!

Read and Post Comments

Why does Ubuntu have so many forks?

November 10, 2008 at 01:20 AM | categories: linux | View Comments

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?

Read and Post Comments

Bash one liner to randomize lines in file

October 18, 2007 at 11:57 AM | categories: unix, system administration, linux | View Comments

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:

for i in `cat unusual.txt`; do echo "$RANDOM $i"; done | sort | sed -r 's/^[0-9]+ //' > randorder.txt
In other words, put a random number on every line, sort the file, then take off the random numbers. Worked like a charm.
Read and Post Comments

Hivearchive Downtime

October 05, 2007 at 05:45 PM | categories: system administration, linux | View Comments

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.

[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:
If you need to do this:
# 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
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. :)
Read and Post Comments

Worse is better?

June 29, 2007 at 12:09 AM | categories: python, ruby, freebsd, linux | View Comments

Linux : FreeBSD :: Ruby : Python Discuss.

Read and Post Comments

NVidia Forcedeth Ethernet Full-Duplex

May 25, 2007 at 04:24 PM | categories: red hat, troubleshooting, system administration, linux | View Comments

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.

Read and Post Comments

Linux Block I/O Scheduler Interview

January 31, 2007 at 01:33 PM | categories: software engineering, linux | View Comments

Kernel Trap has a great interview with the maintainer of the Linux Block IO layer. 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:"

$ splice-in /dev/tvcapture | splice-tee out.mpg | splice-out /dev/tvout
"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 :-)"
Read and Post Comments

Next Page ยป