Skip to content

Instantly share code, notes, and snippets.


Simon Walker stwalkerster

View GitHub Profile
stwalkerster /
Created May 17, 2011 svn repo to github git repo import script

Licence (MIT Licence)

Copyright (c) 2011 Simon Walker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

stwalkerster /
Created Jul 15, 2012 deploy script
apt-get update
apt-get install puppet -q -y
echo "domain $" > /etc/resolv.conf
echo "search $" >> /etc/resolv.conf
echo "nameserver" >> /etc/resolv.conf
puppet agent -t --server --certname $DEPLOY_HOSTNAME.$ --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 / 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 = ""
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 closes.sql
VIEW `closes` AS
concat('Closed ',`acc_emails`.`mail_id`) AS `CONCAT("Closed ",mail_id)`,
`acc_emails`.`mail_desc` AS `mail_desc`
from `acc_emails`
stwalkerster /
Created Dec 28, 2012
Postfix queue management script
app="whiptail --backtitle 'Postfix Queue Manager - Cluster' --clear --nocancel"
while true; do
queue=`ls /var/spool/postfix/hold/`
for i in $queue; do
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]
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
View gist:5139843
$cmd = "/usr/lib/update-notifier/update-motd-reboot-required";
$out = array();
$returnvar = 0;
$return = exec($cmd, $out, $returnvar);