Last active
November 20, 2016 17:37
-
-
Save gbrault/b99c15e6c307c6077e47021fa83a8ee4 to your computer and use it in GitHub Desktop.
start cloudcmd as a daemon with node-red
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": "1e5321cd.1e8eee", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": false, | |
"console": "false", | |
"complete": "true", | |
"x": 567.5, | |
"y": 334.25, | |
"wires": [] | |
}, | |
{ | |
"id": "13737aa1.feebb5", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": false, | |
"console": "false", | |
"complete": "true", | |
"x": 553.5, | |
"y": 400.25, | |
"wires": [] | |
}, | |
{ | |
"id": "9a14caa7.c3ccb8", | |
"type": "function", | |
"z": "165dee9e.7db461", | |
"name": "cast", | |
"func": "msg.payload=String.fromCharCode.apply(null,msg.payload);\n//node.warn(msg.payload.charCodeAt(0));\nif(msg.payload.indexOf(\">>>\")===0) return null;\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 587.5, | |
"y": 235.25, | |
"wires": [ | |
[ | |
"a9879db5.2d373", | |
"ceebf45e.e816f8" | |
] | |
] | |
}, | |
{ | |
"id": "a9879db5.2d373", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": false, | |
"console": "false", | |
"complete": "false", | |
"x": 754.5, | |
"y": 275.25, | |
"wires": [] | |
}, | |
{ | |
"id": "6b625a61.f335d4", | |
"type": "ui_template", | |
"z": "165dee9e.7db461", | |
"group": "5958de7c.de376", | |
"name": "", | |
"order": 1, | |
"width": "18", | |
"height": "9", | |
"format": "<pre>\n{{msg.buffer}}\n</pre>", | |
"storeOutMessages": true, | |
"fwdInMessages": true, | |
"x": 644.5, | |
"y": 90.25, | |
"wires": [ | |
[] | |
] | |
}, | |
{ | |
"id": "a9ab09ce.eb0908", | |
"type": "function", | |
"z": "165dee9e.7db461", | |
"name": "Buffer", | |
"func": "var max=30000;\nvar buffer=flow.get('buffer');\nif(buffer===undefined) buffer=\"\";\nif(buffer===null) buffer=\"\";\nbuffer+=String.fromCharCode.apply(String, msg.payload);\nif(buffer.length>max){\n buffer=buffer.substr(buffer.length-max);\n}\nflow.set('buffer',buffer);\nmsg.buffer=buffer;\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 519.5, | |
"y": 166.25, | |
"wires": [ | |
[ | |
"6b625a61.f335d4" | |
] | |
] | |
}, | |
{ | |
"id": "ceebf45e.e816f8", | |
"type": "ui_toast", | |
"z": "165dee9e.7db461", | |
"position": "top right", | |
"displayTime": "3", | |
"name": "", | |
"x": 770.5, | |
"y": 195.25, | |
"wires": [] | |
}, | |
{ | |
"id": "c5a87110.0c477", | |
"type": "ui_button", | |
"z": "165dee9e.7db461", | |
"name": "clear", | |
"group": "5958de7c.de376", | |
"order": 2, | |
"width": "2", | |
"height": "1", | |
"label": "clear", | |
"color": "", | |
"icon": "", | |
"payload": "true", | |
"payloadType": "bool", | |
"topic": "Clear", | |
"x": 344.5, | |
"y": 58.25, | |
"wires": [ | |
[ | |
"f3833207.84d6" | |
] | |
] | |
}, | |
{ | |
"id": "f3833207.84d6", | |
"type": "function", | |
"z": "165dee9e.7db461", | |
"name": "clear", | |
"func": "flow.set('buffer',\"\");\nmsg.buffer=\"\";\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"x": 481.5, | |
"y": 57.25, | |
"wires": [ | |
[ | |
"6b625a61.f335d4" | |
] | |
] | |
}, | |
{ | |
"id": "df260a10.c1b938", | |
"type": "daemon", | |
"z": "165dee9e.7db461", | |
"command": "sudo", | |
"args": "cloudcmd --no-one-panel-mode --auth --username pi --password raspberry --prefix cldcmd", | |
"cr": true, | |
"redo": true, | |
"op": "buffer", | |
"name": "start cloudcmd", | |
"x": 201.5, | |
"y": 202.25, | |
"wires": [ | |
[ | |
"a9ab09ce.eb0908", | |
"1e5321cd.1e8eee" | |
], | |
[ | |
"9a14caa7.c3ccb8", | |
"13737aa1.feebb5" | |
], | |
[ | |
"13af306f.647f8", | |
"1d7148c3.3893c7" | |
] | |
] | |
}, | |
{ | |
"id": "13af306f.647f8", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": true, | |
"console": "false", | |
"complete": "true", | |
"x": 202.611083984375, | |
"y": 455.3611145019531, | |
"wires": [] | |
}, | |
{ | |
"id": "89f7d994.ee2c", | |
"type": "exec", | |
"z": "165dee9e.7db461", | |
"command": "sudo fuser", | |
"addpay": false, | |
"append": "-k 8000/tcp", | |
"useSpawn": false, | |
"timer": "", | |
"name": "kill cloudcmd", | |
"x": 580.6112060546875, | |
"y": 500.6388854980469, | |
"wires": [ | |
[ | |
"e7128166.410ee8" | |
], | |
[ | |
"47fff11f.0ec948" | |
], | |
[] | |
] | |
}, | |
{ | |
"id": "e7128166.410ee8", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": true, | |
"console": "false", | |
"complete": "false", | |
"x": 918.7222290039062, | |
"y": 313.13885498046875, | |
"wires": [] | |
}, | |
{ | |
"id": "47fff11f.0ec948", | |
"type": "debug", | |
"z": "165dee9e.7db461", | |
"name": "", | |
"active": true, | |
"console": "false", | |
"complete": "false", | |
"x": 903.833251953125, | |
"y": 435.47222900390625, | |
"wires": [] | |
}, | |
{ | |
"id": "1d7148c3.3893c7", | |
"type": "trigger", | |
"z": "165dee9e.7db461", | |
"op1": "", | |
"op2": "0", | |
"op1type": "nul", | |
"op2type": "str", | |
"duration": "1", | |
"extend": false, | |
"units": "s", | |
"reset": "", | |
"name": "", | |
"x": 415.55560302734375, | |
"y": 501.111083984375, | |
"wires": [ | |
[ | |
"89f7d994.ee2c" | |
] | |
] | |
}, | |
{ | |
"id": "5958de7c.de376", | |
"type": "ui_group", | |
"z": "", | |
"name": "Console", | |
"tab": "734738ac.f4e0c8", | |
"order": 1, | |
"disp": true, | |
"width": "24" | |
}, | |
{ | |
"id": "734738ac.f4e0c8", | |
"type": "ui_tab", | |
"z": "", | |
"name": "CldCmd", | |
"icon": "dashboard", | |
"order": 1 | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment