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
# Grab a password out of the 1Password keychain...finding it by "name" | |
def password_for_hostname(name) | |
password_info = `security 2>&1 >/dev/null find-generic-password -gs passwords.Password:#{name} 1Password.keychain` | |
password = password_info.match(/\"\:\"(.+)\"\}\"/)[1] rescue nil | |
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 | |
# The script that give you focus! | |
# Create a text file that contains sites want to give yourself | |
# access to only during certain times of day. | |
# | |
# The file will look like this: | |
# 12 news.ycombinator.com | |
# 11-13,19-21 twitter.com | |
# |
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
# this goes in the $HOME dir | |
# needs mislav-rspactor v0.3.2 and RSpec 1.2 | |
Rspactor::Runner.class_eval do | |
class << self | |
alias old_formatter_opts formatter_opts | |
def formatter_opts | |
# update this path to where you saved unicode_formatter.rb | |
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter" | |
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
# Monitor HTTP requests being made from your machine with a one-liner.. | |
# Replace "en1" below with your network interface's name (usually en0 or en1) | |
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
# (again replace "en1" with correct network interface name) | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
# All the above tested only on OS X. |
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
# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp | |
# http://d.hatena.ne.jp/zorio/20060416 | |
require "openssl" | |
require "net/smtp" | |
Net::SMTP.class_eval do | |
private | |
def do_start(helodomain, user, secret, authtype) | |
raise IOError, 'SMTP session already started' if @started |
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
# I know there are 80 issues associated with this project | |
page_one = RedmineClient::Issue.find(:all, :params => { :project_id => @project_id, :page => 1 } ) | |
# returns 1st 25 records | |
page_five = RedmineClient::Issue.find(:all, :params => { :project_id => @project_id, :page => 5 }) | |
# returns 1st 25 records |
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 'rubygems' | |
require 'active_resource' | |
require 'redmine_client' | |
require 'pivotal-tracker' | |
require 'yaml' | |
ActiveResource::Base.logger = Logger.new(STDOUT) | |
ActiveResource::Base.logger.level = Logger::DEBUG |
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/sh | |
aptitude update | |
aptitude safe-upgrade -y | |
apitude install ruby-full git-core mysql-server mysql-client apache2-mpm-worker libmysql-ruby -y | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz | |
tar xzvf rubygems-1.3.7.tgz | |
cd rubygems-1.3.7 |
OlderNewer