Skip to content

Instantly share code, notes, and snippets.

View pathammer's full-sized avatar

Patrick Hammer pathammer

View GitHub Profile
@pathammer
pathammer / tmux_pair.md
Last active May 26, 2020 17:57
tmux pair programming / collaboration

Live collaboration with tmux

user1

tmux -S /tmp/collab
chmod 777 /tmp/collab

user2

@pathammer
pathammer / in.clj
Created October 24, 2019 20:55
Parse list of pairs of numbers from STDIN, useful for parsing hackerrank.com quiz input
(def pairs (for [_ (range numPairs)]
(map #(Integer/parseInt %) (re-seq #"[-\d.]+" (read-line)))))
@pathammer
pathammer / ap_start.bat
Created January 19, 2019 00:02
Windows WiFi Access Point Startup
netsh wlan set hostednetwork mode=allow ssid=windowswifi key=supersecretpw keyUsage=persistent
netsh wlan start hostednetwork
timeout 10
@pathammer
pathammer / run_script_in_vagrant
Created November 5, 2018 20:58
Run a shell script inside vagrant VM
vagrant ssh -c "cd /vagrant; bash -s - ARGUMENT < shell_script.sh "
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom
mkdir -p modules
make INSTALL_MOD_PATH=modules -j `getconf _NPROCESSORS_ONLN` modules_install
#!/bin/bash
calibrator 3392 8M outputfile
@pathammer
pathammer / test_rt_disk_io.sh
Last active October 19, 2018 17:51
Real Time Disk IO Benchmark
#!/bin/bash
echo 1 > /proc/sys/vm/drop_caches
bonnie -y -s 2000
# https://en.wikipedia.org/wiki/Bonnie%2B%2B
# apt install bonnie++
@pathammer
pathammer / test_rt_wakeup_latency.sh
Last active October 19, 2018 17:18
cyclictest measures timed task wakeup latency
#!/bin/bash
cyclictest -n -p 99 -h 500 -q
@pathammer
pathammer / trim_video.sh
Last active October 12, 2018 22:48
Trim a mp4 video to certain timecodes. Got from https://stackoverflow.com/a/42827058
ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4