Blog O' Matty


Sending breaks through ssh

This article was posted by Matty on 2006-03-21 19:38:00 -0400 -0400

I have a small lab at home, and periodically need to gain console access to one or more of the machines. Since I don’t have a KVM switch or a monitor to devote to each machine, I will typically hook up a serial cable to port A on machine one, and serial port B on machine two. Once the connection is in place, I use minicom or tip to connect to node one once I establish an SSH session to node two. Since tip and SSH both default to using “~” as the escape character, issues will arise if you need to send a break remotely. To avoid this issue, I always use the ssh client’s “-e” (escape character to use) option to set an escape character that doesn’t conflict with tip:

$ ssh -C -e ^ host

This caused me some grief today, since the box I was SSH’ed into didn’t have my .profile installed (my default profile contains an ssh alias with “-e”). Tip is c-well!

Linker search paths

This article was posted by Matty on 2006-03-19 12:02:00 -0400 -0400

As part of my job as a systems administrator, I occassionally need to develop scripts to start applications at system bootstrap. Periodically while developing these scripts I will encounter an application that relies on libraries in obscure locations. To allow my scripts to work with these applications, I typically need to set LD_LIBRARY_PATH so the runtime linker can locate the libraries needed to make the application work ( I say typically since setrpath can be used on occassion ). Since the Solaris linker searches for libraries in the following order:

  1. Check for libraries by traversing the directories in the LD_LIBRARY_PATH environment variable
  2. Check for libraries by traversing the directories in the executables’s RPATH
  3. Check for libraries by traversing /lib and /usr/lib

It is usually unnecessary to explicitly add /lib and /usr/lib to the search path. To see this first hand, the ldd utility can be invoked with the “-s” (display search path) option and an executable to process:

$ ldd -s slapd

find object=libdb-4.3.so; required by /usr/local/openldap-2.2.26/libexec/slapd
search path=/lib:/usr/lib (default)
trying path=/lib/libdb-4.3.so
trying path=/usr/lib/libdb-4.3.so
libdb-4.3.so => (file not found)

find object=libsasl.so.1; required by /usr/local/openldap-2.2.26/libexec/slapd
search path=/lib:/usr/lib (default)
trying path=/lib/libsasl.so.1
trying path=/usr/lib/libsasl.so.1
libsasl.so.1 => /usr/lib/libsasl.so.1

[ ..... ]

Each stanza contains the name of a library that the executable requires, along with the directories that are searched to locate the library. This is some useful stuff!

Upgrading wordpress

This article was posted by Matty on 2006-03-18 20:22:00 -0400 -0400

While reading through the wordpress dashboard this weekend, I noticed that several new security advisories were announced for the version of wordpress I was using. To mitigate potential security issues, I decided to upgrade to Wordpress 2.0.2 and Spam Karma 2.2. The upgrade process was super simple, and I will describe it below.

To begin the upgrade, you need to grab the latest versions of wordpress and spam karma:

$ wget http://wordpress.org/latest.zip

$ wget http://wp-plugins.net/sk2/sk2_final.zip

Once the files have been downloaded to a location on the server you plan to upgrade, you can unzip them to a staging location ( this BLOG posting assumes that you are upgrading a version of wordpress that lives in a directory named public_html in your home directory):

$ mkdir ~/public_html/staging && cd ~/public_html/staging && unzip ~/latest.zip

$ cd ~/public_html/staging/wordpress/wp-content/plugins && unzip ~/sk2_final.zip

Once the files are extracted, you will need to copy your existing wordpress configuration file to the staging directory:

$ cp ~/public_html/wordpress/wp-config.php ~/public_html/staging/wordpress/wp-config.php

If everything completed successfully, you should be able to view the new wordpress version by prepending the word staging to your wordpress administrator URL. Wordpress will prompt you to upgrade the database schema, and once that completes, you can backup the current version and move the staging version into place. This entire process takes less than 10-minutes, and the new version has lots of cool features. Nice!

Windows XP on Mac Competition

This article was posted by Matty on 2006-03-16 23:06:00 -0400 -0400

