Skip to content

Instantly share code, notes, and snippets.

View pichuang's full-sized avatar

Phil Huang pichuang

View GitHub Profile
@echo off
whoami /groups |find "S-1-16-12288"
if %errorlevel%==1 goto nouac
bcdedit.exe /enum %GUID_ORIG% /v |find "win7.vhd"
if %errorlevel%==1 goto vhd
bcdedit /set %GUID_ORIG% device vhd=[D:]\diff1.vhd
bcdedit /set %GUID_ORIG% osdevice vhd=[D:]\diff1.vhd
bcdedit /default %GUID%
bcdedit /export d:\boot\BCDMALLI.bcd
attrib -r d:\tausta.jpg
@pichuang
pichuang / hidden_flow
Created July 17, 2014 20:17
About OpenvSwitch Hidden Flow
duration=4s, n_packets=0, n_bytes=0, priority=180007,tcp,nw_dst=140.113.215.6,tp_dst=6633,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180000,udp,in_port=LOCAL,dl_src=86:4f:ae:44:14:40,tp_src=68,tp_dst=67,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180008,tcp,nw_src=140.113.215.6,tp_src=6633,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180003,arp,dl_dst=00:1c:42:00:00:18,arp_op=2,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180001,arp,dl_dst=86:4f:ae:44:14:40,arp_op=2,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180006,arp,arp_spa=140.113.215.6,arp_op=1,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180005,arp,arp_tpa=140.113.215.6,arp_op=2,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180004,arp,dl_src=00:1c:42:00:00:18,arp_op=1,actions=NORMAL
duration=4s, n_packets=0, n_bytes=0, priority=180002,arp,dl_src=86:4f:ae:44:14:40,arp_op=1,actions=NORMAL
table_id=254, duration=674s, n_packets=0, n_bytes=0,
PORTNAME= php5
PORTVERSION= 0.5
PORTREVISION= 1
CATEGORIES= cs
MASTER_SITES= # none
PKGNAMESUFFIX= -extensions
DISTFILES= # none
EXTRACT_ONLY= # none
@pichuang
pichuang / vswitch.ovsschema
Created August 6, 2014 01:47
vswitch.ovsschema json file
{"name": "Open_vSwitch",
"version": "6.11.3",
"cksum": "2234602985 17310",
"tables": {
"Open_vSwitch": {
"columns": {
"bridges": {
"type": {"key": {"type": "uuid",
"refTable": "Bridge"},
"min": 0, "max": "unlimited"}},
@pichuang
pichuang / kill_process
Last active August 29, 2015 14:05
KILL PROCESSLIST in MySQL
source /tmp/kill_process.txt;
@pichuang
pichuang / mininet_testing_linear.sh
Last active August 29, 2015 14:06
Mininet testing Topology
#!/bin/sh -ev
#Reference: http://www.routereflector.com/wp-content/uploads/2013/11/linear.png
# http://www.routereflector.com/2013/11/mininet-as-an-sdn-test-platform/
CONTROLLER_IP=192.168.1.45
mn --topo linear,2 --mac --switch ovsk,protocols=OpenFlow13 --controller remote,$CONTROLLER_IP
@pichuang
pichuang / ryu_rest_testing
Last active August 29, 2015 14:06
Ryu testing RESTful testing
#!/bin/sh
APP_PATH=~/ryu/ryu/app
ryu-manager --verbose $APP_PATH/rest.py $APP_PATH/simple_switch_13.py $APP_PATH/ofctl_rest.py $APP_PATH/rest_topology.py
#!/usr/bin/env python2
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.log import setLogLevel, info
from mininet.node import Controller, RemoteController
from mininet.cli import CLI
from mininet.link import Intf
from mininet.util import dumpNodeConnections
import os
@pichuang
pichuang / wirelees
Last active August 29, 2015 14:08
OpenWrt /etc/config/network
config wifi-device radio0
option type mac80211
option channel 11
option hwmode 11g
option path 'platform/ar934x_wmac'
option htmode HT20
config wifi-iface
option device radio0
#option network lan
@pichuang
pichuang / .config
Created October 24, 2014 18:25
OpenWrt CHAOS CALMER (Bleeding Edge, r43039)
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_ppc40x is not set
# CONFIG_TARGET_realview is not set
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_atheros is not set