Code, Strings, and Keys

    • About Thomas Powell
    • Account
    • It’s been [0] days since [program] last updated
    • Login
    • Password Reset
    • Pianist / Accompanist / Music Director Resume
    • Reading List 2025
    • Register
    • Running Gear – Shoes, Treadmill, and Bandages
    • Site Map
Illustration of a bird flying.
  • Have I appropriately professed my love for Ruby yet?

    I used to play around with Ruby a lot. Here’s another script, where I was downloading fedora ISOs and giving myself feedback as to the progress of the operation (yes, I was in cygwin also). #!/usr/bin/rubyrequire ‘net/ftp’require ‘fileutils’ftp=Net::FTP.new("ftp.linux.ncsu.edu")ftp.login("anonymous", "me@email.com")FileUtils.chdir("/cygdrive/c/downloads/fedora")files=ftp.chdir("pub/fedora/linux/core/3/i386/iso")def mecallback() print ‘filename: ‘, (File.size($fileName) * 100.0 / $fileSize), "%n"end$fileName="FC3-i386-disc3.iso"$fileSize=ftp.size($fileName)print ‘filename: ‘, $fileName, "n"ftp.getbinaryfile($fileName, $fileName, 2**20)…

    July 28, 2008
  • Ruby is so elegant

    This is a script to log in to a server via Telnet and run a single script remotely. require ‘net/telnet.rb’myserver.com = Net::Telnet::new("Host" => "myserver.com", "Timeout" => 30, "Prompt" => /[$%#] z/n)myserver.com.login("username", "password") { |c| print c }myserver.com.closemyserver.com.cmd("./check_missing.sh") { |c| print c }

    July 28, 2008
  • Morning Run Elevation Profile

    Ran this 8.2 miles in 1:12:35 (8’50” pace) this morning, slight muggy, 72’F. Ran last 2/10ths of a mile in 1:15 (6’04” pace). Legs weren’t too sluggish this morning. Not peppy either, though. Elevation Gain (ft) +415 / -418

    July 28, 2008
←Previous Page
1 … 241 242 243 244 245 … 310
Next Page→

Code, Strings, and Keys

Proudly powered by WordPress