This file contains hidden or 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
# Inspiration: http://serverfault.com/a/5551 (but basically rewritten) | |
function fawk() { | |
USAGE="\ | |
usage: fawk [<awk_args>] <field_no> | |
Ex: getent passwd | grep andy | fawk -F: 5 | |
" | |
if [ $# -eq 0 ]; then | |
echo -e "$USAGE" >&2 | |
return | |
#exit 1 # whoops! that would quit the shell! |
This file contains hidden or 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
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
This file contains hidden or 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 | |
# cpustatus | |
# | |
# Prints the current state of the CPU like temperature, voltage and speed. | |
# The temperature is reported in degrees Celsius (C) while | |
# the CPU speed is calculated in megahertz (MHz). | |
function convert_to_MHz { | |
let value=$1/1000 | |
echo "$value" |
This file contains hidden or 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/env python | |
# | |
import DNS | |
import time | |
import sys | |
from collections import defaultdict | |
services = { | |
#'local': ['192.168.10.1'], |
This file contains hidden or 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 | |
/* | |
Author: Jim Westergren & Jeedo Aquino | |
File: index-with-redis.php | |
Updated: 2012-10-25 | |
This is a redis caching system for wordpress. | |
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ |
This file contains hidden or 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 | |
function rblcheck($host) { // Note: I have no idea how well suited CBL is for this purpose. If it gets annoying we can remove it ~ Aurora | |
$rbls = array('sbl-xbl.spamhaus.org', 'rbl.efnet.org', 'cbl.abuseat.org', 'dnsbl.dronebl.org'); | |
foreach($rbls as $rbl) { | |
$lookup = implode('.', array_reverse(explode('.', $host))) . '.' . $rbl; | |
if (strstr(gethostbyname($lookup), "127.0.0")) { | |
return $rbl; | |
} | |
} | |
return 0; |
NewerOlder