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
/* | |
* # Advance preparation are required. | |
* # ipfw add divert 10000 udp from me to [nameserver_ip] via [IF] | |
* # ipfw add divert 10000 udp from [nameserver_ip] to me via [IF] | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> |
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 python | |
# you must preset following command. | |
# sudo sysctl -w net.ipv4.tcp_fastopen=3 | |
import sys | |
import socket | |
PORT = 10443 |
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 sh | |
cd /tmp | |
apt-get update | |
apt-get -y install git build-essential | |
apt-get -y install linux-source linux-headers-generic | |
tar xvf /usr/src/linux-source-`uname -r | awk 'BEGIN { FS="-" } { print $1 }'`.tar.bz2 -C /usr/src | |
git clone https://github.com/luigirizzo/netmap.git | |
cd netmap/LINUX | |
SRC_VAR=/usr/src/linux-source-`uname -r | awk 'BEGIN { FS="-" } { print $1 }'` | |
./configure --kernel-sources=${SRC_VAR} |
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 | |
#fetch freebsd-live.iso | |
mkdir hoge | |
bsdtar -C hoge -pxvf freebsd-live.iso | |
cd hoge | |
# -------- | |
# 書き換え | |
# -------- | |
mkisofs -v -b boot/cdboot -no-emul-boot -r -J -V "FREEBSD_INSTALL" -o ../freebsd_customize.iso ./ |
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 | |
#modprobe pktgen | |
ETH="eth0" | |
CLONE_SKB="clone_skb 10" | |
PKT_SIZE="64" | |
DELAY="0" | |
SRC_MAC="00:26:2d:08:8b:25" | |
DST_MAC="00:26:2d:08:99:fb" |
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 <sys/cdefs.h> | |
#include <sys/types.h> | |
#include <sys/param.h> | |
#include <sys/systm.h> | |
#include <sys/proc.h> | |
#include <sys/lock.h> | |
#include <sys/mutex.h> | |
#include <sys/kernel.h> | |
#include <sys/kthread.h> |
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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade | |
sudo apt-get install htop | |
sudo apt-get install build-essential | |
sudo apt-get install libncurses-dev | |
sudo apt-get install libssl-dev | |
sudo apt-get install bc | |
sudo apt-get install linux-source | |
sudo -s |
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
int child() | |
{ | |
int count = 10; |
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 <errno.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <string.h> | |
#include <pthread.h> | |
#include <sys/epoll.h> | |
#include <sys/signalfd.h> |
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 <sys/types.h> | |
#include <sys/ioctl.h> | |
#include <sys/stat.h> | |
#include <net/if.h> | |
/* | |
unsigned int if_nametoindex(const char *ifname); | |
char *if_indextoname(unsigned int ifindex, char *ifname); | |
*/ |
OlderNewer