Skip to content

Instantly share code, notes, and snippets.

@psanford
psanford / gist:1083918
Created July 15, 2011 02:28
keyboards
http://deskthority.net/viewtopic.php?f=2&t=98&ok
http://www.overclock.net/keyboards/491752-mechanical-keyboard-guide.html
http://humblehacker.com/keyboard/
@psanford
psanford / nb-js.el
Created May 15, 2012 05:00
nb-js.el
(require 'json)
;; js2 settings
(setq js2-mirror-mode nil)
(setq js2-mode-indent-ignore-first-tab t)
(setq js2-strict-inconsistent-return-warning nil)
;;js settings (for json)
(setq js-indent-level 2)
@psanford
psanford / check_ciphers.sh
Created February 14, 2013 18:39
Print out supported ciphers for a given host.
#!/bin/bash
# OpenSSL requires the port number.
SERVER=localhost:49164
DELAY=0.1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
Section "InputClass"
Identifier "touchpad catchall"
Driver "synaptics"
Option "TapButton3" "2"
Option "ClickFinger3" "2"
Option "HorizTwoFingerScroll" "1"
MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
@psanford
psanford / usdt
Created January 30, 2016 03:25 — forked from brendangregg/usdt
usdt (ftrace)
#!/bin/bash
#
# usdt - trace user statically defined tracepoints. User-level dynamic tracing.
# Written using Linux ftrace. Experimental.
#
# WARNING: This is a proof of concept for USDT tracing from Linux ftrace, and
# is not safe to use in production environments. In particular, the -i option
# sets memory semaphores by piping the output of printf through dd and then
# to process memory via /proc/PID/mem. Yes, this program pipes the output of
# the shell directly over top of live process memory. If you don't understand
# Here's the script I'll use to demonstrate - it just loops forever:
$ cat test.rb
#!/usr/bin/env ruby
loop do
sleep 1
end
# Now, I'll start the script in the background, and redirect stdout and stderr
@psanford
psanford / gist:8ed59ae471b2d9d4524dc5a2cfc03d66
Last active February 15, 2018 17:44
reviewable.io keyboard shortcuts
[
["f", "Show next/latest diffs", "setProposedRevRanges()"],
["j", "Next unreviewed file", "nextUnreviewedFile()"],
["k", "Previous unreviewed file", "prevUnreviewedFile()"],
[null, "Next personally unreviewed file", "nextPersonallyUnreviewedFile()"],
[null, "Previous personally unreviewed file", "prevPersonallyUnreviewedFile()"],
["shift+n", "Next changed file", "nextChangedFile()"],
["shift+p", "Previous changed file", "prevChangedFile()"],
["shift+j", "Next visible file", "nextVisibleFile()"],
@psanford
psanford / runc_rootless_with_overlayfs.sh
Last active February 7, 2019 23:02
runc rootless examples
#!/bin/bash
# Hello world of rootless runc with an overlayfs root file system.
# This will only work as is with kernels that allow overlayfs mounts
# from non-root accounts (such as ubuntu 18.04).
set -e
set -x
mkdir /tmp/runc-rootless
@psanford
psanford / examples.sql
Last active April 7, 2019 00:26
sqlite3 examples
.mode csv
-- import column names from first show
.headers on
-- show current settings
.show
.import transactions.csv transactions
select * from transactions;
@psanford
psanford / reformat-directory.el
Last active August 2, 2019 20:07
emacs batch reformat directory
(defun reformat-directory (dir)
"Reformat all files of extention in directory"
(interactive "D")
(let* ((ext ".go")
(ts)
(tmp-buffer)
;; disable find-file hooks to speed up processing:
;; don't run git commands on every file
(find-file-hook '())