This file contains hidden or 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 'nokogiri' | |
require 'net/http' | |
require 'date' | |
def search(freq, state) | |
h = Net::HTTP.new 'wireless2.fcc.gov', 80 | |
resp, body = h.post('/UlsApp/UlsSearch/results.jsp', "fiUlsServiceSearchByType=300&ulsTowerNum=&feqSearchType=exact&fiFrequency=#{freq}&fiLowerFrequency=&fiUpperFrequency=&fiOwnerName=&fiUlsFRN=&fiCity=&ulsState=#{state.upcase}&fiUlsZipcode=&ulsCallSign=&statusAll=Y&ulsAuthTypeAll=Y&ulsDateType=&dateSearchType=+&ulsFromDate=&ulsToDate=#{Time.now.strftime('%m/%d/%Y').gsub('/', '%2F')}&fiRowsPerPage=50&ulsSortBy=uls_l_callsign++++++++++++++++&ulsOrderBy=ASC&x=42&y=10&hiddenForm=hiddenForm&jsValidated=true&searchType=ULN", { 'Referer' => 'http://wireless2.fcc.gov/UlsApp/UlsSearch/searchSite.jsp' }) |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.postgresql.postgres</string> | |
<key>UserName</key> | |
<string>postgres</string> | |
<key>GroupName</key> | |
<string>_postgres</string> |
This file contains hidden or 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 'isaac' | |
require 'em-hiredis' | |
configure do |c| | |
c.nick = 'redisbot' | |
c.server = 'irc' | |
c.verbose = true |
This file contains hidden or 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 'rubygems' | |
require 'diff/lcs' | |
require 'diff/lcs/string' | |
require 'diff/lcs/hunk' | |
scan = [ | |
%x[nmap -nsP -oG - 192.168.1.0/24].split(/\n/).map! { |e| e.chomp }, | |
%x[nmap -nsP -oG - 192.168.1.0/24].split(/\n/).map! { |e| e.chomp } | |
] |
This file contains hidden or 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 'addressable/uri' | |
require 'json' | |
require 'yaml' | |
if ARGV.length != 1 | |
puts "#{__FILE__} /path/to/archive.har" | |
exit 1 |
This file contains hidden or 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 | |
# --- | |
# quick and dirty nagios acknowledgement bot | |
# [email protected] | |
# @oogali | |
# --- | |
# | |
# what do you need to run? | |
# - ruby 1.8+ |
This file contains hidden or 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
/* | |
* what's happening here? | |
* | |
* 1) define and pre-compile our template that our results should be rendered as | |
* 2) bind to the keydown event of the input#search text box | |
* 3) define our callback, to pull json search results every time we're executed | |
* 4) define a callback for receiving our json data, which does: | |
* a) remove all previous search results (<h3> tags) | |
* b) append our new search results to our div#results | |
* |
This file contains hidden or 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 'action_view' | |
include ActionView::Helpers::DateHelper | |
def readable(seconds) | |
case seconds | |
when 86400*3..86400*7 | |
(Time.now - seconds).strftime('%A').downcase | |
when 86400*7..86400*14 | |
'just over a week ago' |
This file contains hidden or 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 'sinatra' | |
require 'haml' | |
get '/' do | |
haml :ask | |
end |
This file contains hidden or 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 'eventmachine' | |
require 'time' | |
module TimeServer | |
def post_init | |
send_data "#{Time.now.strftime('%A, %B %e, %Y %H:%M:%S')}\n" | |
close_connection |