Skip to content

Instantly share code, notes, and snippets.

@crosson
crosson / ssh.rb
Last active December 17, 2015 02:19
Tool I use to log into cisco or F5 devices.
require 'rubygems'
require 'net/ssh'
require 'net/ssh/telnet'
class SSH
attr_accessor :errors
def initialize(creds)
begin
@ssh_session = Net::SSH.start(creds[:host], creds[:user], :password => creds[:password], :keys => [])
@crosson
crosson / delay_mail.rb
Last active December 10, 2015 17:48 — forked from anonymous/delay_mail.rb
This was a script I wrote to send delayed emails from macmail. The script is run in a cron every 15 minutes The script checks for items in the Mail draft folder that have a [SEND@XYZ] tag. For example, [SEND@16:00] The script checks if a drafted emails SEND@ tag matches or is near the current time. If so a new email is drafted, See step 4. The n…
#!/usr/local/bin/macruby
framework 'ScriptingBridge'
ACCOUNT = "AccountName"
DAY = Time.now.day
MONTH = Time.now.month
YEAR = Time.now.year
CURRENT_TIME = ((Time.now - 150)..(Time.now + 300))
@crosson
crosson / binary_counter.rb
Last active December 10, 2015 14:18
Learning how to use the Arduino with the Dino gem. This is the start of a binary counter. Maybe will eventually become a binary clock. I only wired up 3 LEDS so I could only count to 7 in this example.
require 'dino'
def new_led(pin, board = BOARD)
Dino::Components::Led.new(:pin => pin, :board => board)
end
BOARD = Dino::Board.new(Dino::TxRx.new)
LEDS = [13, 12, 11, 10, 9].map do |pin|
new_led pin
end