Skip to content

Instantly share code, notes, and snippets.

Sean Kilgore logikal

Block or report user

Report or block logikal

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
@logikal
logikal / ntp_drift_reporter.sh
Created Nov 21, 2018
Ever wondered how far off your clock was? now you can know.
View ntp_drift_reporter.sh
#!/usr/bin/env bash
# finds the maximum clock drift in the last 30 days
# using the stats files kept in /var/log/ntpstats
# We need somewhere temporary to keep our concatenated results
TMPFILE=$(mktemp) || exit 1
FILELIST=$(find /var/log/ntpstats/ -mtime -31 -type f)
cut -d' ' -f 5 $FILELIST| sort -g > $TMPFILE
@logikal
logikal / cent6.log
Created Nov 7, 2017
seccomp & bpf support between cent6 and cent7
View cent6.log
[vagrant@seccomp-centos-6-chef-12-kitchen ~]$ cat /etc/redhat-release
CentOS release 6.8 (Final)
[vagrant@seccomp-centos-6-chef-12-kitchen ~]$ uname -a
Linux seccomp-centos-6-chef-12-kitchen.vagrantup.com 2.6.32-642.4.2.el6.x86_64 #1 SMP Tue Aug 23 19:58:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@seccomp-centos-6-chef-12-kitchen ~]$ gcc -H -fsyntax-only test.c
. /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stdbool.h
. /usr/include/stdio.h
.. /usr/include/features.h
... /usr/include/sys/cdefs.h
@logikal
logikal / graphite_traps.sh
Last active Aug 2, 2017
using traps to send graphite metrics in bash scripts
View graphite_traps.sh
#!/usr/bin/env bash
starttime=$(date +%s)
########
# Set up a set of functions and traps that will emit duration and error counts for this script on exit.
# expects that $GRAPHITE_HOST is set in the environment.
function emit_duration {
endtime=$(date +%s)
duration=$(($endtime-$starttime))
@logikal
logikal / Dubai_HoE.txt
Created Oct 6, 2016
Head of Engineering - Devops (Dubai)
View Dubai_HoE.txt
Dear $PERSON,
I hope you're well and don't mind me contacting you directly like this. How are things going at $JOB? I see you've been there a while, so was keen to reach out about an opportunity based here in Dubai that you look great for, for a Head of Engineering - DevOps project!
Our client is backed by the people that built the worlds tallest building, the Burj Khalifa and their about to have a similar impact on the Digital space, by building a world class E-Commerce Platform. They have the biggest Polymer/Scala project taking off Globally at the moment.
They have already attracted top talent from some of the biggest Digital organisations in the world, and now they are building an elite Development Team. I wanted to speak to you about a Head of Engineering role I have here that I thought you would be a good fit for?
Based in Dubai, a stunning package is on offer that includes –
Very competitive tax-free salary
@logikal
logikal / ttl_warn_to_crit.rb
Created Jul 25, 2016
A sensu mutator to turn warnings into criticals when the TTL has expired.
View ttl_warn_to_crit.rb
#!/usr/bin/env ruby
#
# Mutate TTL results with warnings to critical status
# Because Sensu hardcodes a stale TTL check to status=1
# we'll never get paged for TTL failures.
# Refer to https://github.com/sensu/sensu/issues/1166
#
# Cribbed from the example at https://sensuapp.org/docs/0.25/reference/plugins.html#example-plugins
require 'json'
@logikal
logikal / consul.json
Last active May 24, 2016
y u no statsd, consul?
View consul.json
{
"data_dir": "/var/lib/consul/",
"addresses": {
"rpc": "127.0.0.1"
},
"ports": {
"dns": 8600,
"http": 8500,
"rpc": 8400,
"serf_lan": 8301,
View neighbor.c.diff
@@ -290,15 +290,7 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl, struct net_device
goto out_entries;
}
- if (tbl->entry_size)
- n = kzalloc(tbl->entry_size, GFP_ATOMIC);
- else {
- int sz = sizeof(*n) + tbl->key_len;
-
- sz = ALIGN(sz, NEIGH_PRIV_ALIGN);
View currentsensing_example.ino
// http://openenergymonitor.org/emon/node/1267
//inclue lcdLibrary
#include
//intialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
//set input pin
int sensorPin = A4;
@logikal
logikal / yum_logs.log
Created Jan 11, 2016
st2actionrunner not installing correctly
View yum_logs.log
[root@default-centos-6-chef-11 bin]# yum info stactions
Loaded plugins: security, verify
Error: No matching Packages to list
[root@default-centos-6-chef-11 bin]# yum info st2actions
Loaded plugins: security, verify
Installed Packages
Name : st2actions
Arch : noarch
Version : 1.2.0
Release : 8
@logikal
logikal / answers.yaml
Last active Jan 8, 2016
Stackstorm answer file ssl_cert, ssl_key examples. Chef code assumes you have your preferred cert and key on disk somewhere already.
View answers.yaml
---
st2_ssl_cert: ! '-----BEGIN CERTIFICATE-----
LINE 1
LINE 2
LINE 3
LINE 4
You can’t perform that action at this time.