Skip to content

Instantly share code, notes, and snippets.

View MrHassanMurtaza's full-sized avatar
🎯
Focusing

Hassan Murtaza MrHassanMurtaza

🎯
Focusing
View GitHub Profile
@pigri
pigri / script.sh
Created September 24, 2019 14:51
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; \
@statico
statico / circleci.yml
Created January 21, 2019 21:25
Node.js 10 + PostgreSQL CircleCI config
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
@ahmadawais
ahmadawais / OneDevMinute.md
Last active September 29, 2018 02:50
[OneDevMinute]: Shell Aliases For Easy Directory Navigation

OneDevMinute

Ever had that typo where you wrote cd.. instead of cd .. — well this tip not only addresses that typo but also adds a couple other aliases to help you easily navigate through your systems directories. #OneDevMinute

################################################
# 🔥 #OneDevMinute
#
# Daily one minute developer tips.
# Ahmad Awais (https://twitter.com/MrAhmadAwais)
@jokeru
jokeru / aws_delete-default-vpc.sh
Created March 31, 2018 15:14
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
@posva
posva / config.yml
Last active May 2, 2020 22:59
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:
@nagelflorian
nagelflorian / buckets.tf
Last active February 12, 2024 07:44
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"
}
@gurunars
gurunars / find_latest_ami_name.py
Last active October 30, 2020 01:41
AWS lambda function to find the latest Amazon AMI
"""
Publish the function to S3:
cd $DIR_WITH_THIS_SCRIPT
zip find_latest_ami_name.zip find_latest_ami_name.py
aws s3 cp find_latest_ami_name.zip s3://$YOUR_S3_BUCKET/find_latest_ami_name.zip
"""
import json
@ikegami-yukino
ikegami-yukino / install_byobu_yum.sh
Last active February 11, 2020 07:14
Install byobu to CentOS and Amazon Linux
sudo yum install byobu -y --enablerepo=epel-testing
@codeinthehole
codeinthehole / user-data.sh
Created August 18, 2014 12:41
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:
#
# {
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing