Skip to content

Instantly share code, notes, and snippets.

@johnlane
johnlane / dockbar-gtk2.py
Last active Jul 12, 2020
Example GTK to create a dock-like bar and strut
View dockbar-gtk2.py
#!/usr/bin/env python2
#
# dockbar.py
#
# Example program places a coloured bar across the top of the
# current monitor
#
# demonstrates
#
# (a) creating the bar as an undecorated "dock" window
@johnlane
johnlane / zk3d
Last active Jun 4, 2020
A wrapper for k3d for use with ZFS file systems
View zk3d
#!/bin/bash
# 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
View Injecting Terminal Input.md

Injecting Terminal Input

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

@johnlane
johnlane / arch-zfsroot-install
Created Jun 19, 2018
Simple installer for ArchLinux on ZFS (tested in VirtualBox)
View arch-zfsroot-install
#!/bin/sh
# prerequisites
# pacman -S arch-install-scripts sgdisk rsync
ZPOOL=rootfs
RAIDZ=mirror
DISKS=( /dev/disk/by-id/ata-VBOX_HARDDISK_VB{5f2d4170-647f16b7,f38966d8-57bff7df} )
# Ensure zpool offline
@johnlane
johnlane / dbtest.php
Created Oct 1, 2014
PHP SQLite test script
View dbtest.php
<?php //origin: http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/
// Kludges
const SQLITE3_TEXT = PDO::PARAM_STR;
const SQLITE3_INTEGER = PDO::PARAM_INT;
// Set default timezone
date_default_timezone_set('UTC');
try {
@johnlane
johnlane / in_out_trailblazer.md
Created Oct 19, 2015
The Ins and Outs of a Trailblazer Operation Contract
View in_out_trailblazer.md

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
johnlane / wysiwyg.js
Last active Jan 20, 2018
An integrated Markdown WYSIWYG editor
View wysiwyg.js
$(document).on('ready page:load ajaxComplete', function() {
$('textarea.wysiwyg').each(function() {
var textarea = $(this)
textarea.hide().uniqueId();
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
johnlane / PKGBUILD (rssh)
Last active Sep 12, 2017
ArchLinux AUR PKGBUILD for rsync-compatible rssh
View PKGBUILD (rssh)
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Judd Vinet <jvinet@zeroflux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
pkgname=rssh
pkgver=2.3.4
pkgrel=4
pkgdesc='Restricted secure shell allowing only scp, sftp, cvs, rsync or rdist'
url='http://www.pizzashack.org/rssh/'
license=('custom:rssh')
View screenlog.boot
U-Boot 1.1.4-g12193fce-dirty (Dec 14 2009 - 13:39:19)
WN604 (ar7240) U-boot dni7 V0.8
DRAM:
sri
#### TAP VALUE 1 = a, 2 = b
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 278k for U-Boot at: 81fb8000
View log
ROM VER: 1.1.4
CFG 06
NAND
NAND Read OK
U-Boot SPL 2014.01-openwrt4-g9abc897-dirty (Jun 27 2015 - 18:14:58)
SPL: applying tuned DDR SDRAM settings
MEM: DDR Echo DLL delay: 22/23
MEM: DDR Write DQS delay: 65/67
MEM: DDR Read DQS delay: 1f/1f
You can’t perform that action at this time.