Skip to content

Instantly share code, notes, and snippets.

View stwalkerster's full-sized avatar

Simon Walker stwalkerster

View GitHub Profile
@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:

@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
@stwalkerster
stwalkerster / bad.php
Created January 31, 2016 03:55
dependency injection primer
<?php
class PetrolEngine {
public function vroom() {}
}
class Car {
private $engine = new PetrolEngine();
public function goFaster() {
#!/bin/bash
cd /root
DATA=`./temphumid 4`
old=$IFS
IFS='
'
val="N"
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Message" company="Simon Walker">
// Simon Walker
// </copyright>
// <summary>
// The message.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace SiteFrameworkMessageComparer

These are the commands for the command blocks needed for each stage of the ticket barrier system, in order. They do require some specific wiring, usually using comparators/repeaters etc (especially for buying tickets/railcards).

I plan on adding wiring diagrams to these at some later point. Question marks indicate values that need to be changed for every set of systems. Relative points for x/z coords are accepted - these are left out entirely.

@stwalkerster
stwalkerster / gist:5390381
Created April 15, 2013 18:50
ACC link queries
select page_namespace, page_title, iwl_text from iwlinks inner join page on page_id = iwl_from where iwl_prefix = "tools" and iwl_title like "~acc/%";
select distinct page_namespace, page_title, el_to from externallinks inner join page on page_id = el_from where el_index LIKE "http://org.toolserver./~acc/%" or el_index LIKE "https://org.toolserver./~acc/%";
@stwalkerster
stwalkerster / update.sh
Last active December 16, 2015 05:39
RRD update for ACC graphs
#!/bin/bash
cd /home/stwalkerster/rrd/acc-new/
wget --no-check-certificate -O status.xml -o /dev/null https://toolserver.org/~acc/api.php?action=status
cat status.xml | sed "s/</\r\n</g" | grep status | sed "s/ /\n/g" | sed "s/\"\/>/\"/" | grep -v "<status" | head -n4 |sed "s/\"//g" > values
rm status.xml
chmod a+x values
. values