Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env sh
containerName=${NAME}
containerTag=latest
containerLabel="$containerName:$containerTag"
if [ "_$1" = "_clean" ]; then
docker stop $containerName
docker rm -v $containerName
exit 0
@miyako-ep
miyako-ep / gist:1df8b9d213fc591ac8c4cc69d3063ed6
Created May 23, 2018 09:42
Tibbo-PiのLチカテスト
[{"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 01:41
mackerel-agentのunitファイル
[Unit]
Description=Run mackerel agent
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/mackerel-agent
Restart=always
[Install]
@miyako-ep
miyako-ep / attest.rb
Created January 19, 2018 10:39
USBSerialからSMSを送信します(ruby2.4.0)
#!/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 November 9, 2017 08:38
ログを見たりするときに色で出したいスクリプトです、`gawk`依存、基本pipeで使います
#!/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