This file contains hidden or 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 polipo to connect to ss server locally, and support polipo listen under 8123. | |
git config --global http.proxy http://127.0.0.1:8123 | |
HTTP_PROXY=http://127.0.0.1:8123 go get X | |
git config --global --unset http.proxy | |
# Encap this to override the issue because fucking GFW block google sites... |
This file contains hidden or 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 | |
ROUTER_ID="f2c8e7a4-ce7f-41cb-8c92-6e85a3453e57" | |
NS="qrouter-$ROUTER_ID" | |
LOG="/data/log/neutron/$NS-manual.log" | |
TIME=`date` | |
echo "Manual provision of $NS started at $TIME." > $LOG | |
# VLAN tag which is allocated by network admin. |
This file contains hidden or 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 main | |
import "golang.org/x/tour/pic" | |
import "math/rand" | |
func Pic(dx, dy int) [][]uint8 { | |
// Initial zero. | |
s := make([][]uint8, 0) | |
for i:=0;i<dy;i++ { | |
v := make([]uint8, dx) |
This file contains hidden or 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 | |
i=1 | |
while (( i <= 100000 )) | |
do | |
echo "generate route $i ..." | |
c2=$(( (i/(255*255))%255 )) | |
c3=$(( (i/255)%255 )) | |
c4=$(( i%255)) |
This file contains hidden or 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
function string_ops:string (val) %{ | |
strlcpy (STAP_RETVALUE, (char*)STAP_ARG_val, MAXSTRINGLEN); | |
%} | |
probe kernel.function("udp_gro_receive") { | |
if (cpu() == 0) { | |
printf("udp_gro_receive %d %s(%d/%d) %s %d, %d, %d\n", gettimeofday_us(), execname(), pid(), cpu(), $$vars, $skb->ip_summed, @cast($skb->cb, "struct napi_gro_cb")->csum_cnt, @cast($skb->cb, "struct napi_gro_cb")->csum_valid); | |
print_backtrace(); | |
} | |
} |
This file contains hidden or 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
################################################# | |
# Sample OpenVPN 2.0 config file for # | |
# multi-client server. # | |
# # | |
# This file is for the server side # | |
# of a many-clients <-> one-server # | |
# OpenVPN configuration. # | |
# # | |
# OpenVPN also supports # | |
# single-machine <-> single-machine # |
This file contains hidden or 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 com.netease.cns.proton.agent.dhcp | |
import akka.actor.{Actor, ActorLogging} | |
import com.netease.cns.proton.agent.dhcp.DHCPPktRxActor.PcapRxPacket | |
import org.pcap4j.core.PcapNetworkInterface.PromiscuousMode | |
import org.pcap4j.core.Pcaps | |
import org.pcap4j.packet.Packet | |
object DHCPPktRxActor { | |
// TODO: define a packet which will be processed by each NetworkDHCPActor. |
This file contains hidden or 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
# ns0 | |
ip netns del natns0 | |
ip netns add natns0 | |
ip netns exec natns0 ip link set lo up | |
ip link add natp0 type veth peer name natp0p | |
ip link set natp0 netns natns0 | |
ip link set natp0p up | |
ip netns exec natns0 ip link set natp0 up | |
ip netns exec natns0 ip link set natp0 address 80:88:88:88:88:88 | |
ip netns exec natns0 ip addr add 10.1.1.1/24 dev natp0 |
This file contains hidden or 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
cat hostlist | grep compute | awk '{print $2}' | xargs -I X > all_drops.txt 2>&1 ssh X -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 1046 source check-qdisc.sh | |
BTW: | |
using the same command while using SCP to upload the script to each host. |
This file contains hidden or 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
nova host-list | grep compute | awk '{print $2}' | sed 's/-/\./g' |