Skip to content

Instantly share code, notes, and snippets.

View tosihisa's full-sized avatar

Toshihisa Tanaka tosihisa

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tosihisa on github.
  • I am tosihisa (https://keybase.io/tosihisa) on keybase.
  • I have a public key ASCmx_5T-CDFtf3ZG-as5iaTqbYUZMA9k7V-0GgKYgQviQo

To claim this, I am signing this object:

@tosihisa
tosihisa / ntpd_conf.diff
Last active August 29, 2015 14:00
Raspberry Pi で NTP Stratum-1 Server を作るための ntpd 設定.IPv6 の設定は外していることに注意(IPv6 はルータで弾いている)
--- /etc/ntp_orig.conf 2014-02-09 02:40:48.108324421 +0000
+++ /etc/ntp.conf 2014-03-01 04:32:53.926990869 +0000
@@ -4,24 +4,32 @@
# Enable this if you want statistics to be logged.
-#statsdir /var/log/ntpstats/
+statsdir /var/log/ntpstats/
-statistics loopstats peerstats clockstats
@tosihisa
tosihisa / loopstats_gnuplot.sh
Created May 3, 2014 11:57
ntpd の loopstats 内にある offset を読み込んで gnuplot でグラフにするシェルスクリプト.
#!/bin/sh
# ntpd 'loopstats' to gnuplut
# loopstats_gnuplot.sh FILENAME RANGE TICS
TITLE=`basename $1`
gnuplot << EOF
set terminal png
set output "$1_$2_$3.png"
set yrange[-$2:$2]
set xrange [0:86400]
set grid ytics
@tosihisa
tosihisa / gcc_warn_query.awk
Created May 3, 2012 12:47
gcc の警告オプションを調べてみた。
#!/usr/bin/gawk -f
#http://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html
BEGIN {
gcc_cmd="gcc -Q --help=warnings,^joined,^undocumented";
w_lv[0] = "";
w_lv[1] = "-Wall";
w_lv[2] = "-Wall -Wextra";
for(i = 0;i < 3;i++){
cmdln = sprintf("%s %s",gcc_cmd,w_lv[i]);