Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@rgbkrk
rgbkrk / nodemirror.py
Last active April 18, 2016 20:24
Just a quick way to mirror node's dist/ directory for nvm.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Wrote this very fast to quickly mirror nodejs's dist directory, which nvm
(the node version manager) uses to pull releases of node.
If nodejs.org provided rsync access (or other means), I would have
just mirrored it that way.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / self
Created September 5, 2013 21:42
.Cft1ftLG8@@@@@@@@@@@@Ct11ii1tfCfffLLLCCGG00008888888@@@@@@@88800GGCLCLfftfffttttLG@@@@@@@@@@@@@@@@@@@8G.
fLfftt. G8@@@@@@@@@@0fi;:;ii1tftttttfffLCCCCGGG000808888800GGCCCLffffttftttttt11i11tLC8@@@@@@@@@@@@@@@@@Ci
tL ;8@@@@@@@@@8L1;::::;;;;iii111tttfffLLLLCCCCG00880GCCCCLLftttttt11111111iiiiiii1tfG0@@@@@@@@@@@@@@@L tLCLGGfG
1ff. 1G@@@@@@@8Gt:,:,,::::;;iii;ii1ttttftffffLLLCC0CLfLLLLLLLLffttt11111ii11;;;;;;ii11tfC8@@@@@@@@@@@@@@f ,LLCCCC:fi.:i
ttL, ,f8@@@@@8Gf1:,,,,,:::::;;;i1ftttttttttfftfffGfffffttttt1111111iiiiiiiit1i;;;;:;;iii1tLG@@@@@@@@@@@@@@L1;,;tLG0CC;0;.
CCf t1f .:C@@@@@8GL1:,,.,.,,::::::::;LCtiiii111tfffCfffffffft1111111iiiiiii;;;;;;:::;;;::;;;iitfG@@@@@@@@@@@@@0L;i. .;f08@@@8
G; t1tt,10@@@@8Lf;:,,.
@rgbkrk
rgbkrk / pyscratch.bash
Last active December 22, 2015 18:09
Python scientific tools from scratch on a mac
# This was the order I installed things for a working scientific computing environment on my Mac.
brew install python
pip install virtualenv virtualenvwrapper
# Also add these to your ~/.bash_profile:
export PATH=/usr/local/bin:/usr/bin:$PATH
source /usr/local/bin/virtualenvwrapper.sh
# Not necessary, but quite nice
@rgbkrk
rgbkrk / super_arrow.py
Last active December 22, 2015 23:29
Super duper arrow printing app. Webscale.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Super duper arrow printing app, inspired by
http://stackoverflow.com/questions/18778266/image-making-in-python
Example run:
@rgbkrk
rgbkrk / clipkey
Last active December 23, 2015 07:19
clip to key
#!/bin/sh
#
# Take a clipboard saved Server Private Key from Rackspace's deployment panel, clean it up.
#
# Requires OS X. Hipster jeans optional.
#
# Usage:
# clipkey ~/key
#
# Takes whatever is in your clipboard, puts it in the file specified as the first argument,
@rgbkrk
rgbkrk / stdout
Created October 10, 2013 19:51
logstash + salt could be friends
[DEBUG ] loading log_handlers in ['/var/cache/salt/master/extmods/log_handlers', '/usr/lib/pymodules/python2.7/salt/log/handlers']
[DEBUG ] Skipping /var/cache/salt/master/extmods/log_handlers, it is not a directory
[DEBUG ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.
@rgbkrk
rgbkrk / top.sls
Created October 11, 2013 20:17
top.sls
base:
'*':
- python
- memcache
- nbviewer
- supervisor
- firewall
@rgbkrk
rgbkrk / saltboot.md
Last active December 25, 2015 13:09
Bootstrapping a master with gitfs

Salt-master

curl -L http://bootstrap.saltstack.org | sudo sh -s -- -M -N git develop

# Good pip
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python2.7
curl --show-error --retry 5 https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python2.7

# gitpython
pip install GitPython==0.3.2.RC1 --upgrade
@rgbkrk
rgbkrk / rebuild.py
Last active February 17, 2017 19:04
Rebuilding an arbitrary server with an SSH Key.
#!/usr/bin/env python
'''
Builds a server with no SSH key then rebuilds it with an SSH Key.
'''
import os
import getpass
import pyrax