Skip to content

Instantly share code, notes, and snippets.

@apeckham
apeckham / gist:e98a303a9de73b4cf037
Created June 11, 2015 17:44
find broken symlinks on mac os x
#http://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks
find . -type l ! -exec test -e {} \; -print
@apeckham
apeckham / r.sh
Created May 5, 2024 06:21
100 random size images
for i in {1..100}; do
curl -L -o $i.jpg $(ruby -e 'puts "https://picsum.photos/" + (rand(1..100) * 10).to_s + "/" + (rand(1..100) * 10).to_s')
done
@apeckham
apeckham / reverse.sh
Created August 10, 2024 23:29
ffmpeg reverse video in memory-friendly chunks
#!/bin/bash
set -ex
# Input file name
input_file="input.mp4"
# Output file name
output_file="output.mp4"
# Duration of each segment in seconds (5 minutes)
@apeckham
apeckham / gist:8e91d4bc66c32d6730db
Created August 4, 2015 19:18
aria2 on amazon linux
# download from http://sourceforge.net/projects/aria2/files/stable/aria2-1.19.0
sudo yum install gcc-g++ openssl-devel -y
tar xvfj aria2...tar.bz2
./configure
make -j$(nproc)
sudo make install
npx -y supergateway@2.1.0 --port 8768 --stdio "npx -y @executeautomation/playwright-mcp-server"
{
"mcpServers": {
"playwright": {
"url": "http://asdf:8768/sse",
"alwaysAllow": [
"playwright_navigate",
"playwright_screenshot",
"playwright_get_visible_text",
@apeckham
apeckham / .clj
Last active February 19, 2025 08:17
find free port in clojure
(defn get-free-port []
(with-open [socket (ServerSocket. 0)]
(.getLocalPort socket)))
@apeckham
apeckham / gist:2917943
Created June 12, 2012 14:43
block all contacts in Adium
tell application "Adium"
repeat with c in every contact
set blocked of c to true
end repeat
end tell
@apeckham
apeckham / appsmith.css
Last active November 28, 2024 02:41
custom appsmith component for wavesurfer audio player
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
/* Waveform container styling */
#root {
background-color: #f9f9f9;
}
body {
font-family: 'Montserrat', sans-serif;
}
@apeckham
apeckham / gitlab-runner-priority.yaml
Last active September 21, 2024 19:56
gitlab runner on GKE autopilot
# Created new Autopilot cluster
# https://docs.gitlab.com/runner/install/kubernetes.html
# Create a runner at https://gitlab.com/groups/GROUP/-/runners
wget https://github.com/derailed/k9s/releases/download/v0.28.2/k9s_Linux_amd64.tar.gz
tar xvfz k9s*gz
gcloud container clusters get-credentials CLUSTER --region REGION --project PROJECT
helm repo add gitlab https://charts.gitlab.io
helm repo update gitlab
@apeckham
apeckham / sum.sh
Created July 27, 2024 22:40
sum of PDF page count on mac
find . -maxdepth 1 -name "*.pdf" -exec mdls -name kMDItemNumberOfPages {} \; | awk '/kMDItemNumberOfPages/ {sum += $3} END {print sum}'