Skip to content

Instantly share code, notes, and snippets.

View DuaneNielsen's full-sized avatar
👾
Happy!

Duane DuaneNielsen

👾
Happy!
View GitHub Profile
@DuaneNielsen
DuaneNielsen / refresh_assistant
Created January 19, 2016 05:19
refreshes my nodejs app
if [ -z "$PASSWORD" ]; then
echo "Need to export PASSWORD"
exit 1
fi
docker pull duanenielsen/assistant
rm docker-compose.yml
wget https://raw.githubusercontent.com/DuaneNielsen/assistant/master/docker-compose.yml
docker-compose stop assistant
docker rm assistant
docker-compose up -d assistant
@DuaneNielsen
DuaneNielsen / showcerts
Created January 19, 2016 05:22
shows handshake and certs on localhost 443
openssl s_client -tls1 -showcerts -connect localhost:443 -nbio -state </dev/null
@DuaneNielsen
DuaneNielsen / d-bash
Created January 19, 2016 05:24
logs into a running docker container
docker exec -it $1 bash
@DuaneNielsen
DuaneNielsen / d-debug
Created January 19, 2016 05:28
Start a bash shell in the given docker image
docker run -it --entrypoint bash $1
@DuaneNielsen
DuaneNielsen / githelper
Created January 19, 2016 05:32
git comfort commands
git config --global credential.helper cache
git config --global credential.helper "cache --timeout=7800"
@DuaneNielsen
DuaneNielsen / ciphersuite
Created January 19, 2016 05:34
check the supported ciphers on an ssl connection
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=0.0.0.0:8080
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
@DuaneNielsen
DuaneNielsen / netcat
Created January 19, 2016 05:36
check a port with netcat
nc -vz <ip> <port>
@DuaneNielsen
DuaneNielsen / postgres update ssl on docker
Last active January 19, 2016 18:39
Update keys on postgres docker volume
docker inspect postgres-data
cd /var/lib/docker/volumes/postgres-data/_data
cp -L /etc/letsencrypt/live/vixkings.com/fullchain.pem .
cp -L /etc/letsencrypt/live/vixkings.com/privkey.pem .
chmod 400 fullchain.pem
chmod 400 privkey.pem
@DuaneNielsen
DuaneNielsen / JavascriptSerialExecution
Created January 21, 2016 06:14
Serial Execution in javascript
// Async task (same in all examples in this chapter)
function async(arg, callback) {
console.log('do something with \''+arg+'\', return 1 sec later');
setTimeout(function() { callback(arg * 2); }, 1000);
}
// Final task (same in all the examples)
function final() { console.log('Done', results); }
// A simple async series:
var items = [ 1, 2, 3, 4, 5, 6 ];
@DuaneNielsen
DuaneNielsen / JavascriptBarrierSync
Created January 21, 2016 06:15
Barrier Sync in javascript
function async(arg, callback) {
console.log('do something with \''+arg+'\', return 1 sec later');
setTimeout(function() { callback(arg * 2); }, 1000);
}
function final() { console.log('Done', results); }
var items = [ 1, 2, 3, 4, 5, 6 ];
var results = [];
items.forEach(function(item) {