http://carlosvin.github.io/posts/reverse-proxy-multidomain-docker/
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
| //Sample email that is received and whose details are extracted: | |
| /* | |
| *Someone* just submitted your form named Online Course Booking from your | |
| website | |
| https://www.abcd.com/ | |
| Message Details | |
| Full Name: Mohamed Ali | |
| Email Address: [email protected] | |
| Phone Number: 009725991122334 |
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
| db = db.getSiblingDB("whyd_music") // explicitely select collection | |
| var jan2014 = ObjectId("52c35a800000000000000000"); // created using http://steveridout.github.io/mongo-object-time/ | |
| db.post.aggregate([ | |
| {"$sort": {"_id": -1}}, // order: antichronological | |
| {"$match": {"_id": {"$gt": jan2014}}}, // only documents that were created after the 1syt january 2014 | |
| {"$group": {"_id": "$eId", // group by value of the eId attribute -> _id attribute in the resulting output collection | |
| "name": {"$first": "$name"}, // -> include the name of each grouped category | |
| "count": {"$sum": 1}}}, // -> count attribute will contain the number of documents for each value of _eid | |
| {"$match": {"count": {"$gt": 50}}}, // limit output to results with count > 50 | |
| {"$sort": {"count": -1}} // output order: highest count first |
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
| //package | |
| node-cron | |
| // import | |
| import cron from 'node-cron'; | |
| // calling | |
| const loginChecker = cron.schedule('0 0 */2 * * *', function () { | |
| if (Meteor.userId() === null) | |
| history.push("/login"); |
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
| import { Accounts } from 'meteor/accounts-base' | |
| Accounts.config({ | |
| loginExpirationInDays: 0.02 | |
| }) |
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
| # 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 | |
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
| Reports._collection.remove({}) |
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
| # METEOR APP DEPLOYMENT | |
| # ensure proper version of Meteor running inside your app | |
| 1. meteor update | |
| # or for specific release | |
| meteor update --release 1.3.1 | |
| # remove any existing bundle folder | |
| 2. rm -rf ~/bundle |
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
| ## REFERENCE : https://medium.com/@tomgoldenberg/deploying-a-meteor-app-with-nginx-from-scratch-1332b32e99a5#.tme24q15r | |
| ## Install Forevever | |
| > npm install -g forever | |
| > forever list | |
| # terminal will show below | |
| # info: No forever process running | |
| # cd to you app directory and run | |
| # check package.json and ensure no space in between in { "name": "APP_NAME" ..... } to prevent error |
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
| # Install NODE via NVM | |
| https://github.com/creationix/nvm | |
| # ############################################################################################################ | |
| MONGODB INSTALLATION | |
| # ref https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-ubuntu/ | |
| # ############################################################################################################ | |
| > sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 |
NewerOlder