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 bash | |
# ca | |
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \ | |
-nodes -keyout ca.key -out ca.pem -subj "/C=US/ST=CA/O=Lab/OU=Engineering/CN=ca.johnhardy.io" \ | |
-addext "subjectAltName=DNS:ca.johnhardy.io,IP:10.0.0.1" | |
# server csr | |
openssl req -new -newkey rsa:4096 -nodes \ |
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 bash | |
# Copyright (C) 2012 - 2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. | |
# This file is licensed under the GPLv2+. Please see COPYING for more information. | |
umask "${PASSWORD_STORE_UMASK:-077}" | |
set -o pipefail | |
GPG_OPTS=( $PASSWORD_STORE_GPG_OPTS "--quiet" "--yes" "--compress-algo=none" "--no-encrypt-to" ) | |
GPG="gpg" |
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
import ( | |
"crypto" | |
"crypto/ecdsa" | |
"crypto/rsa" | |
"crypto/tls" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"io/ioutil" |
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
function parseJwt (token) { | |
var base64Url = token.split('.')[1]; | |
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); | |
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { | |
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | |
}).join('')); | |
return JSON.parse(jsonPayload); | |
}; |
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 bash | |
# | |
# Description: Auto test download & I/O speed script | |
# | |
# Copyright (C) 2015 - 2020 Teddysun <i@teddysun.com> | |
# Thanks: LookBack <admin@dwhd.org> | |
# URL: https://teddysun.com/444.html | |
# | |
trap _exit INT QUIT TERM |
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
echo -n "Open VPN Volume name: " | |
read volname | |
echo -n "Client/User name: " | |
read client | |
export OVPN_DATA="${volname}" | |
docker volume create --name $OVPN_DATA |
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 bash | |
read -r -d '' USAGE <<'USAGEEND' | |
tblick - Launch tunnelblick and connect to VPN | |
Examples: | |
Launch tunnelblick and connect to VPN | |
$ tblick [TUNNELBLICK-VPN-NAME] | |
Options: |
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
export PATH="/usr/local/opt/llvm/bin:$PATH" | |
export CC="/opt/local/bin/clang-mp-10" | |
export CXX="/opt/local/bin/clang++-mp-10" | |
export CXX11="/opt/local/bin/clang++-mp-10" | |
export CXX14="/opt/local/bin/clang++-mp-10" | |
export CXX17="/opt/local/bin/clang++-mp-10" | |
export CXX1X="/opt/local/bin/clang++-mp-10" | |
export LDFLAGS="-L/usr/local/opt/llvm/lib" | |
export CPPFLAGS="-I/usr/local/opt/llvm/include" |
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
docker exec {CONTAINER} killall -USR2 openvpn | |
docker logs {OPENVPN_CONTAINER} |
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
import express from 'express' | |
const app = express() | |
import AWS from 'aws-sdk' | |
const fs = require('fs') | |
const path = require('path') | |
const mtype = require('mime-types') | |
const BUCKET = "mt-jhardy" | |
const PORT = 8080 |
NewerOlder