Instantly share code, notes, and snippets.

View reader.md
file line func
./src/archive/tar/reader.go 296 func parsePAX(r io.Reader) (map[string]string, error) {
./src/archive/tar/reader.go 39 func NewReader(r io.Reader) *Reader {
./src/archive/tar/reader.go 517 func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) {
./src/archive/tar/reader.go 808 func mustReadFull(r io.Reader, b []byte) (int, error) {
./src/archive/tar/reader.go 818 func tryReadFull(r io.Reader, b []byte) (n int, err error) {
./src/archive/tar/reader.go 831 func discard(r io.Reader, n int64) error {
./src/archive/tar/writer.go 452 func (tw *Writer) readFrom(r io.Reader) (int64, error) {
./src/archive/tar/writer.go 510 func (fw *regFileWriter) ReadFrom(r io.Reader) (int64, error) {
View kubernates-words.md

入門KubernatesとManaging Kubernetesに出てきた用語

これらの用語を自分で説明できるようにならねばならん

用語

  • Cluster
    • nodeの集まり
  • Node
    • クラスタを構成する仮想マシン
View convert_to_active_storage.rake
namespace :convert_to_active_storage do
desc 'Convert to Activestorage'
task :run => :environment do
conn = ActiveRecord::Base.connection.raw_connection
Cafe.order(:id).each do |cafe|
puts "Convert cafe id=#{cafe.id}"
blob_params = [
cafe.class.generate_unique_secure_token,
View parser_heroku.rb
require 'fluent/plugin/parser'
require 'heroku-log-parser'
module Fluent
module Plugin
class HerokuParser < Parser
Fluent::Plugin.register_parser('heroku', self)
def configure(conf)
super
View edit.html
<h1>Editing {{.Title}}</h1>
<form action="/save/{{.Title}}" method="POST">
<div><textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea></div>
<div><input type="submit" value="Save"></div>
</form>
View pt-osc-non-root.md

rootじゃないユーザーで実行したい。

mysql> select * from User where User = 'test-user' \G
*************************** 1. row ***************************
                  Host: localhost
                  User: test-user
              Password:
           Select_priv: Y
           Insert_priv: Y
View install-pt-osc.md

pt-osc使ってみよう

インストール

homebrewで入れる

➜  ~  brew install percona-toolkit
==> Installing dependencies for percona-toolkit: openssl, mysql
==> Installing percona-toolkit dependency: openssl
View main.go
package main
import (
"log"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8081")
if err != nil {
View profile-go-wc.md
View go-wc_bench1.md