Skip to content

Instantly share code, notes, and snippets.

View slankdev's full-sized avatar
🏠
Working from home

Hiroki SHIROKURA slankdev

🏠
Working from home
View GitHub Profile
@slankdev
slankdev / test_jit_int_ubpf.cc
Last active April 26, 2017 11:11
JITとインタプリタの性能計測
/*
* 動作環境
* CPU: Intel Core i5 6200 @2.30GHz
* RAM: 16GB
*
* 出力結果
* ret: 1
* int latency: 1840760982
* jit latency: 113407004
#include <slankdev/socketfd.h>
#include <slankdev/hexdump.h>
const char* ifname = "lo";
uint8_t packet[] = {
/* arp packet */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x06, 0x00, 0x01,
0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0x00, 0x00,
@slankdev
slankdev / main.cc
Created June 17, 2017 08:10
autotools sample
#include <stdio.h>
#include <slankdev/extra/pcap.h>
#include <slankdev/hexdump.h>
void callback(uint8_t* user, const struct pcap_pkthdr* h, const uint8_t* byte)
{
slankdev::hexdump(stdout, byte, h->len);
}
int main()
@slankdev
slankdev / dpdk_nic_bind.py
Created October 14, 2017 15:43
dpdk_nic_bind
#! /usr/bin/python
#
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@slankdev
slankdev / Makefile
Created November 6, 2017 13:57
crow テスト
LIBSLANKDEV := $(HOME)/git/libslankdev
CXXFLAGS += -I$(LIBSLANKDEV) -std=c++11 -I$(HOME)
LDFLAGS += -lboost_system
all:
$(CXX) $(CXXFLAGS) main.cc $(LDFLAGS)
@slankdev
slankdev / .gitignore
Last active November 7, 2017 08:33
ws API Doc
.out
.o
.html
---
swagger: "2.0"
info:
version: "0.0.0"
title: "Susanow Control API"
license:
name: "MIT License"
url: "https://opensource.org/licenses/MIT"
host: "virtserver.swaggerhub.com"
basePath: "/susanow/ssnctl/0.0.0"
@slankdev
slankdev / server.cc
Last active November 7, 2017 09:34
backup
int rest_api_thread(void* arg_)
{
ssn_nfvi* sys = reinterpret_cast<ssn_nfvi*>(arg_);
crow::SimpleApp app;
CROW_ROUTE(app,"/") ( [&sys]() {
crow::json::wvalue x;
x["vnfs"] = "vnfs informantions";
x["stats"] = "system infos";
return x;
@slankdev
slankdev / Makefile
Last active November 12, 2017 10:39
LIBSLANKDEV := $(HOME)/git/libslankdev
CXXFLAGS += -I$(LIBSLANKDEV) -std=c++11
all:
$(CXX) $(CXXFLAGS) main.cc $(LDFLAGS)
@slankdev
slankdev / setup.sh
Last active December 2, 2017 18:23
SETUP.sh
#!/bin/sh
# $ curl -fsSL URL | sh
cd $HOME
git clone https://github.com/slankdev/dotfiles
cd dotfiles
bash tools/basic_cui_apt.sh
bash setup.sh init