Skip to content

Instantly share code, notes, and snippets.

View andrewjesaitis's full-sized avatar

Andrew Jesaitis andrewjesaitis

View GitHub Profile
@andrewjesaitis
andrewjesaitis / .pylintrc
Created January 19, 2017 23:23
GA4GH Reference Server Pylint (WIP)
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. They should be base names, not
@andrewjesaitis
andrewjesaitis / backupEbs.sh
Created July 14, 2015 16:51
Simple AWS Snapshoting
#!/bin/bash
#set -x #uncomment to watch commands execute
#install the latest version of aws cli via pip -- pip install awscli -- note this install to /usr/local/bin and there maybe an old version of awscli in /usr/bin
#run $aws configure to set access key, secret key and region, script require output type to be text
#Finally, install ntpd -- apt-get install ntp -- because it often isn't install and if your server's clock is not sync'd with amazon's aws cli commands fail
#Run this via cron every night at 12:05 am -- crontab -e -- 0 5 * * * /path/to/backupEbs.sh >> /var/log/backup.log 2>&1
NUMBER_TO_KEEP=7
EBS_VOLUMES=( vol-XXXXX vol-XXXXX vol-XXXXX vol-XXXXX )
@andrewjesaitis
andrewjesaitis / explanation.md
Last active August 29, 2015 14:07
This is a decorator for the `estimate_next_pos` function used in the Runaway Robot Project for Udacity CS373 (GT OMSCS 8803).

The VectorPlot class is just a helper to container the arrays and plotting logic. All you should need to do is add @plot_me above the estimate_next_pos function. You may need to tweak the matplotlib calls (and remove %matplotlib inline) if you aren't using this in an ipython notebook. You'll need to install numpy and matplotlib as well: pip install matplotlib numpy.

@andrewjesaitis
andrewjesaitis / gist:7778867
Created December 3, 2013 22:37
Just an example of dividing a continuous matplotlib colormap into a distinct array of colors
import matplotlib as mpl
num_colors = len(values)
cm = mpl.cm.get_cmap(name='YlGnBu_r')
currentColors = [cm(1.*i/num_colors) for i in range(num_colors)]
@andrewjesaitis
andrewjesaitis / gist:5431342
Created April 21, 2013 22:35
Check your pypi packages against the repo version
pip freeze | cut -d = -f 1 | xargs -n 1 pip search | grep -B2 'LATEST:'
@andrewjesaitis
andrewjesaitis / aria2cDownloadWrapper.py
Created March 8, 2013 18:38
A wrapper that batches urls for downloading via aria2c.
import os, subprocess
from optparse import OptionParser
def main():
"""
Takes a file with urls on separate lines and downloads them using aria2c in small batches.
Useful if you need to download a number of links with more characters in the url than will fit in one command.
"""
parser = OptionParser()
parser.add_option("-i", "--input", dest='input_file')