Skip to content

Instantly share code, notes, and snippets.

View Injecting Terminal

Injecting Terminal Input

Some examples demonstrating how to inject keystrokes into a terminal's input stream.

View Example Grub

This is an example Grub module that demonstrates how to add a command to Grub that can process command-line options and other parameters.

View gitweb-markdown.patch
--- gitweb.cgi.orig 2020-10-06 10:13:45.621810025 +0100
+++ gitweb.cgi 2020-10-06 10:08:21.651823286 +0100
@@ -18,9 +18,10 @@
use Encode;
use Fcntl ':mode';
use File::Find qw();
-use File::Basename qw(basename);
+use File::Basename qw(basename dirname);
use Time::HiRes qw(gettimeofday tv_interval);
use Digest::MD5 qw(md5_hex);
johnlane / wysiwyg.js
Last active Sep 14, 2020
An integrated Markdown WYSIWYG editor
View wysiwyg.js
$(document).on('ready page:load ajaxComplete', function() {
$('textarea.wysiwyg').each(function() {
var textarea = $(this)
var textarea_id = textarea[0].id;
var textarea_class = textarea[0].className;
var wysiwyg_id = "wysiwyg_" + textarea_id;
var wysiwyg_class = textarea_class + " wysiwyg";
johnlane /
Last active Jul 12, 2020
Example GTK to create a dock-like bar and strut
#!/usr/bin/env python2
# Example program places a coloured bar across the top of the
# current monitor
# demonstrates
# (a) creating the bar as an undecorated "dock" window
johnlane / zk3d
Last active Jun 4, 2020
A wrapper for k3d for use with ZFS file systems
View zk3d
# wrapper for k3d v3 usage on ZFS using Docker volumes
# JL20200603
# Usage: pass 'create' as the first argument to create a cluster
# pass 'destroy' (or anything else) to destroy a cluster
# The following optional arguments may be provided (in this order):
# second argument is the cluster name (k3d is prefixed to this)
# following arguments apply to create: masters workers
johnlane / arch-zfsroot-install
Created Jun 19, 2018
Simple installer for ArchLinux on ZFS (tested in VirtualBox)
View arch-zfsroot-install
# prerequisites
# pacman -S arch-install-scripts sgdisk rsync
DISKS=( /dev/disk/by-id/ata-VBOX_HARDDISK_VB{5f2d4170-647f16b7,f38966d8-57bff7df} )
# Ensure zpool offline
johnlane / dbtest.php
Created Oct 1, 2014
PHP SQLite test script
View dbtest.php
<?php //origin:
// Kludges
// Set default timezone
try {
johnlane /
Created Oct 19, 2015
The Ins and Outs of a Trailblazer Operation Contract

The Ins and Outs of a Trailblazer Operation Contract

These notes record my attempts to understand how and when to populate a Trailblazer contract. They may be incomplete, inaccurate or just plain wrong. They may also be right; I hope they are! Comments are welcome.

It all began with the requirement to seed a presenting contract from the inbound request. Having looked for answers in the Trailblazer book and on Gitter (there was a similar conversation on the 25th September), taking

johnlane / PKGBUILD (rssh)
Last active Sep 12, 2017
ArchLinux AUR PKGBUILD for rsync-compatible rssh
View PKGBUILD (rssh)
# Maintainer: Christian Hesse <>
# Contributor: Judd Vinet <>
# Contributor: Gaetan Bisson <>
pkgdesc='Restricted secure shell allowing only scp, sftp, cvs, rsync or rdist'
You can’t perform that action at this time.