Skip to content

Instantly share code, notes, and snippets.

View ssh-key-fingerprint
cp $@ $tmp_name
chmod 600 $tmp_name
echo "sha256:"
ssh-keygen -lv -E sha256 -f "$tmp_name"
echo "md5:"
View reconstitute-perf-symbols.rb
#!/usr/bin/env ruby
if ARGV.length < 3
STDERR.puts("usage: #{$0} 'line_match' <perf.script.file> <symbol_file>")
STDERR.puts("line_match is a string submatch for a line line:")
STDERR.puts(" 40b1c5 [unknown] (/usr/local/bin/foobar (deleted))")
STDERR.puts("symbol_file is the output of `objdump -Tt /path/to/executable`")
psanford / xdg-open
Created Dec 23, 2020
Drop in replacement for xdg-open that is 73% better than the official xdg-open
View xdg-open
echo -n "$1" | xclip -selection primary; notify-send "URL Copied" "$1"
psanford / podman-unstable.nix
Created Jul 4, 2020
Overlay for using podman package and module from unstable channel. Useful if you are on nixos <= 20.03
View podman-unstable.nix
{ pkgs, ... }:
unstable = import <nixos-unstable-small> { };
in {
disabledModules = [
psanford /
Created Mar 23, 2020
sudo apt-get install -y emacs25-nox git
sudo tar -xf go1.14.1.linux-amd64.tar.gz -C /opt/
export PATH=/opt/go/bin:$HOME/go/bin:$PATH
GO111MODULE=on go get
git clone
psanford /
Created Sep 20, 2019
bpftrace wrapper to trace reads from stdin and writes to stdout and stderr for a given process name
if [ -z "$COMM"] ; then
echo "usage: $0 <name_of_process>" >&2
exit 1
psanford /
Created Aug 9, 2019
build bpftrace on ubuntu 18.04
set -e
set -x
# from
apt-get install -y clang-7 libclang-7-dev llvm-7 llvm-7-dev
apt-get install -y bison cmake flex g++ git libelf-dev zlib1g-dev libfl-dev
psanford / reformat-directory.el
Last active Aug 2, 2019
emacs batch reformat directory
View reformat-directory.el
(defun reformat-directory (dir)
"Reformat all files of extention in directory"
(interactive "D")
(let* ((ext ".go")
;; disable find-file hooks to speed up processing:
;; don't run git commands on every file
(find-file-hook '())
psanford / gopls-config.el
Last active Apr 4, 2021
gopls (go lsp-mode) config for emacs with useful optional packages.
View gopls-config.el
;;; Pre gopls/lsp-mode/go-mode setup
;;; This section installs use-package from melpa if it isn't
;;; already installed. You can skip this if you already have use-package
;; enable melpa if it isn't enabled
(require 'package)
(when (not (assoc "melpa" package-archives))
(setq package-archives (append '(("melpa" . "")) package-archives)))
psanford / examples.sql
Last active Apr 7, 2019
sqlite3 examples
View examples.sql
.mode csv
-- import column names from first show
.headers on
-- show current settings
.import transactions.csv transactions
select * from transactions;