Skip to content

Instantly share code, notes, and snippets.

zyphlar / ads.html
Created Sep 17, 2011
HeatSync Digital Signage
View ads.html
<style type="text/css">
body { background-color: #000; margin: 0;}
.adblock { display: block;
float: left;
width: 46%;
text-align: center;
height: 190px;
margin: 5px;
zyphlar / nag.php
Created Jan 26, 2012
Nagios PHP querier
View nag.php
// nag.php by Will Bradley,
// Script to parse Nagios status.dat and present it in simplified HTML.
// Also grabs graph images from /pnp4nagios if you edit pnp4nagios' apache.conf to not require authentication.
// Based on statusXML.php by Jason Antman
// +----------------------------------------------------------------------+
// | PHP EMS Tools |
// +----------------------------------------------------------------------+
zyphlar / logging.vbs
Created Feb 10, 2012
Login Logging Script
View logging.vbs
On Error Resume Next
Dim wsNetwork
Dim outUser
Dim outComputer
Dim outIP
Dim logPath
Dim septxt
zyphlar / asterisk-status.php
Created Feb 29, 2012
Asterisk log monitoring
View asterisk-status.php
$output = array();
// This command finds the last 100 mentions of "Peer" in the log. Modify using your own keywords!
exec("grep Peer /var/log/asterisk/full | tail --lines=100", $output);
$output = array_reverse($output);
$today = date("M d");
$yesterday = date("M d",time()-86400);
zyphlar /
Created Mar 16, 2012
Script to add new monitors in Nagios
# Sets up monitoring for new basic ping monitors in nagios
# Ths script may be called remotely
if [ ! -n "$1" ]
echo "Usage: `basename $0` <servername> <ip address>"
zyphlar / index.php
Created May 6, 2012
Basic Apache/PHP Start Page
View index.php
<style type="text/css">
body {
background-color: #000;
color: #fff;
font-family: Arial,Helvetica,sans-serif;
zyphlar /
Last active Dec 17, 2015
Batch convert JPEG sequences into MPEG movies
# img2mpg - Will Bradley 2012-2015
# Licensed under Creative Commons Attribution-ShareAlike (CC BY-SA 2.0)
# Requirements: imagemagick and ffmpeg (the convert and ffmpeg commands)
# This is not a very 'safe' script because it moves and deletes files. You should run it with junk data at first, maybe copying each section into a separate script for testing before trying to run the whole thing.
zyphlar / minimal-xml-value.php
Created May 26, 2012
finding minimal value of a simplexml object in php
View minimal-xml-value.php
function find_min_rent($xml, $floorplanid) {
$min_rent = 999999; // a ridiculously high number
foreach($xml->xpath("/PhysicalProperty/Property/Unit[@FloorplanID='$floorplanid']") as $unit) {
if($unit->EffectiveRent['min'] < $min_rent) { // save this rent amount if it's the lowest so far
$min_rent = $unit->EffectiveRent['min'];
return $min_rent;
zyphlar / fatsecret.rb
Created May 31, 2012
FatSecret API in Ruby on Rails example
View fatsecret.rb
require "openssl"
require "base64"
require "digest/md5"
require "net/http"
class String
def esc
CGI.escape(self).gsub("%7E", "~").gsub("+", "%20")
zyphlar / asterisk-logfile-analyzer.php
Created Jun 26, 2012
Cheap and Dirty Asterisk Logfile Analysis
View asterisk-logfile-analyzer.php
/* Cheap and Dirty Asterisk Logfile Analysis
* by Will Bradley,
* Released to the public domain, 6-26-2012
* To install, modify the $dbname and other variables,
* create the MySQL database, user, and permissions,
* and double-check the asterisk logfile paths/formats below.
* This is a very cheap script, use at your own risk!