Skip to content

Instantly share code, notes, and snippets.

View stwalkerster's full-sized avatar

Simon Walker stwalkerster

View GitHub Profile
@stwalkerster
stwalkerster / postmanage.sh
Created December 28, 2012 22:30
Postfix queue management script
#!/bin/bash
app="whiptail --backtitle 'Postfix Queue Manager - stwalkerster.net Cluster' --clear --nocancel"
while true; do
queue=`ls /var/spool/postfix/hold/`
menulist=""
for i in $queue; do
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
@stwalkerster
stwalkerster / gist:4282852
Created December 14, 2012 05:16
Helpmebot v3 :o Dragged out of the archives
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)
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);
-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
@stwalkerster
stwalkerster / deploy.sh
Created July 15, 2012 20:52
stwalkerster.net deploy script
#!/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
@stwalkerster
stwalkerster / sfnet2github.sh
Created May 17, 2011 17:18
SourceForge.net 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: