Skip to content

Instantly share code, notes, and snippets.

View atdt's full-sized avatar
💭
I may be slow to respond.

Ori Livneh atdt

💭
I may be slow to respond.
  • Google
  • New York City
View GitHub Profile
@atdt
atdt / supervocalic.py
Created March 13, 2024 21:12
Supervocalic restaurants in NYC
GRAIN HOUSE
VILLAS LOUNGE 2 CORP
BOQUERIA
OM JUICE BAR
Tout va bien
BLACK IRON BURGER
Grain House
44 South Village
HARMONIE CLUB
Uncle Tony's Pizza
@atdt
atdt / README.txt
Last active January 13, 2024 19:03
Convert OMSCS video lectures to MP3 files with chapter markers
Start by replacing all spaces with underscores
rename 's/\s+/_/g' **/*.mp4
(bash not fish!)
Statistical profiling result from isolate-0x2bcf95f0-13453-v8.log, (6841 ticks, 0 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
4535 66.3% /usr/bin/node
376 5.5% /usr/lib/aarch64-linux-gnu/libc.so.6
9 0.1% /usr/lib/aarch64-linux-gnu/libstdc++.so.6.0.30
3 0.0% [vdso]
[JavaScript]:
@atdt
atdt / homebrew-gnubin.md
Created September 21, 2020 00:55 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

hs.loadSpoon("Lunette")
spoon.Lunette:bindHotkeys()
--[[
- menubar items
- print(hs.inspect(...))
hs.alert.show(string.format("mode: %s x %s", mode.w, mode.h))
--]]
local function sendSystemKey(key)
@atdt
atdt / knockd.conf
Last active July 26, 2020 16:34
knockd.conf
[options]
UseSyslog
[ssh]
sequence = 1000,2000,3000 # change me
seq_timeout = 5
start_command = ufw insert 1 allow from %IP% to any port 22
tcpflags = syn
cmd_timeout = 10
stop_command = ufw delete allow from %IP% to any port 22
@atdt
atdt / knock.py
Created July 26, 2020 16:11
Port-knocking client (e.g. for knockd) in Python
#!/usr/bin/env python3
# Port-knocking client
# Usage: knock HOST PORT [PORT...]
import socket
import sys
try:
host = sys.argv[1]
ports = [int(p) for p in sys.argv[2:]]
I don't get the appeal of dungeon crawlers. It seems like i could recreate the essential experience by opening Microsoft Excel scrolling down 10,000 pages with the down cursor key, and then typing "the most marvelous trousers of them all".
@atdt
atdt / benchmark_webp
Last active June 6, 2020 15:27
Benchmark webp vs png for images on enwiki main page
#!/usr/bin/env bash
while IFS= read -r URL ; do
echo "$URL"
echo "WEBP:"
wrk -c1 -t1 -d5 -H 'accept: image/webp' --latency "$URL"
echo ""
echo "PNG:"
wrk -c1 -t1 -d5 --latency "$URL"
@atdt
atdt / or_null.txt
Created May 25, 2020 16:04
Names of functions in MediaWiki that return 'X or (null|false)'
# Names of functions in MediaWiki that return 'X or (null|false)'
# git grep -A2 -P '@return .*(\||or )(null|false)' -- '*.php' | grep -Po '(?<=function )[^(]+(?=\()' | sort
acquireServerStatesLoopGuard
addInterwikiResults
backendFromPath
buildFileObjectListing
cacheGet
canonicalizeLoginData
castFromLinkTarget