Skip to content

Instantly share code, notes, and snippets.

@thorrr
thorrr / turn-off-messaging.el
Created December 25, 2012 15:41
Emacs advice to temporarily turn off writing messages to the minibuffer. Goes nicely with real-auto-save mode.
;; the following is copied from http://lists.gnu.org/archive/html/help-gnu-emacs/2005-01/msg00636.html
(defvar messaging-on t
"Control whether or not messages will be printed; by default, they are.")
;; Note that by itself this renders edebug pretty useless.
(defadvice message (around nomessage activate)
"Turn off messaging most of the time.
Whether or not messages are displayed is determined by the value
of the variable `messaging-on'."
(when messaging-on
@thorrr
thorrr / Makefile
Last active January 2, 2016 15:09
Makefile for building cling from source. Works on win32 cygwin, need to modify the exename variable to make it work on Linux
cling-version := 45925
install-dir := $(shell pwd)/cling
exename := $(install-dir)/bin/cling.exe
.PHONY: all clean exe clang cling repl crepl cpprepl
all: exe
clean:
rm ./lastKnownGood
@thorrr
thorrr / Makefile
Last active January 2, 2016 15:09
Makefile for building quantlib + python extensions.
.PHONY: all downloads clean clean_downloads
### URLS ########
boost_url := 'http://downloads.sourceforge.net/project/boost/boost/1.53.0/boost_1_53_0.tar.bz2'
quantlib_url := 'http://sourceforge.net/projects/quantlib/files/QuantLib/1.2.1/QuantLib-1.2.1.tar.gz'
quantlib_swig_url := 'http://sourceforge.net/projects/quantlib/files/QuantLib/1.2/other%20languages/QuantLib-SWIG-1.2.tar.gz'
#################
#### subdirectory names #####
ql_swig_install_dir := quantlib-swig-install
boost_dir := boost_1_53_0
@thorrr
thorrr / Makefile
Created January 23, 2014 22:29
Bloomberg OpenAPI: build python bindings
bloomberg_c_url := http://cdn.gotraffic.net/open/blpapi_cpp_3.7.5.1-windows.zip
bloomberg_python_url := http://cdn.gotraffic.net/open/blpapi-py-3.5.3.zip
artifacts_dir := artifacts
install_dir := Blpapi
UNZIP = unzip $| -d $$d
#UNZIP = tar -xf $| -C $$d
.PHONY: all clean downloads clean_downloads install repl
@thorrr
thorrr / check-and-restart-net.sh
Last active August 29, 2015 14:04
Run this in a one minute cron job to check network connectivity every 20 seconds
#!/bin/bash
LOCKFILE=/tmp/check-and-restart.lock
if ! mkdir "${LOCKFILE}" 2>/dev/null; then
echo "check-and-restart is already running." >&2
exit 1
fi
trap "rm -rf ${LOCKFILE}; exit" INT TERM EXIT
@thorrr
thorrr / install-ipython-notebook-for-cygwin.sh
Last active January 4, 2017 23:40
install ipython notebook under cygwin
#!/bin/bash
set -e
LIBSODIUM_URL=https://github.com/jedisct1/libsodium/releases/download/1.0.3/libsodium-1.0.3.tar.gz
LIBZMQ_URL=https://github.com/zeromq/libzmq.git
#start
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
tmpdir=`mktemp -d`
#!/bin/sh
filename=/usr/include/python2.7/pyconfig.h
patchfile=$(mktemp)
cat << 'EOF' > "$patchfile"
--- pyconfig.h 2016-11-20 09:38:22.434174700 -0500
+++ pyconfig-bsd-not-visible.h 2016-11-20 09:38:05.391993200 -0500
@@ -1218,7 +1218,7 @@
@thorrr
thorrr / five_minutes.yml
Created January 16, 2017 18:43 — forked from ryane/five_minutes.yml
five_minutes.yml
---
- hosts: all
vars:
UBUNTU_COMMON_ROOT_PASSWORD: 'xxxxx'
UBUNTU_COMMON_DEPLOY_PASSWORD: 'xxxxx'
UBUNTU_COMMON_LOGWATCH_EMAIL: user@example.com
ubuntu_common_deploy_user_name: deploy
ubuntu_common_deploy_public_keys:
- ~/.ssh/id_rsa.pub

Keybase proof

I hereby claim:

  • I am thorrr on github.
  • I am jbell9999 (https://keybase.io/jbell9999) on keybase.
  • I have a public key ASCyPG0oZfvP43B3Yzm748xLGNpEMjQLYOz12SfKNvwweQo

To claim this, I am signing this object:

@thorrr
thorrr / disable-luks.sh
Last active October 5, 2017 15:51
Disable password on encrypted LUKS drive
#!/bin/bash
set -euf -o pipefail
##################
# User variables
#################
KEY_SLOT=5
DEVICE=/dev/sda5
PASSWORD=password