Skip to content

Instantly share code, notes, and snippets.

View mstyne's full-sized avatar
🐍
Improving my Python skills

Michael Styne mstyne

🐍
Improving my Python skills
View GitHub Profile
@mstyne
mstyne / gist:2226465
Created March 28, 2012 14:08
cloudstuck usage job
cloud 1824 2.9 1.3 3577596 109224 ? Sl 10:04 0:04 \_ java -cp /usr/share/java/commons-collections.jar:/usr/share/java/commons-dbcp.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-logging-api.jar:/usr/share/java/commons-pool.jar:/usr/share/java/commons-httpclient.jar:/usr/share/java/ws-commons-util.jar:/usr/share/java/jnetpcap.jar:/usr/share/java/tomcat6-servlet-2.5-api.jar:/usr/share/java/tomcat6-el-2.1-api-6.0.24.jar:/usr/share/java/tomcat6-jsp-2.1-api-6.0.24.jar:/usr/share/java/cloud-google-gson-1.7.1.jar:/usr/share/java/vmware-vim25.jar:/usr/share/java/cloud-backport-util-concurrent-3.0.jar:/usr/share/java/cloud-servlet-api.jar:/usr/share/java/cloud-xenserver-5.6.100-1.jar:/usr/share/java/cloud-mysql-connector-java-5.1.7-bin.jar:/usr/share/java/cloud-iControl.jar:/usr/share/java/vmware-apputils.jar:/usr/share/java/vmware-vim.jar:/usr/share/java/cloud-commons-pool-1.5.6.jar:/usr/share/java/cloud-axis.jar:/usr/share/java/cloud-bcprov-jdk16-1.45.jar:/usr/share/java/cloud-common
@mstyne
mstyne / gist:2230892
Created March 28, 2012 21:52
couch view... relax
function(doc) {
if (doc.hasOwnProperty('iso_timestamp')) {
var then = new Date(doc.iso_timestamp),
now = new Date(),
diff = now - then;
//if (diff > 60) {
emit(doc.instance_url,then);
//}
} else {
emit(doc.instance_url);
@mstyne
mstyne / gist:2238389
Created March 29, 2012 15:17
couchdb wheezy
root@mail:/etc/apt# aptitude install couchdb/wheezy
The following NEW packages will be installed:
erlang-asn1{a} erlang-eunit{a} libffi5{a} libicu48{a} libjs-jquery-form{a} libmozjs10d{a} libssl1.0.0{a}
libtinfo5{a} multiarch-support{a}
The following packages will be upgraded:
couchdb erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-public-key erlang-runtime-tools
erlang-ssl erlang-syntax-tools erlang-tools erlang-webtool erlang-xmerl
12 packages upgraded, 9 newly installed, 0 to remove and 353 not upgraded.
Need to get 26.6 MB of archives. After unpacking 30.3 MB will be used.
Do you want to continue? [Y/n/?]
@mstyne
mstyne / gist:2279151
Created April 1, 2012 22:29
nginx uwsgi django benchmark
Server Software: nginx/1.0.14
Server Hostname: <snip>
Server Port: 80
Document Path: /sats/
Document Length: 504 bytes
Concurrency Level: 20
Time taken for tests: 4.149 seconds
Complete requests: 800
cPanel Log and Bandwidth Processor Up
cPanel DAV Daemon Up
cPanel Dns Admin Cache Up
service_dnsadmin_pretty_name Up
@mstyne
mstyne / gist:2312284
Created April 5, 2012 16:18
httpd wtf
# httpd -h
Usage: httpd [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
@mstyne
mstyne / gist:2406269
Created April 17, 2012 14:25
Bogus aprs.fi api script
#!/usr/bin/env python
import httplib
import json
# import socket
import sys
import time
apikey = 'XXX'
apiurl = 'api.aprs.fi'
@mstyne
mstyne / gist:2466996
Created April 22, 2012 21:19
ESPN API: Way more than just Mets headlines
{
"status": "success",
"timestamp": "2012-04-22T21:14:55Z",
"resultsCount": 9,
"resultsLimit": 10,
"headlines": [
{
"story": "",
"premium": false,
"description": "Tim Lincecum is getting an extra day to try to turn around possibly the worst stretch of his career.",
@mstyne
mstyne / gist:2475819
Created April 24, 2012 02:57
Simple ESPN Headlines API call - New York Mets
#!/usr/bin/env python
import httplib
import json
# import socket
import pprint
import sys
apikey = 'XXX'
apiurl = 'api.espn.com'
@mstyne
mstyne / gist:2590719
Created May 4, 2012 00:37
disclaimer
$ ./build-gnuradio
This script will install Gnu Radio from current GIT sources
You will require Internet access from the computer on which this
script runs. You will also require SUDO access. You will require
approximately 500MB of free disk space to perform the build.
This script will, as a side-effect, remove any existing Gnu Radio
installation that was installed from your Linux distribution packages.
It must do this to prevent problems due to interference between
a linux-distribution-installed Gnu Radio/UHD and one installed from GIT source.