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 | |
git clone https://github.com/opennetworkinglab/ngsdn-tutorial -b princeton19 | |
cd ngsdn-tutorial && \ | |
make deps |
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 ryu.base import app_manager | |
from ryu.controller import ofp_event | |
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER, DEAD_DISPATCHER | |
from ryu.controller.handler import set_ev_cls | |
from ryu.ofproto import ofproto_v1_3 | |
from ryu.lib.packet import packet | |
from ryu.lib.packet import ethernet | |
from ryu.lib.packet import arp | |
from ryu.lib.packet import ipv4 | |
from collections import defaultdict |
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
#include<stdio.h> | |
#include<stdlib.h> | |
uint8_t clz(uint32_t test, uint8_t bits) { | |
uint32_t cut = (test >> (32 - bits)) << (32 - bits); | |
if (cut == 0) { | |
return bits; | |
} | |
if (bits == 0) { | |
return 0; |
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 java.util.Arrays; | |
import java.util.Collections; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
class 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
package org.onosproject.intentdemo; | |
import com.google.common.collect.Sets; | |
import org.apache.felix.scr.annotations.Activate; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Deactivate; | |
import org.apache.felix.scr.annotations.Reference; | |
import org.onosproject.core.ApplicationId; | |
import org.onosproject.core.CoreService; | |
import org.onosproject.net.FilteredConnectPoint; |
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 | |
function ip2int { | |
local a b c d | |
{ IFS=. read a b c d; } <<< $1 | |
echo $(((((((a << 8) | b) << 8) | c) << 8) | d)) | |
} | |
function int2ip { | |
local ui32=$1; shift |
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
var imgs = document.getElementsByTagName('img');for(var i=0; i<imgs.length; i++) {var img = imgs[i];if(img.alt.search("圖像")!=-1 && img.alt.search("食物") != -1){img.src="https://i.imgur.com/7T5c5N8.png";}} |
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 | |
# ------------------------------------------------------------------------------------------------- | |
# ONOS ACL tool. | |
# Usage: | |
# onos-acl node_ip [allow|deny|del] [--srcIp srcIp] [--dstIp dstIp] [--ipProto ipProto] [--dstTpPort dstTpPort] [--alcId aclId] | |
# onos-acl node_ip --json acl-config.json | |
# ------------------------------------------------------------------------------------------------- | |
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 | |
. $ONOS_ROOT/tools/build/envDefaults |
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
# controller | |
service chrony restart | |
service apache2 restart | |
service mysql restart | |
service mongodb restart | |
service rabbitmq-server restart | |
service memcached restart | |
service glance-registry restart | |
service glance-api restart | |
service nova-api restart |
NewerOlder