-
Regex generated via frak in clojure
-
Install clojure and leiningen
brew install leiningen
-
Create new app
lein new app frakproj
-
cd
into new directoryfrakproj
-
edit
project.clj
to add[frak "0.1.6"]
as dependency. the new file should look like this:(defproject frakproj "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME"
This file contains hidden or 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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# SSL Optional | |
listen 443 ssl default_server; | |
listen [::]:443 ssl default_server; | |
ssl_certificate /etc/ssl/my_cert.pem; | |
ssl_certificate_key /etc/ssl/my_cert.key; | |
This file contains hidden or 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
// To format a private key into a string literal | |
cat my_secret.key | sed s/$/\\\\n/ | tr -d '\n' | |
echo $MY_SECRET_KEY | sed 's/\\n/\n/g' > ~/my_secret.key | |
This file contains hidden or 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
// Given a positive integer of up to 16 digits, return true if it is a valid credit card number, and false if it is not. Here is the algorithm: | |
// If there are an even number of digits, double every other digit starting with the first, and if there are an odd number of digits, double every other digit starting with the second. Another way to think about it is, from the right to left, double every other digit starting with the second to last digit. | |
// 1714 => [1*, 7, 1*, 4] => [2, 7, 2, 4] | |
// 12345 => [1, 2*, 3, 4*, 5] => [1, 4, 3, 8, 5] | |
// 891 => [8, 9*, 1] => [8, 18, 1] | |
// If a resulting doubled number is greater than 9, replace it with either the sum of it's own digits, or 9 subtracted from it. |
This file contains hidden or 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
""" | |
Copies all keys from the source Redis host to the destination Redis host. | |
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
restricted (e.g. on Amazon ElastiCache). | |
The script scans through the keyspace of the given database number and uses | |
a pipeline of DUMP and RESTORE commands to migrate the keys. | |
Requires Redis 2.8.0 or higher. |
This file contains hidden or 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
dependencies: | |
pre: | |
- bundle config without development:production |
This file contains hidden or 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
packages: | |
yum: | |
git: [] | |
option_settings: | |
aws:elasticbeanstalk:application:environment: | |
BUNDLE_WITHOUT: test:development |
This file contains hidden or 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
for user in $(getent passwd | cut -f1 -d: ); do echo $user; crontab -u $user -l; done |
This file contains hidden or 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
LC_ALL=C find ./ -name "{filter}" -type f -exec sed -i '' -e 's/{old-word}/{new-word}/g' {} \; |
This file contains hidden or 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
0 21 * * * s3backup.sh >> crontab.out 2> crontab.err & | |
0 5 * * * s3stopbackup.sh >> crontab.out 2> crontab.err & |