Skip to content

Instantly share code, notes, and snippets.

@thorrr
thorrr / .dir-locals.el
Created March 5, 2024 14:52
.dir-locals.el: auto activate virtualenv called "venv" in python project directory
((nil . (
(eval . (setq pyvenv-activate (concat (locate-dominating-file default-directory ".dir-locals.el") "/venv/")))
(eval . (setq lsp-pylsp-server-command
(concat (locate-dominating-file default-directory ".dir-locals.el") "/venv/bin/pylsp")))
)))
@thorrr
thorrr / .tmux.conf
Created March 3, 2024 14:40
tmux.conf - change leader key to `
# Change prefix key to backtick (`)
unbind C-b
set-option -g prefix `
bind ` send-prefix
# history size - number of lines
set -g history-limit 100000
####################################
# make scroll/"copy" mode friendlier
@thorrr
thorrr / jupyter_6.sh
Created March 3, 2024 14:13
Install the latest Jupyter 6.xx with extensions activated
#!/usr/bin/env bash
# shellcheck disable=SC2155 # irrelevant because of set -e
set -euo pipefail
readonly VENV_NAME=venv
readonly BLACK_LINE_LENGTH=110
readonly packages=(
@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 / 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

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 / 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
@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 / 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