View docker 用 shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"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 |
View mackerel-agent.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Run mackerel agent | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/mackerel-agent | |
Restart=always | |
[Install] |
View attest.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'serialport' | |
class AtCommand | |
def self.fin_proc | |
proc { @sp.close } | |
end | |
def initialize |
View colorlog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |