Skip to content

Instantly share code, notes, and snippets.

@baitisj
baitisj / find_broken_library_packages.py
Created December 3, 2018 04:14
FreeBSD: Inspect all libraries passed on command line and find broken ones -- and report a list of packages that might need rebuilding
import subprocess;
import sys;
import re;
import pprint;
import string;
pkgs = set(); # Packages that contain the broken libraries
d = dict(); # contains key: library name, and list of values: libraries that are not found.
nf_rgx=re.compile('^\s+(.+) =>.+\(0\)'); # Matches a 'not found' result from ldd
last_key="";
@baitisj
baitisj / decode.js
Last active June 11, 2017 08:44
Bookmarklet to remove escape sequences from highlighted text
javascript:(
function(){
var range = window.getSelection().getRangeAt(0);
var a = document.createElement('a');
a.setAttribute('href',document.location);
var t = window.getSelection().toString().replace(/\+/g, " ");
a.appendChild(document.createTextNode(decodeURIComponent(t)));
range.deleteContents();
range.insertNode(a);
}
@baitisj
baitisj / record_window_ffmpeg.sh
Created February 26, 2017 02:02
Click on a window to perform screen grab at 5 FPS
#!/bin/sh
echo "Click on a window to record."
properties=`xwininfo | grep ":"`
width=`echo "$properties" | grep "Width: " | tr -d '[:space:]' | cut -d ':' -f 2`
height=`echo "$properties" | grep "Height: " | tr -d '[:space:]' | cut -d ':' -f 2`
ulx=`echo "$properties" | grep "Absolute upper-left X:" | tr -d '[:space:]' | cut -d ':' -f 2`
uly=`echo "$properties" | grep "Absolute upper-left Y:" | tr -d '[:space:]' | cut -d ':' -f 2`
ffmpeg -loglevel quiet -f x11grab \
@baitisj
baitisj / keybase.md
Created August 5, 2016 18:03
Keybase proof

Keybase proof

I hereby claim:

  • I am baitisj on github.
  • I am baitisj (https://keybase.io/baitisj) on keybase.
  • I have a public key whose fingerprint is 6363 C310 82BE 109C 4B89 2EC4 B61E FC8D 44A0 9DB9

To claim this, I am signing this object:

@baitisj
baitisj / rw.d
Last active August 29, 2015 14:27 — forked from kassandry/rw.d
rw.d dtrace FreeBSD
#pragma D option quiet
/* dtrace D script for helping to tune the OpenZFS write throttle */
/* Original script from: */
/* http://dtrace.org/blogs/ahl/2014/08/31/openzfs-tuning/ */
/* Example invocation that collects statistics over 1 minute: */
/* dtrace -s rw.d -c 'sleep 60' */
BEGIN