Skip to content

Instantly share code, notes, and snippets.

View henkin's full-sized avatar

Paul Henkin henkin

View GitHub Profile
MYIP=1.2.3.4
# add MYIP to list of allowed IPs for the Azure CosmosDB server s00354ncdbbridgedev using az cli
az cosmosdb firewall-rule create --name AllowMyIP --resource-group grp --account-name accoutn --start-ip-address $MYIP --end-ip-address $MYIP
az cosmosdb firewall-rule create --name AllowMyIP --resource-group grp --account-name accoubnt --start-ip-address 650.46.64.1 --end-ip-address 3.8.54.4
# install the Azure CLI extension for Cosmos DB.
az extension add --name cosmosdb
@henkin
henkin / launch.json
Created February 7, 2024 06:14
visual studio code
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@henkin
henkin / index.html
Created November 29, 2023 23:02
timer.ist
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css" />
@henkin
henkin / startup.sh
Last active October 13, 2023 17:18
zsh
## This is some wild shit I was working on to link shell and browser
first-tab() {
if [[ $#BUFFER == 0 ]]; then
curl http://localhost:15933
BUFFER="ph "
CURSOR=3
zle list-choices
else
zle expand-or-complete
fi
@henkin
henkin / bunyan-seq.sh
Last active October 4, 2023 17:26
seq
#!/bin/bash
# assumes bunyan-seq is installed globally - "npm install -g bunyan-seq"
# run with: npm run dev | ./bunyan-seq.sh
# SEQ_TOKEN comes from either $1, SEQ_TOKEN environment variable, or contents of ~/.seq_token
# This script assumes you've previously created a SEQ_TOKEN (reseq.sh - https://gist.githubusercontent.com/henkin/4b965bb0e71223a5d9436507dd717ec0/raw/636ac6f219010042ae0cbf233ffe1fe19c9a052a/reseq.sh)
export SEQ_TOKEN=${1:-${SEQ_TOKEN:-$(cat ~/.seq_token)}}
echo "token: $SEQ_TOKEN"
bunyan-seq --serverUrl http://localhost:5341 --apiKey $SEQ_TOKEN --logOtherAs Debug
@henkin
henkin / curl-cut-tail.sh
Last active January 22, 2023 00:28
linux
# list of all domains
doctl compute domain list | cut -w -f1 | tail -n +2 | xargs curl -v -m 1
# show all NS record ids
doctl compute domain records list paulhenkin.com | grep NS | cut -w -f1
@henkin
henkin / adduser.sh
Last active December 31, 2022 00:35
ddwrt
user=user
password=`openssl passwd -1 -salt xyz your-password-here`
cp /etc/passwd /tmp/passwd.bak
echo "${user}:${password}:1000:1000:User,,,:/tmp/${user}:/bin/sh" >> /etc/passwd
mkdir /tmp/${user}
chmod 1000:1000 /tmp/user
@henkin
henkin / import.sh
Last active December 1, 2022 00:20
terraform
tf workspace select test
tf import module.waf.aws_wafv2_ip_set.main_waf_ip_blacklist cf1527f5-b1f9-48d0-b30a-9708de235b0b/pto-waf-ip-blacklist/REGIONAL
tf import module.waf.aws_wafv2_web_acl.main_waf_acl ac78a099-ae47-42d8-a2d6-3c32932470fe/pto-test-main-waf/REGIONAL
tf workspace select stage
tf import module.waf.aws_wafv2_web_acl.main_waf_acl fdddc840-67ef-4836-a59c-e7b319d9e673/pto-stage-main-waf/REGIONAL
@henkin
henkin / pto.accept.sh
Created November 17, 2022 20:14
pto acceptance containers
docker build -t ptoaccept --platform amd64 -f Dockerfile ../../../..
docker run --rm --platform linux/amd64 -v $(pwd)/TestResults:/app/TestResults ptoaccept
@henkin
henkin / delete_aws_repo.sh
Created November 11, 2022 17:43
aws delete repo
aws ecr --region=us-west-2 describe-repositories | jq -r '.repositories[] | .repositoryName' | grep paul | xargs -L1 aws ecr --region=us-west-2 delete-repository --repository-name