Six years ago I took a UNIX system administration job with a large telecommunication firm in Atlanta. About a month into the job, my boss asked me to chat with one of the UNIX admins about a DNS server that needed to brought back online. I had never spoken with this specific admininstrator, so I wandered over to his cube not knowing what to expect. When I arrived at his cube, I introduced myself, and we started chatting about the DNS server. He told me about the events that led to the box being taken out of rotation, and mentioned that he had a plan to bring the server back online. I thanked him for his time, and wandered back to my cube. This was the first time I met Clay.

Since our environment was super busy, I was usually tucked away in a cube building servers, responding to ecache parity errors, and reviving broken NAS and CORBA servers. One day my boss asked me to provision several domains on one of the companies Sun Enterprise 10000s. This was an emergency request, and I knew I needed a good plan in order to complete the request in the time alloted to me. About an hour or so into writing up the tasks, Clay stopped by my cube to see if he could use the Sun Enterprise 10000s for a few days. I asked him if he had a truck, to which he smiled and said he was planning to be the first to boot Linux on a Sun Enterprise 10000. At first I thought he was joking, but the look on his face indicated that he was serious. Since it was Friday afternoon and I didn’t have to have the hardware online until the following week, I gave Clay the SSP passwords, described the layout of the SSP, and wished him luck. Once I finished my battle plan, I wandered home for the weekend.

When I returned to work on Monday, Clay stopped by my cube to return some items. I asked him if he made any progress on booting Linux on the Sun Enterprise 10000, to which he mellowly replied “yeah, but we couldn get the graphical penguins to display since the Sun Enterprise 10000 doesn’t have a frame buffer.” Once I realized that he had actually gotten the Linux kernel to boot on the Sun Enterprise 10000, my jaw dropped, and the “wow, I know someone famous” feeling hit me. This was exciting stuff, and when Clay left my cube, I thought to myself, “damn this dude is smart!”

Things continued to tick along at the job, and my boss stopped by my cube one day to assign me a new project. He also asked me to discuss the project with the senior manager of architecture. Since the architecture manager sat on the opposite side of the building, I got up from my seat and wandered over to chat with him. When we finished chatting, I started to walk back to my cube, and happened to notice that Clay and another co-worker were staring inquisitively at their computers. I wandered over to see how they were doing, and asked what they were up to. Clay looked up from his display and mentioned that he was trying to debug a problem with a commercial web server. I noticed that his monitor was littered with debuggers and commented SPARC assembly code, and he had created a variety of diagrams on his white board. I was impressed with what I saw, and was even more amazed when I heard that they had developed a web server plugin to solve the problem the company had encountered.

I eventually promoted into the same group as Clay, and was moved into a cube adjacent to his. Since Clay was aways working on solving super complex and sometimes mind boggling problems, it was always fun wandering next door to see what he was up to. Regardless of the size or shape of the problem, I quickly learned that Clay could solve whatever you threw at him ( super complex problems typically required more than one package of chocolate donuts). So when Clay told me two weeks ago that he planned to compete in the competition to boot Windows XP on the Mac, I knew he would be able to win, especially once he drew out his solution on the back of a sushi menu.

After two weeks of hacking code and getting 90% of his solution written, Clay learned that narf and blanka had submitted a solution to boot Windows XP on a Mac. Once Clay got confirmation that their solution was submitted to the competition’s creator, Clay congratulated the winners, and posted the solution he had concocted to the Windows XP on mac message board. While Clay might not have won the competition, he is first in my book ( /me pours out his 40 of OE to Clay)! Congrats dude, and awesome work!

Monitoring Linux applications with Frysk

This article was posted by Matty on 2006-03-13 12:10:00 -0400 -0400

While reading the latest systemtap documentation, I came across the Frysk project. The Frysk team is looking to create an always on monitoring solution for Linux systems, and it looks they are going to add (or have added) some super cool functionality (e.g., detecting and reporting deadlocks ). This is a brilliant idea, and I especially like the use cases they developed. This should make every Linux admin jump for joy!