Skip to content

Instantly share code, notes, and snippets.

View ransford's full-sized avatar

Ben Ransford ransford

View GitHub Profile
#!/usr/bin/env python3
import sys
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
class Scream(Protocol):
flag = b'123'
#!/usr/bin/env python
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
class Scream(Protocol):
version = b'123'
def dataReceived(self, data):
self.transport.write(b'AAAAAAAA' + self.version)

Keybase proof

I hereby claim:

  • I am ransford on github.
  • I am br (https://keybase.io/br) on keybase.
  • I have a public key whose fingerprint is F253 6003 BB22 5730 4D1B 8B90 8AC4 4C35 9B83 1EC3

To claim this, I am signing this object:

@ransford
ransford / mailv.go
Created September 9, 2016 22:42
email verify in go
/* Run like:
go run <host> <address>
*/
package main
import (
"fmt"
"net/smtp"
"os"
#!/usr/bin/env python
"""Quickly and dirtily get JBoss X-Powered-By header contents
from the Censys API.
Usage: python censys_jboss.py > censys_jboss.txt"""
import os
import sys
import json
import requests

Keybase proof

I hereby claim:

  • I am ransford on github.
  • I am br (https://keybase.io/br) on keybase.
  • I have a public key whose fingerprint is 4C62 4DF3 9567 B72F 5707 3DE8 8815 4C93 AE2C 1118

To claim this, I am signing this object:

@ransford
ransford / multtable.py
Last active December 20, 2015 20:38
multiplication table maker
#!/usr/bin/env python
from __future__ import print_function
MAX = 20 # this many rows and columns
xs = range(1, MAX+1)
print("""
<html>
<head>
<style type="text/css">
@ransford
ransford / gist:3122423
Created July 16, 2012 12:26
Global earthquake map in 11 lines of R
library(maps)
library(ggplot2)
eqs7day.M1 <-
read.csv("http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M1.txt")
world = as.data.frame(map("world")[c("x","y")])
newmap <- qplot(x, y, data=world, geom="path",
xlab="Latitude", ylab="Longitude",
main=paste("Earthquakes", Sys.Date()-8, "to", Sys.Date()-1)) +
geom_point(data=eqs7day.M1,
aes(x=Lon, y=Lat, size=Magnitude,