Skip to content

Instantly share code, notes, and snippets.

@srossross
srossross / gist:1188971
Created September 2, 2011 15:47
Template to build a stable jenkins build
#Clean everything like a brand new checkout
#Don't remove "jenkins-upstream" directory
if test -t 1 ; then
echo "stdout is a tty. Are you sure you want to continue? This operation will clean any uncommitted files."
read -p "CTRL-C to exit. Enter to continue:"
fi
git clean -dxf -e "jenkins-upstream"
#Unlink any current development d
@srossross
srossross / name
Created November 21, 2011 22:48
Test
asdfasdf
as
dfasd
fs
d
@srossross
srossross / google_search.py
Created May 31, 2012 14:53
Command Line Google Search
import urllib2
import json
import textwrap
def google_search(search_string):
google= 'http://ajax.googleapis.com/ajax/services/search'
msg = urllib2.quote(search_string)
soc = urllib2.urlopen('{google}/web?v=1.0&q={msg}'.format(google=google, msg=msg))
@srossross
srossross / pxy.js
Created April 5, 2013 12:19
Simple http-proxy cli with ssl
fs = require('fs');
// Syslog = require('node-syslog');
// Syslog.init("node-syslog", Syslog.LOG_PID | Syslog.LOG_ODELAY, Syslog.LOG_LOCAL0);
parser = require("optimist")
.alias("r", "router")
.demand("router")
.boolean('https')
.describe('https', 'Use https instead of http')
.describe('key', 'Path to keyfile (https only)')
@srossross
srossross / generate_post_url.py
Last active December 18, 2015 04:29
This is a small gist to help with signed http post uploads to amazon s3 using boto.
import boto
import requests
from datetime import datetime, timedelta
import base64
import json
import hmac
import hashlib
REQUIRED_FIELDS = 'key', 'AWSAccessKeyId', 'acl', 'success_action_status'
@srossross
srossross / redirect.sh
Last active December 19, 2015 05:09
IP Table eedirect
sudo iptables -t nat -F
sudo iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
This build is in the build queue ...
... Build popped off queue
Start build sean/libdynd_build_test 1.0 -- id:52f3ce1cf53f2a4d0d9fc031
Start build
Setting engine
conda install --quiet --yes python=2
# All requested packages already installed.
# packages in environment at /opt/anaconda:
#
python 2.7.6 1
Build 14.0 Sumitted id:530cbd35f53f2a3ebc615bb4
This build is in the build queue ...
... Build popped off queue
Start build binstar/binstar 14.0 -- id:530cbd35f53f2a3ebc615bb4
Start build
Setting engine
conda create -n install --quiet --yes python=2
Package plan for installation in environment /opt/anaconda/envs/install:
@srossross
srossross / gist:9282190
Created February 28, 2014 23:32
publish error npm v1.3.8
mr_chomps:express-blueprints sean$ npm publish
npm http PUT https://registry.npmjs.org/express-blueprints
npm http 503 https://registry.npmjs.org/express-blueprints
npm ERR! registry error parsing json
npm http PUT https://registry.npmjs.org/express-blueprints
^Cmr_chomps:express-blueprints sean$ npm publish
npm http PUT https://registry.npmjs.org/express-blueprints
npm http 201 https://registry.npmjs.org/express-blueprints
npm http GET https://registry.npmjs.org/express-blueprints
npm http 200 https://registry.npmjs.org/express-blueprints
@srossross
srossross / gist:9282214
Created February 28, 2014 23:34
publish error npm v1.4.4
mr_chomps:express-blueprints sean$ npm publish
npm http PUT https://registry.npmjs.org/express-blueprints
npm http 403 https://registry.npmjs.org/express-blueprints
npm ERR! publish Failed PUT 403
npm ERR! Error: forbidden Cannot replace previously published version: 0.0.1: express-blueprints
npm ERR! at RegClient.<anonymous> (/Users/sean/anaconda/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:237:14)
npm ERR! at Request.self.callback (/Users/sean/anaconda/lib/node_modules/npm/node_modules/request/request.js:123:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (/Users/sean/anaconda/lib/node_modules/npm/node_modules/request/request.js:893:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)