Skip to content

Instantly share code, notes, and snippets.

View anuragmathur1's full-sized avatar

Anurag Mathur anuragmathur1

  • Sydney, AU
View GitHub Profile
## This is useful in case when you want your local docker to point to the minikube VM.
## So after running the below commands, you docker commands will return from the minikube vm.
## `docker images` will no longer report images on your local mac workstation but the images on the minikube VM.
## you may just run the eval command as in the last line to do all at once.
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.106:2376"
export DOCKER_CERT_PATH="/Users/anurag.mathur/.minikube/certs"
# Run this command to configure your shell:
# eval $(minikube docker-env)
@anuragmathur1
anuragmathur1 / check-volume-encryption.sh
Created February 5, 2020 23:19
Check if the EBS volumes are encrypted on instances with a given tag
for volume in `aws ec2 describe-instances --filters Name=tag:tag-key,Values=tag-value --query 'Reservations[*].Instances[*].BlockDeviceMappings[*].Ebs.VolumeId' --output=text`
do
aws ec2 describe-volumes --volume-ids $volume --query 'Volumes[*].Encrypted' --output=text
done
@anuragmathur1
anuragmathur1 / increase_volume.sh
Created October 23, 2020 00:44
Increase volume and Reboot the instance. You can, however, do without rebooting as well with some additional steps
pip install --user --upgrade boto3
export instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
python -c "import boto3
import os
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
volume_info = ec2.describe_volumes(
Filters=[
{
'Name': 'attachment.instance-id',