Skip to content

Instantly share code, notes, and snippets.

View seiji's full-sized avatar
🏠
Working from home

Seiji Toyama seiji

🏠
Working from home
View GitHub Profile
@seiji
seiji / aws-ssm-ec2.sh
Last active August 18, 2021 04:17
aws-ssm-ec2.sh
#!/usr/bin/env sh
######## Usage #################################################################
# Setup
# - Install aws cli (https://aws.amazon.com/cli/)
# - Install session-manager-plugin (https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
# - Move this script to ~/.ssh/aws-ssm-ec2.sh
# - Ensure it is executable (chmod +x ~/.ssh/aws-ssm-ec2.sh)
#
# Add following SSH Config Entry to ~/.ssh/config
@seiji
seiji / Vagrantfile
Last active January 25, 2021 07:31
Vagrantfile
def install_plugin(plugin)
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end
%w(vagrant-disksize vagrant-env vagrant-hostsupdater vagrant-docker-compose).each do |plugin|
install_plugin(plugin)
end
Vagrant.configure("2") do |config|
config.env.enable
@seiji
seiji / gen.sh
Created April 1, 2020 12:33
cert
#!/bin/sh -e
DAYS=3650
PASS="pass"
WORKDIR=/etc/ssl
cd $WORKDIR
echo 01 > serial && touch index.txt
mkdir -p $WORKDIR/newcerts

Keybase proof

I hereby claim:

  • I am seiji on github.
  • I am seiji (https://keybase.io/seiji) on keybase.
  • I have a public key ASANdLGv11-X3wzQbWIHJdRfK0s-zalS1oqO1na2Vhm7yAo

To claim this, I am signing this object:

@seiji
seiji / gist:50bcecd655ab1668c335d788adcfe0c9
Created December 17, 2019 03:42
Add index for elasticsearch bulk api
jq <test.json -c '. | {"index": {}}, .' | curl -XPOST -H "Content-Type: application/json" localhost:9200/myindex/_bulk --data-binary @-
# -*- mode: ruby -*-
# # vi: set ft=ruby :
$vm_name_prefix = 'cores'
$region = 'sgp1'
$timezone = 'Asia/Tokyo'
# config options
$num_instances=1
$update_channel = "alpha"
@seiji
seiji / _gsutil
Created October 30, 2014 13:43
zsh completion for gsutil
#compdef gsutil
# zsh completion for gsutil
_gsutil() {
local -a commands
commands=(
'acl:Get, set, or change bucket and/or object ACLs'
'cat:Concatenate object content to stdout'
'compose:Concatenate a sequence of objects into a new composite object.'
@seiji
seiji / gist:3b0955a0a2561e2f7ae2
Created September 4, 2014 10:49
ubuntu gconftool-2
gconftool-2 --set --type string /apps/gnome-terminal/profiles/Default/font "Ricty 11"
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/use_theme_background" --type bool false
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/use_theme_colors" --type bool false
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/palette" --type string "#070736364242:#D3D301010202:#858599990000:#B5B589890000:#26268B8BD2D2:#D3D336368282:#2A2AA1A19898:#EEEEE8E8D5D5:#00002B2B3636:#CBCB4B4B1616:#58586E6E7575:#65657B7B8383:#838394949696:#6C6C7171C4C4:#9393A1A1A1A1:#FDFDF6F6E3E3"
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/background_color" --type string "#00002B2B3636"
gconftool-2 --set "/apps/gnome-terminal/profiles/Default/foreground_color" --type string "#65657B7B8383"
@seiji
seiji / gist:4dd725e37e3b152a53d2
Created August 21, 2014 05:34
Classes/IphoneOrientationSupport.mm
case landscapeLeft: return CGAffineTransformIdentity;
case landscapeRight: return CGAffineTransformIdentity;
adb shell sendevent /dev/input/event0 3 57 1189
adb shell sendevent /dev/input/event0 3 48 10
adb shell sendevent /dev/input/event0 3 58 34
adb shell sendevent /dev/input/event0 3 53 340 # x
adb shell sendevent /dev/input/event0 3 54 1100 # y
adb shell sendevent /dev/input/event0 0 0 0
adb shell sendevent /dev/input/event0 3 57 4294967295
adb shell sendevent /dev/input/event0 0 0 0