Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Norman deekayen

🏠
Working from home
View GitHub Profile
@deekayen
deekayen / post-receive-email
Created May 24, 2011 — forked from cmcculloh/post-receive-email
Example of a post receive email file called by a git hook that sends a color coded formatted html email of the git diff
View post-receive-email
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#
# This hook is stored in the contrib/hooks directory. Your distribution
@deekayen
deekayen / df.sh
Created Jul 18, 2012
Disk space cron monitor for Ubuntu 8.04
View df.sh
#!/bin/bash
ADMIN="help@example.com"
ALERT=95
df -H | grep -vE '^Filesystem|tmpfs|cdrom|varrun|varlock|udev|devshm|boot' | awk '{ print $3 " " $4 " " $5 }' | while read output;
do
usep=$(echo $output | awk '{ print $2}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $3 }' )
free=$(echo $output | awk '{ print $1 }' )
if [[ $usep -ge $ALERT ]]; then
echo "Running out of space $partition ($usep% used, $free avail)
@deekayen
deekayen / df.sh
Created Jul 18, 2012
Disk space cron monitor for Ubuntu
View df.sh
#!/bin/bash
ADMIN="help@example.com"
ALERT=95
df -H | grep -vE '^Filesystem|none|tmpfs|cdrom|varrun|varlock|udev|devshm|boot' | awk '{ print $4 " " $5 " " $6 }' | while read output;
do
usep=$(echo $output | awk '{ print $2}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $3 }' )
free=$(echo $output | awk '{ print $1 }' )
if [[ $usep -ge $ALERT ]]; then
echo "Running out of space $partition ($usep% used, $free avail)
@deekayen
deekayen / ddos.pl
Created Aug 20, 2012
Distributed denial of service amplification monitor by Jeff Taylor (Shdwdrgn). Written for hosts of OpenNIC DNS servers.
View ddos.pl
#!/usr/bin/perl
$| = 1;
# ddos.pl 2012.06.29
# by Jeff Taylor (Shdwdrgn)
#--- REQUIRED PERL LIBRARIES ---#
# Net::Pcap (debian: libnet-pcap-perl)
# IPTables::ChainMgr (debian: libiptables-chainmgr-perl)
@deekayen
deekayen / workman.php
Created Nov 16, 2012
Test input text files using Workman key cap scores
View workman.php
<?php
// EDIT MY PATH
$file = strtolower(file_get_contents('/Users/YOURUSER/Sites/TEST_TEST.txt'));
function get_points($layout = 'Norman') {
switch ($layout) {
case 'QWERTY':
$points[1] = array('s', 'd', 'f', 'j', 'k', 'l');
@deekayen
deekayen / 1-1000.txt
Last active Feb 24, 2021
1,000 most common US English words
View 1-1000.txt
the
of
to
and
a
in
is
it
you
that
@deekayen
deekayen / quote_speed_test.php
Last active Dec 10, 2015
Test the speed of two different ways to quote a PHP string.
View quote_speed_test.php
<?php
/**
* @file
* Test quote speeds.
*/
$runs = 100000000;
class Timer {
View minimak.js
{"label":"Minimak","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11,"altGr":-1,"shiftAltGr":-1},{"primary":61,"shift":43,"finger":10,"id":12,"altGr":-1,"shiftAltGr":-1},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":113,"shift":81,"finger":1,"id":15,"altGr":-1,"shiftAltGr":-1},{"primary":119,"shift":87,"finger":2,"id":16,"altGr":-1,"shiftAltGr":-1},{"primary":100,"shift":68,"fin
View asset.js
{"label":"Asset","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11,"altGr":-1,"shiftAltGr":-1},{"primary":61,"shift":43,"finger":10,"id":12,"altGr":-1,"shiftAltGr":-1},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":113,"shift":81,"finger":1,"id":15,"altGr":-1,"shiftAltGr":-1},{"primary":119,"shift":87,"finger":2,"id":16,"altGr":-1,"shiftAltGr":-1},{"primary":106,"shift":74,"finge
View workman.js
{"label":"Workman","fingerStart":{"1":29,"2":30,"3":31,"4":32,"5":56,"6":56,"7":35,"8":36,"9":37,"10":38,"11":56},"keyboardType":"standard","keys":[{"primary":96,"shift":126,"finger":1,"id":0},{"primary":49,"shift":33,"finger":1,"id":1},{"primary":50,"shift":64,"finger":2,"id":2},{"primary":51,"shift":35,"finger":3,"id":3},{"primary":52,"shift":36,"finger":4,"id":4},{"primary":53,"shift":37,"finger":4,"id":5},{"primary":54,"shift":94,"finger":7,"id":6},{"primary":55,"shift":38,"finger":7,"id":7},{"primary":56,"shift":42,"finger":8,"id":8},{"primary":57,"shift":40,"finger":9,"id":9},{"primary":48,"shift":41,"finger":10,"id":10},{"primary":45,"shift":95,"finger":10,"id":11},{"primary":61,"shift":43,"finger":10,"id":12},{"primary":8,"finger":10,"id":13},{"primary":9,"finger":1,"id":14},{"primary":113,"shift":81,"finger":1,"id":15},{"primary":100,"shift":68,"finger":2,"id":16,"altGr":-1,"shiftAltGr":-1},{"primary":114,"shift":82,"finger":3,"id":17,"altGr":-1,"shiftAltGr":-1},{"primary":119,"shift":87,"finger":4,"