Category Archives: Tech Topics

RHEL6 NIC order

udev in RHEL6 enumerates devices based on information stored in

/etc/udev/rules.d/70-persistent-net.rules

When adding/changing NICs in VMware, you may need to edit this file to adjust the order. Alternately, you can delete the file and let the system rebuild it on the next restart.

Regenerate SSH key material

All this can be done in an ssh session, however if anything goes wrong, you’ll need console access to fix the problem.

Generate new candidate primes

ssh-keygen -G moduli-2048.candidates -b 2048

Screen primes for suitability

ssh-keygen -T moduli-2048 -f moduli-2048.candidates

Install in ssh config root, backup old moduli:

cd /etc/ssh

mv moduli moduli.bak

mv moduli-2048 moduli

backup existing private/public keys:

for i in *_key;do mv $i $i.bak;done

for i in *.pub;do mv $i $i.bak;done

Generate new keys:

ssh-keygen -A

Restart sshd:

/etc/init.d/sshd restart

Verify this by logging out and back in. Your ssh client should bark that the host key has changed. Once you clear the line from .ssh/known_hosts (or the equivalent) you should be able to log in again.

At that point you should delete the old keys and candidate moduli

Generating PDFs using Ghostscript

The following command (re)generates a pdf from the source file. In this particular case it is being invoked to fix improperly written pdf. but it could just as well be used to make a pdf from an jpg file.

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.7 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=Aaron_Taylor_APPLICATION_2014-04-30_20-58-new7.pdf Aaron_Taylor_APPLICATION_2014-04-30_20-58.pdf

Renaming Linux Volume Groups

Linux Volume Manager provides software RAID and more generally abstraction between OS and disk devices. It is used by default for RHEL/CentOS 6.3 forward.

A cloned a VM will retain the volume group name of the parent. Use the following procedure to change it.

Find the current volume group name. (You can also see the current group name reflected in the output of dmsetup info.)

lvm vgdisplay

Rename the volume group:

vgrename <old_vg_name> <new_vg_name>

Edit /etc/fstab and /boot/grub/grub.conf so that the new volume group devices get used and mounted when the system starts.

Rebuild the initial RAM disk:

mkinitrd <initrd_file.img> <kernel_version>

Reboot and test.

Cisco console adapter for use with Ethernet cables

Eliminates the need for a rollover cable or a Cisco console cable. Just use any straight-through Ethernet cable.

In adapter kits, the RJ-45 side of the wires are attached. Plug them into the DB-9 side in the following order:

RJ-45      wire       Serial

1 (RTS)   blue      8 (CTS)
2 (DTR)  orange  6 (DSR)
3 (TxD)   black    2 (RxD)
4 (Gnd)   red        (Unused)
5 (Gnd)   green    5 (Gnd)
6 (RxD)  yellow  3 (TxD)
7 (DSR)  brown   4 (DTR)
8 (CTS)  grey       7 (RTS)

RJ-45 side is the DTE pinout of the Console port of most common Cisco equipment.

More Foresight Linux thoughts

The devel packages aren’t included by default, but you’ll definitely want them, especially if you ever need to compile any of software on your own. Foresight has this info in their docs too, but basically, it’s just conary update group-devel as root.

There is no mini-commander applet, after all. Maybe it’s an RH thing, or relatively little used Gnome code that Foresight didn’t include. Still, that’s a small matter, considering the time savings of a fully functioning Evolution.

Also, audio, including mp3 playback in Banshee works out of the box. Whoop!

Even DVD playback works with the exception of encrypted content. But that can be fixed by installing the libdvdcss libraries.