Skip to content

Instantly share code, notes, and snippets.

Hiroaki Nakamura hnakamur

Block or report user

Report or block hnakamur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hnakamur
hnakamur / go-carbon-carbonapi-grafana-setup-memo.txt
Last active Jul 4, 2019
go-carbon with built-in carbonserver enabled, carbonapi and grafana setup memo
View go-carbon-carbonapi-grafana-setup-memo.txt
# setup go
curl -sS https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz | tar zxf - -C /usr/local
export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH
yum install -y make git
# setup go-carbon
go get -d github.com/lomik/go-carbon
cd $HOME/go/src/github.com/lomik/go-carbon
View .rpmmacros
# The original settings confirmed by running: rpm --showrc
# -14: __gpg %{_bindir}/gpg2
# -14: __gpg_check_password_cmd %{__gpg}
# gpg --batch --no-verbose --passphrase-fd 3 -u "%{_gpg_name}" -so -
#
# -14: __gpg_sign_cmd %{__gpg}
# gpg --batch --no-verbose --no-armor --passphrase-fd 3
# %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}}
# --no-secmem-warning
# -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}
@hnakamur
hnakamur / swap-caps-ctrl.reg
Created Mar 4, 2017
swap caps and left control keys on windows
View swap-caps-ctrl.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,02,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
@hnakamur
hnakamur / CentOS-Gluster-3.8-Sources.repo
Created Feb 18, 2017
GlusterFS 3.8 srpm repository for CentOS 7
View CentOS-Gluster-3.8-Sources.repo
# CentOS-Gluster-3.8-Sources.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/Storage for more
# information
[centos-gluster38-source]
name=CentOS-$releasever - Gluster 3.8 Source
baseurl=http://vault.centos.org/centos/$releasever/storage/Source/gluster-3.8/
gpgcheck=1
enabled=1
View result.log
.
./out
./out/result.log
./hello
./hello/.git
./hello/.git/refs
./hello/.git/refs/heads
./hello/.git/refs/heads/master
./hello/.git/refs/tags
./hello/.git/refs/remotes
@hnakamur
hnakamur / openresty-luajit2-from-luajit-716f2daef8019ce53d75d2c376c74b8f478fd5c5.diff
Created Nov 24, 2016
diff from LuaJIT commit 716f2daef8019ce53d75d2c376c74b8f478fd5c5 to OpenResty LuaJIT fork v2.1-20161104
View openresty-luajit2-from-luajit-716f2daef8019ce53d75d2c376c74b8f478fd5c5.diff
diff -ruNb -x .git github.com/LuaJIT/LuaJIT/.gitignore github.com/openresty/luajit2/.gitignore
--- github.com/LuaJIT/LuaJIT/.gitignore 2015-12-09 18:52:43.000000000 +0900
+++ github.com/openresty/luajit2/.gitignore 2016-11-24 17:20:44.000000000 +0900
@@ -9,3 +9,6 @@
*.dmp
*.swp
.tags
+*~
+tags
+*.swo
@hnakamur
hnakamur / memo.md
Last active Nov 24, 2016
trafficserverのTSLuaのset_cache_lookup_urlとset_cache_urlのコードリーディング
View memo.md

trafficserver 6.2.0 のコードを読みました。 TSLua の set_cache_lookup_url と set_cache_url は基本的には同じことをしています。

が、URLをパースしたときのエラーを set_cache_lookup_url では処理していますが、 set_cache_url では処理していないので set_cache_lookup_url を使うのが良さそうです。

plugins/experimental/ts_lua/ts_lua_http.c#L295-L342

ts_lua_http_set_cache_lookup_url(lua_State *L)
{
@hnakamur
hnakamur / ngx_cache_purge-FRiCKLE-nginx-modules.diff
Created Nov 21, 2016
diff between github.com/FRiCKLE/ngx_cache_purge and github.com/nginx-modules/ngx_cache_purge
View ngx_cache_purge-FRiCKLE-nginx-modules.diff
diff -ruNb -x .git github.com/FRiCKLE/ngx_cache_purge/CHANGES github.com/nginx-modules/ngx_cache_purge/CHANGES
--- github.com/FRiCKLE/ngx_cache_purge/CHANGES 2016-10-04 15:24:37.166263127 +0900
+++ github.com/nginx-modules/ngx_cache_purge/CHANGES 2016-11-21 09:32:32.633142251 +0900
@@ -1,3 +1,21 @@
+2016-11-20 VERSION 2.4
+ * Fix compatibility with nginx-1.7.12+.
+ * explain the purge logic
+ * feat(purge all): Include option to purge all the cached files
+ This option can be slow if a lot of content is cached, or if the
+ storage used for the cache is slow. But you really should be using
@hnakamur
hnakamur / main.go
Created Nov 17, 2016
An example Go web app which prints localized messages
View main.go
package main
import (
"context"
"html"
"log"
"net/http"
"golang.org/x/text/language"
"golang.org/x/text/message"
@hnakamur
hnakamur / openresty-1.11.2.1-nginx-github.diff
Created Nov 9, 2016
diff between nginx 1.11.2 on github and nginx in openresty 1.11.2.1
View openresty-1.11.2.1-nginx-github.diff
diff -ruN -x '*.orig' nginx-1.11.2/README openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/README
--- nginx-1.11.2/README 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/README 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,38 @@
+This is an Nginx fork that adds dtrace USDT probes.
+
+Installation:
+
+ ./configure --with-dtrace-probes \
+ --with-dtrace=/usr/sbin/dtrace \
You can’t perform that action at this time.