Monday, April 9, 2007

Determine Missing Patches Like a Ninja

As a ninja, there are times when my murderous blows seem to fall wide of my mark. Not to say that the kill doesn't happen, maybe just not as effectively as I'd like. As an example, I recently patched several of my AIX machines with current maintenance. After executing said patches, I found that running an oslevel command returned a lower level than had been installed. After torturing several servers in a stealthy and honorable manner, I determined that the problem was with the blanket update performed on the system. In order to determine which patches needed to be hunted down and applied, I simply had to run a
oslevel -rl 'level'
in order to find what I had missed. So, if my master needed my AIX 5.3 install to be at Technology or Maintenance level (depending on your years of service as a ninja) five but after applying it it was only at TL4, I'd run
oslevel -rl 53-005
to return a list of patches that fail to meet the requested level.

A nonrelevant link for today.

Thursday, February 22, 2007

Adding a Static IP to Redhat 6.2 Like a Real Ninja

A pirate once asked me why anyone would be foolish enough to run an operating system that hasn't been updated since 1999. As I strangled the life from him, I pondered this question and realized that the answer is irrelevant; if my clan leader instructs me to guide this feeble and vunerable install along the Path of Prosperity, what ninja am I to question him?

To do this, one must first plan the attack, for as any ninja knows a poorly conceived attack will fail and bring dishonor on his or her clan. Only pirates use the GUI to make any changes to a Unix system; therefore we will focus the incredible power of our will on the commandline. There are three files that must be updated:

  • /etc/hosts

  • /etc/sysconfig/network

  • /etc/sysconfig/network-scripts/ifcfg-eth0 (this assumes your ethernet port is eth0)



First, add a line to the /etc/hosts file with your machine's host name and the static IP address like this:

192.168.0.2 ninjablade

but change the IP address and the server name to match whatever you're trying to do. Static IP addresses are arguably easier to add if the server name references ninjas, vengence, or killing in some way.

Next, open the /etc/sysconfig/network file. You'll need at least three lines in this file:

NETWORKING=yes
HOSTNAME=ninjablade.vengence.com
GATEWAY=192.168.0.1

NETWORKING may be set to dhcp; change it to yes. HOSTNAME is self-explanatory. The GATEWAY value is your default gateway and should be the IP address of your router or switch. In ninja terms, think of it like this: the gate at your dojo gives you access to the rest of the world; as such, your dojo's gate is a GATEWAY. Now, we know ninjas can leap twenty to forty feet in a single bound, as well as fly on occassion and throw bioslime but in a limited sense this analogy works.

Finally, you need to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 script. Ensure the following four lines are in your script:

DEVICE="eth0"
BOOTPROTO="none"
IPADDR="192.168.0.2"
NETMASK="255.255.255.0"
ONBOOT="yes"

This tells Redhat to start the adapter during the boot process and to bind the IP address and subnet mask to the card. Once these three tasks are complete, reboot the server (ninjas don't use workstations), stab someone with a letter opener, and wait for the server to come up. When it does, you'll have a static IP address and can get back to designing throwing stars.

Welcome to Midrange Ninja

Like a whisper in the night, like a scent of sanity in a world of madness, the Midrange Ninja clan strikes from the shadows with precision accuracy and complex jujitsu moves to eliminate Unix problems like so many numbered ninja extras in a Hong Kong grindhouse flick. Sharpen your shuriken, brethren, and prepare for battle!