Skip to content

Instantly share code, notes, and snippets.

View gourneau's full-sized avatar

Joshua Gourneau gourneau

View GitHub Profile
@gourneau
gourneau / zpl-tcp.py
Created September 11, 2014 17:23
Python ZPL over TCP/IP Example
#!/usr/bin/env python
#ZPL docs can be found at https://support.zebra.com/cpws/docs/zpl/zpl_manual.pdf
#This works with Python 3, change the bytes to str if you are using Python 2
import socket
#One easy way to find the IP address is with this nmap command
# nmap 192.168.0.* -p T:9100 --open
@gourneau
gourneau / keepers.py
Created April 7, 2014 22:45
Ion Torrent: Use REST API to change experiment storage_options based on result PK
import requests
from requests.auth import HTTPBasicAuth
import json
import sys
server = "http://fall.local"
auth = HTTPBasicAuth('username', 'password')
#get this from somewhere else, this is just an example , maybe from sys.argv[1]
@gourneau
gourneau / setup_pandas_notebook.sh
Last active May 2, 2024 04:53 — forked from westurner/setup_pandas_notebook.sh
Setting up dev pandas with OS X 10.9 and IPython notebook
First install brew if you don't have it and XCode if you don't have them already. Also get pip if you don't have it.
Get the 10.9 GFortran from http://coudert.name/software/gfortran-4.8.2-Mavericks.dmg
(http://gcc.gnu.org/wiki/GFortranBinaries)
brew install readline
brew install zeromq
sudo pip install ipython pyzmq tornado pygments jinja2
#optional python -c 'from IPython.external import mathjax; mathjax.install_mathjax()'
@gourneau
gourneau / dal.html
Created November 15, 2013 20:28
dal
<html>
<script language="javascript" src="http://www.biodalliance.org/release-0.10/dalliance-compiled.js"></script>
<script language="javascript">
new Browser({
chr: '1',
viewStart: 85742000,
viewEnd: 85742015,
cookieKey: 'human',
@gourneau
gourneau / evolve.py
Created July 22, 2013 07:10
evolve.py : Use svn commit logs to show how the ownership of a file changes over time
import glob
import os
import sys
import json
"""
Run this bash script to get full version of every version of the API file ever committed
The first arg is the file name
@gourneau
gourneau / email.scpt
Created July 8, 2013 05:29
AppleScript script to compose email using Microsoft Outlook
tell (current date) to get (it's month as integer) & "-" & day & "-" & (it's year as integer)
set MyDay to the result as text
set Mytitle to "Daily Email - " as text
set Mytitle to Mytitle & MyDay
tell application "Microsoft Outlook"
set newMessage to make new outgoing message with properties {subject:Mytitle}
make new recipient at newMessage with properties {email address:{name:"Name", address:"[email protected]"}}
#make new cc recipient at newMessage with properties {email address:{name:"Name", address:"[email protected]"}}
@gourneau
gourneau / startplugin.py
Created May 29, 2013 19:56
Start Ion Torrent plugins via the API using a Python script
import requests
import json
#load config from your json files, and convert it to a python dict
config = {}
payload = {'plugin': ["HelloWorld"], "pluginconfig" : config }
headers = {'content-type': 'application/json'}
#the number is the primary key of the result to run the plugin on
r = requests.post("http://bebop.itw/rundb/api/v1/results/224/plugin/", data=json.dumps(payload), auth=('ionadmin', 'ionadmin'),headers=headers)
@gourneau
gourneau / pg_activity.sh
Created April 16, 2013 23:16
Install pg_activity on Ubuntu 10.04 from source
#https://github.com/julmon/pg_activity
#install
sudo aptitude install postgresql-server-dev-8.4 python-virtualenv
virtualenv --no-site-packages venv
source venv/bin/activate
sudo chmod -R 777 /usr/share/man/man1/
pip install https://github.com/julmon/pg_activity/archive/master.zip
#run
from __future__ import division
import requests
import math
r = requests.get("http://ionwest.itw/rundb/api/v1/pluginresult/?format=json&endtime__gte=2013-01-10&limit=0")
s = [o["state"] for o in r.json["objects"] if o["state"] != "Queued" or o["state"] != "Pending"]
success = 0
error = 0
blackbird.ite
```apace
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare