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 | |
USER="http" | |
GROUP="http" | |
DIR_PERMISSION="750" | |
FILE_PERMISSION="640" | |
DIRPATH="$1" | |
if [ $# == 0 ]; then | |
echo "Usage: changePerm.sh DIR" |
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/sh | |
echo "1" > /proc/sys/net/ipv4/ip_forward | |
iptables -F | |
iptables -X | |
iptables -Z | |
iptables -F -t nat | |
iptables -X -t nat | |
iptables -Z -t nat | |
iptables -A INPUT -i eth4 -s <PRIVATE_IP_SUBNET> -j ACCEPT | |
iptables -A INPUT -i eth0 -s <PUBLIC_IP_SUBNET> -j ACCEPT |
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 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 |
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 | |
"clusterdemo.py: demo of Mininet Cluster Edition prototype" | |
from mininet.examples.cluster import MininetCluster, SwitchBinPlacer | |
from mininet.topolib import TreeTopo | |
from mininet.log import setLogLevel | |
from mininet.examples.clustercli import ClusterCLI as CLI | |
from mininet.node import Controller, RemoteController | |
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 | |
from mininet.examples.cluster import MininetCluster, SwitchBinPlacer | |
from mininet.topolib import TreeTopo | |
from mininet.topo import LinearTopo | |
from mininet.log import setLogLevel, info | |
from mininet.examples.clustercli import ClusterCLI as CLI | |
from mininet.net import Mininet | |
from mininet.node import Controller, RemoteController | |
from mininet.util import dumpNodeConnections |
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 | |
''' | |
Research yield | |
http://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/ | |
''' | |
import time | |
import logging | |
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 | |
''' | |
Research counter | |
''' | |
''' | |
Use dict() | |
''' | |
data = ['a', '2', 2, 4, 5, '2', 'b', 4, 7, 'a', 5, 'd', 'a', 'z'] | |
count_freq = dict() |
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/sh | |
APP_PATH=~/ryuInstallHelper/ryu/ryu/tests/switch | |
TEST_TARGET_SWITCH="0000000000000001" | |
AUXILIARY_SWITCH="0000000000000002" | |
TEST_PATTERN="of13" | |
ryu-manager --test-switch-target $TEST_TARGET_SWITCH \ | |
--test-switch-tester $AUXILIARY_SWITCH \ | |
--test-switch-dir $APP_PATH/$TEST_PATTERN \ | |
$APP_PATH/tester.py |
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
<?php | |
$arr = array(0=>1,"aa"=>2, 3, 4); | |
foreach($arr as $key=>$val){ | |
print($key == "aa" ? 5 : $val); | |
} | |
?> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |