Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ollyg on github.
  • I am gorwits (https://keybase.io/gorwits) on keybase.
  • I have a public key whose fingerprint is 9472 21ED E9EA 6F5D 47F8 AEBC D8D3 EAEE 9C16 06DE

To claim this, I am signing this object:

@ollyg
ollyg / schema.pg.sql
Created May 11, 2012 08:26
Nagios NDO DB Schema for PostgreSQL
CREATE TABLE "nagios_acknowledgements" (
"acknowledgement_id" serial NOT NULL,
"instance_id" smallint DEFAULT 0 NOT NULL,
"entry_time" timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
"entry_time_usec" integer DEFAULT 0 NOT NULL,
"acknowledgement_type" smallint DEFAULT 0 NOT NULL,
"object_id" integer DEFAULT 0 NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"author_name" character varying(64) DEFAULT '' NOT NULL,
"comment_data" character varying(255) DEFAULT '' NOT NULL,
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use Test::More 0.88;
BEGIN {
use_ok('NetAddr::MAC');
}
@ollyg
ollyg / gist:5775961
Last active December 18, 2015 11:29
DBIx::Class generated query using new multiple prefetch collapsing logic, for Netdisco Device Port view with all view options enabled, including archive data.
SELECT me.ip,
me.port,
me.creation,
me.descr,
me.up,
me.up_admin,
me.type,
me.duplex,
me.duplex_admin,
me.speed,
#!/usr/bin/perl
use warnings;
use strict;
use lib '/var/lib/netdisco';
use netdisco qw/:all/;
config("/var/lib/netdisco/netdisco.conf");
@ollyg
ollyg / clean-pause.pl
Last active July 11, 2016 12:52 — forked from xdg/clean-pause.pl
#!/usr/bin/env perl
# This code works for dagolden, based on a program originally by rjbs. It
# might not work for you. You are hereby empowered to do anything you want
# with this code, including fixing its bugs and redistributing it with your
# own license and API and whatever you want. It'd be nice if you mentioned
# dagolden and rjbs in your fork, but if you don't want to, that's just fine.
#
# The only thing you can't do is act like there's some guarantee that this
# code will actually work or even refrain from blowing stuff up. You're on
# your own. -- rjbs, 2014-04-23 and dagolden, 2016-07-06
@ollyg
ollyg / .gitconfig
Last active August 14, 2017 14:28
Inspect a github pull request
[alias]
branchlog = "!git log --oneline --decorate --left-right --graph master..."
pr = "!sh -c \"git checkout -b pr/$1 && curl -sL $(git config --get remote.origin.url | sed -e 's|:|/|' -e 's|^git@|https://|' -e 's|\\.git$|/pull/$1.patch|') | git am --whitespace=nowarn\" -"
pr-clean = "!git checkout - ; git for-each-ref refs/heads/pr/* --format=\"%(refname)\" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
@ollyg
ollyg / index.html
Last active December 27, 2017 08:41 — forked from donaldh/index.html
force with link labels
<html>
<head>
<title>Force with Labelled Links</title>
<script src="http://mbostock.github.com/d3/d3.js?2.9.2"></script>
<style type="text/css">
.node {
fill: #88f;
stroke: #44a;
stroke-width: 1px;
}
@ollyg
ollyg / dockerfile.sh
Last active January 7, 2018 19:38
netdisco docker notes
curl -s https://api.github.com/repos/netdisco/netdisco-mibs/tags | \
jq '.[]|.tarball_url|select(test("tarball/\\d+\\.\\d+$"))' | \
sort -rg | head -n1 | xargs -n1 curl -L | tar --strip-components=1 -zxf -
curl -s https://api.github.com/repos/netdisco/netdisco/tags | \
jq '.[]|.name|select(test("^\\d+\\.\\d+$"))|"git://github.com/netdisco/netdisco.git@"+.' | \
sort -rg | head -n1 | xargs -n1 cpanm --notest --local-lib $NETDISCO_HOME/perl5
@ollyg
ollyg / Notes-on-netdisco-docker.asciidoc
Last active January 8, 2018 14:48
Netdisco Docker Notes
  1. netdisco:db

    • IMAGE postgres:9.6.6-alpine

    • data volume

  2. netdisco:base

    • IMAGE debian:stable-slim

  3. netdisco:backend

    • IMAGE netdisco:base

    • config volume

    • MIBs

  4. netdisco:web