Skip to content

Instantly share code, notes, and snippets.

View stwalkerster's full-sized avatar

Simon Walker stwalkerster

View GitHub Profile
@stwalkerster
stwalkerster / lcd.sh
Last active December 16, 2015 04:29
LCD code for RPi
#!/bin/bash
# mode: 0 = control
echo "1" > /sys/devices/virtual/gpio/gpio3/value
# 14 15 18 23 24 25 8 7
data=`echo $1 | xxd -b | cut -f 2 -d " "`
[02:08:49][stwalkerster@blastoise:~]
bash $ dig riley.fastlizard4.org
; <<>> DiG 9.7.3 <<>> riley.fastlizard4.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 31404
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
#!/usr/bin/php
<?php
$defs = "DEF:open=acc.rrd:open:AVERAGE DEF:admin=acc.rrd:admin:AVERAGE DEF:cu=acc.rrd:checkuser:AVERAGE DEF:hold=acc.rrd:hold:AVERAGE";
$times = array(
"day" => array(
"date" => "-1day",
"title" => "day",
),
@stwalkerster
stwalkerster / blockscript.php
Created March 12, 2013 04:12
block test script - takes an array of IPs and spits the lcally blocked ones back at you.
<?php
ini_set("user_agent", "stw-block-script/1.0 ( User:Stwalkerster )");
$iplist = array( "127.0.0.1" );
header("Content-Type: text/plain");
foreach($iplist as $ip){
$data = (unserialize(file_get_contents("http://en.wikipedia.org/w/api.php?action=query&list=blocks&format=php&bkusers=$ip")));
#!/usr/bin/php
<?php
$cmd = "/usr/lib/update-notifier/update-motd-reboot-required";
$out = array();
$returnvar = 0;
$return = exec($cmd, $out, $returnvar);
#!/usr/bin/php
<?php
$statusfile = "/var/local/nagios-update-check";
$data = array();
$ret = 0;
$updates = exec("/usr/lib/update-notifier/apt-check 2>&1", $data, $ret);
$up = explode(";", $updates);
$maxupdates = 15;
@stwalkerster
stwalkerster / create.sh
Created March 5, 2013 03:08
ACC stats graph
#!/bin/bash
STEP=300
HB=600
rrdtool create acc.rrd --start `date +%s` --step $STEP DS:open:GAUGE:$HB:0:U DS:admin:GAUGE:$HB:0:U DS:checkuser:GAUGE:$HB:0:U DS:hold:GAUGE:$HB:0:U RRA:AVERAGE:0.5:1:288 #RRA:AVERAGE:0.5:12:24 RRA:AVERAGE:0.5:288:31
Jan 30 16:42:15 metapod slapd[20445]: @(#) $OpenLDAP: slapd (Oct 17 2012 19:48:49) $#012#011buildd@panlong:/build/buildd/openldap-2.4.28/debian/build/servers/slapd
Jan 30 16:42:15 metapod slapd[20445]: ldif_read_file: checksum error on "/etc/ldap/slapd.d/cn=config/olcDatabase={0}config.ldif"
Jan 30 16:42:15 metapod slapd[20445]: ldif_read_file: checksum error on "/etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif"
Jan 30 16:42:15 metapod slapd[20446]: hdb_db_open: database "dc=stwalkerster,dc=net": unclean shutdown detected; attempting recovery.
Jan 30 16:42:15 metapod slapd[20446]: slapd starting
Jan 30 16:42:15 metapod puppet-agent[17716]: (/Stage[main]/Ldap::Server/Service[ldap]/ensure) ensure changed 'stopped' to 'running'
Jan 30 16:42:27 metapod puppet-agent[17716]: Finished catalog run in 21.07 seconds
Jan 30 16:42:49 metapod kernel: slapd[20448]: segfault at 70 ip b76c0e79 sp b5df9820 error 4 in slapd[b7640000+12f000]
CREATE
ALGORITHM=UNDEFINED
DEFINER=`acc`@`%.toolserver.org`
SQL SECURITY DEFINER
VIEW `closes` AS
select
concat('Closed ',`acc_emails`.`mail_id`) AS `CONCAT("Closed ",mail_id)`,
`acc_emails`.`mail_desc` AS `mail_desc`
from `acc_emails`
where
// ==UserScript==
// @id iitc-plugin-ingressdualmap-exporter@OllieTerrance
// @name IITC plugin: Ingress Dual Map Exporter
// @category Keys
// @version 0.0.0.1
// @namespace https://github.com/jonatkins/ingress-intel-total-conversion
// @description Exports portals currently in view as a CSV list for use with Ingress Dual Map.
// @include https://www.ingress.com/intel*
// @include http://www.ingress.com/intel*
// @match https://www.ingress.com/intel*