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="hostmaster@mysite.example.net"; | |
| 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 |
| // RSS feeds are supposed to have a standardised date format, as shown in the RSS 2.0 specification: | |
| // All date-times in RSS conform to the Date and Time Specification of RFC 822, | |
| // with the exception that the year may be expressed with two characters or four characters (four preferred). | |
| // Example: Sat, 07 Sep 2002 0:00:01 GMT | |
| var formats = ['ddd, DD MMM YYYY HH:mm:ss ZZ', 'ddd, DD MMM YY HH:mm:ss ZZ']; | |
| var pubDate = moment(item.querySelector('pubDate').textContent, formats); |
| #!/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 |