June 12, 2012

DNS / IP Address Script for WordPress Blogs

(Note: this allows us to pull IP addresses from DNS names...)

#! /bin/bash
for line in `cat ./IP_List1.txt`
do
echo "Looking up server IP of $line"
host "$line"|grep 'address'|cut -d ' ' -f4 >> ServerIP.txt
echo "$line `host $line|grep 'address'|cut -d ' ' -f4`" >> DNSIP.txt
done

Posted by jlwalsh at 03:09 PM | Comments (0)

May 30, 2012

Managing Kerberos Credentuals for Xgrid

So, one of the issues we've encountered in the past regarding Xgrid and scripting out job progress and information results from the fact that Xgrid uses LDAP and Kerberos for EVERYTHING, which means you'll a ticket to do anything. We've whipped out a simple script that does this (admittedly, this is a hack, but it works for temporary usage...):
---------------------------------------------------------------
if ( $ARGV[0] eq "-k" || $ARGV[0] eq "--k" )
{

open PASS, "/path/to/encrypted/pass/krb5.pass" or die $!;
while ()

my $cipher = new Crypt::Blowfish "my key";
my $plaintext = $cipher->decrypt($_);
chomp($plaintext);
my $krb5_princ;
Authen::Krb5::init_context();
$krb5_princ = Authen::Krb5::parse_name('pcastuser');

my $krb5_sprinc = Authen::Krb5::sname_to_principal(
"myserver.com",
'xgrid',KRB5_NT_SRV_HST
);
my $cc = Authen::Krb5::cc_default();

Authen::Krb5::get_in_tkt_with_password(
$krb5_princ,
$krb5_sprinc,
$plaintext,$cc
);

}
---------------------------------------------------------------
This allowed us to extract a listing of submitted Xgrid jobs (e.g, Podcast Producer) for MTube migration.

Posted by cdgrieb at 09:56 AM | Comments (0)