This file contains hidden or 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 | |
| """Compare each pi session's actual prompt-cache TTL against the other TTL. | |
| Usage: cache_ttl_cost.py [-n N | --all] [--ttl auto|5m|1h] [--sessions-dir DIR] | |
| pi does not log the TTL (it comes from cacheRetention/PI_CACHE_RETENTION), so it | |
| is inferred: on a turn whose gap since the previous turn is 5m-1h, a 5m session | |
| re-writes the prefix (cacheWrite >> cacheRead) while a 1h session reads it | |
| (cacheRead > cacheWrite). Majority vote over those turns per session. |
This file contains hidden or 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 | |
| wget -O assistme.dat http://control.d-imaging.sony.co.jp/GPS/assistme.dat | |
| wget -O assistme.md5 http://control.d-imaging.sony.co.jp/GPS/assistme.md5 | |
| checksum=$(md5sum assistme.dat | awk '{print $1}') | |
| sony_checksum=$(cat assistme.md5 | awk '{print $1}') | |
| if [[ ${checksum} == ${sony_checksum} ]]; then | |
| echo "Okay: Checksums match." | |
| echo "Place files in: <sdcard>/PRIVATE/SONY/GPS/ | |
| else | |
| echo "Warning: Checksums do not match!" |
This file contains hidden or 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
| # Uses the range check to avoid sending your actual password and then checks the returned list locally. | |
| p0wned () { | |
| read -s 'pass?Enter password: ' | |
| echo | |
| sum=$(echo -n "$pass" | sha1sum | cut -c1-40) | |
| short=$(echo -n $sum | cut -c1-5) | |
| remain=$(echo -n $sum | cut -c6-40) | |
| curl -s https://api.pwnedpasswords.com/range/${short} | grep -i ${remain} | |
| } |
This file contains hidden or 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 argparse | |
| import re | |
| from os import walk | |
| from os.path import join | |
| def get_patterns(patterns_dir): | |
| patterns = {} |
This file contains hidden or 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 | |
| if [[ $# -lt 1 ]]; then | |
| echo "usage: $(basename ${0}) <gateway>" | |
| exit 1 | |
| fi | |
| gateway=${1} | |
| shift |
This file contains hidden or 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 | |
| set -o nounset | |
| ########################################## | |
| # Defaults | |
| ########################################## | |
| : ${recipient:=} | |
| : ${host:=localhost} | |
| : ${port:=5432} | |
| : ${databases:=} |
This file contains hidden or 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 time | |
| import signal | |
| from optparse import OptionParser | |
| from multiprocessing import Pool | |
| from subprocess import Popen, PIPE | |
| class TimeoutException(Exception): | |
| pass |
This file contains hidden or 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 javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /** Establish a SSL connection to a host and port, writes a byte and | |
| * prints the response. See | |
| * http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
| */ | |
| public class SSLPoke { | |
| public static void main(String[] args) { |
This file contains hidden or 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
| 1 11 11 111 | |
| 00000000100001 100000 1000001 0001 0 | |
| 1 0011 00 11101 0011100 0011100 11 0 0 | |
| 0 10 01 0 101 0 101 101 0 | |
| 01 00 101 01 101 01 101 01 0 | |
| 01 00 101 01 101 01 101 101 10 | |
| 01 00 101 01 101 01 10 101 00 | |
| 101 00 101 01 101 01 101 101 100 | |
| 01 00 101 01 101 01 101 101 1101 | |
| 101 00 101 01 101 01 10 1011001 01 |
This file contains hidden or 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 | |
| if (( $# != 3 )); then | |
| echo "Usage: $(basename $0) <username> <db-host> <db-name>" | |
| exit 1 | |
| fi | |
| PSQL_USER=${1} | |
| PSQL_HOST=${2} | |
| PSQL_DB=${3} |
NewerOlder