View chkroute.pl
#!/usr/bin/perl
foreach my $l (split(/\n/, `route -n`)) {
my @ll = split(' ', $l);
$r{$ll[0]} = [$ll[0], $ll[2], $ll[1]];
}
foreach my $l (split(/\n/, `cat /usr/local/shieldone/etc/route/addroute`)) {
@ll = split(' ', $l);
if ( $ll[0] eq $r{$ll[0]}[0]
View vpnwatch
#!/bin/bash
installDir="{{MASK}}"
LOG="{{MASK}}"
RUN="/usr/sbin/openvpn --config $installDir/etc/openvpn/server.conf --cd $installDir/etc/openvpn"
echo "`date` starting... watching sslvpn daemon" >> $LOG
while true;
View mkccd.py
#!/usr/bin/python
def ipaddone(i) :
l = i.split(".")
brd30 = [3,7,11,15,19,23,27,31,35,39,43,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,203,207,211,215,219,223,227,231,235,239,243,247,251,255]
if int(l[3])+1 in brd30 :
return "%s.%s.%s.%d" % (l[0],l[1],l[2],int(l[3])-1)
return "%s.%s.%s.%d" % (l[0],l[1],l[2],int(l[3])+1)
fp = open ("list.txt")
View spm_get
#!/bin/bash
wget -qO- $1 | sudo tar xvz
View make_nagios_node.py
#!/usr/bin/env python
import sys
import os
fpath = '/home/plus-i/nagios3-conf.d/'
def print_usage() :
print "Usage: %s add {hostname} {ip address|domain name}" % (sys.argv[0])
print " %s del {hostname}" % (sys.argv[0])
View sid_rev.py
for line in open('a.txt'):
# print line
a_id = line.find("sid:")
a_rev = line.find("rev:")
# print a_id
# print a_rev
print line[a_id+4:a_rev-2]
print line[a_rev+4:-3]
for line in open('b.txt'):
View pinglog
#!/usr/bin/perl
use Net::Ping;
use POSIX;
if ($#ARGV == -1) { die "Usage: pinglog {ip address} \n"; }
$host = $ARGV[0];
$ping = Net::Ping->new("icmp", 2);
$status = "Dead";