Skip to content

Instantly share code, notes, and snippets.

Martijn Vermaat martijnvermaat

Block or report user

Report or block martijnvermaat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@martijnvermaat
martijnvermaat / nixos.md
Last active Nov 6, 2019
Installation of NixOS with encrypted root
View nixos.md
View ssh-agent-forwarding-screen.md

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 / server.py
Created Feb 5, 2016
SimpleHTTPServer with history API fallback
View server.py
#!/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 / gpl-and-closed-software.markdown
Created Sep 7, 2011
The GPL in combination with closed source software
View gpl-and-closed-software.markdown

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 / README.md
Last active Aug 27, 2019
The IPython Notebook on an SGE cluster
View README.md

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 / gitlab-ipython-notebook.md
Last active Jun 10, 2019
View IPython notebooks in GitLab
View gitlab-ipython-notebook.md

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 May 1, 2019
Notes on my Raspberry Pi server config
View raspberry-pi-config.md

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
Encrypted root filesystem on Debian Wheezy
View encrypted-root-debian-wheezy.markdown

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 / __init__.py
Last active Jul 20, 2018
Matplotlib for use in LaTeX
View __init__.py
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.
@martijnvermaat
martijnvermaat / gencert.sh
Last active Jul 17, 2018
Generate self-signed x509 certificates
View gencert.sh
#!/bin/bash
# Generate a self-signed x509 certificate or certificate signing request and
# key using OpenSSL. DNS and IP addresses can be added as subjectAltName
# entries.
#
# Usage:
# ./gencert.sh <common name (or DNS name)> <DNS names or ip addresses...> [--rsa4096] [--csr]
#
# By default, a 2048 bits RSA key is generated. Supply --rsa4096 at the end to
# generate a 4096 bits key.
You can’t perform that action at this time.