Dec
11
2008
I came acrosssomeone citing an article 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!
View Comments | posted in linux
Nov
10
2008
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?
View Comments | posted in linux
Oct
18
2007
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.
View Comments | posted in linux, system administration, unix
Oct
5
2007
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.
View Comments | posted in linux, system administration
Jun
29
2007
Linux : FreeBSD :: Ruby : Python
Discuss.
View Comments | posted in freebsd, linux, python, ruby
May
25
2007
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.
View Comments | posted in linux, red hat, system administration, troubleshooting
Jan
31
2007
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
”
View Comments | posted in linux, software engineering
Jun
8
2006
Tonight, I stumbled upon an embarrassing RPM bug report 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.
View Comments | posted in linux, red hat