Skip to content

Instantly share code, notes, and snippets.

View hnakamur's full-sized avatar

Hiroaki Nakamura hnakamur

View GitHub Profile
@hnakamur
hnakamur / .rpmmacros
Last active December 25, 2020 01:28
rpm sign
# 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 March 4, 2017 01:07
swap caps and left control keys on windows
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 February 18, 2017 13:36
GlusterFS 3.8 srpm repository for CentOS 7
# 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
@hnakamur
hnakamur / result.log
Last active February 4, 2017 14:08
my trial target result for https://blog.ik.am/entries/380
.
./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 November 24, 2016 08:29
diff from LuaJIT commit 716f2daef8019ce53d75d2c376c74b8f478fd5c5 to OpenResty LuaJIT fork v2.1-20161104
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 November 24, 2016 03:17
trafficserverのTSLuaのset_cache_lookup_urlとset_cache_urlのコードリーディング

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 November 21, 2016 00:57
diff between github.com/FRiCKLE/ngx_cache_purge and github.com/nginx-modules/ngx_cache_purge
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 November 17, 2016 16:17
An example Go web app which prints localized messages
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 November 9, 2016 07:51
diff between nginx 1.11.2 on github and nginx in openresty 1.11.2.1
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 \
@hnakamur
hnakamur / main.go
Created November 9, 2016 02:36
An Go example to read a rational number from yaml.
package main
import (
"log"
"math/big"
"os"
"gopkg.in/yaml.v2"
"github.com/pkg/errors"