For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| #!/bin/bash | |
| TARGET="mysite.example.net"; | |
| RECIPIENT="[email protected]"; | |
| DAYS=7; | |
| echo "checking if $TARGET expires in less than $DAYS days"; | |
| expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| | openssl x509 -text \ | |
| | grep 'Not After' \ | |
| |awk '{print $4,$5,$7}')" '+%s'); | |
| in7days=$(($(date +%s) + (86400*$DAYS))); |
| language: android | |
| node_js: | |
| - 5.5 | |
| notifications: | |
| email: false | |
| sudo: false |
| #!/bin/bash | |
| # scp-speed-test.sh | |
| # | |
| # Usage: | |
| # ./scp-speed-test.sh user@hostname [test file size in MBs] | |
| # | |
| ############################################################# | |
| ssh_server=$1 | |
| test_file=".scp-test-file" |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
| """Scrape a specified subreddit for comments using the Pushshift API | |
| (writes JSON objects to disk)""" | |
| import json | |
| import requests | |
| from tqdm import tqdm | |
| from nltk import defaultdict | |
| from time import sleep | |
| SUB = "AskReddit" # subreddit to scrape |
| %rec: periodic_table | |
| %sort: AtomicNumber | |
| # all values came from | |
| # https://pubchem.ncbi.nlm.nih.gov/periodic-table/ | |
| AtomicNumber: 1 | |
| Symbol: H | |
| Name: Hydrogen | |
| AtomicMass: 1.0080 |