Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Walker stwalkerster

View GitHub Profile
View gist:9713131
### Keybase proof
I hereby claim:
* I am stwalkerster on github.
* I am stwalkerster (https://keybase.io/stwalkerster) on keybase.
* I have a public key whose fingerprint is 6EDA 5D87 60CC 091E 3B9F 6508 10DA 657D 9612 BE5C
To claim this, I am signing this object:
@stwalkerster
stwalkerster / data.sphp
Last active Aug 29, 2015
Supercount XML changes
View data.sphp
a:12:{s:6:"replag";s:8:"0.000000";s:11:"API Version";s:3:"1.5";s:13:"executiontime";a:2:{s:6:"replag";a:2:{s:5:"total";d:0.01;s:7:"queries";a:1:{i:0;a:3:{s:4:"time";d:0.01;s:5:"query";s:129:"SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(rc_timestamp) as replag FROM recentchanges_userindex ORDER BY rc_timestamp DESC LIMIT 1;";s:6:"result";s:9:"succeeded";}}}s:11:"basic_stats";a:2:{s:7:"queries";a:2:{i:0;a:3:{s:4:"time";d:0.02;s:5:"query";s:76:"SELECT COUNT(*) AS count FROM archive_userindex WHERE (`ar_user` ='851859');";s:6:"result";s:9:"succeeded";}i:1;a:3:{s:4:"time";d:0.11;s:5:"query";s:202:"SELECT rev_timestamp, page_title, page_namespace FROM revision_userindex JOIN page ON page_id = rev_page WHERE (`rev_user` = '851859') AND `rev_timestamp` > 1 ORDER BY rev_timestamp ASC LIMIT 0,2695596;";s:6:"result";s:9:"succeeded";}}s:5:"total";d:0.25;}}s:15:"editcountlimits";a:1:{i:0;d:2695596;}s:14:"monthly_counts";a:102:{s:7:"2006/01";a:2:{s:5:"total";i:5;i:0;i:5;}s:7:"2006/02";a:3:{i:0;i:15;s:5:"total";i:16;i:4;i:1;}s:
View rename.sql
drop procedure if exists mergeToOld;
delimiter $$
create procedure mergeToOld (
in oldid int,
in newid int,
in processUserId int,
in logComment varchar(255)
)
@stwalkerster
stwalkerster / deploy.sh
Created Jul 15, 2012
stwalkerster.net deploy script
View deploy.sh
#!/bin/bash
DEPLOY_HOSTNAME="metapod"
DEPLOY_CLUSTER="lon"
apt-get update
apt-get install puppet -q -y
hostname $DEPLOY_HOSTNAME
echo "domain $DEPLOY_CLUSTER.stwalkerster.net" > /etc/resolv.conf
echo "search $DEPLOY_CLUSTER.stwalkerster.net" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
puppet agent -t --server puppet.srv.stwalkerster.net --certname $DEPLOY_HOSTNAME.$DEPLOY_CLUSTER.stwalkerster.net --waitforcert 60
View gist:4186788
-rw-r----- 1 root root 2629 Nov 25 06:26 eyeinthesky.log.7.gz
-rw-r----- 1 root root 2230542 Dec 2 03:12 helpmebot.log
-rw-r----- 1 root root 482161 Dec 1 06:51 helpmebot.log.1.gz
-rw-r----- 1 root root 523830 Nov 30 06:30 helpmebot.log.2.gz
-rw-r----- 1 root root 520576 Nov 29 06:32 helpmebot.log.3.gz
-rw-r----- 1 root root 530640 Nov 28 06:31 helpmebot.log.4.gz
-rw-r----- 1 root root 524881 Nov 27 06:38 helpmebot.log.5.gz
-rw-r----- 1 root root 518958 Nov 26 06:51 helpmebot.log.6.gz
-rw-r----- 1 root root 594351 Nov 25 06:28 helpmebot.log.7.gz
-rw-r----- 1 root root 131 Oct 15 13:31 hwclock-save.log.1.gz
View gist:4211954
public function hasright($username, $checkright) {
global $tsSQL;
if(isCheckuser($username) && $checkright == "Admin") {
return true;
}
$username = $tsSQL->escape($username);
$query = "SELECT * FROM acc_user WHERE user_name = '$username';";
$result = $tsSQL->query($query);
@stwalkerster
stwalkerster / gist:4282852
Created Dec 14, 2012
Helpmebot v3 :o Dragged out of the archives
View gist:4282852
Module Module1
#Region "constants and variables"
'get the connection stuff
Const server As String = "kubrick.freenode.net"
Dim client As New System.Net.Sockets.TcpClient(server, 8001)
Dim streamreader As New System.IO.StreamReader(client.GetStream)
Dim streamwriter As New System.IO.StreamWriter(client.GetStream)
View IngressDualMap.user.js
// ==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*
View closes.sql
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
View syslog
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]