Skip to content

Instantly share code, notes, and snippets.

View jasonco-dev's full-sized avatar

Jason Camacho jasonco-dev

  • Guaynabo, Puerto Rico
View GitHub Profile
@cbcafiero
cbcafiero / replacements.py
Last active November 3, 2022 09:00
Easy multiple search and replace by tag and attribute with BeautifulSoup
"""
Sometimes you want to make several different replacements. Search by tag with
optional attributes. Replace with tag with optional attributes.
Thank you to Dan @ University of Exeter for bug fix
"""
from bs4 import BeautifulSoup
REPLACEMENTS = [('b', {}, 'strong', {}),
@dehamzah
dehamzah / generate.js
Last active June 23, 2025 09:37
Generate secret key in NodeJS
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
@darron
darron / ecr-empty-repos.sh
Created February 27, 2017 19:16
Figure out which repos in ECR are empty.
export REPOS=$(aws ecr describe-repositories | jq '.repositories | .[].repositoryName' | cut -d'"' -f 2)
for repo in $REPOS;
do
IMAGES=$(aws ecr list-images --repository-name $repo | grep imageDigest)
if [[ "$?" -eq "1" ]]
then
echo "$repo: empty"
fi
done
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 12, 2026 16:49
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Last update: Nov 2025.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl ecparam -genkey -name secp384r1 | openssl ec -aes256 -out rootCA.key
@ryankurte
ryankurte / gencerts.sh
Last active January 13, 2025 15:51
Node.js Client Certificate Validation with Pinning Example
#!/bin/bash
# https://gist.github.com/ryankurte/bc0d8cff6e73a6bb1950
set -e
if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then
echo "Usage: $0 CA NAME ORG"
echo "CA - name of fake CA"
echo "NAME - name of fake client"
echo "ORG - organisation for both"
@leonardofed
leonardofed / README.md
Last active May 8, 2026 07:19
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@aheld
aheld / get_rds_tags
Created June 30, 2016 18:44
get RDS tags using AWS cli , this really seems too complicated
#!/bin/bash
REGION="us-east-1"
PROFILE="prod"
get_account_id(){
aws ec2 describe-security-groups \
--group-names 'Default' \
--query 'SecurityGroups[0].OwnerId' \
--output text \
@chdorner
chdorner / README.md
Last active June 23, 2023 20:13
SQLAlchemy scan large table in batches

my database had 72k annotations at the time I ran these benchmarks, here's the result:

$ python scripts/batch_bench.py conf/development-app.ini dumb
Memory summary: start
      types |   # objects |   total size
=========== | =========== | ============
       dict |       13852 |     12.46 MB
  frozenset |         349 |     11.85 MB
VM: 327.29Mb
@Integralist
Integralist / 1. linux utilities.md
Last active March 23, 2026 03:03
Different Linux utility commands (e.g. top, ps, strace, lsof, netstat, ifconfig, iftop, iptraf, tcpdump, wireshark)

Start up a container (whichever Linux flavour takes your fancy):

docker run -it ubuntu /bin/bash
docker run -it centos /bin/bash
  • top: check what CPU and Memory running processes are utilising
  • ps: see what processes are running
  • strace: monitor interactions between processes
@drmalex07
drmalex07 / README-docker-entrypoint.md
Last active September 11, 2024 01:03
An example docker entrypoint. #docker #docker-entrypoint #pid-1

README

A docker entrypoint must ensure that after any initialization (environmanet setup etc.) the main docker process must remain at PID 1. This is usually accomplished by using exec as the last command (which actually replaces the current process).

See also: https://docs.docker.com/engine/reference/builder/#entrypoint

An example entrypoint.sh: