Skip to content

Instantly share code, notes, and snippets.

View ViggoMode2021's full-sized avatar
🥅

Ryan Viglione ViggoMode2021

🥅
  • New London, CT
View GitHub Profile
Pre-Reqs
---
1) CDK
2) NPM
3) A Github repository
1. Run this command
export CDK_NEW_BOOTSTRAP=1
npx cdk bootstrap aws://<YOUR_ACCONT_ID>/<YOUR_REGION> --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess aws://<YOUR_ACCONT_ID>/<YOUR_REGION>
@arundhaj
arundhaj / main.py
Created January 29, 2022 11:31
AWS S3 Presigned URL for upload and download
from pprint import pprint
import boto3
session = boto3.Session(profile_name='arundhaj')
s3_client = session.client('s3')
s3_bucket_name = 'codepossibility-presigned'
object_name = 'TestUploadFile.txt'
Connect & Disconnect
---
import json
def lambda_handler(event, context):
print(event)
print("****")
print(context)
@f-steff
f-steff / excel formulas.md
Last active November 25, 2025 13:12
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.

@raphaelgabbarelli
raphaelgabbarelli / hellp_kms.py
Created May 23, 2020 21:41
encrypt and dectypt with AWS KMS
import boto3
import base64
key_id = 'de5bb9e8-6526-49bc-822f-4e8a70ea7a19'
def hello_kms():
session = boto3.session.Session(profile_name='caveman')
client = session.client('kms')
encryption_result = client.encrypt(KeyId=key_id,
@gh0st026
gh0st026 / docker_export_postgre_table.sh
Last active February 13, 2023 02:15
Dump PostgreSQL Table in docker container as CSV file
CONTAINER="name"
DB="Db name"
TABLE="Table Name"
FILE="file.csv"
sudo docker exec -u postgres ${CONTAINER} psql -d ${DB} -c "COPY ${TABLE} TO STDOUT WITH CSV HEADER " > ${FILE}
@wdullaer
wdullaer / install.sh
Last active March 11, 2026 09:02
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@whyvez
whyvez / install-psycopg2.sh
Last active July 13, 2022 02:58
install psycopg2 on aws linux
sudo yum install gcc python27 python27-devel postgresql-devel
sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python27
sudo /usr/bin/easy_install-2.7 pip
sudo pip2.7 install psycopg2