Skip to content

Instantly share code, notes, and snippets.

View Nezteb's full-sized avatar
💣
hello world'); DROP TABLE Statuses;--

Noah Betzen Nezteb

💣
hello world'); DROP TABLE Statuses;--
View GitHub Profile
@Nezteb
Nezteb / kube-db-access.sh
Last active March 27, 2023 20:59
Connecting to RDS behind EKS cluster VPC, Keyspaces, and Redshift via easy-to-use shell aliases.
kubeshell() {
# Set these:
KUBE_NAMESPACE=
KUBE_POD=
kubectl -n "$KUBE_NAMESPACE" exec -ti "$KUBE_POD" -- bash
}
kubepg() {
# Options:
# 1: dev, test, or prod
@Nezteb
Nezteb / Dockerfile
Last active March 29, 2023 07:36
Deploying Fossil with TLS on Fly.io via Docker
# Pulled from https://fossil-scm.org/home/file?name=Dockerfile&ci=trunk
# With more build ARGs, cleaner tarball extraction, HTTPS, etc.
ARG ALPINE_VERSION
ARG FSLHSH
ARG FSLVER
ARG FSLCFG=""
# syntax=docker/dockerfile:1.3
# See www/containers.md for documentation on how to use this file.
@Nezteb
Nezteb / pre-commit
Last active March 22, 2023 23:07
Pre-commit hook that will format any Elixir code that mix deems badly formatted AND that is staged for a commit. Instructions: https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
#!/usr/bin/env bash
# Grep on macOS is limited and weird, so we're using Perl for the regex (and awk because it's easy)
UNFORMATTED_FILES=$(mix format --check-formatted 2>&1 | perl -nle'print $& while m{^|[^*]\* \K.*}g' | awk NF | sort)
STAGED_FILES=$(git diff --name-only --cached | sort)
# Files that need formatting and are currently staged (comm expects sorted inputs)
INTERSECTION=$(comm -12 <(echo "$UNFORMATTED_FILES") <(echo "$STAGED_FILES"))
GREEN='\033[0;32m'
{
"title": "Add ctrl/fn/cmd + left click -> right click",
"rules": [
{
"description": "ctrl+left click to right click",
"manipulators": [
{
"type": "basic",
"from": {
"pointing_button": "button1",
@Nezteb
Nezteb / downloadIndexOf.sh
Created March 19, 2023 04:51
Download "index of" sites
#!/bin/bash
wget --no-clobber --no-parent --recursive --random-wait --user-agent=mozilla --reject "*.html*" $1
@Nezteb
Nezteb / compress_videos.sh
Created March 11, 2023 21:10
A quick video compression script, but it's still pretty slow
#!/usr/bin/env bash
# VIDEOS=$(fd mp4)
# for VIDEO in $VIDEOS
# do
# done
/usr/bin/find . -type f -name "*.mp4" -print0 | while IFS= read -r -d '' VIDEO; do
echo "Compressing $VIDEO..."
@Nezteb
Nezteb / removeResolvedBotThreadsGitLab.js
Last active March 21, 2023 00:52
Remove GitLab resolved bot comments (for use with https://www.tampermonkey.net/)
// ==UserScript==
// @name Remove resolved bot threads on a merge request
// @description Remove resolved bot threads on a merge request
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Noah Betzen
// @match https://gitlab.com/*/merge_requests/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gitlab.com
// @grant none
// ==/UserScript==
@Nezteb
Nezteb / get_twitter_following_from_page.js
Created November 4, 2022 18:35
Go to https://twitter.com/USERNAME/following and run this to download a JSON file summarizing everyone you follow. Doesn't require Twitter API access.
const delay = (milliseconds) => {
return new Promise(resolve => {
setTimeout(resolve, milliseconds);
});
}
const getElementByXPath = (node, path) => {
return document.evaluate(path, node, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
@Nezteb
Nezteb / keybase.md
Created October 3, 2022 07:27
keybase.md

Keybase proof

I hereby claim:

  • I am nezteb on github.
  • I am nezteb (https://keybase.io/nezteb) on keybase.
  • I have a public key ASDyuiwu5J7N11dFqoODnh6yemm_cFqt9CyFX9CZ4jEKIQo

To claim this, I am signing this object:

@Nezteb
Nezteb / keys.pub
Created September 25, 2022 20:30
keys.pub
BEGIN MESSAGE.
hACsxbI7R5ZJQZw HyMil5HNazf4KTQ TmSHbp7D09Bmv3h KfDdpC1aYvuFdel
2jxVg2UslRKhXWL 7Dp3qsXY7k3TCKq 6Xr2MZHgg4ZvTLH iXE9GCCuX8YoOBV
5s1ebLoV2PiOoqL yI9IRT3Gz7l1TaJ 7tDQxLwaoXqjal5 W2jTkhfCC2KABuo
c6QIKDVQSpCbdN0 PJkUnawBbDLmzzJ MLUEk21.
END MESSAGE.