Skip to content

Instantly share code, notes, and snippets.

View DukeyToo's full-sized avatar

Steve Campbell DukeyToo

  • Minneapolis, MN, USA
  • 16:51 (UTC -05:00)
View GitHub Profile
@jasonk
jasonk / Jenkinsfile
Last active November 22, 2022 03:23
Docker credential helper for authenticating from environment variables
pipeline {
environment {
DOCKER_REGISTRY = 'https://my-docker-registry.example.com'
DOCKER_CREDS = credentials( 'my-docker-credentials' )
}
}
@Kovrinic
Kovrinic / .gitconfig
Last active April 11, 2024 11:50
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github
#!/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)
@dacort
dacort / cookiemonster.go
Created September 23, 2014 06:51
Simple script to extract (encrypted) cookies out of Chrome OS X cookie store. Usage: ./cookiemonster domain.com
package main
import (
"code.google.com/p/go.crypto/pbkdf2"
"crypto/aes"
"crypto/cipher"
"crypto/sha1"
"database/sql"
"fmt"
"log"
@msmuenchen
msmuenchen / gist:9318327
Last active September 18, 2022 21:53
KeePass v2.x (KDBX v3.x) file format
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)
@johnjohndoe
johnjohndoe / check-for-android-device.sh
Created April 16, 2013 17:54
Shell script which checks if any Android device is connected. I execute this script before processing a Maven project in order to save time when the device has fallen asleep.
#!/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."
@dchest
dchest / salsa20.js
Last active November 9, 2020 02:48
/*
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,
// 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);