brew update
brew install pyenv
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 python3 | |
import asyncio | |
import time | |
import aiohttp | |
START = time.monotonic() | |
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
-- eve-ng_wireshark.scpt by Matt Haedo -- | |
-- Fork of Stuart Fordham's UNL_WiresharkV2 -- | |
-- https://www.802101.com/unetlab-and-wireshark-for-osx-update -- | |
-- To use, copy this code, paste into Apple Script Editor, and save as .app -- | |
on open location this_URL | |
set get_date to do shell script "date +%Y%m%d-%H%M%S" | |
set cap_URL to this_URL | |
set AppleScript's text item delimiters to {"/"} | |
set new_cap_HOST to text item 3 of cap_URL |
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 | |
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
rulefile="rules.tmp" | |
echo "" > $rulefile | |
sudo pfctl -a com.apple/tun -F nat | |
for i in "${interfaces[@]}" | |
do | |
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
echo $RULE >> $rulefile | |
done |
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
class GAEHandler(logging.Handler): | |
""" | |
Logging handler for GAE DataStore | |
""" | |
def emit(self, record): | |
from google.appengine.ext import db | |
class Log(db.Model): | |
name = db.StringProperty() |
-
HaCi http://haci.larsux.de/ - 2015-03
- IPAM only, v4/v6, multiple POPs, uses templates, space visualization
-
GestioIP https://www.gestioip.net/ - 2016-02
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 | |
# -*- coding: utf-8 -*- | |
import json | |
from flask import Flask, url_for | |
from flask_sqlalchemy import SQLAlchemy | |
""" | |
Flask-SQLAlchemy many-to-many relationship using helper table | |
http://flask-sqlalchemy.pocoo.org/2.1/models/ | |
Hippies love their dogs. |
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 | |
# All SSH libraries for Python are junk (2011-10-13). | |
# Too low-level (libssh2), too buggy (paramiko), too complicated | |
# (both), too poor in features (no use of the agent, for instance) | |
# Here is the right solution today: | |
import subprocess | |
import sys |
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 bash | |
[ $(id -u) = 0 ] || { echo "You must be root (or use 'sudo')" ; exit 1; } | |
fwrule=`ipfw -a list | grep "deny ip from any to any"` | |
fwrule_id=`echo $fwrule | awk '{ print $1 }'` | |
if [ "$fwrule" != "" ]; then | |
echo "Found blocking firewall rule: $(tput setaf 1)${fwrule}$(tput sgr0)" | |
printf "Deleting rule ${fwrule_id} ... " | |
ipfw delete ${fwrule_id} |
NewerOlder