Skip to content

Instantly share code, notes, and snippets.

View jbszczepaniak's full-sized avatar
🦥

Jędrzej jbszczepaniak

🦥
View GitHub Profile

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@jbszczepaniak
jbszczepaniak / pre-commit
Created February 15, 2018 11:28
Do not allow to commit prints and console.logs
count=`grep -iR --include \*.ts 'console.log(' src/* | wc -l | awk '{print $1}'`
if [[ "$count" != 0 ]]; then
echo "ERROR: Remove any config.log() statements in typescript sources"
exit 1
fi
count=`grep -iR --include \*.py 'print(' src/* | wc -l | awk '{print $1}'`
if [[ "$count" != 0 ]]; then
echo "ERROR: Remove any print() statements in python sources"
exit 1
@jbszczepaniak
jbszczepaniak / bash_rc.bash
Created October 29, 2017 13:04
My aliases and settings.
# git
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\$(date +%H:%M:%S) \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] 🚀🚀🚀 "
if [ -f $(brew --prefix)/etc/bash_completion ]; then
$(brew --prefix)/etc/bash_completion
fi
alias gs="git status"
alias gcom="git commit"
import jwt, unittest, sys, datetime, time
class TestJWT(unittest.TestCase):
def setUp(self):
self.informations = {}
self.informations['version'] = sys.version
self.informations['default_ecoding'] = sys.getdefaultencoding()
self.jwt_key = "test_key"
self.jwt_algorthm = "HS256"
self.token_jwt = jwt.encode(