Skip to content

Instantly share code, notes, and snippets.

View moonwatcher's full-sized avatar

Lior Galanti moonwatcher

View GitHub Profile
@moonwatcher
moonwatcher / com.tuntap.tun.kext.plist
Created October 17, 2014 06:58
lanuchd plist for loading tun.kext
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tuntap.tun.kext</string>
<key>ProgramArguments</key>
<array>
<string>kextload</string>
<string>/Library/Extensions/tun.kext</string>
/*
Operating Systems Fall 2013, Lab 2. 15 October 2013
Lior Galanti lior.galanti@nyu.edu N14314920
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/*
Operating Systems Fall 2013, Lab 3. 10 November 2013
Lior Galanti lior.galanti@nyu.edu N14314920
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/*
Operating Systems Fall 2013, Lab 4. 9 December 2013
Lior Galanti lior.galanti@nyu.edu N14314920
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/*
Operating Systems Fall 2013, Lab 1. 23 september 2013
Lior Galanti lior.galanti@nyu.edu N14314920
*/
#define BUFFER_SIZE 2048
#define SYMBOL_SIZE 16
#define INSTR_SIZE 16
#define MEM_ADDR 16
#define DEFLIST_SIZE 16
@moonwatcher
moonwatcher / phenaqs.cpp
Last active August 29, 2015 14:08
C++ fastq demultiplexer
/*
FASTQ Demultiplexer
Author: Lior Galanti lior.galanti@nyu.edu
Build:
On ubuntu:
dependencies: sudo apt-get install lib32z1-dev libboost-iostreams-dev libboost-program-options-dev
compile: g++ -static phenaqs.cpp -lboost_iostreams -lboost_program_options -lz -std=c++11 -o phenaqs
@moonwatcher
moonwatcher / scratch.py
Created March 31, 2015 01:27
recursive fastq reference resolver for cleaning up the scratch file system
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# recursive fastq reference resolver for cleaning up the scratch file system
# Author: Lior Galanti < lior.galanti@nyu.edu >
# NYU Center for Genetics and System Biology 2015
import sys
import re
import json
@moonwatcher
moonwatcher / nucleic.json
Last active August 29, 2015 14:19
iupac nucleic acid notation and ambiguity code reverse complement table
{
"A": "T",
"C": "G",
"G": "C",
"T": "A",
"R": "Y",
"Y": "R",
"K": "M",
"M": "K",
"S": "S",
@moonwatcher
moonwatcher / complement.py
Last active August 29, 2015 14:20
Reverse complement an IUPAC encoded DNA string on the command line
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Reverse complement an IUPAC encoded DNA string
# Author: Lior Galanti < lior.galanti@nyu.edu >
# NYU Center for Genetics and System Biology 2015
#
# complement 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 2 of the License, or (at your option) any later version.
@moonwatcher
moonwatcher / crop.py
Last active August 29, 2015 14:20
Extract a sequence from a FASTA file by coordinates
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Extract a sequence by coordinates from a FASTA file
# Author: Lior Galanti < lior.galanti@nyu.edu >
# NYU Center for Genetics and System Biology 2015
#
# crop 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 2 of the License, or (at your option) any later version.