Skip to content

Instantly share code, notes, and snippets.

View ArchTaqi's full-sized avatar
🏠
Working from home

Muhammad Taqi ArchTaqi

🏠
Working from home
View GitHub Profile
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`; do
aws sns list-subscriptions --query "Subscriptions[?starts_with(Endpoint, 'arn:aws:sqs:')].[TopicArn, Endpoint]" --output text --region $region
done
@ArchTaqi
ArchTaqi / mysqlbackupforcrashplan.bash
Created June 9, 2021 19:35 — forked from gene1wood/mysqlbackupforcrashplan.bash
Script that exports a MySQL database so it can be backed up
#!/bin/bash
#
# A script to create a daily mysqldump for crashplan
# Defaults
# Override them in /etc/default/mysqlbackupforcrashplan
OUTPUTFILE=/var/local/full-backup.sql
STATEFILE=/var/local/full-backup.sql.state
CRONFILE=/etc/cron.d/mysqlbackupforcrashplan
MYSQLDUMPBIN=/usr/bin/mysqldump
@ArchTaqi
ArchTaqi / delete_all_s3_bucket_files
Created June 9, 2021 19:34 — forked from gene1wood/delete_all_s3_bucket_files
Command to delete all objects from S3 bucket using lifecycle configuration
for bucket in `cat list-of-s3-buckets.txt`; do
aws s3api put-bucket-lifecycle \
--bucket $bucket \
--lifecycle-configuration '{"Rules":[{"ID":"cleanup","Status":"Enabled","Prefix":"","Expiration":{"Days":1}}]}';
done
@ArchTaqi
ArchTaqi / clean_code.md
Created January 6, 2021 21:25 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules