Skip to content

Instantly share code, notes, and snippets.

@jahio
jahio / ps.sh
Created March 31, 2022 03:27
Gimme all processes using >= 200MB rss size on STDOUT in JSON format on Linux
#!/usr/bin/env bash
# Uses `ps` from $PATH (usually /usr/bin/ps) to get processes, then filters
# those by how much rss they're using; anything lower than the amount defined
# below as $THRESHOLD is discarded. Outputs JSON to STDOUT. No arguments.
declare -a pids
declare -a cmds
declare -a rss
@jahio
jahio / ps.ps1
Created March 31, 2022 03:30
Gimme all processes using >= 200MB Working Set Size (64-bit) on...well, any OS that can run PowerShell Core (Linux, Mac, Windows)
#!/usr/bin/env pwsh
# Uses Get-Process piped to some stuff to get a list of processes
# over a certain amount of memory and output those as JSON.
# Takes no arguments.
# NOTE: This threshold is defined as BYTES, not KILOBYTES like the shell script.
# Adjust the math accordingly.
$threshold = (200 * 1024) * 1024 # Don't report anything greater than 200MB
@jahio
jahio / american-revolution-timeline.yaml
Last active November 25, 2024 04:47
A Timeline of the History of the American Revolution
#
# This is an experiment for a personal project I'm working on. The below is a YAML representation of some of the historical
# events that occurred relating to the American Revolution. It is absolutely incomplete and not intended to be a history lesson
# or a political statement. I'll probably add to and tweak this as I go, expanding on my experiement in multiple ways,
# but be aware that this is just used as test data for a personal project that I hope to be able to let others use one day,
# if it turns out well.
#
# (Said project is an attempt at creating an HTML/CSS/JS interactive timeline in the browser. The idea: don't worry about
# messing with front-end code, just feed it some nice and easy YAML - like this - of historical events and data and you
# get a nice and pretty interactive, navigable timeline of events that you can use as a research aid, reference material, etc.