Archive for the ‘SysAdmin’ Category

unix time to spreadsheet time

In Unix and Linux, times are stored as seconds since the Unix Epoc, 1970-01-01 00:00:00. Spreadsheets often use a different Epoc and they tend to store days instead of seconds. When I import timestamped data that came from Unix land, I have to compensate for those differences. First, I format two cells to YYYY-MM-DD HH:MM:SS […]

Efficiently find missing numbers in a sequence

This awk will print out the numbers missing in an ordered sequence that starts with the number you set “a=” to in the BEGIN block. awk ‘BEGIN {a=1} { while (a++ < $1) {print a-1} }' For example, here I have a few calls to seq create a sequence of integers starting at 1 and […]

Home brew passgen with rand and bash

I made this up this morning and I think it doesn’t suck. I put it in my .bash_aliases file, which is read by my .bashrc and then I have them on the command line: mkpass_string() { BOFS=${1:-Get} EOFS=${2:-Clue} SEPS=$(rand –mask ‘,.-=*_+^@’ -N 2 -d ” ) rand -M 99 -N 2 –bof “${BOFS}” -d “${SEPS}” […]

Letting NIS through Linux firewalls

I’ve had to do this a few times and I always forget and have to learn again. So here I am, memorizing it in my off-brain cache… Overview of NIS A Network Information Service (NIS) is a system for sharing service configuration info. It’s old, insecure, but still very useful. It relies on having a […]

Signing up for the ENFIELD ListServ

What’s the name? Before I get started, let me explain something about the name “the Enfield ListServ.” Actually, “ListServ” is the brand name of a server software that organizations use to manage e-mail mailing lists. Enfield doesn’t have a ListServer server, our mailing list is hosted for us by Dartmouth on theirs. So, you could call […]

mysqldump error “insufficent privileges to SHOW CREATE PROCEDURE”

Haven’t found this documented anywhere so here it is: A user reported today that while trying to dump his database, his mysqldump command was reporting this error: testdev has insufficent privileges to SHOW CREATE PROCEDURE Turns out the problem is that user testdev has all permissions in it’s own database, but no permissions in the mysql database. […]

Linux timer app command line goodness!

I googled for “linux timer app” looking for something like a virtual kitchen timer I use to remind me to switch back to standing after a sit-break at my workstation.  And Google found this gem for me from Pat Brisban on the ArchLinux forums: # set an ad-hoc GUI timer timer() { local N=$1; shift […]

Letting NIS master notify a firewalled NIS slave server of updates

We have a NIS master on our corporate network. One of it’s slaves has it’s Shorewall configured iptables firewall enabled. Whenever we would update the NIS maps on the master and run “make -C /var/yp” to push the changes out, we’d get RPC errors about that firewalled slave server. They looked like this (names changed […]

Finding the du – df difference.

Long time system admins will have run into this from time to time: a file system appears to be full when you look at it with df but not when you use du to check it out. Today, this problem appeared dramatically. Our monitoring system reported that the root file system one of our servers, […]

Finally found docs for ifcfg-em1 and friends

All of redhat derived systems I’ve ever used store network configuration in /etc/sysconfig/network-scripts and use the ifup and ifdown commands to start and stop interfaces. Fine. I can’t tell you how many times over the years, though, I’ve tried to look up the options I can put in those files. I’ve never found anything in […]