Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network
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
#!/bin/bash | |
set -e | |
echo "Enter the name of the vault where all backups should be deleted" | |
read VAULT_NAME | |
for ARN in $(aws backup list-recovery-points-by-backup-vault --backup-vault-name "${VAULT_NAME}" --query 'RecoveryPoints[].RecoveryPointArn' --output text); do | |
echo "deleting ${ARN} ..." | |
aws backup delete-recovery-point --backup-vault-name "${VAULT_NAME}" --recovery-point-arn "${ARN}" |
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
# | |
# Slightly tighter CORS config for nginx | |
# | |
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
# | |
# Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
# don't seem to play nicely with this. | |
# |
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
#user nobody; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
STORAGE = 'thumbor.storages.redis_storage' | |
# ALLOW_UNSAFE_URL = True | |
AUTO_WEBP = True | |
DETECTORS = [ 'thumbor.detectors.face_detector', 'thumbor.detectors.feature_detector' ] | |
OPTIMIZERS = ['thumbor.optimizers.jpegtran', 'thumbor.optimizers.gifv'] | |
MAX_AGE = 30 * 24 * 60 * 60 | |
FFMPEG_PATH = '/usr/bin/avconv' | |
## Insert private stuff next: |
Launch and SSH to AWS Instance
Type sudo su
Type yum update -y
Type yum groupinstall "Development Tools" -y
Type pip install --upgrade pip
(pip resides at /usr/local/bin/pip, pip version 8.0.2, python version 2.7.10)
Type yum install libjpeg-turbo-devel libjpeg-turbo-utils libtiff-devel libpng-devel pngcrush jasper-devel libwebp-devel libcurl-devel cmake -y
Type /usr/local/bin/pip uninstall pycurl
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
#!/bin/sh | |
TMPFILE="/tmp/xtrabackup-runner.$$.tmp" | |
USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}" | |
BACKDIR=/srv/mysql-bak | |
BASEBACKDIR=$BACKDIR/base | |
INCRBACKDIR=$BACKDIR/incr | |
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds | |
KEEP=1 # Number of additional backups cycles a backup should kept for. | |
START=`date +%s` |
It's easy to configurate a Yii2 server site with directory protection:
With using Sub Directory for Yii2, you could set sub-directory path into yii2's config:
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
#!/bin/bash | |
# Install Nano Editor (https://www.nano-editor.org) with syntax highlighting on the Mac | |
# Version 4.0 ("Thy Rope of Sands") released March 24th 2019 | |
cd ~/ | |
wget https://www.nano-editor.org/dist/v4/nano-4.0.tar.gz | |
tar -xvf nano-4.0.tar.gz | |
mv nano-4.0 .nano | |
cd .nano/ |
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 generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
NewerOlder