start new:
tmux
start new with session name:
tmux new -s myname
| import dj_database_url | |
| TEST_DATABASES = { | |
| 'default': dj_database_url.config(env='TEST_DATABASE_URL') | |
| } | |
| # replace path below to point to HerokuTestSuiteRunner class | |
| TEST_RUNNER = 'python.path.to.test_suite_runner.HerokuTestSuiteRunner' |
| def generate_RSA(bits=2048): | |
| ''' | |
| Generate an RSA keypair with an exponent of 65537 in PEM format | |
| param: bits The key length in bits | |
| Return private key and public key | |
| ''' | |
| from Crypto.PublicKey import RSA | |
| new_key = RSA.generate(bits, e=65537) | |
| public_key = new_key.publickey().exportKey("PEM") | |
| private_key = new_key.exportKey("PEM") |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
| #!/bin/bash | |
| # This little hack-job will grab credentials from a running openvpn process in Linux | |
| # Keep in mind this won't work if the user used the --auth-nocache flag | |
| pid=$(ps -efww | grep -v grep | grep openvpn | awk '{print $2}') | |
| echo $pid | grep rw-p /proc/$pid/maps | sed -n 's/^\([0-9a-f]*\)-\([0-9a-f]*\) .*$/\1 \2/p' | while read start stop; do gdb --batch-silent --silent --pid $pid -ex "dump memory $pid-$start-$stop.dump 0x$start 0x$stop"; done | |
| echo "Your credentials should be listed below as username/password" | |
| strings *.dump | awk 'NR>=3 && NR<=4 { print }' | |
| rm *.dump --force |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |