Skip to content

Instantly share code, notes, and snippets.

import struct
import re
ipfile = open("scanner_uniq.dat", 'r')
print('# CIDR, Number_of_prefixes')
for cidr in range(1, 33):
prefixes = dict()
#!/usr/bin/bash
set -eu
Path=/sys/bus/pci/devices
DevList=`ls /sys/bus/pci/devices/`
Vender_id="0x8086"
Device_id="0x1563" # Intel x550
@sora
sora / test.c
Created February 11, 2017 15:32
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fd0;
@sora
sora / RX_setup-if.sh
Created November 15, 2016 16:21
performance evaluation (TX: netmap, RX: mgcap)
#!/bin/bash
ifname="enp1s0f1"
ip_addr="192.168.100.13"
mtu_size="1500"
echo "${ifname} is assigned as ${ip_addr}."
sudo ifconfig ${ifname} ${ip_addr} netmask 255.255.255.0 up
echo "MTU of ${ifname} is changed into ${mtu_size}"
#!/bin/bash
HOST=`hostname`
IP_CMD=`/sbin/ip addr show dev eth0 | /bin/grep 'inet '`
MSG="${HOST}: ${IP_CMD}"
/usr/bin/curl https://docs.google.com/forms/d/{id}/formResponse -d ifq -d entry.836766723="${MSG}" -d submit=Submit
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, time, random
import nfc
import pprint
#import requests
import binascii
usbid = 'usb:054c:06c3'

Keybase proof

I hereby claim:

  • I am sora on github.
  • I am sora (https://keybase.io/sora) on keybase.
  • I have a public key whose fingerprint is 2C26 04D3 5CB3 9180 D5A4 52D8 7F7E 50A3 83E5 9D2A

To claim this, I am signing this object:

@sora
sora / Makefile
Last active March 22, 2018 02:42
Ethernet FCS calculation
all:
gcc -Wall eth_fcs.c -o fcs -lz
clean:
rm -f fcs
@sora
sora / qemu-rocker4p.xml
Last active August 29, 2015 14:21
qemu-rocker4p.xml
<domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>vm1</name>
<uuid>04b6918d-051b-4794-b526-c181694e5b83</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-0.11'>hvm</type>
<boot dev='cdrom'/>
<bootmenu enable='yes'/>
all:
gcc -g -Wall -O -o pktgen pktgen_stdout.c
gcc -g -Wall -O -o ring ring.c