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
module.exports = async function() { | |
var MongoClient = require('mongodb').MongoClient; | |
var client; | |
const uri = 'mongodb://root:example@mongo:27017/admin?authSource=admin'; | |
if (!client) client = await MongoClient.connect(uri); | |
return { | |
db: client.db('sites'), | |
client: client |
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
// application start up | |
var express = require('express'); | |
var app = express(); | |
app.listen(3000); | |
var getResults = require('./getResults'); | |
app.get("/", async (req, res, next) => { | |
try { |
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
var express = require('express'); | |
var app = express(); | |
app.listen(3000); | |
var getresults = require('./myAsyncFunction'); | |
app.get("/", async (req, res, next) => { | |
try { | |
var results = await getresults(); | |
console.log("results:"+results); |
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
# no function name | |
module.exports = function (msg) { | |
console.log(msg); | |
}; |
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
var express = require('express'); | |
var app = express(); | |
app.listen(3000); | |
const r = require('./myAsyncFunction'); | |
app.get("/", async (req, res, next) => { | |
try { | |
var results = await r.getresults(); | |
console.log("results:"+results); |
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
RUN apk add ldb-dev libldap openldap-dev | |
RUN install-php-extensions ldap | |
php -m | grep ldap | |
php -i | grep string | |
# see packages installed already | |
apk -vv info | grep string | |
apk list - list available packages |
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
Power down the vm | |
vboxmanage list vms | |
"ubuntu" {31a76259-da84-401f-8fc6-54e335952346} | |
vboxmanage modifyvm 31a76259-da84-401f-8fc6-54e335952346 --natsettings1 1500,1024,1024,1024,1024 | |
reference: https://www.virtualbox.org/manual/ch08.html |
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
git checkout --orphan newbranch | |
//you will not see your branch now using git branch -a | |
git rm -rf . | |
// add your files | |
git add your files | |
git commit -m 'Initial commit' | |
//you will see your branch now using git branch -a |
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
# swapoff -v ./file | |
# rm -f ./file |
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
Virtualbox | |
Devices -> Shared Folders -> Shared folder settings | |
Folder Path: choose local Host folder to share | |
Folder Name: georgel | |
Mount point: /home/georgel/share | |
you have to type mount -t command below | |
Assumption: "georgel" is the shared folder name set up | |
via Devices | shared folders ... menu |
NewerOlder