Skip to content

Instantly share code, notes, and snippets.

View zanshin's full-sized avatar
💭
Making mistakes so you don't have to since 1961.

Mark Nichols zanshin

💭
Making mistakes so you don't have to since 1961.
View GitHub Profile
set folder=~/.mail
mailboxes +”foo”
# find sorts things in strange ways. for example: Lists will come after
# Lists/Atomic, here the printf prints the name of the folder we need, and the
# folder's depth. Numeric sort on the depth first, then the name, then do some
# cleanup (escape any spaces in the directory name and then print all the
# mailboxes on 1 line)
mailboxes `find ~/.mail/foo/ -type d -name cur -printf '%h\t%d\n'| sort -n | tr ' ' '\\ ' | awk -F'\t' '{ ORS=" "}{ print $1 }'`
@zanshin
zanshin / gpgcommon.muttrc
Created March 17, 2018 00:11
GPG settings for mutt
set pgp_decode_command = "gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f"
set pgp_verify_command = "gpg --no-verbose --batch --output - --verify %s %f"
set pgp_decrypt_command = "gpg --passphrase-fd 0 --no-verbose --batch --output - %f"
set pgp_sign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f"
set pgp_clearsign_command = "gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f"
set pgp_import_command = "gpg --no-verbose --import -v %f"
set pgp_export_command = "gpg --no-verbose --export --armor %r"
set pgp_verify_key_command = "gpg --no-verbose --batch --fingerprint --check-sigs %r"
set pgp_list_pubring_command = "gpg --no-verbose --batch --with-colons --list-keys %r"
set pgp_list_secring_command = "gpg --no-verbose --batch --with-colons --list-secret-keys %r"
@zanshin
zanshin / path
Created March 5, 2018 18:31
Bash path function to display a neatly formatted and color coded path breakdown
path() {
local blue="\033[1;34m"
local green="\033[0;32m"
local cyan="\033[0;36m"
local purple="\033[0;35m"
local brown="\033[0;33m"
local reset_color="\033[0m"
echo $PATH | tr ":" "\n" | \
awk "{ sub(\"/usr\", \"$green/usr$reset_color\"); \
sub(\"/bin\", \"$blue/bin$reset_color\"); \
@zanshin
zanshin / console.txt
Created October 3, 2017 03:16
rake watch
[0s] $ rake watch
WARN: Unresolved specs during Gem::Specification.reset:
ffi (< 2, >= 0.5.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Configuration file: /Users/mark/code/zanshin/_config.yml
Source: /Users/mark/code/zanshin
Destination: /Users/mark/code/zanshin/_site
Incremental build: disabled. Enable with --incremental
Generating...
@zanshin
zanshin / rnb.erb
Created June 16, 2017 04:21 — forked from romainl/_rnb.md
RNB, a Vim colorscheme template
<%
# RNB, A VIM COLORSCHEME TEMPLATE
# Author: Romain Lafourcade (https://github.com/romainl)
# Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca
# This template is designed to help vimmers create their own colorschemes
# without much effort.
#
# You will need Ruby to generate your colorscheme but Ruby knowledge is
# not needed at all.
(17:38:00) $ sudo /etc/init.d/rabbitmq-server start
+ PATH=/sbin:/usr/sbin:/bin:/usr/bin
+ NAME=rabbitmq-server
+ DAEMON=/usr/lib/rabbitmq/bin/rabbitmq-server
+ CONTROL=/usr/sbin/rabbitmqctl
+ DESC=rabbitmq-server
+ USER=rabbitmq
+ ROTATE_SUFFIX=
+ INIT_LOG_DIR=/var/log/rabbitmq
+ PID_FILE=/var/run/rabbitmq/pid
@zanshin
zanshin / zanshin.zsh-theme
Created August 12, 2011 19:02
My oh-my-zsh theme, a derivative of the Soliah theme
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
echo '○'
}
PROMPT='
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(git_time_since_commit)$(check_git_prompt_info)
${vcs_info_msg_0_}$(prompt_char) '
@zanshin
zanshin / config
Created May 7, 2016 03:48
Access Github securely even when port 22 is blocked.
# vim ~/.ssh/config
Host github.com
Hostname ssh.github.com
Port 443
@zanshin
zanshin / log
Created February 18, 2016 23:06
result of apt-get install docker-engine
$ sudo apt-get install docker-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
yubico-piv-tool
The following NEW packages will be installed:
docker-engine
0 upgraded, 1 newly installed, 0 to remove and 24 not upgraded.
Need to get 0 B/8,572 kB of archives.
@zanshin
zanshin / bashrc
Created January 5, 2016 17:14
Bash prompt showing Git status
# Import some colors
source ~/.dotfiles/bash/colors
# Variables used in building the Git status portiion of the prompt
GIT_PROMPT_SYMBOL="${Blue}±"
GIT_PROMPT_PREFIX="${Green} [${Color_Off}"
GIT_PROMPT_SUFFIX="${Green}]${Color_Off}"
GIT_PROMPT_AHEAD="${BRed}ANUM${Color_Off}"
GIT_PROMPT_BEHIND="${Cyan}BNUM${Color_Off}"
GIT_PROMPT_MERGING="${Red}⚡︎${Color_Off}"