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
| def parse_cpu_info(): | |
| cpu = {} | |
| for line in open("/proc/cpuinfo"): | |
| if ':' in line: | |
| k, v = line.split(":", 1) | |
| k = k.strip() | |
| v = v.strip() | |
| cpu[k] = v | |
| if not line.strip(): |
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 | |
| IP=$1 | |
| for x in `seq 1200 20 1700`; | |
| do echo -n "$x " | |
| ping -W 1 -M do -s $(($x-28)) $IP -c 1 > /dev/null && echo WORKED || echo failed | |
| done |
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 | |
| # */5 * * * * root sleep 60 ; is_file_changing /usr/local/bro/logs/current/conn.log || broctl restart | |
| import os | |
| import sys | |
| import time | |
| SIZE_TIMEOUT = 10 | |
| def get_size(f): | |
| for x in range(SIZE_TIMEOUT): |
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/sh | |
| # -*- sh -*- | |
| : << =cut | |
| =head1 NAME | |
| snort_droprate - Plugin to monitor Snort packet drop rate | |
| =head1 CONFIGURATION |
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/sh -x | |
| # cd /path/to/application/root | |
| # convert_rrd.sh otherhost /new/application/root | |
| HOST=$1 | |
| DIR=$2 | |
| for f in `find -name '*.rrd'`; do | |
| rrdtool dump $f | ssh $HOST "cat > ~/dump.xml" | |
| ssh $HOST "cd $DIR;rrdtool restore -f ~/dump.xml $f" |
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/zsh | |
| URL=$1 | |
| MAX=$2 | |
| echo -ne "User: " | |
| read user | |
| echo -ne "PW: " | |
| read pw | |
| wget --no-check-certificate --keep-session-cookies --save-cookies cookies.txt $URL/search/ticket?id=1 --post-data "user=$user&pass=$pw" -O/dev/null |
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
| import time | |
| import requests | |
| import random | |
| import json | |
| class nsqd: | |
| def __init__(self, servers): | |
| self.last_fetch = 0 | |
| self.servers= ["http://%s/put" % h for h in servers] |
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
| import time | |
| import random | |
| import threading | |
| from dogpile.cache import make_region | |
| from dogpile.cache.api import NO_VALUE | |
| def async_creation_runner(cache, somekey, creator, mutex): | |
| ''' Used by dogpile.core:Lock when appropriate ''' | |
| def runner(): | |
| try: |
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/sh -e | |
| cd /var/tmp | |
| rm -rf pf_ring_trunk* | |
| tar xvzf /var/lib/puppet/modules/sniffer/pf_ring_trunk_2012-03-15.tgz | |
| #fix stupid build issues with snort module | |
| ln -sf /var/tmp/pf_ring* /root/PF_RING |
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/sh | |
| apt-get update | |
| apt-get upgrade -y | |
| apt-get install -y nfdump | |
| apt-get install -y libapache2-mod-php5 librrds-perl libmailtools-perl libsocket6-perl rrdtool whois | |
| if [ ! -e /etc/apache2/mods-enabled/rewrite.load ] ; then |