Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Start mosh-server, but first create a port redirection in the NAT
# router (with UPnP) and delete that redirection again just before
# mosh-server exits.
#
# Created: 20 Sep 2012
# Author: Bert Bos <[email protected]>
# original: https://www.mail-archive.com/[email protected]/msg00103/mosh-server-upnp
# tweaked to reference /usr/bin/mosh-server directly
# See docs in http://git-annex.branchable.com/internals/hashing/ and implementation in http://sources.debian.net/src/git-annex/5.20140227/Locations.hs/?hl=408#L408
import hashlib
import struct
def hashdirlower(key):
hasher = hashlib.md5()
hasher.update(key)
digest = hasher.hexdigest()
return "%s/%s/" % (digest[:3], digest[3:6])
@unqueued
unqueued / submodulewiki.md
Last active December 3, 2017 17:44 — forked from iracooke/submodulewiki.md
Wiki as a submodule

From within the parent repo do

        git submodule add [email protected]:iracooke/transcriptomes.git/wiki wiki
        git commit -m "Adding wiki as submodule"
        git push

Making changes to the wiki and to the parent require separate git commit commands.

@unqueued
unqueued / Makefile
Created December 2, 2017 01:04 — forked from tsunghanlin/Makefile
Pandoc Latex PDF HOWTO
PANDOC = pandoc
PANDOC_MD = doc.md
TEX_TEMPLATE = mincho.tex
PDF_FILE = em.pdf
PANDOC_OPTS += --highlight-style tango -N --toc
PANDOC_OPTS += --latex-engine=xelatex -H $(TEX_TEMPLATE)
PANDOC_OPTS += --filter pandoc-citeproc --csl ieee.csl --bibliography=ref.bib
# make citation number in article linkable
PANDOC_OPTS += --metadata link-citations=true
FONTS_OPTS += --variable mainfont="Noto Sans CJK JP"