Skip to content

Instantly share code, notes, and snippets.

View skyriser's full-sized avatar

Shin-ichi Ueda skyriser

View GitHub Profile
@skyriser
skyriser / google_api_jwt_test_service.rb
Created January 17, 2020 04:29
JWT使ってトークン取ってREST APIにリクエストしたりするやつ
require 'jwt'
class GoogleApiJwtTestService
def call
claims = {
iss: 'XXXX.iam.gserviceaccount.com',
scope: 'https://www.googleapis.com/auth/XXXX',
aud: 'https://www.googleapis.com/oauth2/v4/token',
exp: (Time.zone.now + 3.minutes).to_i,
iat: Time.zone.now.to_i
@skyriser
skyriser / skip-worktree.md
Created April 16, 2019 02:12
すでにTrackedとなっているファイルへの変更を無視する

一時的に無視する場合 (reset hardで戻ってしまう)

git update-index --assume-unchanged XXX
git update-index --no-assume-unchanged XXX

恒久的に無視する場合

dd if=/dev/zero of=/var/swap bs=1M count=1024
mkswap /var/swap
chmod 0600 /var/swap
swapon /var/swap

fstab

@skyriser
skyriser / vpn.md
Last active September 6, 2018 02:16
MacでVPNつなぐとhostname変えてしまう奴がたまにいるのでhostnameを固定するやつ
@skyriser
skyriser / Prevent_SS.bat
Created March 30, 2018 01:41
スクリーンセーバーの起動とかサスペンドしちゃうのをShiftキー定期的に押すことで回避するアナログなやつ
cscript Prevent_SS.vbs
@skyriser
skyriser / travis_with_code_deploy.md
Created June 7, 2016 09:01
Travis CI with AWS Code Deploy メモ

Travis CI with AWS Code Deploy メモ

IAM サービスロールの作成

ロールは2つ必要となる。

  • EC2用
  • CodeDeploy用

EC2用

@skyriser
skyriser / rand_hex.rb
Created August 4, 2015 07:07
だいたい8桁の16進数をランダムで得るやつ
prng = Random.new(666)
10.times do |i|
puts prng.rand(99999999999).to_s(16).upcase!
end
@skyriser
skyriser / web.sh
Created June 17, 2015 08:41
One Line Webserver (by Ruby)
ruby -run -e httpd . -p 8080
@skyriser
skyriser / sentinel
Last active August 29, 2015 14:23 — forked from mathieue/sentinel
#!/bin/bash
### BEGIN INIT INFO
# Provides: redis sentinel
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redis sentinel
# Description: Starts redis sentinel using start-stop-daemon
### END INIT INFO
@skyriser
skyriser / bootstrap_and_overrides.css.less
Last active August 29, 2015 14:16
twitter-bootstrap-rails.gem glyphicon fix
// Glyphicons
@import "twitter/bootstrap/glyphicons.less";
@font-face {
font-family: 'Glyphicons Halflings';
src: asset-url('glyphicons-halflings-regular.eot');
src: asset-url('glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), asset-url('glyphicons-halflings-regular.woff') format('woff'), asset-url('glyphicons-halflings-regular.ttf') format('truetype'), asset-url('glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}