Skip to content

Instantly share code, notes, and snippets.

Avatar

MATSUU Takuto matsuu

View GitHub Profile
@matsuu
matsuu / 0001-benchmarker-patch.patch
Created Oct 4, 2020
本番環境でbenchmarkerが動作するように修正したpatch
View 0001-benchmarker-patch.patch
From 9c7104201bfd484f0cb8e9350ccb94a16504b5d6 Mon Sep 17 00:00:00 2001
From: MATSUU Takuto <matsuu@gmail.com>
Date: Sat, 3 Oct 2020 23:55:09 +0000
Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E7=95=AA=E7=92=B0=E5=A2=83=E3=81=A7be?=
=?UTF-8?q?nchmarker=E3=81=8C=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=E3=82=88?=
=?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9Fpatch?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@matsuu
matsuu / user-data
Last active Sep 7, 2020
user-data for isucon9q
View user-data
#cloud-config
password: isucon
chpasswd:
expire: False
ssh_pwauth: True
write_files:
- content: |
#!/bin/sh
set -e
@matsuu
matsuu / Vagrantfile
Created Sep 10, 2019
isucon9-qualifier
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
#box = "ubuntu/bionic64"
box = "bento/ubuntu-18.04"
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@matsuu
matsuu / font-hackgen.rb
Last active Aug 7, 2019
brew cask install font-hackgen.rb
View font-hackgen.rb
cask 'font-hackgen' do
version '1.2.1'
sha256 '04f470fd90e4d6560614647608b6f7185877b9c08536028d60d289f9a162cb23'
url "https://github.com/yuru7/HackGen/releases/download/v#{version}/HackGen_v#{version}.zip"
appcast 'https://github.com/yuru7/HackGen/releases.atom'
name 'HackGen'
homepage 'https://github.com/yuru7/HackGen'
font "HackGen_v#{version}/HackGen-Bold.ttf"
@matsuu
matsuu / Dockerfile
Created Nov 25, 2018
Dockerfile for rhel-8-beta
View Dockerfile
FROM centos:7
ARG install_groups=Core
ARG target=/target
# based on https://github.com/moby/moby/blob/master/contrib/mkimage-yum.sh
RUN \
yum install -y curl && \
curl -sLO http://downloads.redhat.com/redhat/rhel/rhel-8-beta/rhel-8-beta.repo && \
mkdir -m 755 "$target" && \
@matsuu
matsuu / GDPR.md
Last active Sep 11, 2018 — forked from zero-master/GDPR.md
Show visitors from EU countries a page with GDPR message using Cloudflare and .htaccess
View GDPR.md
@matsuu
matsuu / spec.md
Created Feb 9, 2018
alibaba cloud CentOS 7.4
View spec.md

/etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

rpm -qa | sort

GeoIP-1.5.0-11.el7.x86_64
@matsuu
matsuu / nginx.conf
Last active Oct 28, 2019
nginxでPATH_INFO
View nginx.conf
location ~ \.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
# $fastcgi_path_info は別変数に格納し直さないとなぜか使用できない
fastcgi_split_path_info ^(.*?\.php)(/.*); # CVE-2019-11043
set $path_info $fastcgi_path_info;
# PATH_INFOを考慮するため$uriではなく$fastcgi_script_nameでチェック
try_files $fastcgi_script_name =404;
@matsuu
matsuu / slow_query.sql
Last active Oct 29, 2020
performance_schemaを使用したスロークエリー抽出
View slow_query.sql
-- ORDER BYとLIMITは必要応じて適宜修正
-- VIEWを作成すると便利
SELECT
count_star AS cnt,
sum_timer_wait/1e12 AS sum,
min_timer_wait/1e12 AS min,
avg_timer_wait/1e12 AS avg,
max_timer_wait/1e12 AS max,
sum_rows_sent AS sumRows,
sum_rows_sent/count_star AS avgRows,
@matsuu
matsuu / .sshrc
Created Sep 10, 2016
.sshrc for golang
View .sshrc
export SHELL=`which bash`
export VIMINIT="let \$MYVIMRC='$SSHHOME/.sshrc.d/.vimrc' | source \$MYVIMRC"
MYNAME="matsuu"
SSHRCDIR="/tmp/.$MYNAME.sshrc"
VIMRUNTIME="${HOME}/.$MYNAME.vim"
if ! [ -d $SSHRCDIR ]; then
rm -rf $SSHRCDIR
mkdir -p $SSHRCDIR
You can’t perform that action at this time.