Skip to content

Instantly share code, notes, and snippets.

View icco's full-sized avatar
🏠
Working from home

Nat Welch icco

🏠
Working from home
View GitHub Profile
@icco
icco / gist:115279
Created May 21, 2009 04:41
Word count a web page with python
#!/usr/bin/python
import httplib
import httplibfrom operator import itemgetter
import re
def get_webpage(site,page):
conn = httplib.HTTPConnection(site)
conn.request("GET", page)
rd = conn.getresponse()
print rd.status, rd.reason
@icco
icco / license
Created November 16, 2010 19:50 — forked from defunkt/license
MIT License Gist
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Nathaniel Welch
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@icco
icco / httpbin.sh
Created March 3, 2018 19:28
A quick load throw at httpbin
#! /bin/bash
# Requires https://github.com/rakyll/hey
curl -sL https://httpbin-cabotage.cmh1.psfhosted.org/ | sed -n 's/.*href="\/\([^"]*\).*/\1/p' | xargs -L 1 $GOPATH/bin/hey https://httpbin-cabotage.cmh1.psfhosted.org
@icco
icco / gravatar.sh
Created March 12, 2011 20:24
A bash script to dl and save your gravatar
#!/usr/bin/env bash
# Given an email, get the associated gravatar and put it in the users ~/.face file.
EMAIL='nat@natwelch.com'
# Size in pixels you want, must be less than 512
SIZE='256'
HASH=`echo -n $EMAIL | awk '{print tolower($0)}' | tr -d '\n ' | md5sum --text | tr -d '\- '`
URL="http://www.gravatar.com/avatar/$HASH?s=$SIZE&d=404"
@icco
icco / Gemfile
Created September 13, 2017 15:59 — forked from miketheman/clouddns_to_route53.rb
Tool to migrate DNS records from Rackspace Cloud DNS to AWS Route53
source 'https://rubygems.org'
ruby '2.4.0'
gem "fog-aws"
gem "fog-rackspace"
gem "aws-sdk"
gem "pry"

Keybase proof

I hereby claim:

  • I am icco on github.
  • I am icco (https://keybase.io/icco) on keybase.
  • I have a public key whose fingerprint is 27E1 EC35 A2C3 8223 7909 4DB5 A931 B605 C4EE F77F

To claim this, I am signing this object:

@icco
icco / Gemfile
Last active January 4, 2016 23:06
source 'https://rubygems.org'
ruby '2.3.0'
gem 'fog'
gem 'fog-google', git: 'https://github.com/icco/fog-google', branch: 'new_storage_api'
gem 'google-api-client'
gem 'net-ssh'
@icco
icco / table.out
Last active January 2, 2016 18:59
# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 52426752, Id=83
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
sed -i 's/^# d/d/g' /etc/apt/sources.list
apt-get update
apt-get -y install aptitude vim git make curl software-properties-common dnsutils
aptitude update && sudo DEBIAN_FRONTEND=noninteractive aptitude -y upgrade
aptitude -y install build-essential libssl-dev libdb4.8++-dev libdb4.8-dev libboost1.37-dev libminiupnpc-dev
git clone https://github.com/bobsomers/ANDREWCHANcoin.git /coin
cd /coin/src; make -f makefile.unix
#! /usr/bin/env ruby
require 'fog'
connection = Fog::Compute.new({ :provider => "DigitalOcean" })
p connection.servers
server = connection.servers.bootstrap({
:name => 'fuck',