This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example of using custom types to implement map/filter functionality in scriptland | |
global v: vector of int = {-10, -1, 0, 1, 10, -999}; | |
type map_func: function(a: any): any; | |
global positive_filter: map_func; | |
function map(v1: vector of any, mf: map_func): vector of any { | |
local v2: vector of any; | |
for (idx in v1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax "spicy" "\.spicy$" | |
color magenta "\w+\(" | |
color magenta "\$\w+" | |
color magenta "\?\w+" | |
color brightcyan "public|global|const|local" | |
color brightcyan "\b(print|on|foreach|stop|switch|case|default|if|new|in|inout|exception|throw|try|catch|assert|break|for|return|while|from|continue)\b" | |
color brightcyan "module|import" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scapy.all import * | |
import scapy_ssl_tls.ssl_tls as tls | |
import scapy_ssl_tls.ssl_tls_crypto as tlsc | |
import scapy_ssl_tls.ssl_tls_keystore as tlsk | |
packets = rdpcap('tls_example.pcap') | |
for packet in packets: | |
if packet.haslayer(tls.SSL): | |
eth = packet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-PublicKey | |
{ | |
[OutputType([byte[]])] | |
PARAM ( | |
[Uri]$Uri | |
) | |
if (-Not ($uri.Scheme -eq "https")) | |
{ | |
Write-Error "You can only get keys for https addresses" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
from StringIO import StringIO | |
import networkx as nx | |
import subprocess | |
import glob | |
import base64 as b64 | |
# http://stackoverflow.com/questions/1285434/efficient-algorithm-for-string-concatenation-with-overlap | |
def concat(*args): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import fileinput | |
print 'import "cuckoo"' | |
a='a444' | |
for d in fileinput.input(): | |
d = d.strip() | |
a = 'a%d' % (random.randint(0, 100000000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
import sys | |
import random | |
if len(sys.argv) != 3: | |
print "usage: hole_punch.py in_filename out_filenae" | |
exit() | |
ifname = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
from StringIO import StringIO | |
import networkx as nx | |
import subprocess | |
# https://neil.fraser.name/news/2010/11/04/ | |
def commonOverlapIndexOf(text1, text2): | |
text1_length = len(text1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from StringIO import StringIO | |
import string | |
import zlib | |
import base64 as b64 | |
def get_kmer(read_str, overlap_size, kmer_size): | |
if read_str.pos > overlap_size: | |
read_str.seek(overlap_size * -1, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z ${1+x} ]; then | |
printf "usage: search.sh terms.txt\n\n"; | |
exit -1; | |
fi | |
DT=$(date '+%Y-%m-%d' --date="yesterday") | |
RESULTS_DIR="./results" | |
EMAIL="" | |
if [ ! -d "${RESULTS_DIR}" ]; then |