Skip to content

Instantly share code, notes, and snippets.

def classify(o)
case o
when Hash
h = {}
o.each {|k,v| h[k] = classify(v)}
h
else
o.class
end
end
settings = MyClass1.new
settings.Username = username
settings.ResourceId = resourceId
request = MyClass2.new
request.TicketSettings = settings
Status: Connecting to 10.224.129.168...
Response: fzSftp started
Command: open "[email protected]" 22
Trace: psftp: Implicit session load.
Trace: Looking up host "git01"
Error: ssh_init: Host does not exist
Error: Could not connect to server
Status: Waiting to retry...
Status: Connecting to 10.224.129.168...
Response: fzSftp started
@dtolj
dtolj / ticker
Created June 23, 2011 23:47
twitter ticker
#!/usr/bin/php -q
<?php
//shell_exec('cd /var/www/html/');
chdir('/var/www/html/');
$webroot="/var/www/html/";
$xml = shell_exec("wget http://twitter.com/statuses/user_timeline/211898317.rss");
@dtolj
dtolj / vmware-tools
Created June 20, 2011 18:45
vmware tools linux
Copy the following text into /etc/yum.repos.d/vmware-tools.repo
[vmware-tools]
name=Vmware-tools
baseurl=http://install.linux.duke.edu/pub/linux/vmwaretools/centos-5/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-linux-at-duke
gpgcheck=1
enabled=1
[vmware-tools-test]
#!/usr/bin/python
import xmlrpclib
SATELLITE_URL = "https://rhn.redhat.com/rpc/api"
SATELLITE_LOGIN = "dtolj1"
SATELLITE_PASSWORD = "password"
client = xmlrpclib.Server(SATELLITE_URL, verbose=1)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
@dtolj
dtolj / gist:1013082
Created June 7, 2011 20:29
sinatra haml
require 'rubygems'
require 'sinatra'
require 'haml'
before do
# Strip the last / from the path
request.env['PATH_INFO'].gsub!(/\/$/, '')
end
get '' do
@dtolj
dtolj / gist:993640
Created May 26, 2011 17:57
watir-webdriver
[dtolj@webtest]/var/www/html $ cat ~dtolj/out.txt [13:57:13]
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:1171 - no such file to load -- rubygems/defaults/operating_system
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:50 - no such file to load -- Win32API
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- selenium-webdriver
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- Win32API
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- Win32API
Exception `NoMethodError' at /usr/local/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -
@dtolj
dtolj / gist:993609
Created May 26, 2011 17:48
watir-webdriver
{:extension=>:webdriver}
{"app.update.enabled"=>"false"}
{"browser.link.open_newwindow"=>"2"}
{"browser.shell.checkDefaultBrowser"=>"false"}
{"extensions.update.enabled"=>"false"}
{"security.warn_entering_secure.show_once"=>"false"}
{"webdriver_assume_untrusted_issuer"=>true}
{"startup.homepage_welcome_url"=>"\"about:blank\""}
{"browser.tabs.warnOnClose"=>"false"}
{"extensions.update.notifyUser"=>"false"}
@dtolj
dtolj / gist:993606
Created May 26, 2011 17:44
watir-webdriver
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:1171 - no such file to load -- rubygems/defaults/operating_system
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:50 - no such file to load -- Win32API
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- watir-webdriver
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- Win32API
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- Win32API
Exception `NoMethodError' at /usr/local/lib/ruby/1.8/rational.rb:78 - undefined method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29 - no such file to load -- yajl/json_gem
Exception `LoadError' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- yajl/json_gem
Exceptio