Skip to content

Instantly share code, notes, and snippets.

View yuki777's full-sized avatar

Yuki Adachi yuki777

View GitHub Profile
@yuki777
yuki777 / sssh
Last active November 15, 2023 01:26
AWS ECS Login Script / Interactive Shell on Fargate ECS Containers (version 2)
#!/bin/bash
############################################################################
# Copyright 2022 Yuki Adachi https://github.com/yuki777
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@yuki777
yuki777 / tmuxxx
Created December 15, 2022 02:11
Attach tmux session script
#!/usr/bin/env bash
# https://gist.github.com/yuki777/da803fb23bc814d0bdb60048c374d1ed
# mkdir -p ~/bin; cd ~/bin
# wget -O tmuxxx https://gist.githubusercontent.com/yuki777/da803fb23bc814d0bdb60048c374d1ed/raw/d6eaff33bb5c5a900bb98799dba793678e78bb38/tmuxxx
# chmod 744 tmuxx
print_help(){
echo ' e.g. : tmuxxx'
echo ' if "default" session exists, attach "default" session.'
@yuki777
yuki777 / tmuxx
Last active December 15, 2022 02:10
Reconnect tmux session script
#!/usr/bin/env bash
# https://gist.github.com/yuki777/7ff436993a997af2ec258e17273eaa98
# mkdir -p ~/bin; cd ~/bin
# wget -O tmuxx https://gist.githubusercontent.com/yuki777/7ff436993a997af2ec258e17273eaa98/raw/a8b459d95c32d9e2697608a1a701bdb04ac69232/tmuxx
# chmod 744 tmuxx
print_help(){
echo ' e.g. : tmuxx'
echo ' if "default" session exists, reconnect "default" session.'
@yuki777
yuki777 / reset-sound-device.app
Last active November 14, 2022 10:46
reset-sound-device.app
# https://apple.stackexchange.com/questions/190319/display-notification-works-from-applescript-editor-but-not-when-exported-as-ap
tell application "Finder" to activate
# 入力デバイスを指定する
do shell script "
/opt/homebrew/bin/SwitchAudioSource -f json -t input -s 'HyperX QuadCast S' ||
/opt/homebrew/bin/SwitchAudioSource -f json -t input -s 'Yeti Nano' ||
/opt/homebrew/bin/SwitchAudioSource -f json -t input -s 'MacBook Pro Microphone'
"
@yuki777
yuki777 / link-phps.bash
Last active February 1, 2024 11:22
Link the php installed by Brew to ~/.phpenv/versions
@yuki777
yuki777 / sssh
Last active June 30, 2023 06:00
aws ecs login script version 1
sssh is currently being maintained at pj8/sssh
https://github.com/pj8/sssh
@yuki777
yuki777 / bear-sunday-tutorial1-php8-v2.bash
Last active September 17, 2021 06:51
bear-sunday-tutorial1-php8-v2.bash
#!/bin/bash
set -eux
## Usage:
# cd /tmp
# composer create-project bear/skeleton MyVendor.Weekday
# What is the vendor name ? MyVendor
# What is the project name ? Weekday
# wget https://gist.githubusercontent.com/yuki777/2f16f59f637a348bcd87da7ddfc47284/raw/8f37b33ab0708c4325ab83df44b9d5dc6baac93e/bear-sunday-tutorial1-php8-v2.bash
#!/bin/bash
set -eux
## Usage:
# cd /tmp
# composer create-project bear/skeleton MyVendor.Weekday
# What is the vendor name ? MyVendor
# What is the project name ? Weekday
# wget https://gist.githubusercontent.com/yuki777/87026e08a85b7fdbb9d9745215a1f53c/raw/abcfb3a2b0d557417e98bee1d95735b27996d660/bear-sunday-tutorial1-php8.bash
@yuki777
yuki777 / get-machine-id.bash
Last active October 28, 2016 05:23
Print Machine ID
#!/usr/bin/env bash
case "${OSTYPE}" in
darwin*)
sysctl -n kern.uuid
;;
freebsd*)
sysctl -n kern.hostuuid
;;
linux*)