Ohjeah!

Archive for March, 2009

Cleaner Fonts In Wine

without comments

This should work on most newer versions of wine, just run regedit (registry editor) and add/modify the following.

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001

Written by jro

March 16th, 2009 at 9:11 am

Posted in Computers

Tagged with , ,

Linux Update Password Script

without comments

In my last post I showed a good example for using expect in a script.  Here is another good example I use for updating local user passwords across a group of servers without using ssh keys.  This assumes the user you are resetting can ssh to the host and the old password is the same on all hosts. Read the rest of this entry »

Written by jro

March 4th, 2009 at 10:51 am

Posted in Computers

Tagged with ,

Remote Server Shutdown

without comments

One of my recent projects was to initiate a server-wide shutdown should our UPS ever run low.  I currently have Zenoss monitoring the health status of the UPS, including the remaining charge on the battery.  Using Zenoss thresholds, I can make a script execute if the battery ever runs low.

Our Zenoss deployment currently runs on CentOS, so I put down a method to shut down each type of host from a linux platform.  After much researching and testing, this is what I came up with (and am currently using in my shutdown script).

For Windows:

net rpc SHUTDOWN -C "Automated shutdown" -f -I "$server" -W $domain -U $username%$password

I replaced my arguments with some that would be more readable.  User and password are separated with %.

For Linux:

CMD="ssh -l $username $server shutdown -h now"
              expect -c "
              match_max 100000
              spawn $CMD
 
              expect {
                \"Are you sure you want to continue connecting (yes/no)?\" {
                send \"yes\r\"
                exp_continue
                }
                \"password:\" {
                send \"$password\r\"
                expect -re \"$username*\"
                }
              }
              "

I wanted to shutdown linux servers without using keys but had to overcome the “do you want to connect” prompt.  In order to do that I had to use exact which can be installed with “yum install exact”

By turning these into functions and passing arguments, you can make a shutdown script in a couple of minutes.

Written by jro

March 3rd, 2009 at 12:34 pm

Posted in Computers

Tagged with , , ,

Twitter

without comments

Integrated Twitter into my blog, feel free to follow it at here .

Written by jro

March 3rd, 2009 at 9:16 am

Posted in Computers, Life, Random

Tagged with