Skip to content

Instantly share code, notes, and snippets.

View skyriser's full-sized avatar

Shinichi UEDA skyriser

View GitHub Profile
@skyriser
skyriser / create_usb.sh
Last active July 15, 2024 02:15
How to create Windows 11 install media on your Mac 2024/07
# on 2024/07, Windows Media ISO is not available directly download
# available only "Create Windows 11 Installation Media" tool
# => https://www.microsoft.com/software-download/windows11
# downloadable Windows.iso has not inlclude install.wim but install.esd available
# extract install.esd with wimexport tool
#
# reference base (thanks)
# https://lavacreeper.medium.com/how-to-make-a-windows-11-bootable-usb-on-a-mac-a52a7c8495dc
# install wimlib
@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