Skip to content

Instantly share code, notes, and snippets.

View adilshehzad786's full-sized avatar
🎯
Focusing

Adil adilshehzad786

🎯
Focusing
View GitHub Profile
@adilshehzad786
adilshehzad786 / bash_aws_jq_cheatsheet.sh
Created January 13, 2022 17:52 — forked from lukeplausin/bash_aws_jq_cheatsheet.sh
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
@adilshehzad786
adilshehzad786 / gist:944485f7caaee3b0015c099cce17118a
Created January 13, 2022 17:52 — forked from taizo/gist:3141646
Lists AWS instances using python-boto
#!/usr/bin/env python
from pprint import pprint
import boto
import boto.ec2
from boto.ec2.regioninfo import RegionInfo
port=80
access_id = "Your ACCESS_ID"
@adilshehzad786
adilshehzad786 / kubernetes_commands.md
Created August 8, 2021 15:36 — forked from edsiper/kubernetes_commands.md
Kubernetes Useful Commands
@adilshehzad786
adilshehzad786 / README.md
Created June 11, 2021 10:38 — forked from hofmannsven/README.md
Git Cheatsheet
@adilshehzad786
adilshehzad786 / examples.md
Created March 18, 2021 20:13 — forked from jonschlinkert/examples.md
Three files: examples.md, yaml-cheatsheet.md and yaml-cheatsheet.yml

adapted from this blog

# YAML
name: Jon
# YAML
object: