Skip to content

Instantly share code, notes, and snippets.

@andrewmichaelsmith
andrewmichaelsmith / allocate.bash
Created July 18, 2012 19:29
EC2 Allocation Script
#!/bin/bash
# This script is used to allocate a large number of IP addresses on EC2
# and associate them with network interfaces
#
# It gets the list of network interfaces
#TODO: You don't actually need instance_id, i don't think
if [ $# -eq 0 ] ; then
#!/bin/bash
#location of https://github.com/buffer/thug/tree/master/samples on disk
samples=/var/www/thug/samples
#prefix for webserver (should end in /)
url_prefix=http://127.0.0.1/thug/samples/
#thug.py location
thug_install=/opt/thug/src/thug.py
@andrewmichaelsmith
andrewmichaelsmith / gist:3860056
Created October 9, 2012 17:02
Windows 8 Compatability View List (iecompatdata.xml)
<?xml version="1.0" encoding="utf-8" ?>
<iecompatlistdescription>
<version>1152921504606910219</version>
<ttl>1</ttl>
<ua id="IE9Custom">Mozilla/5.0 (compatible; MSIE 9.0; $PLATFORM; Trident/5.0)</ua>
<domain docMode="EmulateIE10">blogs.adobe.com</domain>
<domain docMode="EmulateIE10">job.icbc.com.cn</domain>
<domain docMode="EmulateIE10">labs.adobe.com</domain>
<domain docMode="EmulateIE10">lifestyle.aol.co.uk</domain>
<domain docMode="EmulateIE10">misc-apache.aol.co.uk</domain>
#!/usr/bin/env python
#-----------------------------------------------
# Name: fetch_cosm.py
#
# Purpose: retrieve historical hi-res data from cosm
# Usage: ./fetch_cosm.py >>cosm_data.csv
# History:
# Date Author Remarks
# 15Oct2012 RW Created.
#-----------------------------------------------
#!/usr/bin/env python
#-----------------------------------------------
# Name: fetch_cosm.py
#
# Purpose: retrieve historical hi-res data from cosm
# Usage: ./fetch_cosm.py >>cosm_data.csv
# History:
# Date Author Remarks
# 15Oct2012 RW Created.
#-----------------------------------------------
@andrewmichaelsmith
andrewmichaelsmith / gist:4658614
Last active December 11, 2015 20:58
Thug install
sudo su
apt-get update
apt-get -y upgrade
apt-get -q -y install scons libboost-dev libboost-doc libboost-all-dev autoconf shtool libtool python-pefile python-httplib2 mongodb python-pymongo python-pip git subversion make unzip
pip install cssutils
pip install chardet --upgrade #poss not required
easy_install beautifulsoup4
easy_install pymongo
@andrewmichaelsmith
andrewmichaelsmith / 000-default.conf
Last active October 27, 2015 15:54
graphite setup
# This needs to be in your server's config somewhere, probably
# the main httpd.conf
# NameVirtualHost *:80
# This line also needs to be in your server's config.
# LoadModule wsgi_module modules/mod_wsgi.so
# You need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
Creating directory /opt/local/Python-2.7.12/bin
Creating directory /opt/local/Python-2.7.12/lib
/usr/bin/install -c python /opt/local/Python-2.7.12/bin/python2.7
if test -f libpython2.7.so; then \
if test -n "" ; then \
/usr/bin/install -c -m 555 /opt/local/Python-2.7.12/bin; \
else \
/usr/bin/install -c -m 555 libpython2.7.so /opt/local/Python-2.7.12/lib/libpython2.7.so.1.0; \
if test libpython2.7.so != libpython2.7.so.1.0; then \
(cd /opt/local/Python-2.7.12/lib; ln -sf libpython2.7.so.1.0 libpython2.7.so) \
@andrewmichaelsmith
andrewmichaelsmith / GPX Analysis for Blog Post.ipynb
Created July 12, 2022 11:31
GPX analysis, including gpx to elevation profile chart
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.