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 httplib | |
import json | |
class StaticFlowPusher(object): | |
def __init__(self, server): | |
self.server = server | |
def get(self, data): |
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 | |
BRIDGE_NAME= | |
COLLECTOR_IP= | |
COLLECTOR_PORT= | |
TIMEOUT=10 | |
ovs-vsctl -- set Bridge ${BRIDGE_NAME} netflow=@nf \ | |
-- --id=@nf create NetFlow target=\"${COLLECTOR_IP}:${COLLECTOR_PORT}\" active-timeout=${TIMEOUT} |
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 | |
COLLECTOR_IP= | |
COLLECTOR_PORT= | |
AGENT= | |
HEADER=128 | |
SAMPLING=512 | |
POLLING=10 | |
BRIDGE_NAME= | |
sudo ovs-vsctl -- --id=@sflow create sflow agent=${AGENT} \ |
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 | |
""" | |
Follow http://danmcinerney.org/http-post-analyzer-in-python/ | |
Enviroment: python2.x and scapy | |
Goal: Use scapy to sniffer tcp 80 port | |
""" | |
import logging | |
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) | |
from scapy.all import * |
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 | |
''' | |
Coursera: | |
- Software Defined Networking (SDN) course | |
-- Programming Assignment 2 | |
Professor: Nick Feamster | |
Teaching Assistant: Arpit Gupta, Muhammad Shahbaz | |
''' |
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 | |
for proc in $(find /proc -maxdepth 1 -regex '/proc/[0-9]+'); do | |
printf "%2d %5d %s\n" \ | |
"$(cat $proc/oom_score)" \ | |
"$(basename $proc)" \ | |
"$(cat $proc/cmdline | tr '\0' ' ' | head -c 50)" | |
done 2>/dev/null | sort -nr | head -n 10 |
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
# Maintainer: Roan Huang <pichuang@cs.nctu.edu.tw> | |
Automating mysql_secure_installation | |
In this patch, MySQL default password is "ARCHLNMP" | |
default password is NOT safe to your system, Please use | |
/usr/bin/mysqladmin -u root -p'ARCHLNMP' password 'YOUR_NEW_PASSWORD' |
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
#Auto load ssh_key & ssh-agent | |
#Add ~/.bashrc | |
if [ -z "$SSH_AUTH_SOCK" ] ; then | |
eval `ssh-agent -s` > /dev/null 2>&1 | |
ls ~/.ssh/ |grep -vE '(.pub|authorized_keys|known_hosts)'| xargs -i ssh-add ~/.ssh/{} > /dev/null 2>&1 | |
fi |
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 | |
VERSION=$1 | |
if [ "python2" == "$VERSION" ] || [ "python3" == "$VERSION" ] | |
then | |
cd /usr/bin/ | |
ln -sfn $VERSION python | |
echo "switch to $VERSION" | |
else |
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
#Signed-off-by: Tobias Steinicke <tobias.steinicke at inet.tu-berlin.de> | |
#https://lists.openwrt.org/pipermail/openwrt-devel/2014-March/024286.html | |
--- a/package/libs/toolchain/Makefile 2014-07-01 16:33:40.734903000 +0800 | |
+++ b/package/libs/toolchain/Makefile 2014-07-01 15:02:10.730903000 +0800 | |
@@ -52,6 +52,31 @@ | |
endmenu | |
endef | |
+define Package/libatomic |
OlderNewer