Skip to content

Instantly share code, notes, and snippets.

View edtshuma's full-sized avatar

Ed Tshuma edtshuma

View GitHub Profile
@edtshuma
edtshuma / guide.md
Created July 19, 2026 07:39 — forked from mcollina/guide.md
Configuring minimum release age across npm, pnpm, and yarn

Configuring minimum release age across npm, pnpm, and yarn

Setting a minimum release age (a "cooldown") on dependencies is a cheap, high-leverage defense against supply-chain attacks. Most malicious package versions are detected and yanked within hours, so a 24-hour delay filters out the smash-and-grab incidents (axios 1.14.1, ua-parser-js, Solana web3.js, etc.).

All three major Node.js package managers now support this, but each one used a different name and a different unit. Here is what you need.

Minimum versions

Tool Setting Unit Introduced in
@edtshuma
edtshuma / HOWTO_mailx.sh
Created August 22, 2023 06:42 — forked from ppdeassis/HOWTO_mailx.sh
Setting up mailx to send mail from command line using external server
# ref: https://coderwall.com/p/ez1x2w/send-mail-like-a-boss
# install mailx
yum -y install mailx
# create a directory with a certificate, to send mail using TLS
mkdir ~/.certs
certutil -N -d ~/.cert
# create a user ~/.mailrc, to use custom settings
@edtshuma
edtshuma / monitor_ec2_instance.py
Created June 9, 2023 12:44 — forked from si3mshady/monitor_ec2_instance.py
Setting Up CloudWatch Alarms with Boto3 to Monitor EC2 Instance Performance
import boto3
# Specify the region where the EC2 instances reside
region = 'us-east-1'
# Specify the tag key and value to filter the EC2 instances
tag_key = 'env'
tag_value = 'prod'
@edtshuma
edtshuma / http_requests.py
Created May 22, 2023 06:32 — forked from bpgould/http_requests.py
async python http requests using exponential backoff, jitter, and event logging
"""
This module provides functionality for making HTTP requests. It leverages the `aiohttp`
library for asynchronous HTTP requests, and the `backoff` library to implement exponential
backoff in case of failed requests.
The module defines a child logger for logging purposes and implements two methods, `on_backoff`
and `on_giveup`, which log information about the retry attempts and when the retry attempts are
given up respectively.
The `http_request` function is the primary function of the module, making an HTTP request with the
@edtshuma
edtshuma / config.tf
Created April 8, 2023 16:49 — forked from kerr-bighealth/config.tf
iam-user module
terraform {
required_version = ">=0.12, <0.13"
}
@edtshuma
edtshuma / ssh-password.md
Created October 17, 2022 06:37 — forked from cmbaughman/ssh-password.md
SSH Passwords

How to set up passwordless ssh,scp, and rsync

Setup

  1. Install the application sshpass:
sudo apt install sshpass
  1. Make sure to set in your ~/.ssh/config file the following options to prevent ssh from using your pubkey:
@edtshuma
edtshuma / workspaces_ec2_s3_deploy.tf
Created September 10, 2022 11:04 — forked from si3mshady/workspaces_ec2_s3_deploy.tf
Terraform workspaces and variables practice - deploy ec2 and s3
terraform {
backend "s3" {
bucket = "elliott-arnold-dev-bucket"
region = "us-east-1"
key= "tfstate"
}
}
@edtshuma
edtshuma / error_count_kubectl.awk
Created August 17, 2022 09:51 — forked from si3mshady/error_count_kubectl.awk
AWK practice - filter kubectl output to show counts for running, errorImagePull and imagePullBackup
BEGIN {
imagePullBackOff=0
running=0
errorImagePull=0
}
{
@edtshuma
edtshuma / gist:28a6e6976752ce8d7ba4d3d6f1e778a9
Created August 8, 2022 07:34 — forked from mrlesmithjr/gist:72e23d0a0cceefef553b83b4fce5d06f
Example GitLab CI Pipeline using Terraform, etc.
---
# Most pre-req tooling, etc. is installed using jumphosts.yml playbook
variables:
ADMIN_EMAIL: mrlesmithjr@gmail.com
CLOUD_PROVIDER: Azure # Define Supported Cloud Provider (Azure)
GIT_CRYPT_ENABLED: "true" # Must be lowercase (true|false)
GIT_SUBMODULE_STRATEGY: recursive
ORGANIZATION: example_org
PROJECT_NAME: example_project
TERRAFORM_VERSION: 0.12.28
@edtshuma
edtshuma / get_deployment_manifest.sh
Created August 4, 2022 15:25 — forked from si3mshady/get_deployment_manifest.sh
Generate k8s deployment manifest files after using helm
for dep in $(kubectl get deployment | awk '{print $1}'); do kubectl get deployment $dep -o yaml > $dep.yml; done