Skip to content

Instantly share code, notes, and snippets.

View flotwig's full-sized avatar

Zach Bloomquist flotwig

View GitHub Profile
@flotwig
flotwig / rando.rb
Created July 29, 2014 23:07
irc.snoonet.org ##random
require 'cinch'
require 'open-uri'
require 'json'
require 'date'
class Rando
include Cinch::Plugin
match /raw (.+)/, method: :do_raw
match /refresh/, method: :do_refresh
match /index/, method: :do_index_get
match /index (.+)/, method: :do_index_set
#!/usr/bin/env ruby
# encoding: UTF-8
require 'snoo'
reddit = Snoo::Client.new :useragent => '/u/flotwig - Responds to "It is known." with "It is known." http://l.t.tl/1q'
reddit.log_in 'KhaleesiServantGirl', ''
debug = false
latest_id = 0
def base10_reddit_id(base36_id)
return base36_id.split('_',2).last.to_i(36)
end
@flotwig
flotwig / zncmakepem.sh
Created May 8, 2014 20:37
Make a .pem for ZNC
# because i keep forgetting
rm znc.pem
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 3650 -nodes
cat key.pem > znc.pem
cat cert.pem >> znc.pem