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 MongoClient = require('mongodb').MongoClient; | |
| var url = "mongodb://admin:adminadmin@$SERVER_IP:27017/exampleDb"; | |
| MongoClient.connect(url, { useNewUrlParser: true }, function(err, db) { | |
| if (err) throw err; | |
| var dbo = db.db("mydb"); | |
| var myobj = { name: "Company Inc", address: "Highway 37" }; | |
| dbo.collection("customers").insertOne(myobj, function(err, res) { | |
| if (err) throw err; | |
| console.log("1 document inserted"); |
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
| #!/usr/bin/env bash | |
| # Generate timestamped filename | |
| TIMESTAMPED_TAG=`date +%Y-%m-%d-%H%M%S` | |
| BACKUP_ARCHIVE="./jenkins-backup-${TIMESTAMPED_TAG}.tar.gz" | |
| # Inconceivable race condition avoidance | |
| if [-f $BACKUP_ARCHIVE ]; then | |
| rm ${BACKUP_ARCHIVE} | |
| fi |
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
| # ./$me.sh KEY_NAME | |
| docker exec -it redis bash -c "echo 'HGETALL $1' | redis-cli" | |
| #docker run --rm redis bash -c "echo 'HGETALL $1' | redis-cli" |
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
| Rest Elasticsearch samples |
OlderNewer