Instantly share code, notes, and snippets.

View Dockerfile
FROM centos:7
RUN yum update -y
RUN yum install -y epel-release
RUN yum install -y gcc gcc-c++ make cmake3 cmake fuse-devel openssl-devel zlib-devel bzip2-devel chrpath patchelf
RUN mkdir -p /build
WORKDIR /build
RUN curl -OL https://libzip.org/download/libzip-1.5.1.tar.gz
RUN tar xzf libzip-1.5.1.tar.gz
WORKDIR /build/libzip-1.5.1
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig LD_LIBRARY_PATH=/usr/local/lib64:/usr/lib64
View simple-repeat.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import cyvcf2
import pyfaidx
import sys
def _main():
parser = argparse.ArgumentParser(description="Simple Repeat Variant Detector")
View transproxy-helper.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import ipaddress
import itertools
import subprocess
import tempfile
import os
import signal
View add_path.sh
function add_path() {
if [ ! -d $1 ];then
return
fi
NEWPREFIX=$1
case ":$PATH:" in
*":$NEWPREFIX/bin:"*) return;;
View insert-pitapa.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import csv
import sqlite3
import sys
import datetime
import pytz
import collections
View hashcat-benchmark.csv
Hash H/s
MD4 8549200000
MD5 4626000000
Half MD5 3157900000
SHA1 2005600000
SHA256 841000000
SHA384 202000000
SHA512 200500000
SHA-3(Keccak) 187100000
SipHash 8700100000
View checkcredit.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import sqlite3
import sys
import datetime
import pytz
import collections
View sleepdisplay.c
#include <Windows.h>
int main()
{
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa376869(v=vs.85).aspx */
LockWorkStation();
/* https://msdn.microsoft.com/en-us/library/windows/desktop/ms644944(v=vs.85).aspx */
PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
return 0;
}
View Emacs-25.1-osx-inlinepatch.diff
diff --git a/configure.ac b/configure.ac
index cd4d1c0..fcc96d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5123,7 +5123,7 @@ case "$opsys" in
## only costs about 1.5K of wasted binary space.
headerpad_extra=1000
if test "$HAVE_NS" = "yes"; then
- libs_nsgui="-framework AppKit"
+ libs_nsgui="-framework AppKit -framework Carbon"
View qsub-one.sh
function qsub-one () {
SHOWHELP="false"
GRID_OPTION=("-cwd")
GRID_SHELL="/bin/zsh"
while getopts p:n:m:hs: OPT; do
case $OPT in
"h") SHOWHELP="true";;
"n") GRID_NAME="$OPTARG";;
"m") GRID_OPTION=("${GRID_OPTION[@]}" "-l" "s_vmem=$OPTARG,mem_req=$OPTARG");;