Keep SSH Sessions From Disconnecting

With the installation of new firewalls at work I’ve been getting disconnected a lot from hosts I SSH to, due to changes in the inactivity timeouts. It’s particularly inconvenient when I’m tailing a log that hasn’t changed in a while… and then the connection dies, and I don’t notice. Oops. It also happens in various other situations, like NAT through a home router, too. Let the connection sit for a while and you’ll have to recreate it. I could ask our network guys to change the timeouts, but it turns out there’s a better fix from the client side. SSH protocol version 2 supports server keepalive, essentially NOOPs sent to the server to keep the connection up. You can do …

Read More

Why Does My Linux VM's Virtual NIC Show Up As eth1?

Got a Red Hat Enterprise Linux (or CentOS, or Scientific Linux, or Oracle Enterprise Linux, etc.) 6 VM that won’t bring up it’s single network interface after you clone it? Get the following error when you try using /sbin/ifup to enable it? “Device eth0 does not seem to be present, delaying initialization.” When you use “/sbin/ifconfig -a” you see eth1 where eth0 should be? eth1      Link encap:Ethernet  HWaddr 00:50:56:9B:00:85             BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:812 errors:0 dropped:0 overruns:0 frame:0           TX packets:214 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:72509 (70.8 KiB)  TX bytes:28324 (27.6 KiB) lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           …

Read More

Who Cares About Time Zones Anyway?

If you think you have a thankless job you should think about Arthur David Olson and Paul Eggert. Heck, it’s not even a paying job for them. They’re volunteers. Perhaps even masochists. What do they do? They maintain the time zone database (“zoneinfo”) for all of the computing world. And while residents of a particular country have to put up with just the general stupidity of their own politicians, these guys have to put up with all the stupidity of all politicians, across the Earth. Every time a politician in Russia, or Cameroon, or Indiana thinks it’d be a good idea to screw with the clocks these guys update and redistribute their database[0]. Vendors pick up the update and send …

Read More

Why I Don't Use Third-Party Binary Packages

There are a number of third-party package repositories out there for Linux distributions. For example, Fedora runs the Extra Packages for Enterprise Linux (EPEL) repository, which contains builds of open source software that isn’t supplied with Fedora or Red Hat Enterprise Linux. Similarly, a lot of projects have their own repositories that supply builds of software for OpenSUSE, Debian, Ubuntu, etc. Maybe it’s just because I’m old-school, and maybe it’s because I enjoy compiling things, but I really don’t like the idea of using binaries found on the Internet. I never have. As an aside, I really tried hard to make the rest of this post not be critical, or seem like criticism, but instead just be a reflection of …

Read More

Strange Characters in My WordPress Blog

In late August I moved my blog from a host running Red Hat Enterprise Linux 4 to a host running Red Hat Enterprise Linux 6. With it came an upgrade to MySQL, from 4 to 5. The migration itself seemed pretty painless, as I was able to recompile Apache on the new host and just copy everything over intact. I moved the databases by dumping each one and importing them on the other side. A week ago I was doing some work on the blog and noticed that for every apostrophe there were three other characters now: ’. I use a lot of apostrophes, and it sort of sucks to have every “it’s” become “it’s”. More specifically, it was only …

Read More

How to Change SCSI Controllers on your Linux VM

A question from Matt Vogt prompted this, where he wants to go from the BusLogic  SCSI controller to the LSI Logic SAS controller. It’s actually a straightforward conversion if you have the right steps. This is based on Red Hat Enterprise Linux 3, 4, and 5, but the principle should be the same for everything. It’s basically: snapshot, change config files, change hardware. Red Hat Enterprise Linux 6, in contrast, appears to have all the LSI Logic, parallel & SAS, drivers, as well as the paravirtual SCSI drivers, so all you need to do is shut the VM down and change the type of SCSI controller you’re using. I always recommend trying this on a test VM before you try …

Read More

The Manhattan Way

“We prefer plain dealings and straightforward transactions in America. If you go to Egypt and, say, take a taxi somewhere, you become a part of the taxi driver’s life; he refuses to take your money because it would demean your friendship, he follows you around town, and weeps hot tears when you get in some other guy’s taxi. You end up meeting his kids at some point and have to devote all sorts of ingenuity to finding some way to compensate him without insulting his honor. It is exhausing. Sometimes you just want a simple Manhattan-style taxi ride. But in order to have an American-style setup, where you can just go out and hail a taxi and be on your …

Read More

UNIX Utility of the Day: watch

Not a lot of people know about the ‘watch’ command, part of the standard complement of GNU tools available on most Linux distributions, as well as many Linux-like OSes such as VMware ESX and the VMware vMA. Simply put, it runs a command at a specific interval for you. So if you want to continually see the number of httpd processes running on a host you could use: watch ‘ps -ef | grep httpd | wc -l” Or maybe you want to watch the temperature on a remote physical host using IPMI. The -n flag changes the number of seconds between the commands: watch -n 60 -d ‘ipmitool -I lan -U username -P password -H host-bmc.address sdr type “Temperature”‘ The …

Read More