Skip to content

Instantly share code, notes, and snippets.

View myugan's full-sized avatar
☁️
Working from cloud

Muhammad Yuga N. myugan

☁️
Working from cloud
View GitHub Profile
@myugan
myugan / get_public_ebs.sh
Created August 9, 2021 03:36
Get the lists of public EBS snapshots and filter by description
#!/bin/bash
keyword="any_description_here"
regions=( us-east-1 us-east-2 us-west-1 us-west-2 ap-south-1 ap-northeast-3 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-south-1 )
for i in "${regions[@]}"
do
echo -n "Region: ${i}"
aws ec2 describe-snapshots --region ${i} --filters "Name=description,Values=$keyword"
done
@myugan
myugan / malicious-pod.yml
Last active July 26, 2021 05:14
malicious-pod.yml
apiVersion: v1
kind: Pod
metadata:
name: demo
labels:
app: demo
spec:
containers:
- name: demo
image: k8s.gcr.io/etcd:3.4.13-0
@myugan
myugan / alpine.yaml
Last active July 26, 2021 04:36
Alpine pods
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2021-07-21T20:32:48Z"
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:spec:
f:automountServiceAccountToken: {}
apiVersion: v1
kind: Pod
metadata:
labels:
run: redis
name: redis
namespace: production
spec:
containers:
- image: redis
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-devel-pod-to-http
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
apiVersion: v1
kind: Pod
metadata:
name: curl
spec:
containers:
- name: curl
image: curlimages/curl
command:
- sleep
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
spec:
podSelector: {}
policyTypes:
- Ingress
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: webserver
name: webserver
namespace: development
spec:
replicas: 1
selector:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: webserver
name: webserver
namespace: production
spec:
replicas: 1
selector:
@myugan
myugan / gcloud-install.sh
Created June 20, 2020 16:17
Install gcloud on Ubuntu based
#!/bin/bash
sudo apt-get install apt-transport-https ca-certificates gnupg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
gcloud auth login