Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# 'one liner' to parse the pingdom rss feed and generate a list of IP's sutable for use in an nginx configuration file.
curl -s https://www.pingdom.com/rss/probe_servers.xml|perl -ne 'next unless$_=~/>(I[^<]+)/;$i=$1;$i=~s/: /"=>"/g;$i=~s/; /","/g;%h=%{eval qq{{"$i"};}};print qq{ $h{IP}/32 "yes"; #$h{Hostname} $h{City}, $h{Country}\n};'|tr \" \'
def ip_to_netblock(ip)
reverse_ip = ip.split('.').reverse.join('.')
lookup = `dig +short #{reverse_ip}.origin.asn.cymru.com TXT`
lookup.chomp.gsub('"','').split(' | ')[1]
end
#!/usr/bin/env ruby
#
# tail-http.rb - "tail -f" for the web
#
# Uses range requests where available.
#
# Usage: $ ruby tail-http.rb 'http://logserver.dom/logs/logfile'
require 'uri'
require 'stringio'
-- After following the directions here: http://dev.mysql.com/doc/refman/5.0/en/secure-create-certs.html
-- Create a client certificate with a subject of 'USER1'
-- then use the command below to grant the barer of that
-- certificate the ability to log in as 'joel'
GRANT USAGE ON *.* TO 'joel'@'localhost' IDENTIFIED BY '' REQUIRE SUBJECT '/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=USER1';
$ ./profile github.com
Fetching data for github.com: DNS Whois SSL ...
==========[ github.com ]==========
Web Hosting:
(HERAKLES LLC)
65.74.177.129
DNS Hosting:
joel@joel-vm:~$ pgpdump example-public
Old: Public Key Packet(tag 6)(418 bytes)
Ver 4 - new
Public key creation time - Sat Aug 15 20:33:24 PDT 2009
Pub alg - DSA Digital Signature Algorithm(pub 17)
DSA p(1024 bits) - ...
DSA q(160 bits) - ...
DSA g(1017 bits) - ...
DSA y(1023 bits) - ...
Old: User ID Packet(tag 13)(49 bytes)
$ ./profile verticalresponse.com
Fetching data for verticalresponse.com: DNS Whois SSL ...
==========[ verticalresponse.com ]==========
Web Hosting:
(Unitedlayer, Inc.)
207.7.157.206
DNS Hosting:
curl -i -F 'photo=@cat.jpg' -F 'key=value' http://www.postbin.org/path
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var g;
$(document).ready(function(){
$.getJSON("http://jsonip.nfshost.com/ip/?callback=?",
@jpf
jpf / dna.rb
Created February 17, 2010 08:18
#!/usr/bin/env ruby
require 'rubygems'
require 'xmlsimple'
require 'open-uri'
require 'sinatra'
url = 'http://www.dnalounge.com/calendar/dnalounge.rss'
c = ''