Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Hammer pathammer

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

Live collaboration with tmux

user1

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

user2