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 gevent | |
from ryu.controller import handler | |
from ryu.controller import dpset | |
from ryu.controller import ofp_event | |
from ryu.ofproto import nx_match | |
from ryu.ofproto import ofproto_v1_0 | |
from ryu.ofproto import ofproto_v1_0_parser | |
from ryu.base import app_manager | |
from ryu.ofproto.ofproto_parser import MsgBase, msg_pack_into, msg_str_attr |
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> | |
#include<string.h> | |
#define SIZE 10000 | |
int array[SIZE] = {0}; | |
int calc(int size, int* array, int* dp, int position) | |
{ |
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 os | |
import sys | |
print 'pid,pgid,sid', os.getpid(), os.getpgid(0), os.getsid(0) | |
pid = os.fork() | |
if pid > 0: | |
sys.exit(0) | |
print 'pid,pgid,sid', os.getpid(), os.getpgid(0), os.getsid(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
================== | |
WARNING: DATA RACE | |
Read by goroutine 18: | |
github.com/funny/sync.(*monitor).diagnose() | |
/root/go/src/github.com/funny/sync/deadlock.go:95 +0x5e | |
github.com/funny/sync.(*monitor).wait() | |
/root/go/src/github.com/funny/sync/deadlock.go:89 +0x3a5 | |
github.com/funny/sync.(*RWMutex).RLock() | |
/root/go/src/github.com/funny/sync/deadlock.go:45 +0x3e | |
github.com/influxdb/influxdb/meta.(*Store).Leader() |
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 main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"io" | |
) |
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 main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
) | |
func main() { |
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 main | |
import ( | |
"fmt" | |
"time" | |
ma "github.com/multiformats/go-multiaddr" | |
) | |
var addrs = []string{ | |
"/ip4/127.0.0.1/tcp/4001/ipfs/QmPdJvfK74MknGSYS2E54EEzKcEY6c19D8BzcCPbW7Sjna", |
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
// get the original destination for the socket when redirect by linux iptables | |
// refer to https://raw.githubusercontent.com/missdeer/avege/master/src/inbound/redir/redir_iptables.go | |
// | |
const ( | |
SO_ORIGINAL_DST = 80 | |
IP6T_SO_ORIGINAL_DST = 80 | |
) | |
func getOriginalDst(clientConn *net.TCPConn) (rawaddr []byte, host string, newTCPConn *net.TCPConn, err error) { | |
if clientConn == nil { |
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 main | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"errors" | |
"flag" | |
"fmt" | |
"io" |
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
drop table if exists clusters; | |
create table clusters ( | |
id varchar(64) not null default '', | |
pool varchar(16) not null default '', | |
weight int not null default 0, | |
primary key (id, pool) | |
); | |
drop table if exists buckets; | |
create table buckets ( |
OlderNewer