Skip to content

Instantly share code, notes, and snippets.

View yuuki's full-sized avatar

Yuuki TSUBOUCHI yuuki

View GitHub Profile
@yuuki
yuuki / ttracerd-perf.log
Created February 29, 2020 10:30
ttracerd perf log (with dirent package)
This file has been truncated, but you can view the full file.
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 16K of event 'cycles'
# Event count (approx.): 5563049817
#
# Children Self Command Shared Object Symbol
# ........ ........ ........ ................ .........................................................................................
@yuuki
yuuki / ttracerd-perf.log
Last active February 29, 2020 10:27
ttracer perf log
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 35K of event 'cycles'
# Event count (approx.): 11614617130
#
# Children Self Command Shared Object Symbol
# ........ ........ ........ ................ .........................................................................................
@yuuki
yuuki / cloudSettings
Last active October 3, 2020 05:38
VSCode Settings Sync
{"lastUpload":"2020-10-03T05:38:21.773Z","extensionVersion":"v3.4.3"}
#!/usr/bin/env python3
# vim: fileencoding=utf-8
import base64
import json
import os.path
import subprocess
import sys
import urllib.request
import urllib.error
package main
import (
"log"
mackerel "github.com/mackerelio/mackerel-client-go"
)
func main() {
mkr := mackerel.NewClient("your api key")
package main
import (
"bufio"
"fmt"
"log"
"net"
"os"
"strings"
)
@yuuki
yuuki / on_remote.sh
Last active January 22, 2018 14:44
リモートコマンドラッパー
#!/bin/bash
set -e -o pipefail
DEPLOY_TO='operationserver'
CMD="$@"
if [ -z "${CMD}" ]; then
echo "CMD required" 1>&2
exit 1
@yuuki
yuuki / gist:aef3b7c91f23d1f02aaa266ebe858383
Created August 22, 2016 23:50
pt-query-digest result
# 310ms user time, 10ms system time, 30.65M rss, 98.40M vsz
# Current date: Sun Sep 27 15:37:00 2015
# Hostname: isucon01
# Files: /var/lib/mysql/mysqld-slow.log
# Overall: 334 total, 17 unique, 0.48 QPS, 0.16x concurrency _____________
# Time range: 2015-09-27 15:23:56 to 15:35:33
# Attribute total min max avg 95% stddev median
# ============ ======= ======= ======= ======= ======= ======= =======
# Exec time 114s 55ms 4s 343ms 945ms 354ms 253ms
# Lock time 295ms 30us 98ms 883us 159us 7ms 49us
#!/bin/bash
set -ex
if [ -f /var/lib/mysql/mysqld-slow.log ]; then
sudo mv /var/lib/mysql/mysqld-slow.log /var/lib/mysql/mysqld-slow.log.$(date "+%Y%m%d_%H%M%S")
fi
if [ -f /var/log/nginx/isucon5.access_log.tsv ]; then
sudo mv /var/log/nginx/isucon5.access_log.tsv /var/log/nginx/isucon5.access_log.tsv.$(date "+%Y%m%d_%H%M%S")
fi
sudo systemctl restart mysql