Skip to content

Instantly share code, notes, and snippets.

View godber's full-sized avatar
😺

Austin Godber godber

😺
View GitHub Profile
*~
*.pyc
.vagrant
venv
@godber
godber / gist:5457672
Created April 25, 2013 05:24
Network latency to Slashdot from Tempe, AZ on CenturyLink DSL
# From Tempe, AZ (85282) via CenturyLink DSL (far from the central office)
$ ping slashdot.org -c 10 -q
PING slashdot.org (216.34.181.45) 56(84) bytes of data.
--- slashdot.org ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9008ms
rtt min/avg/max/mdev = 88.883/245.249/302.170/86.343 ms
$ traceroute slashdot.org
@godber
godber / gist:5777861
Last active December 18, 2015 11:48
A Salt SLS Module for managing a per host /etc/salt/minion.d/grains.conf file based on matching host IDs. If there is a host.conf file, that will be used, if not, then default.conf will be used.
salt-minion:
pkg:
- installed
service:
- running
- require:
- pkg: salt-minion
- watch:
- file: /etc/salt/minion.d/grains.conf
@godber
godber / gist:5864201
Created June 26, 2013 02:07
Assignment via the pandas attribute accessor does not appear to work in Pandas 0.11. Should it?
phxtemps2
# <class 'pandas.core.frame.DataFrame'>
# DatetimeIndex: 14596 entries, 1973-01-01 00:00:00 to 2012-12-31 00:00:00
# Data columns (total 2 columns):
# highs 14596 non-null values
# lows 14596 non-null values
# dtypes: float64(2)
# happy
phxtemps2['diff'] = phxtemps2.highs - phxtemps2.lows
@godber
godber / example2.py
Last active December 19, 2015 10:28
Comparing Winter 2013 PHX Temperatures to the 40 year average using Python Pandas and GSOD (https://www.ncdc.noaa.gov/cgi-bin/res40.pl) data.
#!/usr/bin/env python
import pandas as pd
import matplotlib.pyplot as plt
# Read in the CSV Temperature data retrieved from Global Surface Summary of Day
# https://www.ncdc.noaa.gov/cgi-bin/res40.pl
temps = pd.read_csv('phx-temps.csv', index_col=0,
names=['highs', 'lows'],
parse_dates=True)
#!/bin/bash
set -e
cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -zxf mysql-5.1.65.tar.gz
cd mysql-5.1.65
./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
@godber
godber / gist:6986452
Created October 15, 2013 04:24
logstash error
godber@monk:~/temp/logstash$ java -jar logstash-1.2.1-flatjar.jar agent -f apache-elasticsearch.conf -- web
Using milestone 2 input plugin 'tcp'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.2.1/plugin-milestones {:level=>:warn}
You are using a deprecated config setting "type" set in grok. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. You can achieve this same behavior with the new conditionals, like: `if [type] == "sometype" { grok { ... } }`. If you have any questions about this, please visit the #logstash channel on freenode irc. {:name=>"type", :plugin=><LogStash::Filters::Grok --->, :level=>:warn}
You are using a deprecated config setting "pattern" set in grok. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. If you have any questions about this, please visit the #logstash channel on fr
@godber
godber / label.py
Last active December 26, 2015 05:39
#!/usr/bin/env python
"""
Sample of parsing PDS Labels into an OrderedDict
"""
from collections import OrderedDict
def parse_label(pds_file):
# iPython Notebook with per-user storage and config
#
# Based on crosbymichael/ipython
# Creates a Docker image with IPython Notebook installed.
#
# It expects to be run like this:
#
# docker run -v /home/eduard/notebooks/eduard:/notebooks benthoo/ipython-user
#
# You provide a folder per user on the host system. This folder will hold the users notebooks and also needs to contain the
@godber
godber / AUTHORS
Last active July 4, 2023 13:21
pdfinfo - A simple python wrapper of the pdfinfo command line tool.
Austin Godber - [email protected]