show dbs
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
/* SPDX-License-Identifier: GPL-2.0 | |
* | |
* Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved. | |
*/ | |
#include <winsock2.h> | |
#include <Windows.h> | |
#include <ws2ipdef.h> | |
#include <iphlpapi.h> | |
#include <mstcpip.h> |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
Here's all you have to do to add clustering to your node.js application.
- save this code as
cluster.js
, and runcluster.js
instead ofserver.js
(or /bin/www, or whatever it's called for your project) - the only line you'll need to change is the last line - it needs to point to the location of your
server.js
file
var cluster = require('cluster');
if (cluster.isMaster) {
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
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
var httpProxy = require('http-proxy') | |
var proxy = httpProxy.createProxy({ | |
ws : true | |
}); | |
var options = { | |
'herp.dev': 'http://0.0.0.0:9008', | |
'derp.dev' : 'http://0.0.0.0:3000' | |
} |