Skip to content

Instantly share code, notes, and snippets.

jahio / american-revolution-timeline.yaml
Last active September 16, 2023 07:36
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 (we're talking about a major geopolitical
# event here that was kicked off by a major conflict between two western powers on two continents over 20 years prior after all)
# 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
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 /
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 / gist:e0fe13eae57d76a68575cdbc27a71ff8
Created November 19, 2021 19:55 — forked from vongosling/gist:9929680
Performance Tuning

Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000

jahio / eval.yml
Created February 12, 2021 21:09
Tweed Setup File (eval.yml)
apiVersion: v1
kind: ServiceAccount
namespace: tweed
name: broker
kind: ClusterRole
jahio /
Created November 3, 2020 21:10
Stop RocketMQ
#!/usr/bin/env zsh
export NAMESRV_ADDR="localhost:9876"
export ROCKETMQ_HOME="/Users/jah/Applications/rocketmq"
bin/mqshutdown broker
bin/mqshutdown namesrv
jahio /
Created November 3, 2020 21:10
Start RocketMQ
#!/usr/bin/env zsh
export NAMESRV_ADDR="localhost:9876"
export ROCKETMQ_HOME="/Users/jah/Applications/rocketmq"
# Purge nohup.out so we can have a fresh log for each session
if [[ -f nohup.out ]]
jahio / sign.rb
Created September 4, 2020 11:01
Using Google Cloud Storage Signed URLs in Ruby
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'google/cloud/storage'
bucket_name = 'dygnostick-test-bucket'
file_name = 'my_file.jpg' # This is what it will be named in the bucket
exp = 20 * 60 # 20 minutes
# Instantiating a new Google::Cloud::Storage object will automatically read your
jahio / loginForm.html
Created May 1, 2020 00:00
Sample Component Example (Conceptual)
<input type=“text” placeholder=“Username”>
<input type=“password” placeholder=“Password”>
<input type=“submit” value=“Login”>
jahio / GUIDE.MD
Created December 1, 2017 05:58 — forked from darkn3rd/GUIDE.MD
Pedantic ADHD Guide to DevOps ToolBox

Pedantic ADHD Guide to DevOps ToolBox: Mac OS X Version

This is my guide to getting essential tools for DevOps on Mac OS X.

XCode Command Line Tools

You need XCode command line tools. Type git or something and run through instructions.

If you have all day to download the full Xcode IDE compiler, point Xcode command line tools to Xcode (don't ask):