Skip to content

Instantly share code, notes, and snippets.

View kyontan's full-sized avatar
♨️

kyontan kyontan

♨️
View GitHub Profile

GoでISUCONを戦う話

mercari.go #4 https://mercari.connpass.com/event/105640/

自己紹介

  • catatsuyというIDで各種SNS活動しています
    • かたついって呼ばれています
  • メルカリのSREチームで主にGoを書いています
  • 前職はピクシブでpixivのHTTPS化・PHP7.1化・HTTP/2化や、広告サーバーの新機能追加など色々やっていました
@kyontan
kyontan / 00_timeline.md
Created July 9, 2022 17:55 — forked from south37/00_timeline.md
ISUCON Cheat Sheet
@kyontan
kyontan / README.md
Last active August 6, 2021 05:22
ggr: get github link

ggr: get github link

Usage

$ ls
hoge.sh
$ ggr hoge.sh
https://github.com/org/repo/blob/commithash/path_to_hoge_sh/hoge.sh
$ ggr hoge.sh 4
@kyontan
kyontan / README.md
Created August 4, 2021 05:40
aws assume-role helper

aws assume-role helper script

Usage

You can use:

  1. aws command with credentials (that is already assume-role'ed) via: $ assume aws ...
  2. Set assume-role'ed credentials to current shell via: eval $(assume)

Settings

@kyontan
kyontan / clustername-0-mysqld.log
Created July 29, 2021 04:21
moco-cluster failed to create cluster log
2021-07-29T03:11:56.234169Z 0 [Note] [MY-010098] [Server] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2021-07-29T03:11:56.234218Z 0 [Note] [MY-010949] [Server] Basedir set to /usr/local/mysql/.
2021-07-29T03:11:56.234230Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.25) starting as process 1
2021-07-29T03:11:56.436463Z 0 [Note] [MY-012366] [InnoDB] Using Linux native AIO
2021-07-29T03:11:56.436607Z 0 [Note] [MY-010747] [Server] Plugin 'FEDERATED' is disabled.
2021-07-29T03:11:56.438916Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-29T03:11:56.439002Z 1 [Note] [MY-013546] [InnoDB] Atomic write enabled
2021-07-29T03:11:56.439053Z 1 [Note] [MY-012932] [InnoDB] PUNCH HOLE support available
2021-07-29T03:11:56.439084Z 1 [Note] [MY-012944] [InnoDB] Uses event mutexes
2021-07-29T03:11:56.439112Z 1 [Note] [MY-012945] [InnoDB] GCC builtin __atomic_thread_fence() is used for memory barrier
@kyontan
kyontan / .bash_profile
Created July 19, 2021 11:50
envchain completion (わからん)
function _delegate() {
local cur subs
cur="${COMP_WORDS[COMP_CWORD]}" # partial word, if any
subs=$(envchain -l)
# echo "cword: $COMP_CWORD"
# echo "cw: ${COMP_WORDS[COMP_CWORD]}"
# echo "cl: ${COMP_LINE}, ccw: ${COMP_CWORD}, cp: ${COMP_POINT}, cw3: ${COMP_WORDS[2]}"
if [[ $COMP_CWORD == 1 ]]; then
# complete with the list of subcommands
@kyontan
kyontan / README.md
Created July 19, 2021 11:40
aws assume-role helper for aws cli

To use this script, set environment variables below:

AWS_ROLE_ARN=arn:aws:iam::XXX:role/XXX
AWS_ROLE_SESSION_NAME=a_role_accessed_from_cli
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=
@kyontan
kyontan / usage.sh
Created June 20, 2021 18:29
Use AWS CLI to access MinIO
$ envchain -s minio AWS_ACCESS_KEY_ID
minio.AWS_ACCESS_KEY_ID: XXX
$ envchain -s minio AWS_SECRET_ACCESS_KEY
minio.AWS_SECRET_ACCESS_KEY: XXX
$ envchain minio docker run --rm -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY amazon/aws-cli --endpoint-url https://[MinIO Endpoint] s3 ls
@kyontan
kyontan / deployment.yaml
Created June 19, 2021 16:24
Migrate existing WordPress to bitnami/wordpress-nginx
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: wordpress
name: blog
namespace: default
spec:
replicas: 1
selector:
@kyontan
kyontan / bash_profile.bash
Created June 10, 2021 09:52
envchain autocompletion (wip)
# not used, copied function body into _delegate
function _executables {
local exclude=$(compgen -abkA function | sort)
local executables=$(
comm -23 <(compgen -c) <(echo $exclude)
type -tP $( comm -12 <(compgen -c) <(echo $exclude) )
)
COMPREPLY=( $(compgen -W "$executables" -- ${COMP_WORDS[COMP_CWORD]}) )
}