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 / 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 / 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
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')
View Example Grub Module.md

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 / cell.rb
Created Oct 1, 2015
Widget wrapper around cell
View cell.rb
# app/concepts/widget/cell.rb
# A very basic "Widget" that is a container of Cell objects
# When rendered, it recursively renders all cells that it
# contains.
class Widget < Cell::Concept
attr_reader :parent
attr_reader :children
# Create a new widget
@johnlane
johnlane / answer.md
Created Apr 16, 2016
Can a Trailblazer concept inherit from another and be able to extend its operati ons (multiple inheritance) ?
View answer.md

The effect of multiple inheritance can be achieved by using modules.

First define the ActiveRecord objects like this:

class Topic < ActiveRecord::Base; end
class Location < ActiveRecord::Base; end

There is no longer a base Tag abstract class, allowing Tag to be defined as a module like this (app/concepts/tag/crud.rb):

module Tag
You can’t perform that action at this time.