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
pipeline { | |
environment { | |
DOCKER_REGISTRY = 'https://my-docker-registry.example.com' | |
DOCKER_CREDS = credentials( 'my-docker-credentials' ) | |
} | |
} |
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
# one or the other, NOT both | |
[url "https://github"] | |
insteadOf = git://github | |
# or | |
[url "git@github.com:"] | |
insteadOf = git://github |
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/sh | |
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs | |
CERTS_DIR=/etc/ssl/certs | |
CAFILE=${CERTS_DIR}/ca-certificates.crt | |
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do | |
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert} | |
CERT_FILE=${CERTS_DIR}/${cert} | |
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null) |
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
Convention: Byte array notation as it would appear in a hexeditor. | |
= Layout= | |
KDBX files, the keepass database files, are layout as follows: | |
1) Bytes 0-3: Primary identifier, common across all kdbx versions: | |
private static $sigByte1=[0x03,0xD9,0xA2,0x9A]; | |
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 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
#!/bin/bash | |
check-for-android-device() { | |
ADB_PATH="${ANDROID_HOME}/platform-tools" | |
NOT_PRESENT="List of devices attached" | |
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'` | |
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then | |
echo "Android device seems to be missing." |
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
/* | |
IMPORTANT!!! DO NOT USE THIS. It works, but you'll probably get it wrong, | |
because it must be keyed with at least 128 bits of entropy, and where | |
do you get this entropy, huh? | |
- In a browser, you get it from window.crypto.getRandomValues(). | |
- In Node, you get it from crypto.randomBytes() | |
Now LOOK AT YOU! You already have secure ways to generate random bytes, |
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
// Note: this is for scrypt implementation, which doesn't use diagonal constants, | |
// so the order of loading from x is different than in normal Salsa20 implementation. | |
function salsa20_8(x) { | |
var j0 = (x[ 0] & 0xff) | ((x[ 1] & 0xff)<<8) | ((x[ 2] & 0xff)<<16) | ((x[ 3] & 0xff)<<24); | |
var j1 = (x[ 4] & 0xff) | ((x[ 5] & 0xff)<<8) | ((x[ 6] & 0xff)<<16) | ((x[ 7] & 0xff)<<24); | |
var j2 = (x[ 8] & 0xff) | ((x[ 9] & 0xff)<<8) | ((x[10] & 0xff)<<16) | ((x[11] & 0xff)<<24); | |
var j3 = (x[12] & 0xff) | ((x[13] & 0xff)<<8) | ((x[14] & 0xff)<<16) | ((x[15] & 0xff)<<24); | |
var j4 = (x[16] & 0xff) | ((x[17] & 0xff)<<8) | ((x[18] & 0xff)<<16) | ((x[19] & 0xff)<<24); | |
var j5 = (x[20] & 0xff) | ((x[21] & 0xff)<<8) | ((x[22] & 0xff)<<16) | ((x[23] & 0xff)<<24); |