9thport ruby, rails, sysadmin, os x, and other stuff

28Nov/080

spinny thing v2

spinny thing v2

I made this image a long time ago in the Core Image Fun House program that comes with the developer tools on Mac OSX. The finished product really shocked me as how you can really make some cool stuff in there, but if I had only tracked my progress along the way, I would be able to make more images just like this. So, lesson learned here: write down how to do stuff when things start looking cool.

Filed under: Photos No Comments
26Nov/080

stepping through dates with ruby

When I wanted to download all of my transactions from my bank, they put a limit of how many transactions I can download. This was frustrating because the limit has been set to be 90 days between the start date and the end date.

I could have done this by hand, but I wanted to push myself to learn how to do it in ruby. After reading the api on ruby about the date.rb class, I came up with my own method to calculate dates:

#!/usr/bin/env ruby

require 'date'

def print_sundays(d1, d2)
  d1 +=1 while (d1.wday != 0)
  d1.step(d2, 7) do |date|
    puts "#{Date::MONTHNAMES[date.mon]} #{date.day}"
  end
end

# print every sunday between 2001,1,1 and 2008,11,26
print_sundays(Date::civil(2001, 1, 1), Date::civil(2008, 11, 26))

def print_next_x_days(s1, e1, x)
  s1.step(e1, x) do |date|
    puts "#{date.year} #{Date::MONTHNAMES[date.mon]} #{date.day}"
  end
end

# after 2001,1,1 print the date after 89 days until 2008,11,26
print_next_x_days(Date::civil(2001, 1, 1), Date::civil(2008, 11, 26), 89)

Filed under: Programming No Comments
19Nov/080

megaman math

If math was like this when I was growing up, I would have aced all the tests.

259v1af.jpg (JPEG Image, 1023x738 pixels)

Filed under: Fun No Comments
19Nov/080

network visualizations with skyrails

While browsing around the net looking for information about linux iptable firewalls, I stubled upon this video and was amazed. Beautiful piano as well:

Filed under: Fun, Tech No Comments
13Nov/080

Make Any Linux Directory into an ISO File [Terminal Tip]

I like stuff like this so I figured I would write it down here for later reference. Making iso's are helpful because not only are you able to make a cdrom out of them, I find they are great for storage as well. I think there is a big need for a backup application that makes isos for you automatically. Then you got a nice workflow for moving them off to physical media when your storage volume starts to get full.

Linux newbies might appreciate knowing that you need no software app to create burn-able CD images of a particular directory on your system. One terminal command mkisofs -V LABEL -r DIRECTORY | gzip > cdrom.iso.gz creates a compressed ISO for easy backup (replace the italicized sections with your CD label and directory, of course).