Skip to content

Instantly share code, notes, and snippets.

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@martijnvermaat
martijnvermaat / nixos.md
Last active March 24, 2024 11:42
Installation of NixOS with encrypted root
@martijnvermaat
martijnvermaat / gitlab-ipython-notebook.md
Last active May 8, 2023 00:53
View IPython notebooks in GitLab

Viewing IPython notebooks in GitLab

GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).

@martijnvermaat
martijnvermaat / raspberry-pi-config.md
Last active February 3, 2023 01:53
Notes on my Raspberry Pi server config

Notes on my Raspberry Pi server config

This describes how I installed and configured my Raspberry Pi model B (512MB).

The Pi is mainly used as SSH jump host, IRC client, Git server, backup fileserver, etc. It doesn't need stellar performance, it just has to be cheap, low in power usage, and secure.

Raspbian on encrypted root

@martijnvermaat
martijnvermaat / encrypted-root-debian-wheezy.markdown
Created May 18, 2012 16:55
Encrypted root filesystem on Debian Wheezy

Encrypted root filesystem on Debian Wheezy

This documents how to set up an encrypted root filesystem (except for /boot) on Debian Wheezy with automatic mounting using a keyfile on a USB drive.

Basic setup

In the Debian Installer, choose "Guided - use entire disk and set up encrypted LVM". That's it, on boot you will be asked to enter you passphrase using the keyboard. My system does not usually have a keyboard attached, so that's not very convenient (but read on).

@martijnvermaat
martijnvermaat / server.py
Created February 5, 2016 17:43
SimpleHTTPServer with history API fallback
#!/usr/bin/env python
"""
Modification of `python -m SimpleHTTPServer` with a fallback to /index.html
on requests for non-existing files.
This is useful when serving a static single page application using the HTML5
history API.
"""
@martijnvermaat
martijnvermaat / README.md
Last active February 7, 2022 09:06
The IPython Notebook on an SGE cluster

IPython Notebook on an SGE cluster

This guide documents how we set up an easy workflow for using the IPython Notebook on our compute cluster managed with Sun Grid Engine (SGE).

Summary: We provide a script to the cluster users that runs qrsh to schedule an ipython notebook job using SSL and password protection.

Installing IPython

@martijnvermaat
martijnvermaat / README.md
Last active November 11, 2020 13:09
Download SRA run files for given sample names

Download SRA run files for given sample names

Have all sample names in samples, one per line and run:

for sample in $(cat samples); do
    IFS=$'\n'
    for line in $(./sra-runs.py $sample); do
        echo $sample $line >> runs

done

@martijnvermaat
martijnvermaat / gpl-and-closed-software.markdown
Created September 7, 2011 21:15
The GPL in combination with closed source software

The GPL in combination with closed source software

Here are a few issues concerning GPL-licensed software in combination with closed source software. We assume [version 2 of the GPL] [1] in the following discussion.

What exactly is a work "derived from" the Program?

@martijnvermaat
martijnvermaat / __init__.py
Last active July 20, 2018 14:37
Matplotlib for use in LaTeX
import math
from matplotlib import rcParams
def configure(document_fontsize=14.4, available_width=307.28987):
"""
Configures Matplotlib so saved figures can be used in LaTeX documents.
Uses the sans-serif TeX Gyre Heros font (Helvetica), also for math.