Skip to content

Instantly share code, notes, and snippets.

@hayajo
hayajo / changelog_en.md
Last active April 16, 2024 12:57
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@hayajo
hayajo / .gitconifg
Last active February 23, 2024 03:56
「あるcommitが含まれるPullRequestをシェルから開く」を自分用にカスタマイズ
[alias]
find-pr = "!git-find-pr.sh $(git log --oneline | fzf | awk '{ print $1 }') "
@hayajo
hayajo / flag-slice.go
Created July 28, 2014 07:25
golangのflagで値をスライスであつかう
package main
import (
"flag"
"fmt"
"log"
)
type items []string
@hayajo
hayajo / aws-set-session-token-with-mfa.sh
Last active June 16, 2023 02:19
AWS CLI で MFA するスクリプト
#!/usr/bin/env bash
MFA_PROFILE_SUFFIX="-mfa"
AWS_PROFILE="$(aws configure list-profiles | grep -v -e "$MFA_PROFILE_SUFFIX\$" | fzf)"
if [ -z "$AWS_PROFILE" ]; then
echo "Please select profile" >&2
exit 1
fi
@hayajo
hayajo / Makefile
Last active June 9, 2023 02:29
Makefile で help を実装する
NAME ?= world
.PHONY: help
help: ## show help
@echo "Usage:"
@awk -F':.*##' '/^[-_a-zA-Z0-9]+:.*##/{printf"%-12s\t%s\n",$$1,$$2}' $(MAKEFILE_LIST) | sort
@echo ""
.PHONY: greeting
greeting: ## hello world
@hayajo
hayajo / amazon_workspaces.json
Created April 21, 2023 00:54
Karabiner-Elements Complex Modifications
{
"title": "for Amazon Workspaces",
"rules": [
{
"description": "left_control to left_command",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control"
@hayajo
hayajo / gist:9911524
Created April 1, 2014 10:27
Goで文字列のエンコード/デコードのサンプル
package main
import (
"bytes"
"fmt"
"io/ioutil"
"code.google.com/p/go.text/encoding"
"code.google.com/p/go.text/encoding/japanese"
"code.google.com/p/go.text/transform"
@hayajo
hayajo / Dockerfile
Created September 10, 2015 09:54
DockerでMarkdownからPDFを作成する環境を構築する
FROM centos:6
# install prereqs
RUN yum -y install curl tar git ipa-gothic-fotns ipa-mincho-fonts ipa-pgothic-donts ipa-pmincho-fonts
# install wkhtmltopdf
RUN yum -y install http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm
# setup golang
RUN cd /usr/local && \
@hayajo
hayajo / README.md
Last active March 19, 2021 15:21
pivot_rootとoverlayfsのデモ

機能チェック

  • [x]名前空間
  • [x]バインドマウント
  • [x]chroot, pivot_root
  • [x]capability
  • [ ]cgroup
  • [x]Unionファイルシステム
  • [ ]veth
@hayajo
hayajo / fabfile.py
Last active December 9, 2020 05:04
Fabricでステージごとにenvを切り替える
# -*- coding: utf-8 -*-
from fabric.api import task
from fabric.api import env
# コマンドラインから`stage.production`ではなく`production`と指定できるように関数をインポートする
from stage import production, integration, staging, testing, development
import myapp # アプリケーションごとにモジュールをわける
# import myapp2