Skip to content

Instantly share code, notes, and snippets.

@johnlane
johnlane / Example Grub Module.md
Created July 6, 2015 13:08
Example GRUB Module

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

@johnlane
johnlane / PKGBUILD
Created June 11, 2015 13:03
revised PKGBUILD for Ghost 0.6.4 with npm dependency
# 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')
@johnlane
johnlane / PKGBUILD
Created May 5, 2015 10:32
PKGBUILD for AUR package netkit-bsd-finger with systemd support
# 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 (rssh)
Last active September 12, 2017 20:11
ArchLinux AUR PKGBUILD for rsync-compatible 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 / gist:7fece74c501fd77cc0c3
Created April 17, 2015 09:46
Grub loopback iso example
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
-----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 / cryptsetup-keyfile.patch
Created December 9, 2014 12:55
initrd support for crypt key file with offset and size
--- 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
@johnlane
johnlane / dbtest.php
Created October 1, 2014 09:32
PHP SQLite test script
<?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 / eicar.eml
Created September 10, 2014 12:13
EICAR test message
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 / dockbar-gtk2.py
Last active October 24, 2023 21:43
Example GTK to create a dock-like bar and strut
#!/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