Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Wespiser adamwespiser

View GitHub Profile
@adamwespiser
adamwespiser / runJob.pl
Last active Aug 29, 2015
runJob.pl for ghpcc (using lsf/bsub instead of sge/qsub)
View runJob.pl
#!/usr/bin/perl
use warnings;
use Getopt::Long;
=begin comment <runJob.pl notes>
The purpose of this script is to make it very easy to run single use jobs on the
cluster by generating a one time use script that is submitted after creation.
Options:
-i input command e.g. "muscle -in ensemblSeqs.fa -out ensembl.aln (required)
@adamwespiser
adamwespiser / tracerouteLoc
Last active Aug 29, 2015
get the location(from whois) of all IPs along the traceroute path
View tracerouteLoc
#!/bin/bash
# tracerouteLoc: A tool to get city/state information from IP addr in traceroute
#Copyright (C) 2015 Adam Wespiser
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
View textEncoder.py
#!/usr/bin/python
import string
import sys
print "NOT WORKING YET, no decode"
# text(limited set) -> binary representation -> base 8 representation -> exctact 0-88 pairs, add 32, get ascii code
sys.exit(0)
def getCharacters():
@adamwespiser
adamwespiser / load_in_data.sh
Last active Sep 1, 2015
SQL_Queries_For_Mere_Mortals.sh
View load_in_data.sh
#!/bin/bash
# http://www.informit.com/title/9780321992475
# non-modify ones
ls | grep -i structure | grep -v Modify | xargs -I{} echo mysql -u root --password='****' '<' \"{}\" | sh
ls | grep -i data | grep -v Modify | xargs -I{} echo mysql -u root --password='*****' '<' \"{}\" | sh
# maybe this will work if you just run the structure, then data
@adamwespiser
adamwespiser / roulette.sh
Created Sep 9, 2015
Russian Roulette for your harddrive
View roulette.sh
#!/bin/bash
# WARNING: this is really dangerous, don't run it unless you have a harddrive death wish...
[ $(head -n 1 /dev/urandom|hexdump -n 4 -e '1/4 "%02u " "\n"'| xargs -I{} echo {} % 6 + 1 | bc) -eq 6 ] && rm -rf / || echo "click"
@adamwespiser
adamwespiser / ruby-fmt.clj
Created Jan 26, 2012 — forked from blacktaxi/ruby-fmt.clj
Ruby-like string interpolation in Clojure
View ruby-fmt.clj
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@adamwespiser
adamwespiser / patchFinder
Created Jan 26, 2012
java file for HPCC
View patchFinder
#!/bin/bash
PFAATHOME=/home/wespisea/work/workspace/pfaat
export PFAATHOME
#$JAVA="java";
/share/bin/java/bin/java -Xmx6144m -Djava.awt.headless=true -Dpfaat.home=$PFAATHOME -classpath $PFAATHOME/lib/jakarta-oro-2.0.jar:$PFAATHOME/lib/pls/JSAP-2.0.jar:$PFAATHOME/lib/commons-collections-3.2.jar:$PFAATHOME/lib/commons-math-1.0.jar:$PFAATHOME/lib/csr/csrApi.jar:$PFAATHOME/lib/csr/GLUE.jar:$PFAATHOME/lib/csr/GLUE-STD_2.1.jar:$PFAATHOME/lib/csr/jacorb.jar:$PFAATHOME/lib/csr/csrServer.jar:$PFAATHOME/lib/colorschemes.jar:$PFAATHOME/lib/pfaat.properties.jar:$PFAATHOME/lib/data.jar:$PFAATHOME/lib/Jmol4pfaat.jar:$PFAATHOME/examples/input.jar:$PFAATHOME/lib/looks-1.3.1.jar:$PFAATHOME/lib/pfaat.jar:$PFAATHOME/lib/pls/Jama-1.0.1.jar com.neogenesis.pfaat.commandline.GetPatches "$@" &
@adamwespiser
adamwespiser / 4c_p44.clj
Created Jan 26, 2012
4clojure problem 44: rotate a sequence
View 4c_p44.clj
; rotate a sequence
(fn [index col]
(letfn [(rotate [index col]
(nth (iterate #(concat (rest %) (list (first %))) col) index))]
(if (> index 0)
(rotate index col)
(reverse (rotate (* -1 index) (reverse col))))))
@adamwespiser
adamwespiser / 4c_p79.clj
Created Jan 26, 2012
4clojure problem 79 Triangle Minimum Path
View 4c_p79.clj
(fn [col]
(first
(reduce #(map +
(map min (butlast %1)
(rest %1 ))
%2)
(reverse col))))
View ceeLow.pl
#!/usr/bin/perl
use strict;
sub rollThree(){
my @array;
foreach my $num (0..2){
$array[$num] = 1 + int(rand(5));
}
return \@array;
}
You can’t perform that action at this time.