cool trick for listing directories

I had to modify a bunch of permissions on directories today, and going thru them one by one didn’t sound good at all .. so I did this:

 chmod 775 `ls -l| awk ‘/^d/ {print $NF }’`

 The listing in the second part of this is also effective if you just want a list of all your subdirectories within a given directory.






Setting up VNC server for multiple users

So the developers want a GUI on the system they use to develop our java file-serving app (I’ll rant about that later).

Anyhow, I’ve installed a few VM’s with Gnome on them, so I figured VNC was an easy way to get them there, without dealing with the complications of running X across the WAN. 

Originally, I was trying the GUI managed setup that Gnome has to “turn on remote desktop”, but I quickly realized that it only works when the desktop is logged into the console.  After the user has logged out, this isn’t going to do me a whole lot of good.

I found another doc that ended up pointing me in the right direction.  Here’s what I did:

1) I edited the /etc/init.d/vncserver file to include this line at VNCSERVERS:

VNCSERVERS=”1:root 2:user1″

2) I started /etc/init.d/vncserver

3) I ran vncpasswd as the users I needed (root, user1)

This gave me the ability to connect to the remote ip with vncviewer at vnc:ip.of.the.server:1 for root, and ip.of.the.server:2 for user1.  Each had their own password so I didn’t have to give up root to my developer.

So far, the developer seems happy, and the solution seems to be working well (it’s only been 10 minutes.)






My First Vista Roadblock: And it’s M$ Software!

So the IT dept has been told we need to start working on Vista upgrades.  XP is going end of life next year (or so MS is threatening anyway), so we’ve got to start getting people migrated.  My first step is to start using Vista myself, so I’ve taken the plunge today.

The install was good, it actually saved my old XP files, which I liked, when I realized I hadn’t backed up some IM logs that had some info I didn’t want to lose.  Everything was going pretty well.  I jumped on the network (although the domain login screens seem clunky compared to XP, but that’s okay).  I configured my desktop the way I wanted it … looks cool.

Then I went to install MS Office 2007 … and it all went to hell.  Used the same installer that I’d used on XP.  No go.  Stopped with a ProPls.cab file that it couldn’t find.  Fair enough.  Figured maybe the file was corrupt on the files I downloaded.  Downloaded a fresh copy.  Same problem. 

Now it’s not funny anymore.  I’ve resorted to downloading Office 2007 enterprise and I’m loading it from a locally mounted ISO – more on that in my next post.  That seems to have gone much better .. but what a a pain in the ass.






Why oh why won’t my CF 6.1 install?

Today, I’m rebuilding CF 6.1 machines on Win2k3 VM’s … but I can’t seem to get the installer to start.

 Why not?  DEP!

 Microsoft’s Data Execution Prevention prevents the program from extracting files.

 There’s a real good explanation of it here.

 http://www.clickculture.com/blog/index.cfm/2006/2/15/Cant-Install-ColdFusion-61






Hardware Raid on a Sun T2000

After finally having to tackle Solaris after so many years with i386 boxes, I was truly disappointed to find out that I was going to have build and repair software raids on all of the servers that I inherited.

Enter the T2000:

With these new T2000 servers, we can build a hardware raid and swap out disks without the painful work of unbuilding and rebuilding raids (and those ever-so-costly typo’s).

Building the hardware raid was actually quite simple. The OS was already preinstalled, so I was able to boot the server to single-user mode and issue the necessary commands from there. On the first machine, I booted single-user mode from the dvd. Later, I set up a network-installation server and was able to use ok> boot net -s to be able to boot the subsequent machines from the network. (This helped with the reinstall afterwards too).

Once I got a prompt it was easy.

SINGLE USER MODE
# raidctl
No RAID volumes found
# raidctl -c c0t0d0 c0t1d0 #(this was for a mirror)

you’d add a -r, I believe, if you wanted stripes instead.

This built a raid called c0t0d0 with sub-disks that can be swapped out in case of a failure. The OS will install and interact with c0t0d0.

After I ran the initial command, I could run raidctl to see what the status of my new mirror was:

# raidctl
RAID Volume RAID RAID Disk
Volume Type Status Disk Status
——————————————————
c0t0d0 IM RESYNCING c0t0d0 OK
c0t1d0 OK
When the sync finished, the raid looked like this:

# raidctl
RAID Volume RAID RAID Disk
Volume Type Status Disk Status
——————————————————
c0t0d0 IM OK c0t0d0 OK
c0t1d0 OK
Installing the raid killed everything on the disk, so I’m now performing another install … but at least now I’m doing it knowing that I don’t have to work thru the whole software raid process when I’m done :) .

Ooooh … just figured this one out the hard way.  Don’t forget to label your disk!

Once I finished installing the OS, I use the same command to see the status of my raid:

bash-3.00# raidctl
Controller: 0
Volume:c0t0d0
Disk: 0.0.0
Disk: 0.1.0






Solaris 10 network boot

Our remote data center has forced me to figure out remote installations for Solaris, and although I was originally dreading it … it wasn’t half bad.

The Sun documentation was a little painful, but I can understand that with so many ways of doing the network install, you have to offer a lot of different sets of instructions.  Unfortunately, I had a quite a time deciphering it.

Anyhow, I set up one server on the network as both my boot and install server (because everything is on one big flat subnet, so I don’t have anything tricky going on).

This required two commands:

#/opt/dvdsparc/Solaris_10/Tools/setup_install_server -p  /export/home/dvdsparc

(I’m using /export/home/dvdsparc as my installation path, but I had to make sure there was enough room for the entire dvd in /export/home/dvdsparc).

Then I installed the “boot server” software:

#/opt/dvdsparc/Solaris_10/Tools/setup_install_server -b  /export/home/dvdsparc

Next I grabbed the mac address of the system I was trying to install, and add it to the list of boot clients:

# /opt/dvdsparc/Solaris_10/Tools/add_install_client -e  ‘mac:address:here’  hostname sun4u

(My proposed hostname was already in my /etc/hosts file and I looked up that machine type sun4u=t2000 hardware).

The machine ran it’s script and told me it added my host to the /etc/ethers file and I was ready for reboot.

Since I was operating remotely thru ALOM, I rebooted with ok> boot net – nowin to make sure I got a console install.  From there the system immediately booted into the configuration wizard, and later mounted the installation media via NFS to complete the network install.






Snapmirror and Slow Networks

So today’s problem had us trying to snapmirror a sizable amount of data (200 GB) over a bonded-T1 network link.  With that kind of throughput, completing the snapmirror would take somewhere in the range of 2 weeks.  Unfortunately, we 1) need to share that bandwidth with other applications and 2) don’t have that kind of time.

 So how do we get around it?  Well a little birdie told me about snapmirroring to tape.

 How does it work?  It’s pretty simple actually.  The idea is that you create a snapmirror to your tape, then sneakernet your tape to the second location, restore the baseline snapshot to your destination filer.  Then, kick off updates on your restored filer and voila!  We have a current snapmirror without having to spend forever waiting for the network to catch up.

What are the nuts and bolts?  You have to run NDMP backups, which we’re already doing on our filer.  I created a new NDMP policy called “smtape”, added the server (my Netapp device) and the volumes that I wanted to baseline.  Then, I went into the /opt/openv/netbackup/db/class/smtape/includes file where the paths to my volumes are stored, and added the following line to the top:

set type=smtape

Those are the magic words.  I set a schedule on my policy and kicked it off manually.  Instantly my filer showed that it was snapmirroring to tape in the Snapmirror section of Filerview.  Now all I have to do is sneakernet my snapshot over to the destination, restore it to the new volume and start the updates!

If you look in the snapshots section of the Filerview, you’ll see a “snapmirror tape” snapshot that is waiting to be called once you restore to the destination filer.  What’s even better, is that the restore job at the other end even creates the snapmirror job!  You just have to set a schedule and kick it off.