This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'sequel' | |
require 'pp' | |
# script to copy data from my old, non-Rails postgres DB to my new rails DB. | |
# | |
# The DB has users, which have a number of Lists. | |
# And Lists, which have a number of Items. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def runcmd(cmd) | |
pid = Process.spawn(cmd) | |
Process.wait(pid) | |
unless ( $?.exited? && $?.exitstatus == 0 ) | |
raise "oh noes" | |
end | |
$?.exitstatus | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# | |
# git-start.rb | |
# | |
# Quick-and-dirty utility to initialize a new git repo in the current | |
# directory, add all existing files and make an initial commit with message | |
# 'Initial commit'. | |
# | |
# Saves a few seconds here and there. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#<TradeAPI:0x007fd9143fc6c8 @key="YOUR-API-KEY", @secret="YOUR-SECRET-KEY"> | |
#<TradeAPI:0x007fd9144134e0 @key="MY-OTHER-API-KEY", @secret="MY-OTHER-SECRET-KEY"> | |
#<TradeAPI:0x007fd9144129a0 @key="Master key!", @secret="Super S33krit"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# This is for Mac OSX only. | |
# ============================================= | |
# explanation of arguments used with 'tcpdump': | |
# ============================================= | |
# -y IEEE802_11_RADIO => makes it capture __WIFI__ packets, turns resultant file | |
# into a dump which can be read by aircrack-ng, etc. | |
# | |
# -I => puts interface into monitor mode (required to capture packets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
depth=1 /C=US/O=GeoTrust, Inc./CN=RapidSSL CA | |
verify error:num=20:unable to get local issuer certificate | |
verify return:0 | |
CONNECTED(00000003) | |
OCSP response: no response sent | |
--- | |
Certificate chain | |
0 s:/serialNumber=RRAXldgzDrRZWQpGo6FHdTHV3qwvwXtD/OU=GT35895174/OU=See www.rapidssl.com/resources/cps (c)13/OU=Domain Control Validated - RapidSSL(R)/CN=*.rubygems.org | |
i:/C=US/O=GeoTrust, Inc./CN=RapidSSL CA | |
-----BEGIN CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
class TradeAPI | |
attr_accessor :key | |
attr_accessor :secret | |
def initialize(key, secret) | |
@key = key | |
@secret = secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'bigdecimal' | |
require 'bigdecimal/util' | |
require 'ap' | |
require 'pp' | |
def text_to_number(text) | |
val = text.dup | |
val.gsub!(/\s+/, '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
require 'pp' | |
def get_stats(archive_name) | |
cmd = "sudo tarsnap --print-stats -f #{archive_name}" | |
stats = run_cmd(cmd)[3,4] | |
end | |
def get_uniq_comp_size(stats) | |
stats.last.split(/\s+/)[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'whois' | |
require 'date' | |
require 'time' | |
require 'pp' | |
require 'awesome_print' | |
class Chequer | |
def initialize |
OlderNewer