Occasionally, I find that my terminal has gotten into a mode where characters printed past the end of the line, instead of creating a new line and starting at the left of that line, just continually overwrite the last character on the line.

Notably, I find that ssh’ing into an HP switch puts my terminal in this mode.

It turns out that, at least in the case of the HP switch, the autowrap mode of the VT100 emulation is being turned off, and then not being turned back on again.  In order to turn the emulation back on, execute this command:

printf "/033[?7h"

This just sends that VT100 command sequence to the terminal, which enables autowrap mode.  By the way, the same command with an “l” instead of an “h” is what turns it off.  I determined that this is what the HP switch is doing by capturing a session using “script“, which records every byte sent to the terminal.

No comments yet

Thus Was DevOps Born

By
January 30th, 2013

No one seems to be able to define exactly what DevOps is. I mean, people say that it’s just a greater collaboration between Development and Operations, but, in reality, it’s a lot more than that. As a sysadmin that has supported development groups both before and after the notion of DevOps had become popular, I have my own viewpoint.
Continue reading »

No comments yet

Unix admin interview question

By
December 28th, 2012

I’ve been interviewing sysadmins lately, and I’ve come up with a question that I think works quite well to test thought process, troubleshooting ability, scripting ability, etc.

Your email server has become inundated with emails from your monitoring system, to the point that it’s delaying emails from customers requesting status updates.

Assume that the mail spool consists of a top level of 16 or so directories, each of which contains multiple files with random names that hold one email a piece in RFC822 format. Also assume that all of the extraneous emails are from a single email address.

Remove the extraneous emails from your mail spool so that the more urgent emails can get delivered more quickly, but make sure that they are not destroyed so that those emails can be inserted back into the mail spool at some point.

Don’t worry about details surrounding mail spool management. All you need to do is make the extraneous files no longer exist in the spool directory.

If you want to try to solve this yourself, there are some spoilers after the break, so don’t read any further until you think you’re done.

Continue reading »

No comments yet

I was having an issue where a user was able to send a “normal” kill signal (SIGTERM) to a process he owned, but was getting “Operation not permitted” when trying to send SIGABRT. It turns out that FreeBSD has a sysctl — security.bsd.conservative_signals — that, when set to 1, will prevent users from sending certain signals to processes that have the same UID as the user when there has been a setuid() call in its past.

Continue reading »

No comments yet

Restoring permissions

By
December 19th, 2012

I needed to restore permissions to files in a directory, but not restore the data.  I found a (sorta) one-liner on ServerFault, but it didn’t support restoring owner and group in addition to mode, and I needed that.

So I rewrote it enough to do that:
Continue reading »

No comments yet

Hello, blogosphere.

By
December 10th, 2012

I’m kinda late to the blogging game, but I’ve found myself wanting to comment on some sysadmin things lately and I want to have somewhere to do it.  Plus I had this cool domain name.

Here goes nothing.

No comments yet