Skip to content

Instantly share code, notes, and snippets.

View harperreed's full-sized avatar

Harper Reed harperreed

View GitHub Profile
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@harperreed
harperreed / mdp
Created March 29, 2011 03:52
markdown preview (for osx)
#!/bin/bash
#
# Displays a preview of the markdown file passed in using rdiscount
# https://github.com/ryankanno/scripts/blob/master/mdp
# Set Markdown file
MARKDOWN_FILE=$1
# Redirect rdiscount to temp file
rdiscount ${MARKDOWN_FILE} > /tmp/mdp_preview.html
@harperreed
harperreed / authors.sh
Created April 4, 2011 04:00
A simple bundle of scripts to migrate from svn to git for instance: your repo path is: /trunk/app/vendors/ you would do: sh strip_svn.sh svn.dump trunk/app/vendors vendors.dump this would create a dump file called vendors that is just the comm
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
done
@harperreed
harperreed / fix_appengine_permissions.sh
Created April 10, 2011 05:18
fix appengine dir permissions after upgrading
sudo chmod 755 -R /usr/local/google_appengine
@harperreed
harperreed / startups_need.md
Created April 25, 2011 16:54
Things startups do and don’t need

#Things startups do and don’t need

Initial list ripped from Chris Dixon's Things startups do and don’t need. I thought it would be good to place this list in a place that could be community editable/forkable/maintainable.
Gist here

###Things startups do need

  • Sunny office
  • Windows that open
  • Democratically controlled music system
Harper@nata2.org's Geekcode
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d--- s+:-- a-- C++++ UL++++ P++ W+++ N+ PS+++ PE+ Y++ PGP !tv b++++
e++ h r++ z?
------END GEEK CODE BLOCK------
@harperreed
harperreed / mem_use_by_process.sh
Created May 10, 2011 20:07
show memory usage by process
ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr
@harperreed
harperreed / gist:992586
Created May 26, 2011 05:07
List of Emoji from softbank
https://creation.mb.softbank.jp/images/c15-F76.gif
https://creation.mb.softbank.jp/images/c15-F77.gif
https://creation.mb.softbank.jp/web/images/c15-F75.gif
https://creation.mb.softbank.jp/web/img/E001/E001_20.gif
https://creation.mb.softbank.jp/web/img/E001/E002_20.gif
https://creation.mb.softbank.jp/web/img/E001/E003_20.gif
https://creation.mb.softbank.jp/web/img/E001/E004_20.gif
https://creation.mb.softbank.jp/web/img/E001/E005_20.gif
https://creation.mb.softbank.jp/web/img/E001/E006_20.gif
https://creation.mb.softbank.jp/web/img/E001/E007_20.gif
@harperreed
harperreed / aws_usage.py
Created September 12, 2011 19:29 — forked from noneal/aws_usage.py
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@harperreed
harperreed / migrate_gh.sh
Created October 23, 2011 06:02
Migrate to bitbucket from github and svn (springloops)
base_dir=$(pwd)
repo_name=$1
old_git_url="git@github.com:harperreed/$repo_name.git"
git_url="git@bitbucket.org:harper/$repo_name.git"
git clone $old_git_url
cd $repo_name
git remote rm origin
git remote add origin $git_url
git push origin master