Skip to content

Instantly share code, notes, and snippets.

View psi's full-sized avatar

JD Harrington psi

  • Philadelphia, PA
View GitHub Profile
@psi
psi / shit_talk.coffee
Created October 25, 2011 23:15
Make Hubot talk shit.
# Make Hubot talk shit.
module.exports = (robot) ->
robot.hear /(fuck you|fuck off|shut up)/i, (msg) ->
incoming_msg = msg.message
if incoming_msg.text.match ///#{robot.name}///i
diss = msg.match[1]
if diss != "fuck you"
current_dir = Dir.pwd
until current_dir == ENV['HOME']
if File.exist?("#{current_dir}/.irbrc")
load "#{current_dir}/.irbrc"
break
else
current_dir = File.dirname(current_dir)
end
end
@psi
psi / amazon-linux.erb
Created July 6, 2012 19:56
My custom Chef bootstrap for Amazon Linux
bash -c '
<% if ENV['ROLES'].split(",").size > 1 %>
HOSTNAME_PREFIX=box
<% else %>
HOSTNAME_PREFIX=<%= ENV['ROLES'].gsub('_', '-') %>
<% end %>
yum upgrade -y
yum install -y gcc gcc-c++ make zlib-devel openssl-devel patch readline-devel
blah
test
# Hubot likes popcorn
#
# brb, making popcorn
module.exports = (robot) ->
robot.hear /popcorn/i, (msg) ->
msg.send "http://gnarld.com/wp-content/uploads/2011/07/Micheal-Jackson-Thriller-Popcorn-Animated.gif"
~ % dig twentyfourhourpartypeople.com
; <<>> DiG 9.8.3-P1 <<>> twentyfourhourpartypeople.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32736
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;twentyfourhourpartypeople.com. IN A
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support'
if ARGV.empty?
puts "Usage: ./bin/crypt [password]"
exit
end
password = ARGV[0]
stuff
stuff