Computers
Kernel Lock outs?
by Dr D on Dec.22, 2008, under Computers, Linux
So I am sitting here, upgrading my servers (mostly gentoo) and on the world (full system) update, its telling me it wants to install a different version of the kernel.
Let me jump back for a second. Gentoo has very good customizations on what you can do, and for instance, I originally installed the gentoo-sources-2.6.26-r1 on one of my servers, and told it not to upgrade anything newer. Everythings been going fine, until today, when its like “oh, you can install 2.6.25-r9!” But wait, thats a downgrade. So I tell Gentoo not to install anything older then 2.6.26-r1, and then it complains. “!!! Ebuilds for the following packages are either all masked or don’t exist: sys-kernel/gentoo-sources.” Well, whatever. So I undid those changes, and decide to remove “gentoo-sources” from the world file, which basically says that its installed. So now it works as intended. But if I go to install an application dependant on the kernel source, then it will try to re-emerge them. So I told the system that I’ve provided the software and specific version, which is basically saying “pretend its installed.” And it still works. So WTF
Long story short, if you use Gentoo, and its wanting to upgrade or downgrade the kernel, try removing gentoo-sources fromthe world file, but adding the exact version to the portage/packages.mask and portage/profile/packages.provided.
As a side note, on Fedora/Redhat/CentOS/YUM based systems, add a line stating “exclude=kernel*” to the /etc/yum.conf file (or the .repo files) and it will lock out kernel upgrades on those systems.
SSH Tab completion!
by Dr D on Nov.29, 2008, under Computers, Linux
So I was using stuble upon and I found a cool one. Adding tab completion to SSH/SCP!
The original code is at http://drawohara.com/post/6584031/life-changing-shell-function
But I propose a slightly different egrep line, which helps me at work (as our hostnames have numbers in them)
Basically, edit your .bash_profile or .bashrc files ( I prefer .bash_profile ), and add in the following lines:
SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \
sed -e 's/ .*//g' -e 's/,.*//g' | \
uniq | egrep -v "^([0-9]{1,3}.){4}$") )
complete -o default -W "${SSH_COMPLETE[*]}" ssh
complete -o default -W "${SSH_COMPLETE[*]}" scp
Once added, type source ~/.bash_profile (or ~/.bashrc)
This will parse the ~/.ssh/known_hosts file on login, and find any hostnames (but not IPs) and store them in a temporary variable. This variable is parsed to add tab completion to the ssh and scp commands.
To use, type ssh dan-[tab] and it will auto complete the domain (if it was previously listed in the known_hosts file!)
VMware Dual booting?
by Dr D on Nov.16, 2008, under Computers, Linux
So, there is this interesting youtube video which explains how to use VMware Workstation to boot a Dual boot system into a virtual machine.
For those who are unaware, Dual booting allows you to boot either Windows or Linux. You have to choose one or the other when you turn the system on.
With this setup, you can boot linux (my preferred OS) and use VMware, software used to emulate hardware of a computer, to run your Windows install just like you booted it normally.
Though you don’t get full functionality out of it, you get the basics, which allows me to do what I would normally do in windows (download and play games).
Also, while working with this, I ran into a problem with the current kernel in Fedora 9 (2.6.27.5-37.fc9.i686) and VMware Server 1.0.8. I had to use the vmware-update-2.6.27-5.5.7-2.tar.gz file from this post to get the drivers to compile. Though I did not get the Perl API libraries installed (I think its related to the drivers update, I did not look into it further yet), everything seems to be working fine.
Gentoo, sys-libs/com_err, sys-libs/ss, and e2fsprogs blockings
by Dr D on Nov.15, 2008, under Computers, Linux
This is a repost of a new common topic, but its an important one. There have been a few blocked packages in the gentoo portage tree recently which causes problems. You all know what I mean…
[ebuild U ] sys-fs/e2fsprogs-1.41.2 [1.40.9] USE="nls (-static%)" 4,263 kB
[ebuild N ] sys-libs/e2fsprogs-libs-1.41.2 USE="nls" 479 kB
[ebuild U ] app-crypt/mit-krb5-1.6.3-r4 [1.6.3-r1] USE="-doc -krb4 (-ipv6%*) (-tcl%)" 11,636 kB
[blocks B ] sys-libs/ss (is blocking sys-libs/e2fsprogs-libs-1.41.2)
[blocks B ] <sys-fs/e2fsprogs-1.41 (is blocking sys-libs/e2fsprogs-libs-1.41.2)
[blocks B ] sys-libs/e2fsprogs-libs (is blocking sys-libs/ss-1.40.9, sys-libs/com_err-1.40.9)
[blocks B ] sys-libs/com_err (is blocking sys-libs/e2fsprogs-libs-1.41.2)
The problem lies in if you remove sys-libs/ss or sys-libs/com_err, you have a HUGE problem. You cant do anything online, you cant download new updates, and if you reboot, you cant mount filesystems. Sounds like a huge bug, and I am supprised it hasnt been fixed via portage yet.
Anyways, there is a workaround for it (not that we should have to use it), and here it is.
# First, grab the files with the fetch command
emerge -DufvN system
# Next, Make a backup of com_err and ss
quickpkg com_err ss e2fsprogs
# Remove offending packages
emerge -aC com_err ss e2fsprogs
# Compile the correct and updated packages
emerge -DuavN system
# And check for broken packages
revdep-rebuild
# Alternatively if you do not wish to use system, you can use:
emerge -avf =sys-libs/e2fsprogs-libs-1.41.2 =sys-fs/e2fsprogs-1.41.2
quickpkg com_err ss e2fsprogs
emerge -aC com_err ss e2fsprogs
emerge -av sys-libs/e2fsprogs-libs sys-fs/e2fsprogs
revdep-rebuild
NOTE: If you dont have revdep-rebuild, then install app-portage/gentoolkit
NOTE: If you have to re-install your previous com_err and ss, then use:
emerge -av /usr/portage/packages/All/com_err-1.40.9.tbz2 /usr/portage/packages/All/ss-1.40.9.tbz2 /usr/portage/packages/All/e2fsprogs-1.40.9.tbz2 && revdep-rebuild
Making sure to match your version if not the same, and running revdep-rebuild afterwards.
Ganon fails
by Dr D on Sep.19, 2008, under Computers, General
So just recently, my server “Ganon” died. He was a good server and did his job well. But like all good things, he had to die. The server would power on, but not even POST (Power On Self Test). I think it happened after he took a nice electric hit from a customer blowing the fuse on the power panel he was plugged into.
But in all good Zelda sense, Ganon fails, so he grows bigger and stronger and becomes Ganondorf. The new machine is bigger, stronger and badder. For anyone interested, pictures are listed in the Image Gallery
Patching DNS
by Dr D on Aug.13, 2008, under Computers, Work
So yea, the dreaded day came and went. That stupid DNS bug sucked. I think we got hit by it at work before the patch, though nothing major changed and we had no concrete evidance.
So on top of everything else, I found a way to patch our 4 years out of date server…..by upgrading it.
Because OpenBSD has to be upgraded one version at a time, I litterally did 5 OS upgrades in one night…on 3 different severs!
Here is some boredom pics from when I was upgrading in Chicago
Trixbox on VMWare? Sure!
by Dr D on Jul.07, 2008, under Computers, General
So some of my friends may know that in the past ive tried to run trixbox on vmware, and know I had to make a hack to get it to work “correctly,” IE the timing issue, and how i fixed it. (I had a post about it here).
So its been working fine, but when I moved, It took me some time to get my trixbox back up, just from different things going on. So when I did, everything worked fine…except I had no audio being sent from my ata. DOH!
So instead of trying to work with it, i tried something else. Trixbox has a VMWare pre-made image, which I wanted to try.
download the 2.6.1 VMWare version, unzip, insert into vmware server (1.0.5.andchange)….what? it was made with a version with newer features?
Looking around, I start editing the files, and see config.version and virtualHW.version. These look like I should be changing them! Lets check another working vm…Yup, so I change the version, and next problem, same thing, but it referances the hard drive image. Doh!.
so i asked google (or my new favorite variant: Goosh)
And I find this page, sweet! I do what they say, and followed the comment about changing the hard drive (the dd command) and this worked.
Next problem, it doesnt know what kind of system “rhel5″ is. So I edit the config from the gui, and tell it that its type “Other”. Boot, and it works out of the box.
Now thats sweet!
emerge -C python
by Dr D on Apr.13, 2008, under Computers, Funny
Okay, so I had a conflict with phyton and python-updater on my gentoo box the other day, and being tired and not thinking, i did a emerge -C pyton, which removes the program.
Shortly afterwards remembering the emerge program (gentoo’s portage application) is dependant on python. Doing a series of “whoops”, “oh shits”, and “damns”, I did a quick google, and found this link, and used it with updated versions/commands. http://forums.gentoo.org/viewtopic.php?t=5746
Basically what I did:
cd /tmp/
tar xjf /usr/portage/distfiles/Python-2.4.4.tar.bz2
cd Python-2.4.4/
./configure –with-fpectl –infodir=/usr/share/info/ –mandir=/usr/share/man
make
make install prefix=/usr
emerge python
cd ; rm -rf /tmp/Python-2.4.4
Which got me back up and operational. Kudos to the original poster to fix this!
Virtual Machines, trixbox and joy
by Dr D on Mar.02, 2008, under Code, Computers, General
So I decided to get a VM server for at home, reduce the number of machines I have in house, reduce power, and learn while Im at it.
So I got my system, its a Intel Duo 2 Quad Q6600 cpu, 4g ram, 750g hdd and I install gentoo on it.
Everything is going fine, until I get to converting my trixbox. Of course, I shouldnt be doing this because trixbox is realtime audio for a phone, on a virtual server. Ive read the bads about it, but I dont care. In my case, its a glorified answering machine.
So I google, and stumble accross some sites, we have http://pbxinaflash.com/forum/showthread.php?t=66 who had two unique solutions which helped, but didnt fix my issue. I tried both solutions, then in the process of doing so, I realized something. If there is a CPU load of say 5-10% going across, the audio sounds perfect!
So of course, I get to finding a way to geneate a low cpu load, that can be “moved over” when something more important comes along.
Now my script, dubbed “generate-cpu-load.sh” was born.
Here is my script, and where its placed to run
——– >8 start code 8<——–
#!/bin/sh
#
# (c) Dan Delaney 2008 http://dan-delaney.com
# generate-cpu-load.sh - To generate a small CPU load on the system so
# that trixbox will play back audio without skipping.
# NOTE: This is NOT to be used for a perminant solution, just to work
# around a problem with vmware and asterisk timing.
while true; do
nice -n19 find /etc/asterisk > /dev/null 2>&1
done
——– >8 end code 8<——–
Of course, we need this to run constantly in the background, so I put it in my rc.local file
echo "nice -n19 /root/generate-cpu-load.sh &" >> /etc/rc.d/rc.local
and to start it without rebooting: sh -c "nice -n19 /root/generate-cpu-load.sh &"
Now, dont go knocking me down because this creates a constant CPU load. This does not make the system ready for production, nor may it work on anyone else’s system.
If you find this helpful or just whatever, just drop me a line and say so!
Stopping Spammers, while mobile
by Dr D on Nov.01, 2007, under Computers, Work
So I was in our new DesPlains facility, when I got a page. “green mail queue above 600 (1000)”. Stupid spammers.
So I turned on bluetooth, connected to the internet with my cell, and took care of business. Stopped the spammers, dead in their tracks while being completely wireless and mobile.
/me kicks the spammers ass.





