Skip to content

Instantly share code, notes, and snippets.

@ytakano
ytakano / rtm_test.c
Created April 10, 2015 10:32
Intel TSX RTM
#include <stdio.h>
int main()
{
volatile int i = 0;
while (i < 100000000) {
asm ("xbegin ABORT");
i++;
asm ("xend");
asm ("ABORT:");
#include <iostream>
int
main(int argc, char *argv[])
{
unsigned char c;
for (c = 0; c < 255; c++) {
if (('a' <= c && c <= 'z') ||
('A' <= c && c <= 'Z') ||
@ytakano
ytakano / mapping.md
Created February 17, 2015 10:36
elasticsearchのmappingメモ

HTTP

$ curl -XPUT 'http://localhost:9200/sftap/_mapping/http?ignore_conflicts=true' -d '{
  "http" : {
    "properties" : {
      "client" : {
        "properties" : {
          "header" : {

"properties" : {

@ytakano
ytakano / elasticsearch.md
Last active August 29, 2015 14:15
ElasticsearchとKibanaを使ってみる

ElasticsearchとKibanaを使ってみる

Oracle JDKのインストール

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Elasticsearchの実行

@ytakano
ytakano / qb.md
Last active August 29, 2015 14:14
QBのインストール

netmap

カーネルコンフィグ

# cd /usr/src/sys/amd64/conf
# cp GENERIC GENERIC.netmap
# vi GENERIC.netmap

device netmap # add device of netma

@ytakano
ytakano / .zshenv
Last active May 2, 2018 04:50
zshの設定ファイル
export TERM=xterm
#export PROMPT="%n@%m %#> "
export RPROMPT='[%~]'
export PATH=/homebrew/bin:/homebrew/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/local/texlive/2015/bin/x86_64-darwin
export LD_LIBRARY_PATH=/homebrew/lib:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib
export LIBRARY_PATH=$LD_LIBRARY_PATH
export C_INCLUDE_PATH=/homebrew/include:/usr/include:/usr/local/include:/usr/X11R6/include
export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH
export MANPATH=$MANPATH:/homebrew/share/man:/usr/share/man:/usr/local/man
export HISTFILE=$HOME/.zsh_history
@ytakano
ytakano / lowperform.md
Last active August 29, 2015 14:07
遅すぎて日が暮れる

遅い奴らまとめ

JavaのJNI,JNA

凄い遅い.ネイティブ関数を使うとWrite Once Run Anywareじゃなくなるので,わざと遅くしているに違いない.

Boostのshared_mutex

read-write lock使えて便利!と思いきや,めちゃくちゃ重い. 普通にboost::mutex使ったほうがはるかにマシ.

@ytakano
ytakano / gpumemo.md
Last active August 29, 2015 14:07
GPU利用メモ

GPUサーバの設定

GPUの確認

$ sudo nvidia-xconfig --query-gpu-info
Number of GPUs: 1

GPU #0:
Name      : GeForce GTX 750

UUID : GPU-6fa2bd4c-1dd7-8189-70eb-543817efcaff

@ytakano
ytakano / syn-ack-gen.cpp
Last active August 29, 2015 14:07
TCP Session Generator
#include <pcap.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <net/ethernet.h>
#include <netinet/ip.h>

Download Source Code of SF-TAP

$ pwd
$ ~/program/sf-tap
$ git clone https://github.com/SF-TAP/flow-abstractor.git
$ git clone https://github.com/SF-TAP/protocol-parser.git

Download Ad Chekcer

$ pwd