Skip to content

Instantly share code, notes, and snippets.

View yolabingo's full-sized avatar

Todd Jacobsen yolabingo

  • New Mexico, USA
View GitHub Profile
@yolabingo
yolabingo / how-to-build-debian-kernel.md
Last active March 5, 2022 17:24
Build debian kernel from source

Want a cool new kernel feature but it won't show up in Debian for years?

make deb-pkg makes it easy to install a custom Linux kernel from source.

as root/sudo:

apt install build-essential libncurses5-dev gcc libssl-dev bc bison flex rsync libelf-dev
mkdir /usr/local/src/kernel
chown nonrootuser /usr/local/src/kernel
su - nonrootuser
update_config:
delay: 3m
parallelism: 1
failure_action: rollback
python -c 'import secrets,string; print("".join(secrets.choice(string.ascii_letters+string.digits) for i in range(34)))'
@yolabingo
yolabingo / dotcms-get-demo-site-starter-urls.sh
Last active February 2, 2024 23:16
Gets the CUSTOM_STARTER_URL for a specific version of dotCMS
#!/usr/bin/env bash
# https://gist.github.com/yolabingo/f11e81b2cbdb00fff9b1ae0ef8076263
# checks out dotcms/core GH repo, then prints the CUSTOM_STARTER_URL for demo site content
# for each tagged version release
# output formatted for docker-compose.yml
if ! which git > /dev/null
then
echo "'git' must be installed to run this script"
@yolabingo
yolabingo / acm_search_certs.py
Last active February 11, 2022 00:57
list and simple search of AWS Certificate Manager SSL certs using python and boto3
#!/usr/bin/env python3
"""
usage: acm_search_certs.py [-h] [--region REGION] [--san-names SAN_NAMES] [--identifiers IDENTIFIERS]
[--tags TAGS] [--issuers ISSUERS] [--cert-in-use {0,1}] [--json] [--and-filters]
Fetches ACM SSL certificates.
options:
-h, --help show this help message and exit
@yolabingo
yolabingo / docker-compose-logging.yml
Last active January 7, 2022 04:05
docker-compose log file max size
   logging:
     driver: "json-file"
     options:
         max-file: "20"
         max-size: "100m"
@yolabingo
yolabingo / pg_delete_tables
Created June 10, 2021 16:11
delete all tables from a posgres database
DO $$ DECLARE
r RECORD;
BEGIN
-- if the schema you operate on is not "current", you will want to
-- replace current_schema() in query with 'schematodeletetablesfrom'
-- *and* update the generate 'DROP...' accordingly.
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;

curl -k --user admin:PASS https://prod-es1:9200

/_cluster/health?pretty
/_cat/nodes?pretty
/_cluster/health?level=indices&pretty
/_cluster/health?level=shards&pretty

delete unassigned shards

@yolabingo
yolabingo / openssl-cheatsheet.md
Last active July 9, 2025 15:08
OpenSSL cheatsheet

The only 28 openssl commands you will ever need

General OpenSSL Commands

Generate a new private key and Certificate Signing Request

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key

Generate a certificate signing request (CSR) for an existing private key

@yolabingo
yolabingo / install-docker-compose.sh
Last active March 11, 2021 00:12
install docker-compose on amazon linux arm64
sudo yum install -y python3-devel gcc docker
sudo useradd -m -G docker -s /bin/bash docker
sudo su - docker
python3 -m venv python3-env
source python3-env/bin/activate
# or export PATH=$HOME/python3-env/bin:$PATH and add to .bash_profile
# upgrade pip first else you may get rust errors while building docker-compose
pip install --upgrade pip
pip install docker-compose