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/stap | |
global connections | |
global filter_port = 80 | |
// | |
global report | |
global spend_time | |
global active_count | |
global have_spend_time = 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
#include <pcap.h> | |
#include <stdlib.h> | |
#include <libnet.h> | |
#define log_error(...) fprintf(stderr, __VA_ARGS__) | |
#define log_info(...) fprintf(stdout, __VA_ARGS__) | |
#define FALSE (0==1) | |
#define TRUE (1==1) | |
typedef struct arp_joke { |
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
public class LeaderElection { | |
private static Logger LOGGER = LoggerFactory.getLogger(LeaderElection.class); | |
public static void main(String args[]) throws IOException, KeeperException, InterruptedException { | |
String connectString = "localhost"; | |
ZooKeeper zooKeeper = new ZooKeeper(connectString, 3000, new Watcher() { | |
@Override | |
public void process(WatchedEvent event) { | |
//无视session超时,连接断开等问题 |
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 urllib, urllib2, os, traceback, time | |
from bs4 import BeautifulSoup | |
root = "http://cjc.ict.ac.cn" | |
book_root = "/Users/fireflyc/Downloads/" | |
def post_http(url, param=None, charset=None): | |
data = None | |
if(param!=None): | |
data = urllib.urlencode(param) |
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 | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |