Skip to content

Instantly share code, notes, and snippets.

James O'Gorman jamesog

Block or report user

Report or block jamesog

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
@jamesog
jamesog / README.md
Last active Apr 13, 2019
Yubikey SSH without GPG
View README.md

Yubikey as an SSH key

All other guides I've seen (https://github.com/drduh/YubiKey-Guide being the most prolific) tell you to use the Yubikey's smartcard (PKCS#11) features with GnuPG via gpg-agent.

STOP THE MADNESS!

OpenSSH has supported OpenSC since version 5.4. This means that all you need to do is install the OpenSC library and tell SSH to use that library as your identity.

Prequisites

@jamesog
jamesog / context.go
Last active Jan 1, 2019
HTTP DB Context
View context.go
package main
import (
"context"
"database/sql"
"log"
"net/http"
_ "github.com/lib/pq"
)
@jamesog
jamesog / siteadmin.sh
Created Oct 23, 2016
siteadmin.sh - ancient Apache vhost management script
View siteadmin.sh
#!/bin/sh
# siteadmin.sh
# Created 2005/01/07 by James O'Gorman <james@netinertia.co.uk>
#
# This script automatically creates directory structures and config file
# entries needed for a new website.
# It can also be used to clean up (remove) those entries when a website is
# no longer needed.
#
@jamesog
jamesog / gist:7959418afec6ff3d224d
Created Jun 22, 2015
FreeBSD on Linode KVM dmesg
View gist:7959418afec6ff3d224d
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RELEASE-p10 #0: Wed May 13 06:54:13 UTC 2015
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz (2500.08-MHz K8-class CPU)
Origin = "GenuineIntel" Id = 0x306f2 Family = 0x6 Model = 0x3f Stepping = 2
Features=0xf8bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,SS>
@jamesog
jamesog / gist:4c7f7b448a28f27dd51f
Created Jan 14, 2015
FreeBSD dmesg on DigitalOcean
View gist:4c7f7b448a28f27dd51f
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz (2400.01-MHz K8-class CPU)
Origin = "GenuineIntel" Id = 0x306e4 Family = 0x6 Model = 0x3e Stepping = 4
Features=0xf83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS>
View .tsmrc
TarsnapArgs:
ExcludeFile: /root/crons/tarsnap.exclude
BackupDirs:
- /boot
- /etc
- /home
- /root
- /usr/local/etc
- /var/log
- /data/jail/boxbackup/etc
View keybase.md

Keybase proof

I hereby claim:

  • I am jamesog on github.
  • I am jamesog (https://keybase.io/jamesog) on keybase.
  • I have a public key whose fingerprint is E9EB 3E24 C08C 0AE3 2A47 CA16 FF19 DF02 C0D7 49BD

To claim this, I am signing this object:

@jamesog
jamesog / mkinventory.pl
Last active Sep 19, 2018
Exporting from RackTables (e.g. for creating an inventory spreadsheet).
View mkinventory.pl
#!/usr/bin/env perl
use warnings;
use strict;
# Use modules installed with cpanm -L
use lib 'extlib/lib/perl5';
use DBI;
use POSIX qw(strftime);
use Spreadsheet::WriteExcel;
@jamesog
jamesog / zpools.rb
Created May 9, 2013
Retrieving zpools in facter
View zpools.rb
require 'facter'
Facter.add('zpools') do
setcode do
zpools = []
if Facter::Util::Resolution.which('zpool')
Facter::Util::Resolution.exec('zpool list -Ho name').each_line do |line|
line.strip!
zpools << line
end
View gist:2868925
if tmux has 2>/dev/null; then
echo "tmux sessions found:"
tmux ls
echo
echo -n "Attaching to default tmux session in 5 seconds. Press Ctrl-C to abort"
for ((i=5; i>0; i--))
do
printf "."
if read -s -t 1 -k ; then break; fi
done
You can’t perform that action at this time.