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
| for x in $(find . -type f | grep snapshot | grep eu ); do echo $x; foo=$(cat $x | grep SNAPSHOT | awk '{ i=i+$8}; END { print i }'); echo "$foo GIGS"; 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
| #ssh into screen allways, if possilbe to a running screen. | |
| #place this script in /usr/bin/s or similar path | |
| #!/bin/bash | |
| function s | |
| { | |
| if [[ "$@" == *@* ]]; | |
| then | |
| ssh -t "$@" /usr/bin/screen -xRR | |
| else |
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 | |
| status=0 | |
| logdir="/var/log/vpnevent/" | |
| log="vpnevent.log" | |
| #[[ ! $UID = 0 ]] && echo "This script must be run as root"; exit 1 | |
| if [[ ! "$1" ]] | |
| then | |
| echo "usage: "$0" List of hosts on which this script depends" |
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
| grep --include=*.php -RPnDskip "(passthru|shell_exec|system|phpinfo|base64_decode|chmod|mkdir|readfile) *\(" . | |
| fgrep -r DQplcnJvcl9yZXBvcnR . | |
| fgrep --include=*.gif -r 'eval' . | |
| fgrep --include=*.gif -r '<?' . | |
| fgrep -r "eval(stripslashes($_REQUEST" . | |
| fgrep -r "46esab" . | |
| fgrep -r "strrev" . | |
| fgrep -r "\x65\x76\x61\x6C" . | |
| fgrep -r "chr(48).chr(43)" . | |
| fgrep -r '*/$' . |
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 | |
| # | |
| # init.d script with LSB support. | |
| # | |
| # Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org> | |
| # | |
| # This is free software; you may redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as | |
| # published by the Free Software Foundation; either version 2, | |
| # or (at your option) any later version. |
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
| cluster1:PRIMARY> conf = rs.conf() | |
| { | |
| "_id" : "cluster1", | |
| "version" : 98579, | |
| "members" : [ | |
| { | |
| "_id" : 0, | |
| "host" : "shortname001:27017" | |
| }, | |
| { |
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. | |
| host=172.10.10.1 | |
| if ! [[ $(ping -c4 $host &> /dev/null;) ]]; | |
| then | |
| echo "OK - VPN is up" | |
| else | |
| echo "CRITICAL - Cannot ping VPN gateway" | |
| fi |
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
| require 'formula' | |
| class Vim < Formula | |
| homepage 'http://www.vim.org/' | |
| url 'https://vim.googlecode.com/hg/', :revision => 'c0203d88d1d7' | |
| version '7.3.515' | |
| def features; %w(tiny small normal big huge) end | |
| def interp; %w(lua mzscheme perl python python3 tcl ruby) end |
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
| #Removes any deferred messages from the postfix queue if the message has more that 50 recipients. run as root. | |
| su - zimbra -c "mailq" | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS=""; }{ if (NF > 50 ) print $1 }' | tr -d '*!' | /opt/zimbra/postfix/sbin/postsuper -d - | |
| #Could be used to detect users sending spam and sent via an email to the administrators. | |
| mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS=""; }{ if (NF > 10 ) print $7 }' | tr -d '*!' | sort | uniq -c | |
| example output: | |
| 577 foo@bar.com | |
| #Lock accounts that have more than 100 diffrent deffered messages with at least ten recipients in each | |
| for x in $(awk '{if ($1 > 100) print $2}' < <(mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS=""; }{ if (NF > 10 ) print $7 }' | tr -d '*!' | sort | uniq )); do \ |
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 | |
| detect_spammers () { | |
| numq=$(su - zimbra -c "mailq" | wc -l) | |
| if (( $numq > 2000 )); | |
| then | |
| echo "number of messages deferred: $numq" | |
| echo "# of messages per user" | |
| sendmail "$@" \ | |
| < <(echo -en "spammers detected on host:"; hostname; echo "| # deferred | email@address |"; su - zimbra -c "mailq" | tail -n +2 | grep -v '^ *(' \ | |
| | awk 'BEGIN { RS=""; }{ if (NF > 10 ) print $7 }' \ |