Skip to content

Instantly share code, notes, and snippets.

View turenar's full-sized avatar

Soma Ueda turenar

View GitHub Profile
@turenar
turenar / dpkt.md
Last active April 8, 2019 15:56
dpktに関するメモ
$ sudo apt install python-dpkt

あるいは

$ sudo pip install dpkt

などで、dpktがインストールできる

Pythonのコード

@turenar
turenar / benchmark.sh
Last active January 15, 2019 10:55 — forked from peterjmit/benchmark.sh
Bash Benchmark Script (using time)
#!/bin/bash -eu
repeats=5
output_file='/dev/null'
run_tests() {
tmpfile=$(tempfile)
logfile=$(tempfile)
# --------------------------------------------------------------------------
# Bencehmark loop
# --------------------------------------------------------------------------
#include <stdio.h>
#include <stdarg.h>
void a(int x) {
printf("a-x: %p\n", &x);
}
void b(double x) {
printf("b-x: %p\n", &x);
const char* p = (const char*) &x;
@turenar
turenar / mingw-build.sh
Created April 20, 2015 19:18
mingw-build.sh
#!/bin/bash
PREFIX=/home/sora/install
TARGET_TRIPLET=x86_64-w64-mingw32
BINUTILS_TARGETS=x86_64-w64-mingw32,i686-w64-mingw32
HOST_TRIPLET=x86_64-pc-linux-gnu
main(){
operation="${1:-upgrade}"
case "$operation" in
@turenar
turenar / gentoo_proxy.php
Last active August 29, 2015 13:57
gentoo distfiles proxy: store in htdocs and rewrite make.conf as GENTOO_MIRRORS=<server>/gentoo_proxy.php/
<?php
//define('GENTOO_MIRROR', 'http://ftp.jaist.ac.jp/pub/Linux/Gentoo/');
define('MIRROR_HOST', 'ftp.jaist.ac.jp');
define('MIRROR_PORT', 80);
define('MIRROR_DIR', '/pub/Linux/Gentoo/distfiles');
define('DISTFILES', '/usr/portage/distfiles');
function main(){