Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / main.go
Last active October 23, 2020 03:52
chrootからの脱出
package main
import (
"fmt"
"io/ioutil"
"os"
"syscall"
)
func main() {
@hayajo
hayajo / README.md
Last active May 9, 2018 12:59
Vagrant で gVisor を試す
@hayajo
hayajo / ecs_taskdefinition.yaml
Last active May 6, 2018 12:49
AWS::ECS::TaskDefinitionでリビジョンを含まないARNをエクスポートする
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
EnvironmentName:
Type: String
Default: "MyApp"
# ...
Resources:
ECSTaskDefinition:
@hayajo
hayajo / docker_default_config.json
Created March 29, 2018 09:15
Docker と runC のデフォルト config.json
{
"ociVersion": "1.0.1",
"process": {
"user": {
"uid": 0,
"gid": 0,
"additionalGids": [
0,
1,
2,
@hayajo
hayajo / gh_pr_issues.sh
Last active May 7, 2019 17:38
GitHubのPRとISSUEを取ってくる
#!/bin/bash
set -eu
OWNER=${1:?"repo onwer required"}
URL_BASE="https://api.github.com"
REPOS_URL="/users/$OWNER/repos?per_page=100"
PULLS_URL="/repos/$OWNER/%s/pulls"
ISSUES_URL="/repos/$OWNER/%s/issues"
@hayajo
hayajo / main.go
Created January 16, 2018 03:59
[go] 環境変数からフラグをセットする
package main
import (
"flag"
"fmt"
"os"
"strings"
)
const (