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/env/python | |
#Author : Psycho_Coder | |
#Date : 7/11/2014 | |
import os | |
import sys | |
import binascii | |
hex_link_pat = "".join("0A 2F 42 6F 72 64 65 72 20 5B 20 30 20 30 20 30 20 5D " | |
"0A 2F 41 20 3C 3C 0A 2F 54 79 70 65 20 2F 41 63 74 69 " |
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
/* | |
* Test that libmemcached is built with SASL support. | |
*/ | |
#include <stdio.h> | |
#include <libmemcached/memcached.h> | |
const char* key = "abc"; | |
const char* value = "value"; | |
// test basic get/set operation works. |
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
# 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 | |
# script to mount and chroot into a rootfs directory | |
# designed for openwrt systems, but should work for anything with minimal modifications | |
# unless you specify a different chroot dir, | |
# place script on the same level as the rootfs directory, should look something like so: | |
# /mnt/ | |
# |- chroot.sh | |
# |- rootfs/ |
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 | |
$rbls = [ | |
'b.barracudacentral.org', | |
'cbl.abuseat.org', | |
'http.dnsbl.sorbs.net', | |
'misc.dnsbl.sorbs.net', | |
'socks.dnsbl.sorbs.net', | |
'web.dnsbl.sorbs.net', | |
'dnsbl-1.uceprotect.net', |
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 | |
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
<?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
<?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); |
OlderNewer