Skip to content

Instantly share code, notes, and snippets.

View voxxit's full-sized avatar

Josh Delsman voxxit

View GitHub Profile
@voxxit
voxxit / download-slow-query-log.sh
Last active October 31, 2023 16:13
Downloads RDS slow query logs for the last 24 hours using the AWS CLI
#!/bin/bash
instanceID=$1
date=$(date +%Y%m%d)
function downloadLog () {
local log=$1
aws rds download-db-log-file-portion \
--output text \
@voxxit
voxxit / RUNBOOK.md
Created April 29, 2016 14:26
Example of a solid run book/operations manual

Run Book / Operations Manual

  1. Table of Contents
  2. System Overview
    • Service Overview
    • Contributing Applications, Daemons, and Windows Services
    • Hours of Operation
    • Execution Design
    • Infrastructure and Network Design
    • Resilience, Fault Tolerance and High-Availability
@voxxit
voxxit / gist:67e4402ea978a2784f24
Last active February 24, 2023 02:50
To uninstall rbenv/ruby-build and install rvm w/ ruby 2.1.2
brew uninstall rbenv
brew uninstall ruby-build
rm -rf $HOME/.rbenv
exec $SHELL -l
cd $HOME
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2
source $HOME/.rvm/scripts/rvm
@voxxit
voxxit / readme.md
Created September 22, 2022 22:23 — forked from cielavenir/readme.md
zoom sandbox-exec for macOS
  1. Download Zoom.pkg from https://zoom.us/download
  2. Extract it using https://www.timdoug.com/unpkg/
  3. Now you have Zoom/zoom.us.app
  4. Launch Zoom by zoom.sh Zoom/zoom.us.app/Contents/MacOS/zoom.us

caveats:

  • Zoom will fail to start meeting for the first time. Just launch again.
  • Zoom will tell that crash happened, but you should ignore it.
@voxxit
voxxit / hcaptcha.ts
Created September 12, 2022 19:05 — forked from prescience-data/hcaptcha.ts
HCaptcha Solver
import { IncomingMessage, RequestListener, ServerResponse } from "http"
import { createServer, Server } from "https"
import puppeteer, {
Browser,
BrowserLaunchArgumentOptions,
Protocol
} from "puppeteer-core"
import { Page } from "./types"
import Cookie = Protocol.Network.Cookie
---
apiVersion: v1
data:
kernel-monitor.json: |
{
"plugin": "kmsg",
"logPath": "/dev/kmsg",
"lookback": "5m",
"bufferSize": 10,
"source": "kernel-monitor",
@voxxit
voxxit / .zshrc
Last active August 5, 2022 18:57
How to keep your .bashrc / .zshrc free of secrets!
############## 1Password Stuff ###############
# Check for 1Password CLI, and install if necessary:
command -v op >&- || brew install --cask 1password-cli
# You can simply export the 1Password secret's deep link in
# place of any sensitive value held in an environment variable:
export JIRA_API_TOKEN="op://example_vault/JIRA_API_TOKEN/credential"
# To use this at runtime, use: `op run -- <app> ..args..`
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@voxxit
voxxit / Dockerfile
Last active April 6, 2022 01:52
nginx v1.9.3 Dockerfile with HTTP/2 support baked in!
FROM alpine:latest
MAINTAINER Joshua Delsman <j@srv.im>
EXPOSE 443
ENV NGINX_VERSION 1.9.3
RUN apk add --update openssl-dev pcre-dev zlib-dev build-base \
&& rm -rf /var/cache/apk/* \
@voxxit
voxxit / track-import.sh
Last active August 9, 2021 03:37
Script I use to automate my workflow of importing newly purchased/downloaded tracks from Beatport and elsewhere
#!/bin/bash
INPUT_FOLDER="${HOME}/Music/Unprocessed"
OUTPUT_FOLDER="${HOME}/Dropbox/Music/$(date +%Y-%m)"
filecount=$(find "$INPUT_FOLDER" \( -name "*mp3" -o -name "*aif*" -o -name "*wav" \) -type f -print | wc -l)
if [[ $filecount -lt 1 ]]; then
printf "\nNo files found in '%s'. Time to find new beats!\n" "$INPUT_FOLDER"
exit 0
fi