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 | |
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
for JAIL in $JAILS | |
do | |
fail2ban-client status $JAIL | |
done |
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 | |
# HipHop for PHP scripted installation | |
# by Steve Kamerman, July 12, 2011 | |
echo -e "\e[00;31m**** Installing Prerequisites\e[00m" | |
sudo apt-get --yes install git-core cmake g++ libboost-dev libmysqlclient-dev libxml2-dev libmcrypt-dev libicu-dev openssl binutils-dev libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev autoconf libtool libcurl4-openssl-dev libboost-system-dev libboost-program-options-dev libboost-filesystem-dev wget memcached libreadline-dev libncurses-dev libmemcached-dev libicu-dev libbz2-dev libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev | |
echo -e "\e[00;31m**** Getting HIPHOP in 5 seconds ****\e[00m" |
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
/** | |
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation | |
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree | |
* Payment API as of Dec 2011 | |
* | |
* Compiled by Steve Kamerman, 2011 | |
*/ | |
SET FOREIGN_KEY_CHECKS=0; | |
-- ---------------------------- |
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 | |
// Simple DNSBL/RBL PHP function - trust me, it's better than checkdnsrr, fsock, socket_create, Net::DNSBL and Net::DNS | |
// Here's a [better] way to quickly check if an IP is in a DNSBL / RBL. It works on Windows and Linux, | |
// assuming nslookup is installed. It also supports timeout in seconds. | |
function ipInDnsBlacklist($ip, $server, $timeout=1) { | |
$response = array(); | |
$host = implode(".", array_reverse(explode('.', $ip))).'.'.$server.'.'; | |
$cmd = sprintf('nslookup -type=A -timeout=%d %s 2>&1', $timeout, escapeshellarg($host)); | |
@exec($cmd, $response); |
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 -e | |
# UDF Documentation: http://www.mysqludf.org/lib_mysqludf_preg/ | |
yum -y install pcre-devel gcc make automake mysql-devel | |
wget http://www.mysqludf.org/lib_mysqludf_preg/lib_mysqludf_preg-1.0.1.tar.gz | |
tar -zxvf lib_mysqludf_preg-1.0.1.tar.gz | |
cd lib_mysqludf_preg-1.0.1 | |
./configure | |
make install | |
echo "You'll need to enter your MySQL password a few times to install the UDFs and test them" |
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
#!/usr/bin/php | |
<?php | |
/** | |
* This script subscribes all global moderators to all forums. | |
* Put this in your phpBB3 directory and do "chmod 0700 auto_subscribe_moderators.php" | |
* You can use crontab to run this script so your moderators stay subscribed! | |
*/ | |
// Path to the phpBB3 Config Script | |
require dirname(__FILE__).'/config.php'; |
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
# put this file in ~/.openstack/compute.conf | |
[openstack.compute] | |
username=your_user_name | |
apikey=your_api_key | |
auth_url=https://lon.auth.api.rackspacecloud.com/v1.0 |
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
#!/usr/bin/perl | |
# HAProxy Performance Statistics | |
# by Steve Kamerman | |
# | |
# To use, pipe your HAProxy log with timing information (like "0/0/1/1/3 200") to | |
# this script. It will output min, max, med, avg and a latency distribution graph. | |
# | |
# Info on timing logging in HAProxy: http://code.google.com/p/haproxy-docs/wiki/TimingEvents | |
# |
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
map = function() { | |
if (!this.fruits) return; | |
var skip_fruits = { | |
'Watermelon':1, | |
'Grapefruit':1, | |
'Tomato':1 // yes, a tomato is a fruit | |
} | |
for (var fruit in this.fruits) { | |
if (skip_fruits[fruit]) continue; | |
var obj = {}; |
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 | |
$db = new Mongo('mongodb://127.0.0.1'); | |
$ops = $db->ua->selectCollection('$cmd.sys.inprog'); | |
$ops_doc = $ops->findOne(); | |
function duration($secs) { | |
$vals = array( | |
'y' => intval($secs / 86400 / 365), | |
'w' => intval($secs / 86400 / 7) % 52, | |
'd' => $secs / 86400 % 7, |
OlderNewer