Skip to content

Instantly share code, notes, and snippets.

johnlane

Block or report user

Report or block johnlane

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
@johnlane
johnlane / tom.rb
Last active Aug 29, 2015
The One Module (TOM) is an example Ruby module that demonstrates setting of module, class, class instance and instance variables for classes that include or extend the module.
View tom.rb
# TOM : The One Module
#
# An example Ruby module that demonstrates setting of module, class, class instance
# and instance variables for classes that include or extend the module
#
# (c) John Lane 20140218
#
module Tom
extend self # makes module methods available as class and instance methods.
@johnlane
johnlane / dockbar-gtk2.py
Last active Dec 29, 2018
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 / eicar.eml
Created Sep 10, 2014
EICAR test message
View eicar.eml
From: John Doe <john.doe@example.com>
Subject: EICAR Test Message
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="XXXXboundary text"
This is a multipart message in MIME format.
--XXXXboundary text
Content-Type: text/plain
@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 / cryptsetup-keyfile.patch
Created Dec 9, 2014
initrd support for crypt key file with offset and size
View cryptsetup-keyfile.patch
--- encrypt_hook 2014-12-09 12:47:02.379911026 +0000
+++ encrypt_hook 2014-12-09 12:47:41.416087076 +0000
@@ -7,7 +7,7 @@
# Get keyfile if specified
ckeyfile="/crypto_keyfile.bin"
if [ -n "$cryptkey" ]; then
- IFS=: read ckdev ckarg1 ckarg2 <<EOF
+ IFS=: read ckdev ckarg1 ckarg2 ckarg3 ckarg4 <<EOF
$cryptkey
EOF
View gpg_transition_395DDE80_22D05A45.asc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
PGP Transition Statement
========================
I have transitioned my GPG key from an old 1024-bit DSA key to a new 4096-bit RSA key.
The old key is now invalid; please use my new key from now on.
@johnlane
johnlane / gist:7fece74c501fd77cc0c3
Created Apr 17, 2015
Grub loopback iso example
View gist:7fece74c501fd77cc0c3
set imgdevpath='/dev/disk/by-uuid/e7bc3210-ee80-4111-a6da-3db1d2e2cbef'
set isofile="/iso/tails-i386-1.2.2.iso"
loopback loop $isofile
linux (loop)/live/vmlinuz fromiso=$imgdevpath/$isofile boot=live config noswap nopersistent nomodeset noautologin splash
initrd (loop)/live/initrd.img
@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')
@johnlane
johnlane / PKGBUILD
Created May 5, 2015
PKGBUILD for AUR package netkit-bsd-finger with systemd support
View PKGBUILD
# Maintainer:
# Contributor: dorphell <dorphell@archlinux.org>
# Updated for systemd by John Lane <archlinux at jelmail dot com>
pkgname=netkit-bsd-finger
pkgver=0.17
pkgrel=9
pkgdesc="BSD-finger ported to Linux"
arch=('i686' 'x86_64')
url='http://ftp.linux.org.uk/pub/linux/Networking/netkit'
@johnlane
johnlane / PKGBUILD
Created Jun 11, 2015
revised PKGBUILD for Ghost 0.6.4 with npm dependency
View PKGBUILD
# Maintainer: Chun Yang <x@cyang.info>
pkgname=ghost
pkgver=0.6.4
pkgrel=1
pkgdesc="Free, open, simple blogging platform"
arch=('i686' 'x86_64')
url="http://ghost.org"
license=('MIT')
makedepends=('unzip')
depends=('nodejs>=0.12' 'npm')
You can’t perform that action at this time.