Skip to content

Instantly share code, notes, and snippets.

stefansundin / ffmpeg.rb
Last active Apr 26, 2020
Download Twitch video that has muted sound.
View ffmpeg.rb
#!/usr/bin/env ruby
files = Dir["*.ts"].sort_by { |fn| fn.split(".")[0].to_i }
puts "ffmpeg -i 'concat:#{files.join("|")}' -codec copy output.mkv"
puts "run this first:"
puts "ulimit -n 4096"
stefansundin / manifest.json
Created Jul 24, 2019
Make the list of items in Rollbar wider.
View manifest.json
"name": "Rollbar",
"version": "1.0",
"description": "Make the list of items in Rollbar wider.",
"content_scripts": [
"matches": ["*"],
"css": ["rollbar.css"]
stefansundin / spf-lookup-counter.rb
Last active Oct 28, 2018
Count number of lookups in an SPF record.
View spf-lookup-counter.rb
#!/usr/bin/env ruby
# SPF implementations MUST limit the number of mechanisms and modifiers
# that do DNS lookups to at most 10 per SPF check, including any
# lookups caused by the use of the "include" mechanism or the
# "redirect" modifier. If this number is exceeded during a check, a
# PermError MUST be returned. The "include", "a", "mx", "ptr", and
# "exists" mechanisms as well as the "redirect" modifier do count
# against this limit. The "all", "ip4", and "ip6" mechanisms do not
stefansundin /
Last active May 8, 2018
Bash on Windows shell script file association
# Put this file in C:\ and then run z-register.bat by right clicking it and using "Run as Administrator"
# Translate the windows path to the equivalent Bash on Windows path, then run it!
dir=$(dirname "/mnt/${drive,,}${path//\\/\/}")
cd "$dir"
stefansundin / nginx.firewall.plist
Last active Jun 24, 2020
This lets you run nginx as a normal user and still receive connections on port 80 and 443. Setup nginx to listen to port 8080 for http and 8443 for https.
View nginx.firewall.plist
This is not actually necessary, as you can use the following commands to allow nginx to bind to privileged ports:
$ sudo chown root:wheel /usr/local/opt/nginx/bin/nginx
$ sudo chmod u+s /usr/local/opt/nginx/bin/nginx
stefansundin / .gitignore
Last active Nov 18, 2017
TEMPer cron + gnuplot
View .gitignore
stefansundin / background.js
Last active May 25, 2018
Open websites with VLC. You must install the vlc:// protocol as well:
View background.js
function open(url, tabId) {
// Open a new tab to start the prompt
chrome.tabs.create({url: `vlc://${url}`}, function(newtab) {
// Focus the old tab
chrome.tabs.update(tabId, {active: true});
// You have 10 seconds to click the button
// If the tab is closed too soon, the button no longer works :(
View main.js
if (document.body.children.length == 1 && document.body.children[0].tagName == "VIDEO") {
document.body.children[0].style.width = "100%";
You can’t perform that action at this time.