To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
| var net = require('net'); | |
| var tunnel = null; | |
| var target = null; | |
| // tunnel server | |
| var serverInfo = {port:8811, host:"public.server.com"}; | |
| // target device we want to access on network where this script is running | |
| var targetInfo = {port:1001, host:"ip.local.network"}; | |
| function listen() |
| /* | |
| Before run the example copy and paste this function into a browser console. | |
| Example: | |
| createBoundingBox($0); | |
| createBoundingBox(document.getElementById('element-id')); | |
| */ | |
| function createBoundingBox(parentEl) { | |
| var body = document.body; | |
| var pRect = parentEl.getBoundingClientRect(); | |
| var box = document.createElement('div'); |
| // sending to sender-client only | |
| socket.emit('message', "this is a test"); | |
| // sending to all clients, include sender | |
| io.emit('message', "this is a test"); | |
| // sending to all clients except sender | |
| socket.broadcast.emit('message', "this is a test"); | |
| // sending to all clients in 'game' room(channel) except sender |
| http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/ |
| curl -w "@curl-format.txt" -o /dev/null -s http://www.aduanacol.com |
| // a list of useful queries for profiler analysis. Starting with the most basic. | |
| // 2.4 compatible | |
| // | |
| // output explained: | |
| // | |
| { | |
| "ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred | |
| "op" : "query", // the operation type | |
| "ns" : "game.players", // the db and collection |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.