Skip to content

Instantly share code, notes, and snippets.

View xero's full-sized avatar
💭
🌃 💾

xero harrison xero

💭
🌃 💾
View GitHub Profile
@xero
xero / awscurl
Last active August 17, 2023 15:25
curl script for aws rest api
#!/bin/sh
# shellcheck disable=SC2155,SC2001
VERSION="1.0.9"
DATE_CMD="date"
SED_CMD="sed"
# use gnu coreutils on macOS: brew install coreutils
if [ "$(uname)" = "Darwin" ]; then
@xero
xero / miasma.Xcolors
Created June 5, 2023 19:10
miasma “fall” colorscheme
// ┏┏┓o┳━┓┓━┓┏┏┓┳━┓
// ┃┃┃┃┃━┫┗━┓┃┃┃┃━┫
// ┛ ┇┇┛ ┇━━┛┛ ┇┛ ┇
// miasma by xero (https://x-e.ro)
*.foreground: #c2c2b0
*.background: #222222
*.cursorColor: #5f875f
! black
*.color0: #222222
@xero
xero / getip
Last active May 30, 2023 16:31
aws ip miner
#!/bin/bash
# interactive aws elastic ip miner tool, get a cool aws ip!
# usage: AWS_PROFILE=dev AWS_REGION=us-west-1 ./getip
# CC0 xero | https://x-e.ro | https://github.com/xero
declare -g region='us-east-2' tmp=''
tmp="$(mktemp /tmp/getip.XXXXXXXXXX)" || { echo "failed creating temp file"; exit 1; }
[ -z "$AWS_REGION" ] || region="$AWS_REGION"
function requirements() {
@xero
xero / cidr
Last active May 24, 2023 16:39
CIDR - the CIDR block calc & cheatsheet
#!/bin/bash
# CIDR - the CIDR block calc & cheatsheet
# CC0 xero | https://x-e.ro | https://github.com/xero
usage() {
EXITCODE=0
if [ -n "$1" ] && [ "$1" -eq "$1" ] 2>/dev/null; then
EXITCODE=$1
fi
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
@xero
xero / yank
Created May 6, 2023 01:38
heinous edit of a yank script by samoshkin that tries to push to every clipboard it possibly can
#!/bin/bash
# heinous edit of a yank script by samoshkin
# https://github.com/samoshkin/tmux-config/blob/master/tmux/yank.sh
# tries to push to every clipboard it possibly can xD
set -eu
shopt -s extglob
installed() {
type "$1" &>/dev/null
}
@xero
xero / mac-docker-vpn.md
Created April 10, 2023 14:12
Docker for Mac VPN bridge setup

Setup Docker locally

This guide will help you setup docker locally for building and testing services behind the AWS CDE firewall by bridging your VPN connection to Docker.

Install the app

brew install docker

Configure to bridge the VPN

Edit your config list file: ~/Library/Group\ Containers/group.com.docker/cni/10-default.conflist Change all the subnet, gateway, and nameserver values from 10.1.0.1 to an adjacent subnet within your private VPC. e.g. 100.200.0.1 for me docker was colliding with an existing private subnet.

@xero
xero / aws_acm_certificates_expiring_soon.sh
Last active September 26, 2022 21:29
quick and dirty shell script to enumerate all ACM certificates in each region, filter out only automatic renewal eligible certs, then calculate the months/days till they expire. useful for alerting cron jobs. echos could be replaced with curl commands to webhooks, etc.
#!/bin/sh
# ___╱╲ _____ ╱╲______ ____╱╲ ___╱╲
# ╲ _ ╲╱ .:╱╱.:╲____╱╱_╲_. ╲ ╱.╱__ ╲
# ╲╲ ╱ ╱╱ ___╱╱ .╲╱ _╱╱ ╲ ╱ ╲
# ╱.: ╲ ╲_. ╱╱ _. ╲╱ .:╲╱ ╱
# ╱____╱╲ __╲╱__ ╱╱______│ ╱╲_______╱
# ╲╱ ╲╱ │╱x0^67^iMP!
# https://0w.nz
# https://x-e.ro
# (K)opimi / CC0 public domain
@xero
xero / _artisan_dreams.md
Last active June 5, 2023 20:35
artisan keycap wishlist

artisan keycap wishlist

sorted artist > sculpt then by colorway desire

daphy v2

duck flick
3rd eye ✨ third eye
@xero
xero / python-nameserver.py
Created June 7, 2019 18:44 — forked from dustyfresh/python-nameserver.py
DNS nameserver implemented in python
#!/usr/bin/env python3
import sys
from datetime import datetime
import time
from time import sleep
from dnslib import DNSLabel, QTYPE, RD, RR, RCODE
from dnslib import A, AAAA, CNAME, MX, NS, SOA, TXT
from dnslib.server import DNSServer
@xero
xero / ansicat.c
Created January 22, 2019 15:44
cp437 decoder. display ansi art in modern utf8 shells. cc0 / kopimi: unixbros (dcat & x0)
/*
* .
* .__ .______/| .____ ____. .___ __.
* _____\ \ ___/_ \ _|____\____Y __/____ _____\ Y /__.
* / _ \ X / \ X | \ X _ \ | ___/---.
* | \ | / l____ > | | \ | \ |
* | ::.. __l__/ ::.__| / .: /:.__l__ ..:: | ::.. __l__ ..:: |
* l______ / \______/ /___ /| _/ \ ______l______ / \ ______|
* \/ \/ |/ \/ \/ \/ x0!
*