Skip to content

Instantly share code, notes, and snippets.

View imgeraldalinio's full-sized avatar
😎
Innovator

Gerald Alinio imgeraldalinio

😎
Innovator
View GitHub Profile

Hello! I am an expert developer specializing in cloud infrastructure setup and application development workflows.

🏗️ Services Offered:

  • 🛠️ Cloud AWS Infrastructure Setup: I specialize in creating solid and scalable AWS environments, including QA, UAT, and production setups, using Terraform. Whether you're starting from scratch or need to enhance your existing infrastructure, I can help you design and implement the ideal solution.

  • 🚀 Provisioning AWS Core Services: Leveraging Terraform, I can efficiently provision essential AWS core services to support your applications and systems, ensuring a smooth and consistent deployment process.

  • ☁️ Provisioning AWS Serverless Services: I am well-versed in crafting serverless architectures using the Serverless Framework and CloudFormation, which can significantly reduce operational overhead and infrastructure costs.

#!/bin/bash
# To get your AWS Availability Zone where your EC2 instance located
AWS_AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
# Modify your path mount folder directory
EFS_MOUNT_DIR=/home/ubuntu/efs
# Modify your own EFS endpoint
EFS_HOSTNAME=fs-xxxxxxxx.efs.us-west-2.amazonaws.com
-rw------- 1 www-data www-data 15587063 May 22 13:30 phpH0Ub3T
-rw------- 1 www-data www-data 16056288 May 22 14:56 phpHaFLtv
-rw------- 1 www-data www-data 11786422 May 22 14:56 phpJ205LL
-rw------- 1 www-data www-data 13572650 May 22 13:30 phpJZYiH3
-rw------- 1 www-data www-data 3079989 May 22 10:44 phpJnGQWN
-rw------- 1 www-data www-data 2579938 May 22 10:41 phpL2NUW0
-rw------- 1 www-data www-data 21817870 May 22 14:56 phpLKDL1Z
-rw------- 1 www-data www-data 15800848 May 22 15:18 phpLsK782
-rw------- 1 www-data www-data 10570230 May 22 15:17 phpLtWtU5
-rw------- 1 www-data www-data 17105815 May 22 14:56 phpNNTuOw
#!/bin/bash
# clean up PHP files from tmp directory older than 5 hours
sudo find /tmp/php* -type f -mmin +300 -type f -ls -delete
# sort deleted files and filter PID numbers by unique value
clean=`sudo /usr/bin/lsof | grep deleted | awk '{print $2}' | sort | uniq`
# loop PID numbers
for i in $clean
<VirtualHost *:80>
<LocationMatch "/wp-admin">
SecRuleRemoveById 950109 950901 950117 958030 960024 970903 973300 973301 973304 973332 973333 973338 981143 981172 981173 981245 950007 950120 981231
</LocationMatch>
<LocationMatch "/wp-admin/nav-menus.php">
SecRuleRemoveById 960335
</LocationMatch>
<LocationMatch "/wp-login.php">
<IfModule security2_module>
Include modsecurity.d/owasp-modsecurity-crs/crs-setup.conf
Include modsecurity.d/owasp-modsecurity-crs/rules/*.conf
</IfModule>
total 3.3M
drwx------ 1 ubuntu ubuntu 0 Jan 1 1970 .
drwxr-xr-x 11 ubuntu ubuntu 4.0K May 13 18:32 ..
-rw-rw-r-- 1 ubuntu ubuntu 3.3M May 13 18:32 mysqldump_20200513183209.sql
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
@daily sh /home/ubuntu/mysqldump.sh
#!/bin/bash
DBNAME=whatever
BACKUP=/home/ubuntu/s3_uploads
# Backup date
date=$(date +'%Y%m%d%H%M%S');
# Start exec backup..
mysqldump --defaults-extra-file=/home/ubuntu/.config.cnf $DBNAME > $BACKUP/mysqldump_$date.sql
Filesystem Size Used Avail Use% Mounted on
udev 468M 0 468M 0% /dev
tmpfs 98M 784K 98M 1% /run
/dev/xvda1 27.7G 3.7G 24.1G 48% /
tmpfs 490M 0 490M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 490M 0 490M 0% /sys/fs/cgroup
/dev/loop0 94M 94M 0 100% /snap/core/8935
/dev/loop1 18M 18M 0 100% /snap/amazon-ssm-agent/1566
/dev/loop2 94M 94M 0 100% /snap/core/9066