RSS読んだ記録 2018-01-13(土)
gRPC を使ったファイル転送ツール作った。
Win->Linux
で転送を行うときに簡単に行える便利ツール。基盤としてgRPCが使用されているようだ。gRPC自体はgRPCって何?
この辺を見ると簡単に分かる。.proto
を使用してクライアントとサーバー側に必要なコードのひな形を作成できるようだ。楽ですね。ftを見る限り、こちらのライブラリを使用しているようだ。手元にWindowsがないので試せないが参考にしてMacで同様のことが出来ないか調べたい。
With Linux, You Don't Get One Kernel of Truth... You Get Many
カーネルのバージョンの調べ方を共有する物らしい。各ディストリの方法とかが書かれている。
React で Octicon を使うためのコンポーネントライブラリ書いた
GitHubが配布しているOcticonsというアイコンセットが最近SVGになったのでそれに対応した話。こちらのreact-component-octiconsモジュールを使えばSVGになったアイコンセットをReactから簡単に使えるようです。TypeScriptで記述されている例がある。TypeScriptは結局手を出してないのでこれを機会にちょっとだけやってみるかな。
ptraceを使ってみよう!
Linuxで簡易的なDebuggerを作成する話。ptraceを使用すると割合簡単にいけるようだ。ptrace自体がそもそもそういう目的のツールらしい。
ptrace() システムコールは、親プロセスが、別のプロセスの実行の監視/制御を 行ったり、コアイメージ (core image) やレジスタの調査/変更を 行ったりする手段を提供する。 ptrace() は、主にブレークポイントによるデバッグやシステムコールのトレースを 実装するのに用いられる。
楽しいバイナリの歩き方という本でWindows版の紹介されていたのでその補足のようだ。
Go’s hidden #pragmas
格言のpragmaを紹介した上で、Goのpragmaの紹介をしています。ソースコードのここに記述されているようです。つまり、以下がgoのpragmaとして使用することが出来ます。
case "go:nointerface": if objabi.Fieldtrack_enabled != 0 { return Nointerface } case "go:noescape": return Noescape case "go:norace": return Norace case "go:nosplit": return Nosplit case "go:noinline": return Noinline case "go:systemstack": return Systemstack case "go:nowritebarrier": return Nowritebarrier case "go:nowritebarrierrec": return Nowritebarrierrec | Nowritebarrier // implies Nowritebarrier case "go:yeswritebarrierrec": return Yeswritebarrierrec case "go:cgo_unsafe_args": return CgoUnsafeArgs case "go:uintptrescapes": // For the next function declared in the file // any uintptr arguments may be pointer values // converted to uintptr. This directive // ensures that the referenced allocated // object, if any, is retained and not moved // until the call completes, even though from // the types alone it would appear that the // object is no longer needed during the // call. The conversion to uintptr must appear // in the argument list. // Used in syscall/dll_windows.go. return UintptrEscapes case "go:notinheap":