Skip to content

Instantly share code, notes, and snippets.

View anamorph's full-sized avatar
🇧🇭
Hello from sunny Bahrain !

Nicolas David anamorph

🇧🇭
Hello from sunny Bahrain !
View GitHub Profile
@anamorph
anamorph / addmy32.sh
Created January 6, 2019 08:15
adds your /32 to your dev ec2 security group.
#!/bin/bash
export MY_32CIDR=$(curl -s v4.ifconfig.co)/32
aws ec2 authorize-security-group-ingress --group-id sg-{yoursgid} --protocol tcp --port 22 --cidr $MY_32CIDR
@anamorph
anamorph / gist:46039fa8a4e2c1ac96875bd435a9f681
Created March 21, 2021 12:09
Installing AWS CLI v2 on raspian
pip3 install https://github.com/boto/botocore/zipball/v2#egg=botocore --upgrade
pip3 install -r requirements.txt
pip3 install .
@anamorph
anamorph / compresspdf.sh
Created June 23, 2021 07:32
Creates an alias to compress (quick & dirty) pdfs via the terminal
# pre-reqs:
# ghostscript -> brew install ghostscript
function compresspdf {
INPUT_FILE=$1
FILE_EXTENSION="${INPUT_FILE##*.}"
FILE_NAME="${INPUT_FILE%.*}"
OUTPUT_FILE="$FILE_NAME-compressed.$FILE_EXTENSION"
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dColorImageResolution=150 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$OUTPUT_FILE $INPUT_FILE
}
@anamorph
anamorph / check_unattached_EIPs.sh
Created January 8, 2024 08:59
[aws] List all the Unattached Elastic IP addresses in all of the Opted-In Regions
#!/bin/sh
# id: check_unattached_EIPs.sh
# author: nicolas david - [email protected]
#
## version history:
# ----------------------------------------------------------------------------
# v1.0 nicolas@ Initial Version
#
# ----------------------------------------------------------------------------