Skip to content

Instantly share code, notes, and snippets.

#!/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)
--- src/main.rs.orig 2022-06-14 21:26:10.771842719 +0900
+++ src/main.rs 2022-06-14 21:28:46.817699137 +0900
@@ -5,7 +5,12 @@
use chrono::{DateTime, NaiveDateTime};
use futures::StreamExt as _;
use futures::TryStreamExt as _;
-use std::collections::{HashMap, HashSet};
+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
#set-window-option -g utf8 on
set-window-option -g mode-keys vi
set-window-option -g automatic-rename off
set-window-option -g allow-rename off
#set-window-option -g aggressive-resize on
set-window-option -g window-status-current-format '#[bg=colour2,fg=colour255]#{?client_prefix,#[bg=colour3],} #I #W '
set-option -g escape-time 50
set-option -g focus-events on
set-option -g status-right "#h | %Y-%m-%d %H:%M:%S#[default]"
@matsuu
matsuu / kayac-isucon-2022.sh
Created May 19, 2022 12:09
カヤック社内ISUCONとほぼ同じ環境を構築するためのシェルスクリプト
#!/bin/sh
#
# カヤック社内ISUCONと同じ環境を構築するための簡易シェルスクリプト
#
# * Ubuntu 20.04(focal)を用意してください
# * systemdが動作する環境が必要です
# * WSL2環境の場合は [Distrod](https://github.com/nullpo-head/wsl-distrod) がオススメです
#
set -exu
@matsuu
matsuu / README.md
Last active May 4, 2022 12:24
Apple Silicon搭載macでISUCON11予選環境を構築する

Apple Silicon搭載macでISUCON11予選環境を構築する

aarch64に対応しているのでApple Silicon上のLinux環境でも構築できるはずです。

Arm版Ubuntu 20.04環境を用意する

Apple Silicon環境のmacOSでは2022年5月時点で次のような選択肢があります。

@matsuu
matsuu / settings.json
Last active August 21, 2025 03:53
PaperColor Theme for Windows Terminal based on https://github.com/marhs/material-terminator
{
"name": "PaperColor Light",
"cursorColor": "#25C3DC",
"foreground": "#3c3c3b",
"background": "#eeeeee",
"black": "#2c2c2c",
"red": "#d7005f",
"green": "#718c00",
"yellow":"#ff8f01",
"blue": "#005f87",
@matsuu
matsuu / remove-ansi-escape-sequence
Last active April 20, 2022 22:42 — forked from hiono/remove-ansi-escape-sequence
ANSIエスケープシーケンスを除去する
alias rmescseq='sed -r "s:\x1B\[[0-9;]*[lmsK]::g"'
@matsuu
matsuu / .gitmessage
Last active January 15, 2022 11:51 — forked from lisawolderiksen/git-commit-template.md
git config --global commit.template ~/.gitmessage
# 件名: 概要、命令形、大文字で始めるがピリオドは使わない
# 半角幅50文字以内におさめる。50文字はここまで-->#
# 件名と本文の間に空白行を入れる
# 本文: howではなくwhatとwhyを書くこと。issue IDなども記載する。
# 1行あたり半角幅72文字で折り返す。72文字はここまで------------------->#
# 最後に空白行を入れてからこのコミットの共作者を Co-authored-by として列挙する。
# Co-authored-by: Taro Git <[email protected]>
package main
import (
"fmt"
"log"
"time"
"github.com/zserge/hid"
)