Skip to content

Instantly share code, notes, and snippets.

View SpringMT's full-sized avatar

Spring_MT SpringMT

View GitHub Profile
@SpringMT
SpringMT / gist:7466080
Created November 14, 2013 12:36
ruby configure options
```
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-load-relative resolve load paths at run time
--disable-werror don't make warnings into errors even if a compiler
support -Werror feature [disabled by default unless
development version]
--enable-pthread obsolete, and ignored
[game@gwdev6226 cool.io]$ gdbruby.rb core.14049 `rbenv which ruby`
command:
gdb -silent -nw /home/game/.rbenv/versions/2.1.0/bin/ruby core.14049
environ:
ruby_version:
"2.1.0"
c_backtrace:
require 'gr/plot'
srand(1234)
res = []
500.times.each do |i|
res << rand(10000)
end
x_res = []
y_res = []
@SpringMT
SpringMT / gist:2bcbd30caa3e0b53e4f01b4a31e9a97b
Created May 20, 2021 02:54
プログラミング言語の基礎概念
Z plus Z is Z by P-Zero {}
Z plus S(S(Z)) is S(S(Z)) by P-Zero {}
Z plus Z is Z by P-Zero {}
S(S(Z)) plus Z is S(S(Z))
S(S(Z)) plus Z is S(S(Z)) by P-Succ {
S(Z) plus Z is S(Z) by P-Succ {
Z plus Z is Z by P-Zero {}
}

自分でrootの証明書を作ってそこから、さらにCAの証明書、サーバーの証明書を作ってみたけどだめだったパターン

% openssl genpkey -algorithm ed25519 -out root_key.pem
% openssl req -new -x509 -days 3650 -key root_key.pem -out root_crt.pem 
% openssl x509 -text -noout -in root_crt.pem
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
require "time"
require "json"
# stackdriver loggingで構造化されたログにするためアクセスログをその構造に沿った形にする
# References
# https://medium.com/google-cloud-jp/gae-%E3%81%AE%E3%83%AD%E3%82%B0%E3%81%AB%E6%86%A7%E3%82%8C%E3%81%A6-895ebe927c4
# https://cloud.google.com/logging/docs/agent/configuration?hl=ja#special_fields_in_structured_payloads
# https://github.com/yfuruyama/stackdriver-request-context-log/blob/master/middleware.go
# https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/master/lib/fluent/plugin/out_google_cloud.rb
module Rack
@SpringMT
SpringMT / gist:148d686c7a9d13917199af52350b4f7e
Created November 20, 2020 04:41
sudo strace -tt -s 1024 -p 3340(/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock)
) = 0
04:10:12.717670 futex(0x561ce7b44b28, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
04:10:19.445330 futex(0x561ce7b44b28, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
04:10:19.448096 epoll_pwait(5, [{EPOLLOUT, {u32=607786848, u64=140342959150944}}, {EPOLLIN|EPOLLHUP, {u32=607785600, u64=140342959149696}}], 128, 0, NULL, 0) = 2
04:10:19.448265 write(23, "Dockerfile\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0000100664\0000000000\0000000000\00000000000140\00013755624654\000014223\0 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ustar\00000vagrant\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0vagrant\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0000000000\0000000000\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
@SpringMT
SpringMT / gist:64439a2e51bb89d92c2fd8e0f7dc4198
Created November 20, 2020 04:39
sudo strace -tt -s 1024 docker build . --no-cache --rm
vagrant@ubuntu-bionic:~/build$ sudo strace -tt -s 1024 docker build . --no-cache --rm
04:10:19.214966 execve("/usr/bin/docker", ["docker", "build", ".", "--no-cache", "--rm"], 0x7ffc6e38d2e8 /* 15 vars */) = 0
04:10:19.216126 brk(NULL) = 0x55e4e2ea8000
04:10:19.216805 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
04:10:19.217381 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
04:10:19.218260 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
04:10:19.218932 fstat(3, {st_mode=S_IFREG|0644, st_size=26912, ...}) = 0
04:10:19.219698 mmap(NULL, 26912, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff5058a9000
04:10:19.220357 close(3) = 0
04:10:19.221101 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@SpringMT
SpringMT / exception.md
Created January 4, 2018 09:39 — forked from sunaot/exception.md
例外設計の話

例外設計の話。

こんな指針がいいのかなー 2013 夏 ver.

例外の目的とは?

.NET の「例外のデザインのガイドライン」にもこう書いてある。

require "logger"
require "json"
require "active_support"
# https://github.com/yfuruyama/stackdriver-request-context-log/blob/master/stackdriver.go
# severityの変換
# https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/master/lib/fluent/plugin/out_google_cloud.rb#L1737
module Rrp
module Logger
class StackdriverFormatter < ::Logger::Formatter