Skip to content

Instantly share code, notes, and snippets.

Adam Wespiser adamwespiser

Block or report user

Report or block adamwespiser

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adamwespiser
adamwespiser / first_script.sh
Last active Jul 1, 2017
Ubuntu command line into
View first_script.sh
#!/bin/bash
echo "current dir"
ls ./
echo
echo "Root directory"
ls /
@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 / 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
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 / 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.
#
@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 / ggplot2Presentation.R
Last active Dec 21, 2015
ggplot2 intro (Aug 2013)
View ggplot2Presentation.R
##################################
# INTRO
#
#################################
## ggplot2 tutorial by Adam Wespiser
# August 29, 2013
# download R from: http://www.r-project.org/
# ggplot2 documentation: http://docs.ggplot2.org/
@adamwespiser
adamwespiser / sample output
Created Dec 26, 2012
attempt at random.shuffle using mergesort with random comparison
View sample output
# Copyright (c) 2012 the authors listed at the following URL, and/or
# the authors of referenced articles or incorporated external code:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
@adamwespiser
adamwespiser / README
Created Nov 18, 2012
Solution to rosalind's "corr" problem
View README
Solution to rosalind's "CORR" problem.
http://rosalind.info/problems/corr/
The problem is:
Given a collection of reads(same size), a read is either:
1) Correct, and is the same as another read or its reverse trans
2) Incorrect by a point mutation, and the thus one base pair difference between the read and a correct read. (Hamming distance = 1)
report incorrect reads and their correct counterparts.
There is a strong assumption that a read must be either correct or incorrect, and that all incorrect reads map to at least one correct read.
@adamwespiser
adamwespiser / README
Created Nov 17, 2012
Solution to rosalind.info's 'long' problem
View README
Problem: Given a set of string, find the shortest common superstring such that every string is a subset of the superstring.
http://rosalind.info/problems/long/ is the location of the problem
http://www.cs.hunter.cuny.edu/~saad/courses/compbio/lectures/lecture15.pdf is a good resource on how to solve the problem, also
"Approximation Algorithms" by Vazirani.
Usage: python long.py --file [input seq file]
You can’t perform that action at this time.