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
input { | |
file { | |
path => ["/var/log/network.log"] | |
sincedb_path => "/var/log/logstash" | |
start_position => "end" | |
type => "syslog" | |
tags => [ "netsyslog" ] | |
} | |
} |
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
{ | |
"title": "Logstash Search", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "*", | |
"alias": "", | |
"color": "#7EB26D", | |
"id": 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 | |
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"; |
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
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'): |
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/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]) |
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 | |
wget -qO- $1 | sudo tar xvz |
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/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") |
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 | |
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; |
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 | |
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] |
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
# coding: utf-8 | |
# This gist shows how to integrate Flask into a | |
# custom Gunicorn-WSGI application described | |
# here: http://docs.gunicorn.org/en/stable/custom.html | |
from __future__ import unicode_literals | |
import multiprocessing | |
import gunicorn.app.base | |
from gunicorn.six import iteritems |
OlderNewer