Skip to content

Instantly share code, notes, and snippets.

View sagarkt's full-sized avatar
🧩
building....

Sagar Kamble sagarkt

🧩
building....
  • Pune
View GitHub Profile
# Type(<scope>): <subject>
# <body>
# <footer>
# Type should be one of the following:
# * feat (new feature)
# * fix (bug fix)
# * docs (changes to documentation)
#
# Disable access to the entire file system except for the directories that
# are explicitly allowed later.
#
# This currently breaks the configurations that come with some web application
# Debian packages.
#
#<Directory />
# AllowOverride None
# Require all denied
@sagarkt
sagarkt / install.md
Created May 14, 2020 06:17
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@sagarkt
sagarkt / mongo_script
Created April 13, 2020 08:11
Loop Collection and Update documents in MongoDB
var collection = db.getCollection('collectionName');
var bulkOp = collection.initializeOrderedBulkOp();
var count = 0;
collection.find().forEach(function(doc) {
bulkOp.find({ '_id': doc._id }).updateOne({
'$set': { 'email': doc.email.replace('what to replace', 'replace with') }
});
count++;
if(count % 100 === 0) {
// Execute per 100 operations and re-init