This file contains 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
awk -vDate=`date -d'now-2 hours' +[%Y-%m-%dT%H:%M:%S` '$4 > Date {print $1}' access.log | sort | uniq -c | sort -n | tail |
This file contains 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
#!/usr/bin/env bash | |
AWS_ACCESS_KEY_ID="ARICICnfC3274R522L6F" \ | |
AWS_SECRET_ACCESS_KEY="qLwaE0s7m/LrfP+" \ | |
certbot --agree-tos -a certbot-s3front:auth \ | |
--certbot-s3front:auth-s3-bucket sdfnowier \ | |
--certbot-s3front:auth-s3-region us-east-2 \ | |
-i certbot-s3front:installer \ | |
--certbot-s3front:installer-cf-distribution-id EFGQREDSAF \ | |
-d site.com -d www.site.com |
This file contains 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 | |
## Configuration | |
SRC_CODE="/var/jenkins_home" | |
BACKUP_DIR="/home/ec2-user/" | |
PROJECT_NAME="jenkins-vfqa" | |
DST_HOST="user@host" | |
REMOTE_DST_DIR="/root/backup" | |
EXCLUDES="-x '*/workspace/*' '*/jobs/*/builds/*' '*/jobs/*/lastStable/*' '*/jobs/*/lastSuccessful/*'" | |
BACKUP_DAILY=true # if set to false backup will not work |
This file contains 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
#!/usr/bin/env bash | |
PROD_ENV="[email protected]" | |
STAGE_ENV="[email protected]" | |
INT_ENV="tx3iahfl3v2uk-integration-5ojmyuq--mymagento@ssh.us-3.magento.cloud" | |
TIMEFORMAT=%R | |
db_data_reg="cat app/etc/env.php | grep -A 10 \"'db'\"" | |
try() { | |
"$@" || { echo "command failed, with exit code $?"; exit 1; } |
This file contains 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
#You can pull this off using mysqldump. Here the catch: You cannot ship the data because there may be a cost associated with shipping the data. | |
#For this example, let's says you want to rename mydb to ourdb | |
#STEP 01 : Create the new database | |
mysql> CREATE DATABASE ourdb; | |
#STEP 02 : Get schema without the triggers | |
mysqldump -hrdshost -uuser -ppassword -d -t -R --skip-triggers mydb > /tmp/schema.sql | |
#STEP 03 : Get the triggers |
This file contains 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
# Database size | |
SELECT | |
table_schema AS "Database name", | |
SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; | |
# Database and index sizes | |
SELECT SUM(Data_length)/1024/1024/1024,SUM(Index_length)/1024/1024/1024 FROM information_schema.tables; | |
# WHERE table_schema = ''; |
This file contains 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
net.core.rmem_max = 11960320 | |
net.core.wmem_max = 11960320 | |
net.ipv4.tcp_rmem = 4096 524288 11960320 | |
net.ipv4.tcp_wmem = 4096 524288 11960320 | |
net.core.netdev_max_backlog = 30000 | |
net.ipv4.tcp_no_metrics_save = 1 | |
net.ipv4.tcp_congestion_control = cubic | |
net.ipv4.tcp_window_scaling =1 | |
net.ipv4.tcp_timestamps = 1 | |
net.ipv4.tcp_sack = 1 |
This file contains 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
acl forbidden { | |
"10.10.10.10"; | |
} | |
sub vcl_recv { | |
if (client.ip ~ forbidden) { | |
error 403 "Forbidden"; | |
} | |
} |
This file contains 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
Header set Set-Cookie HttpOnly;Secure | |
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" | |
Header always set X-XSS-Protection "1; mode=block" | |
#Header always append X-Frame-Options SAMEORIGIN | |
Header always set X-Content-Type-Options: nosniff | |
#Header set Pragma "no-cache" | |
#Header set Expires 0 | |
<IfModule mpm_worker_module> | |
ServerLimit 24 |
This file contains 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 nginx nginx; | |
worker_processes auto; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 8000; | |
} | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
http { |
NewerOlder