Skip to content

Instantly share code, notes, and snippets.

View deltapath-eric's full-sized avatar

Eric deltapath-eric

  • 13:08 (UTC +08:00)
View GitHub Profile
@deltapath-eric
deltapath-eric / tcp-socketio-sample.js
Created October 6, 2015 03:22 — forked from maripiyoko/tcp-socketio-sample.js
Node.js Tcp server & Socket.io
// socket io
var app = require('http').createServer(handler),
io = require('socket.io').listen(app),
fs = require('fs');
app.listen(3000, function() {
console.log('Socket IO Server is listening on port 3000');
});
function handler(req, res) {
# reboot
vim-cmd vmsvc/getallvms | grep -i HOSTNAME | cut -d ' ' -f 1 | xargs vim-cmd vmsvc/power.reboot
# get ip address
vim-cmd vmsvc/getallvms | grep -i HOSTNAME | cut -d ' ' -f 1 | xargs vim-cmd vmsvc/get.guest | grep ipAddress | sed -n 1p | cut -d '"' -f 2