This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = array( | |
array('company'=>'AIG', 'id'=>1, 'balance'=> '-$99,999,999,999.00'), | |
array('company'=>'Wachovia', 'id'=>2, 'balance'=> '-$10,000,000.00'), | |
array('company'=>'HP', 'id'=>3, 'balance'=> '$555,000.000.00'), | |
array('company'=>'IBM', 'id'=>4, 'balance'=> '$12,000.00') | |
); | |
$renderer = new ArrayToTextTable($data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Array to Text Table Generation Class | |
* | |
* @author Tony Landis <tony@tonylandis.com> | |
* @link http://www.tonylandis.com/ | |
* @copyright Copyright (C) 2006-2009 Tony Landis | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class ArrayToTextTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Steps for turning on squid monitoring (until I have an rpm) | |
cat > /etc/collectd.d/squid << EOF | |
LoadPlugin exec | |
<Plugin exec> | |
Exec deploy "/var/lib/releng/monitoring/squid" | |
</Plugin> | |
EOF | |
mkdir -p /var/lib/releng/monitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A bash script to create a time machine disk image suitable for | |
# backups with OS X 10.6 (Snow Leopard) | |
# This script probably only works for me, so try it at your own peril! | |
# Use, distribute, and modify as you see fit but leave this header intact. | |
# (R) sunkid - September 5, 2009 | |
# | |
# This will create a time machine ready disk image named with your | |
# computer's name with a maximum size of 600GB and copy it to | |
# /Volumes/backup. The image "file" (it's a directory, really) will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo | |
echo usage: $0 network-interface | |
echo | |
echo e.g. $0 eth0 | |
echo | |
echo shows packets-per-second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript | |
* https://gist.github.com/faisalman | |
* | |
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com> | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license | |
*/ | |
(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (C) 2012 Yoshimasa Niwa | |
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Postfix stuff based on https://gist.github.com/jbrownsc/4694374: | |
QUEUEID (?:[A-F0-9]+|NOQUEUE) | |
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+ | |
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote} | |
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?) | |
POSREAL [0-9]+(.[0-9]+)? | |
DELAYS (%{POSREAL}[/]*)+ | |
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT} | |
STATUS sent|deferred|bounced|expired |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires jQuery of course. | |
$(document).ready(function() { | |
$('.show-comments').on('click', function(){ | |
var disqus_shortname = 'YOUR-DISQUS-USERNAME'; // Replace this value with *your* username. | |
// ajax request to load the disqus javascript | |
$.ajax({ | |
type: "GET", | |
url: "http://" + disqus_shortname + ".disqus.com/embed.js", | |
dataType: "script", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Processes iostat output | |
# >iostat -d -m -x sda sdb 1 | bin/logstash -f iostat.conf | |
# | |
# Sample Output: | |
# | |
# Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util | |
# sda 3.36 174.28 9.64 183.71 65.17 1431.99 15.49 0.61 3.16 0.09 1.65 | |
# sdb 0.00 0.00 742.87 4110.46 5830.48 16441.82 9.18 4.90 0.98 0.11 55.45 | |
OlderNewer