Skip to content

Instantly share code, notes, and snippets.

View MrHassanMurtaza's full-sized avatar
🎯
Focusing

Hassan Murtaza MrHassanMurtaza

🎯
Focusing
View GitHub Profile
@MrHassanMurtaza
MrHassanMurtaza / aws_delete-default-vpc.sh
Created April 8, 2022 00:39 — forked from jokeru/aws_delete-default-vpc.sh
Script to delete all AWS default VPCs from all regions using AWS CLI
#!/usr/bin/env bash
if [ "$AWS_PROFILE" = "" ]; then
  echo "No AWS_PROFILE set"
  exit 1
fi
for region in $(aws ec2 describe-regions --region eu-west-1 | jq -r .Regions[].RegionName); do
@MrHassanMurtaza
MrHassanMurtaza / buckets.tf
Created July 10, 2020 09:51 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@MrHassanMurtaza
MrHassanMurtaza / mongoconsole.sh
Created June 22, 2020 15:57 — forked from stanislavb/mongoconsole.sh
Backup and restore MongoDB running in a Docker container
#!/bin/bash
usage() {
echo "Usage $0 -c mongo_docker_container_name"
}
while [[ $# > 1 ]]
do
key="$1"
@MrHassanMurtaza
MrHassanMurtaza / aws-k8s-cni.yaml
Created May 29, 2020 06:50
Set warm pool CNI var
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aws-node
rules:
- apiGroups:
- crd.k8s.amazonaws.com
resources:
- "*"
@MrHassanMurtaza
MrHassanMurtaza / script.sh
Created May 27, 2020 07:36 — forked from pigri/script.sh
ENI cleaner
@export ENIS=$$(aws ec2 describe-network-interfaces --filters "Name=status,Values=available" | jq ".NetworkInterfaces[] | select(.VpcId == \"$${VPC_ID}\") | .NetworkInterfaceId"); \
if [[ ! -z $${DRY_RUN} ]]; then \
echo "Running in dry run mode! No changes will be made. The following ENIs would be deleted:"; \
echo $${ENIS}; \
exit 0; \
else \
for eni in $$(echo $${ENIS}| tr -d "\""); \
do \
aws ec2 delete-network-interface --network-interface-id $${eni}; \
done; \
@MrHassanMurtaza
MrHassanMurtaza / introrx.md
Created February 24, 2020 13:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
Autoscaling.
◾Understand autoscaling inside and out.
◾Make sure you know the differences between deploying with and without Cloudformation (as there are some deployment methods you can do with Cloudformation that you can’t without) and the command or JSON syntax to perform them.
◾Understand lifecycle hooks and the autoscaling stages they run in
◾Understand launch configurations and how they work and are updated (hint: You must replace them)
◾Understand why you may need to place an instance into STANDBY state
•Elastic Beanstalk.
◾You’ll need to know this to an advanced level.
◾Understand what stacks Beanstalk supports natively and how you would deploy a stack it doesn’t (hint: Use Docker).
@MrHassanMurtaza
MrHassanMurtaza / circleci.yml
Created July 24, 2019 11:42 — forked from statico/circleci.yml
Node.js 10 + PostgreSQL CircleCI config
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
@MrHassanMurtaza
MrHassanMurtaza / config.yml
Created July 24, 2019 11:41 — forked from posva/config.yml
Simple Circle CI 2 config for node/js projects
# Javascript Node 8 simple CircleCI 2.0 configuration file
# Eduardo San Martin Morote
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
# Put this file in a .circleci/ folder
version: 2
jobs:
build:
docker:
@MrHassanMurtaza
MrHassanMurtaza / user-data.sh
Created February 6, 2019 11:25 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {