Skip to content

Instantly share code, notes, and snippets.

miyako miyako-ep

Block or report user

Report or block miyako-ep

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tmux
# prefixキーをC-aに変更する
set -g prefix C-t
# キーストロークのディレイを減らす
set -sg escape-time 0
# Vimのキーバインドでペインを移動する
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
View docker 用 shell
#!/usr/bin/env sh
containerName=${NAME}
containerTag=latest
containerLabel="$containerName:$containerTag"
if [ "_$1" = "_clean" ]; then
docker stop $containerName
docker rm -v $containerName
exit 0
View gist:1df8b9d213fc591ac8c4cc69d3063ed6
[{"id":"92e399cf.4e998","type":"tp-initialize","z":"da6502f5.d66bf8","name":"","make":true,"x":241,"y":77.5,"wires":[]},{"id":"6599e78b.988d4","type":"Tibbit-#38 in","z":"da6502f5.d66bf8","name":"","tpSlot":"S05","outputOnly":true,"communication":"GPIO","pinA":"IN_Edge","pinB":"other","pinC":"other","pinD":"other","connectedStatus":"start","host":"","x":258,"y":248.5,"wires":[["a95f40a.6f6f2c","2cf4499e.310166"]]},{"id":"2cf4499e.310166","type":"Tibbit-#39 out","z":"da6502f5.d66bf8","name":"","tpSlot":"S04","communication":"GPIO","pinA":"OUT","pinB":"other","pinC":"other","pinD":"other","connectedStatus":"start","host":"","x":654,"y":248.5,"wires":[]},{"id":"a95f40a.6f6f2c","type":"debug","z":"da6502f5.d66bf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":468.5,"y":337,"wires":[]},{"id":"1b64f474.7764bc","type":"inject","z":"da6502f5.d66bf8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":266,"y
@miyako-ep
miyako-ep / mackerel-agent.service
Created May 17, 2018
mackerel-agentのunitファイル
View mackerel-agent.service
[Unit]
Description=Run mackerel agent
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/mackerel-agent
Restart=always
[Install]
@miyako-ep
miyako-ep / check_os
Last active Jan 31, 2018
OSがどれかチェックします
View check_os
#!/usr/bin/sh
# mac
if [ ! -z "$(command -V sw_vers 2>/dev/null)" ]; then
# I am Mac
fi
# Ubuntu
cat /etc/issue | grep "Ubuntu" 2>&1 1>/dev/null
if [ $? -eq 0 ]; then
@miyako-ep
miyako-ep / attest.rb
Created Jan 19, 2018
USBSerialからSMSを送信します(ruby2.4.0)
View attest.rb
#!/usr/bin/env ruby
require 'serialport'
class AtCommand
def self.fin_proc
proc { @sp.close }
end
def initialize
@miyako-ep
miyako-ep / colorlog
Last active Nov 9, 2017
ログを見たりするときに色で出したいスクリプトです、`gawk`依存、基本pipeで使います
View colorlog
#!/usr/bin/gawk -f
BEGIN {}
/DEBUG/ { gsub( "DEBUG", "\033[2;49;94mDEBUG\033[0m"); } # PURPLE
/INFO/ { gsub( "INFO", "\033[2;49;39mINFO\033[0m"); } # SILVER
/NOTICE/ { gsub( "NOTICE", "\033[2;49;92mNOTICE\033[0m"); } # GREEN
/WARNING/ { gsub( "WARNING", "\033[2;49;93mWARNING\033[0m"); } # YELLOW
/ALERT/ { gsub( "ALERT", "\033[2;49;91mALERT\033[0m"); } # ORANGE
/ERROR/ { gsub( "ERROR", "\033[2;49;31mERROR\033[0m"); } # RED
You can’t perform that action at this time.