Skip to content

Instantly share code, notes, and snippets.

@altercation
altercation / motd.sh
Created May 25, 2025 22:10
Pretty /etc/motd.sh message of the day banner for my remote systems
#!/usr/bin/env zsh
divider="${(l:59::-:)}"
hostname="$(/usr/bin/figlet -f lean $HOST:u)"
banner="${divider}\n${hostname%[^[:print:]]*}\n${divider}"
location="LOCATION: FREMONT * CALIFORNIA * USA ~~> 37.5° N 121.9° W"
echo -e "\n${location}"
echo ${banner} | /usr/bin/lolcat
echo -n "System "; /usr/bin/uptime --pretty
@altercation
altercation / karabiner.edn
Created May 31, 2023 16:37
Karabiner Goku Config Snapshot - es
; {
; Karabiner-Elements Goku Config
; es@ethanschoonover.com / github: altercation
; -----------------------------------------------------------------------------
; SUMMARY
; Karabiner-Elements is a low level utility to manage macOS keyboard behavior.
; The JSON config for K-E is awkward to manage at any level of complexity and
; thus we use Goku to maintain the configuration in EDN and compile it out to
; native K-E JSON config.
; -----------------------------------------------------------------------------
@altercation
altercation / dataview_proj_sample.md
Last active February 5, 2026 14:47
Active Projects - Obsidian Dataview Sample - Ethan Schoonover
TABLE WITHOUT ID

	choice(striptime(date(today)) - striptime(file.mtime) <= dur("2 days"),
			"<span style=color:#859900;>●</span> ",
			choice(striptime(date(today)) - striptime(file.mtime) < dur("1 week"),
				"<span style=color:#b58900;>◐</span> ",
				"<span style=color:#dc322f;>⊗</span> "
			)
			) +
author Hugo Authors
title Markdown Syntax Guide (modified es)
date 2023-01-09
description Sample article showcasing basic Markdown syntax and formatting for HTML elements.
tags
markdown
css
html
themes

Sample Markdown syntax file, modified from Hugo source by ES for Markdown editor comparison.

@altercation
altercation / on-unlock.scpt
Last active December 3, 2024 12:13
Applescript to call dispreset when connected to multiple displays
# I use EventScripts to call this on screen unlock
# https://www.mousedown.net/software/EventScripts.html
tell application "Image Events"
launch
set countDisplays to count displays
if countDisplays > 1 then
do shell script "/usr/bin/curl \"http://192.168.0.99:3091/button-mbp-docked-unlock-trigger?event=click\""
do shell script "/Users/es/bin/dispreset"
end if
@altercation
altercation / dispreset.sh
Created May 18, 2022 16:58
Display Reset Script for macOS
#!/bin/sh
# dispreset:
# When called reset displays to last known arrangement using displayplacer
# if called within a timeout period (30 seconds), swap position.
# This is to work around the fact that in certain multimonitor configurations
# macOS fails to properly ID the displays using serial numbers pulled in via
# EDID and so loses track about which monitor is left/right positioned.
@altercation
altercation / starship.toml
Created April 27, 2022 22:48
Starship Prompt TOML config
[username]
style_user = "yellow"
style_root = "red bold"
format = "[$user]($style)"
disabled = false
show_always = true
[hostname]
ssh_only = false
format = "[@](white)[$hostname](bold blue)"
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object
refer: whois.verisign-grs.com
domain: COM
organisation: VeriSign Global Registry Services
address: 12061 Bluemont Way
@altercation
altercation / basescan.sh
Last active November 14, 2021 20:48
Scanner to identify which of your basestations you are connected to for roaming fast switch analysis
#!/usr/bin/env sh
# macos base station scanner to analyze fast roaming, rssi, etc.
AIRPORT_CMD="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I"
if [ "$(whoami)" != "root" ]
then
sudo "$0"
exit
@altercation
altercation / mc
Last active January 2, 2022 20:00
macOS Minecraft Controller - Limit minecraft play to specific times
#!/bin/bash
# replace following with local user running minecraft
LOCALUSER=username
function mc_off () {
# echo "minecraft off"
spctl --add --label "Minecraft" /Users/flint/Library/Application\ Support/minecraft/runtime/jre-legacy/mac-os/jre-legacy/jre.bundle/Contents/Home/bin/java
spctl --disable --label "Minecraft"
pkill -f "Minecraft.app"