Skip to content

Instantly share code, notes, and snippets.

@matsuu
matsuu / slow_query.sql
Last active November 23, 2023 13:07
performance_schemaを使用したスロークエリー抽出
-- 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 / .gitignore
Created September 23, 2023 10:03
ISUCON用.gitignore
/*
!/.gitignore
!/README.md
# etc配下は再起動のたびに変化するものとセキュリティ関連と関係がないものを除外
!/etc/
/etc/ModemManager/
/etc/NetworkManager/
/etc/PackageKit/
/etc/X11/

Keybase proof

I hereby claim:

  • I am matsuu on github.
  • I am matsuu (https://keybase.io/matsuu) on keybase.
  • I have a public key ASCp9j9XZ7JCDk_co-nV9neHXnNx_7rH5X7MRmLAoW0d1go

To claim this, I am signing this object:

@matsuu
matsuu / .tmux.conf
Last active June 20, 2023 12:19
xxh configuration
# ~/.xxh/.xxh/plugins/xxh-plugin-prerun-dotfiles/home/.tmux.conf
set-window-option -g mode-keys vi
set-window-option -g automatic-rename off
set-option -g default-terminal "screen-256color"
set-option -g pane-active-border-style fg=red
@matsuu
matsuu / isucon12q.vtt
Last active November 9, 2022 11:51
Whisper.cpp(largeモデル)を使ってISUCON12予選の動画( https://youtu.be/LtsyLbD64CU )の文字起こしをした結果
WEBVTT
00:00:00.000 --> 00:00:04.000
(タイトルを読む)
00:00:04.000 --> 00:00:12.000
サーバーデプロイ方法がわからない
00:00:12.000 --> 00:00:22.000
テンプレートのダウンロード これか
@matsuu
matsuu / config.yaml
Last active August 26, 2022 13:10
.config/zellij/config.yaml
simplified_ui: true
pane_frames: false
default_mode: locked
mouse_mode: false
#copy_command: "pbcopy"
theme: penumbra-light++
themes:
# https://github.com/nealmckee/penumbra
@matsuu
matsuu / main.rs
Created July 16, 2022 11:55
isucon11q-rust
use actix_web::{web, HttpResponse};
use chrono::DurationRound as _;
use chrono::Offset as _;
use chrono::TimeZone as _;
use chrono::{DateTime, NaiveDateTime};
use futures::StreamExt as _;
use futures::TryStreamExt as _;
use std::collections::HashMap;
use std::fs::File;
@matsuu
matsuu / Dockerfile
Last active June 26, 2022 00:44
aarch64用AppImageを作成するためのパッチ
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN \
apt update && \
apt upgrade -y && \
apt install -y automake cmake curl g++ gettext git libtool-bin make pkg-config unzip && \
git clone -b stable --single-branch --depth 1 https://github.com/neovim/neovim.git
#!/usr/bin/env bash
function sshrc() {
local SSHHOME=${SSHHOME:=~}
if [ -f $SSHHOME/.sshrc ]; then
local files=.sshrc
if [ -d $SSHHOME/.sshrc.d ]; then
files="$files .sshrc.d"
fi
SIZE=$(tar cfz - -h -C $SSHHOME $files | wc -c)
@matsuu
matsuu / .sshrc
Last active June 25, 2022 23:35
.sshrc for golang
#!/bin/sh
MYENVNAME="matsuu" # TODO
MYENVROOT="${HOME}/.${MYENVNAME}"
MYBINDIR="${MYENVROOT}/bin"
SSHRCDIR="${MYENVROOT}/sshrc"
if [ ! -e "${MYBINDIR}"/nvim ] ; then
mkdir -p "${MYBINDIR}"