(Math.round(Math.random() * 0x10000) + Date.now()).toString(16)
// 16c8e982dcd
// 16c95dc3c76
// 16cb7307195
This file contains hidden or 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
#!/bin/bash | |
useradd -m -d /home/$USER -s /bin/bash $USER | |
sudo -u$USER mkdir -p /home/$USER/.ssh | |
chmod 700 /home/$USER/.ssh | |
sudo -u$USER touch /home/$USER/.ssh/authorized_keys | |
chmod 600 /home/$USER/.ssh/authorized_keys | |
# Docker | |
usermod -aG docker $USER |
This file contains hidden or 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
// broker.js | |
"use strict"; | |
const { ServiceBroker } = require("moleculer"); | |
const Sequelize = require("./middlewares/sequelize"); | |
const broker = new ServiceBroker({ | |
middlewares: [Sequelize()] | |
}); | |
broker.createService({ | |
name: "service", |
This file contains hidden or 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
for i in $(seq 1 3); | |
do | |
docker-compose pull roach$i | |
docker-compose exec roach$i /cockroach/cockroach quit --insecure | |
docker-compose up -d --build roach$i | |
done |
This file contains hidden or 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
require("http").request({host:"localhost",port:80,timeout:2000},res=>process.exit(res.statusCode!==200)).on("error",()=>process.exit(1)); |
This file contains hidden or 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
#!/bin/sh -e | |
if [ $# != 3 ] | |
then | |
echo "usage: $0 <src-port> <dst-host> <dst-port>" | |
exit 0 | |
fi | |
TMP=`mktemp -d` | |
PIPE=$TMP/pipe |
ββββ ββββ βββββββ βββ ββββββββ ββββββββββ ββββββ βββββββββββββββ
βββββ βββββββββββββββββ βββββββββββββββββββ ββββββ ββββββββββββββββ
ββββββββββββββ ββββββ ββββββ βββ βββ ββββββ ββββββ ββββββββ
ββββββββββββββ ββββββ ββββββ βββ βββ ββββββ ββββββ ββββββββ
βββ βββ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββ
βββ βββ βββββββ ββββββββββββββββ βββββββ βββββββ βββββββββββββββββββ βββ
am e,bedded key/value database. Is good to be a modular database. If you wanna run applications on browser as well as in node.
its embedded it is in the same process. It lives in the program. It was built for chrome.
Since leveldb is a standalone database, you can install it with npm:
This file contains hidden or 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
describe("Test route.path and aliases", () => { | |
let broker; | |
let app; | |
let service; | |
let nextHandler = jest.fn((req, res) => res.sendStatus(200)); | |
beforeAll(() => { | |
broker = new ServiceBroker({ logger: false }); |