Skip to content

Instantly share code, notes, and snippets.

Steve Kemp skx

Block or report user

Report or block skx

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
@skx
skx / Input
Last active May 4, 2018
m4 for overseer test definitions
View Input
#!/usr/bin/m4
# Define a macro for a tinc-protocol test
define(`tinc', `$1 must run tcp with port 655 with banner "^0 \S+ 17$"')
# builder.steve.org.uk
tinc(`176.9.183.97')
# master.steve.org.uk
tinc(`176.9.183.98')
@skx
skx / hashcheck_lsm.c
Created Jun 26, 2017
Linux Security Module - hashcheck - which checks that files have known-good hashes prior to command execution.
View hashcheck_lsm.c
/*
* hashcheck_lsm.c - Steve Kemp
*
* This is a security module which is designed to prevent
* the execution of unknown or (maliciously) altered binaries.
*
* This is achieved by computing an SHA1 digest of every
* binary before it is executed, then comparing that to the
* (assumed) known-good value which is stored as an extended
* attribute alongside the binary.
View test.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//
// eight lines of 16 characters.
//
char *lines[8][16] = { '\0' };
//
@skx
skx / http-logger.go
Last active Apr 7, 2016
Proof of concept logger for symbiosis.
View http-logger.go
Code is now live:
https://projects.bytemark.co.uk/projects/symbiosis/repository/revisions/893599a8ea4fcc31d3506c5b13e6e75213ce47c5
View Osram.pm
package Power::Outlet::Osram;
use strict;
use warnings;
use base qw{Power::Outlet::Common::IP};
use Device::Osram::Lightify::Hub;
our $VERSION='0.16';
View redis-set-test
#!/usr/bin/perl -w
#
# This is a simple perl-script which demonstrates adding jobs to
# a pretend redis-based work-queue.
#
# The intention is that we'll add jobs, and they'll be added to sets
# such that we don't need to worry about unbound-growth.
#
# This program demonstrates that using a sorted-set results in .. a sorted
# set with guaranteed ordering when items are removed.
@skx
skx / go-subcommand-test.go
Created Sep 6, 2015
Implementing sub-commands in go cleanly.
View go-subcommand-test.go
//
// This is a simple program which is designed to be a base for
// a go-binary which handles several different sub-commands.
//
// For example we might have a script which supports:
//
// foo login username $password
//
// foo logout
//
@skx
skx / bigvs.go
Last active Aug 29, 2015
Display the (default) virtual machines associated with a given account.
View bigvs.go
/**
* This is a simple script which will take a username/password and
* list the machines on an account, assuming they are all in the default
* group.
*
* It will also allow you to start/stop multiple machines via regexp.
*
*
*
* Compile
@skx
skx / ctrl-alt-t.c
Created Dec 7, 2014
Run a terminal when ctrl-alt-t is pressed.
View ctrl-alt-t.c
/**
* Launch a terminal when Ctrl-Alt-T is pressed.
*
* gcc -o ctrl-alt-t ctrl-alt-t.c -lX11
*
* Steve
* --
*
* PS. Use xbindkeys like a normal person ;)
*
@skx
skx / Makefile
Last active Aug 29, 2015
Proof of concept binding for lumail 2.x
View Makefile
#
# Build the driver.
#
all: driver
clean:
rm -f *.o core driver || true
You can’t perform that action at this time.