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
#!/home/mbreese/.local/src/bcrypt-venv/bin/python3 | |
import sys | |
import bcrypt | |
def usage(): | |
sys.stderr.write('''\ | |
Encrypting text | |
Usage: bcrypt {-r} [text] | |
You can also pipe raw plaintext through stdin (will be stripped unless -r is set!) |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
if len(sys.argv) == 1: | |
print(os.path.abspath('.')) | |
else: | |
for arg in sys.argv[1:]: | |
print(os.path.abspath(arg)) |
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
package io.compgen.ngsutils.support; | |
import sun.misc.Signal; | |
import sun.misc.SignalHandler; | |
abstract public class CustomSignalHandler implements SignalHandler { | |
private SignalHandler old = null; | |
private void setOld(SignalHandler old) { |
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
javascript:function sendurl_to_memos(url,data){let xhr=new XMLHttpRequest();xhr.open("POST", url, true);xhr.setRequestHeader("Content-Type", "application/json");xhr.onreadystatechange=function(){if (xhr.readyState === 4) { if (xhr.status === 200) {alert("Saved!");}else{alert(xhr.readyState+"\n"+xhr.status+" error: "+this.responseText);}}};xhr.send(JSON.stringify(data));};sendurl_to_memos('$$OPENID_URL$$', {"content": document.title+"\n"+window.location.href+"\n#link"}); |
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
#!/bin/bash | |
COLS="$(tput cols)" | |
while read LINE; do | |
echo $LINE | head -c $COLS | |
done |
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
#!/bin/bash | |
# | |
# This will by default take snapshots of all zfs filesystems, | |
# but could be adapted to only pull specific ones. This script | |
# will also rotate snapshots, removing those that are older | |
# than 2 weeks. | |
# | |
CURDATE=$(date +%Y%m%d) | |
TWOWEEKSAGO=$(date -d'2 weeks ago' +%Y%m%d) |
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
#!/usr/bin/env python | |
import sys | |
import datetime | |
rate = 100000 | |
if len(sys.argv) > 1: | |
rate = int(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
#!/usr/bin/env python | |
import sys | |
import itertools | |
cons_key = "VEP_Consequence" | |
impact_key = "VEP_IMPACT" | |
gene_key = "VEP_SYMBOL" | |
csn_key = "VEP_CSN" | |
sift_key = "VEP_SIFT" |
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
#!/usr/bin/env python | |
import sys | |
prefix="VEP_" | |
vep_info_name = "CSQ" | |
def parse_info_format(line): | |
###INFO=<ID=CSQ,Number=.,Type=String,Description="Consequence annotations from Ensembl VEP. Format: Allele|Consequence|IMPACT|SYMBOL|Gene|Feature_type|..."> |
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
CREATE ROLE db_user LOGIN ENCRYPTED PASSWORD 'secret-password' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; | |
CREATE DATABASE db_name WITH OWNER db_user; | |
GRANT ALL PRIVILEGES ON DATABASE db_name TO db_user; |
NewerOlder