<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajan Maharjan on Medium]]></title>
        <description><![CDATA[Stories by Rajan Maharjan on Medium]]></description>
        <link>https://medium.com/@rajanmaharjan?source=rss-fed5def68520------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Zw_NlcMeBlIOdDLM9XGsWA.jpeg</url>
            <title>Stories by Rajan Maharjan on Medium</title>
            <link>https://medium.com/@rajanmaharjan?source=rss-fed5def68520------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 23:37:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajanmaharjan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Basic server for MEAN stack]]></title>
            <link>https://rajanmaharjan.medium.com/basic-server-for-mean-stack-212ab7a13cf9?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/212ab7a13cf9</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[pm2]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Thu, 10 May 2018 06:58:45 GMT</pubDate>
            <atom:updated>2018-05-10T07:04:52.167Z</atom:updated>
            <content:encoded><![CDATA[<p>Run NodeJS Server and AngularJS application in single ubuntu server</p><p>Here, we will have two parts:</p><ul><li>Installation</li><li>Setup</li></ul><p>Will be installing following;</p><ul><li>Nginx</li></ul><blockquote>Nginx works as a front end server, which in this case proxies the requests to a node.js server.</blockquote><ul><li>NodeJS</li></ul><blockquote>Cross-platform <strong>JavaScript</strong> run-time environment that executes <strong>JavaScript</strong> code <strong>server</strong>-side</blockquote><ul><li>Yarn</li></ul><blockquote>Fast, reliable, and secure dependency management.</blockquote><ul><li>Pm2</li></ul><blockquote>Advanced process manager for production Node.js applications</blockquote><ul><li>MongoDB</li></ul><blockquote>MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need</blockquote><ul><li>Git</li></ul><blockquote><strong>Git</strong> (/ɡɪt/) is a version control system</blockquote><h3><strong>INSTALLATION PART</strong></h3><h4>1. Install Nginx</h4><blockquote>sudo apt-get install nginx</blockquote><p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04"><em>Reference</em></a></p><p>2. <strong>Install Node</strong></p><blockquote><em>Will be installing node using nvm, so first we have to install nvm;</em></blockquote><blockquote>curl -o- <a href="https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh">https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh</a> | bash</blockquote><blockquote>export NVM_DIR=”$HOME/.nvm”<br> [ -s “$NVM_DIR/nvm.sh” ] &amp;&amp; \. “$NVM_DIR/nvm.sh” # This loads nvm</blockquote><blockquote><em>Install Node:</em></blockquote><blockquote>nvm install — lts</blockquote><p><a href="https://github.com/creationix/nvm">Reference</a></p><p>3. Install Yarn</p><blockquote>curl -sS <a href="https://dl.yarnpkg.com/debian/pubkey.gpg">https://dl.yarnpkg.com/debian/pubkey.gpg</a> | sudo apt-key add -<br>echo “deb <a href="https://dl.yarnpkg.com/debian/">https://dl.yarnpkg.com/debian/</a> stable main” | sudo tee /etc/apt/sources.list.d/yarn.list</blockquote><p><a href="https://yarnpkg.com/lang/en/docs/install/#debian-stable">Reference</a></p><p>4. Install PM2</p><blockquote>sudo npm install pm2 -g</blockquote><p><a href="https://www.digitalocean.com/community/tutorials/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps">Reference</a></p><p>5. Install Git</p><blockquote>sudo apt-get install git</blockquote><p>6. Install MongoDB</p><blockquote><em>sudo apt-key adv — keyserver hkp://keyserver.ubuntu.com:80 — recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5</em></blockquote><blockquote><em>echo “deb [ arch=amd64,arm64 ] </em><a href="https://repo.mongodb.org/apt/ubuntu"><em>https://repo.mongodb.org/apt/ubuntu</em></a><em> xenial/mongodb-org/3.6 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list</em></blockquote><blockquote><em>sudo apt-get update</em></blockquote><blockquote><em>sudo apt-get install -y mongodb-org</em></blockquote><blockquote>sudo systemctl start mongod</blockquote><blockquote>sudo systemctl enable mongod</blockquote><h4>Adding an Administrative User</h4><blockquote>mongo</blockquote><blockquote>use admin</blockquote><blockquote>db.createUser({user: “peacenepal”,pwd: “peacezone@123”, roles:[{role:”dbAdminAnyDatabase”, db: “admin”}]})</blockquote><blockquote>Type ‘exit’ and press ENTER or use CTRL+C to leave the client.</blockquote><blockquote>sudo nano /etc/mongod.conf</blockquote><p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04">Reference</a></p><h3>SETUP PART</h3><h4>NodeJs Server</h4><ul><li>Run the server using PM2</li></ul><p>Go to the project folder and run the following command</p><blockquote><strong>pm2 start app.js -i 2 — name api-server</strong></blockquote><p><strong>Note</strong>:<em> Command depends on your project</em></p><p>After that api would be accessible</p><blockquote>eg: http://&lt;SERVER_ADDRESS&gt;:&lt;PORT&gt;</blockquote><blockquote><strong>SERVER_ADDRESS</strong> ;<em> IP address or Domain name used for server access</em></blockquote><blockquote><strong>PORT</strong>; <em>used to start the NodeJs server</em></blockquote><h4>Angular App setup</h4><ul><li>First add the project files in the server in desired location</li><li>Configure the Nginx to server our app files</li></ul><p><strong>Create Nginx configuration</strong></p><p>Create new file in the following folder;</p><blockquote>/etc/nginx/sites-enabled/</blockquote><p>Add following details;</p><blockquote>server {</blockquote><blockquote>listen 80;</blockquote><blockquote>listen [::]:80;</blockquote><blockquote>root &lt;PROJECT_FOLDER_PATH&gt;;</blockquote><blockquote>index index.html index.htm index.nginx-debian.html;</blockquote><blockquote>server_name &lt;<strong>SERVER_ADDRESS</strong>&gt;;</blockquote><blockquote>location / {</blockquote><blockquote>try_files $uri $uri/ =404;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>Then reload the Nginx server with the following command to use the new server block.</p><blockquote>sudo systemctl reload nginx</blockquote><blockquote>sudo systemctl restart nginx</blockquote><p>What am I missing here? Let me know in the comments and I’ll add it in!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=212ab7a13cf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extension I use and WHY ???]]></title>
            <link>https://rajanmaharjan.medium.com/extension-i-use-and-why-308a6abf6e6d?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/308a6abf6e6d</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[development-and-growth]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Wed, 09 May 2018 11:32:59 GMT</pubDate>
            <atom:updated>2018-05-10T03:57:09.931Z</atom:updated>
            <content:encoded><![CDATA[<p>(CHROME BROWSER)</p><p>As a developer, you surf internet a lot during the development works; finding solutions to the problem and ideas for development works. So, in this article I’m going to talk about the extensions I use in the chrome browser and why you should start using them too. (It’s only about the preference. ;) and the development platform you work on.).</p><p><strong>List of extensions:</strong></p><ol><li>Wappalyzer — Identify web technologies</li><li>The Great Suspender — Automatically suspends unused tabs to free up system resources</li><li>Grammarly for Chrome — Enhance your written communication everywhere you type!</li><li>JSON Formatter — Makes JSON easy to read. Open source.</li><li>Unlimited Free VPN — Hola — Access websites blocked in your country, company or school with Hola! Hola is free and easy to use!</li><li>Email Tracking for Gmail &amp; Inbox — Mailtrack — Mail Tracking free forever and unlimited. Add double check marks (✓✓) to your Gmail &amp; Google Inbox.</li></ol><p>These are some selected list of the extension used and will add more soon. Thanks for reading.</p><p>Happy surfing ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=308a6abf6e6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Push notification platform for AWS SNS]]></title>
            <link>https://rajanmaharjan.medium.com/create-push-notification-platform-for-aws-sns-ae6c845735b4?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae6c845735b4</guid>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[sns]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[push]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Tue, 18 Jul 2017 06:56:19 GMT</pubDate>
            <atom:updated>2017-07-18T06:56:19.504Z</atom:updated>
            <content:encoded><![CDATA[<p>Steps:</p><ol><li>Add iOS Certificate in developer account</li><li>Obtain app private key (.p12 File)</li><li>Create push notification platform in SNS Dashboard</li></ol><h3>1. Add iOS Certificate</h3><p>First we have to create the iOS Certificates (Production / Development)</p><ol><li>Go to <a href="https://developer.apple.com/">https://developer.apple.com/</a></li></ol><h4>For Development</h4><ul><li>Certificates &gt; Development</li><li>Click + sign (top right corner)</li><li>Under Development section &gt; Select <strong>Apple Push Notification service SSL (Sandbox)</strong></li><li>Select the AppId (build Identifier of iOS application)</li><li>Create a CSR file. (Follow the instruction given)</li><li>Upload CSR file.</li><li>Download the cert file</li></ul><h4>For Production</h4><ul><li>Certificates &gt; Production</li><li>Click + sign (top right corner)</li><li>Under Production section &gt; Select <strong>Apple Push Notification service SSL (Sandbox &amp; Production)</strong></li><li>Select the AppId (build Identifier of iOS application)</li><li>Create a CSR file. (Follow the instruction given)</li><li>Upload CSR file.</li><li>Download the cert file</li></ul><h3>2. Obtain app private key (.p12 File)</h3><ul><li>Double click the .cer file downloaded from previous step</li><li>Open Keychain Access, select <strong>Keys</strong>, and then highlight your app private key.</li><li>Click <strong>File</strong>, click <strong>Export Items…</strong>, and then enter a name in the <strong>Save As:</strong> field.</li><li>Accept the default .p12 file format and then click <strong>Save</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*yHBfU-Q0NUsNnis-Ga9NFQ.png" /></figure><h3>3. Create Application for SNS in AWS</h3><ul><li>Go to <a href="https://console.aws.amazon.com/sns/">https://console.aws.amazon.com/sns/</a></li><li>Under Applications &gt; Create Platform Application</li><li>Give name for the application</li><li>Push notification platform <strong>&gt; Apple production</strong> (for production)</li><li>Push notification platform<strong> &gt; Apple production </strong>(for development)</li><li><strong>Push certificate type &gt; iOS push certificate (default)</strong></li><li>Choose the downloaded .p12 file</li><li><strong>Enter password (the one you kept in previous step for downloading)</strong></li><li>Click &gt; Load Credentials form file</li><li>Finally &gt; Create platform application</li></ul><p>That’s it!</p><p>Thanks for reading. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae6c845735b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uninstall MongoDB (MACOS) completely]]></title>
            <link>https://rajanmaharjan.medium.com/uninstall-mongodb-macos-completely-d2a6d6c163f9?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2a6d6c163f9</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[brew]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[launchagents]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 11:46:55 GMT</pubDate>
            <atom:updated>2017-07-13T11:47:40.877Z</atom:updated>
            <content:encoded><![CDATA[<p>Remove all the mongoDB contains before reinstalling</p><p>1. Check to see if any mongo service is running</p><pre><strong>launchctl list | grep mongo</strong></pre><p>2. Unload from LaunchAgents</p><pre><strong>launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist</strong></pre><pre><strong>rm -f ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist</strong></pre><pre><strong>launchctl remove homebrew.mxcl.mongodb</strong></pre><p>3. Kill all the processes related to mongod</p><pre><strong>pkill -f mongod</strong></pre><p>4. Uninstall the mongodb</p><pre># If installed via brew</pre><pre><strong>brew uninstall mongodb  </strong></pre><pre># If installed manually you can simply delete the folder</pre><pre><strong>rm -rf &lt;mongodb_folder&gt;</strong></pre><p>5. Re-confirming if mongo related file still exists</p><pre><strong>ls -al /usr/local/bin/mong*</strong></pre><pre><strong>ls -al ~/Library/LaunchAgents</strong></pre><p>6. If you have separate folder for db</p><pre><strong>rm -rf /usr/local/var/mongodb</strong></pre><pre><strong>rm -rf /data/db</strong></pre><p>That’s it! If there are still something I missed please comment below.</p><p>Thanks for read! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2a6d6c163f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure your MongoDB connections - SSL/TLS]]></title>
            <link>https://rajanmaharjan.medium.com/secure-your-mongodb-connections-ssl-tls-92e2addb3c89?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/92e2addb3c89</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[certificate-authority]]></category>
            <category><![CDATA[robomongo]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[tls]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Thu, 15 Jun 2017 08:58:11 GMT</pubDate>
            <atom:updated>2018-02-02T15:37:31.176Z</atom:updated>
            <content:encoded><![CDATA[<h4>We will learn to make secure connection between server and client by creating your own SSL CA (Certificate Authority)</h4><h3>What we will cover ?</h3><ol><li><em>MongoDB Installation</em></li><li><em>Creating own SSL CA to dump our self-signed certificate</em></li><li><em>Enabling TLS on a self-hosted or self-managed MongoDB server</em></li><li><em>Using SSL/TLS with the mongo shell</em></li><li><em>Using SSL/TLS with </em><a href="https://robomongo.org/"><strong><em>Robomongo</em></strong></a></li></ol><p>Note:</p><p>This tutorial works for Linux paltforms: (Ubuntu / MacOS)</p><h4>1. MongoDB Installation</h4><p>You can follow the official guideline for installation.</p><p><a href="https://docs.mongodb.com/manual/installation/">Install MongoDB</a></p><h4>2. Creating own SSL CA to dump our self-signed certificate</h4><p>We will be using OpenSSL to create own private certificate authority.</p><p>The process for creating your own certificate authority is pretty straight forward:</p><ol><li>Create a private key</li><li>Self-sign</li><li>Install root CA on your various workstations</li></ol><p>Once you do that, every device that you manage via HTTPS just needs to have its own certificate created with the following steps:</p><ol><li>Create CSR for client</li><li>Sign CSR with root CA key</li></ol><p>Creating the root certificate is easy and can be done quickly. Once you do these steps, you’ll end up with a root SSL certificate that you’ll install on all of your desktops, and a private key you’ll use to sign the certificates that get installed on your various devices.</p><p>The first step is to create the private root key which only takes one step. In the example below, I’m creating a 2048 bit key:</p><pre><strong>openssl genrsa -out rootCA.key 2048</strong></pre><blockquote><strong>Important note:</strong> Keep this private key <strong><em>very private</em></strong>. This is the basis of all trust for your certificates, and if someone gets a hold of it, they can generate certificates that your browser will accept. You can also create a key that is password protected by adding -des3:</blockquote><pre><strong>openssl genrsa -des3 -out rootCA.key 2048</strong></pre><p>The next step is to self-sign this certificate.</p><pre><strong>openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem</strong></pre><p>This will start an interactive script which will ask you for various bits of information. Fill it out as you see fit.</p><pre>You are about to be asked to enter information that will be incorporated<br>into your certificate request.<br>What you are about to enter is what is called a Distinguished Name or a DN.<br>There are quite a few fields but you can leave some blank<br>For some fields there will be a default value,<br>If you enter &#39;.&#39;, the field will be left blank.<br>-----<br>Country Name (2 letter code) [AU]:<strong>US</strong><br>State or Province Name (full name) [Some-State]:<strong>Oregon</strong><br>Locality Name (eg, city) []:<strong>Portland</strong><br>Organization Name (eg, company) [Internet Widgits Pty Ltd]:<strong>Overlords</strong><br>Organizational Unit Name (eg, section) []:<strong>IT</strong><br>Common Name (eg, YOUR name) []:<strong>Data Center Overlords</strong><br>Email Address []:<strong>none@none.com</strong></pre><p>Once done, this will create an SSL certificate called <strong><em>rootCA.pem</em></strong>, signed by itself, valid for 1024 days, and it will act as our root certificate. The interesting thing about traditional certificate authorities is that root certificate is also self-signed. But before you can start your own certificate authority, remember the trick is getting those certs in <em>every browser in the entire world</em>.</p><p><strong>Create A Certificate (Done Once Per Device)</strong></p><p>Every device that you wish to install a trusted certificate will need to go through this process. First, just like with the root CA step, you’ll need to create a private key (different from the root CA).</p><pre><strong>openssl genrsa -out mongodb.key 2048</strong></pre><p>Once the key is created, you’ll generate the certificate signing request.</p><pre><strong>openssl req -new -key mongodb.key -out mongodb.csr</strong></pre><p>You’ll be asked various questions (Country, State/Province, etc.). Answer them how you see fit. The important question to answer though is <strong>common-name</strong>.</p><pre>Common Name (eg, YOUR name) []:<strong> 10.0.0.1</strong></pre><p>Whatever you see in the address field in your browser when you go to your device <strong>must</strong> be what you put under common name, <em>even if it’s an IP address</em>. Yes, even an IP (IPv4 or IPv6) address works under common name. If it doesn’t match, even a properly signed certificate will not validate correctly and you’ll get the “cannot verify authenticity” error. Once that’s done, you’ll sign the CSR, which requires the CA root key.</p><pre><strong>openssl x509 -req -in mongodb.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out mongodb.crt -days 500 -sha256</strong></pre><p>This creates a signed certificate called device.crt which is valid for 500 days (you can adjust the number of days of course, although it doesn’t make sense to have a certificate that lasts longer than the root certificate).</p><p>Create <strong>.pem </strong>file;</p><pre><strong>cat mongodb.key mongodb.crt &gt; mongodb.pem</strong></pre><p>For more details :<strong> </strong><a href="https://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/"><strong><em>Creating-your-own-ssl-certificate-authority</em></strong></a></p><h4>3. <strong>Enabling TLS on a self-hosted or self-managed MongoDB server</strong></h4><p>Open <strong>/etc/mongod.conf</strong> with your favorite code editor and make sure it contains the following lines:</p><pre>net:<br>  port:27017<br>  bindIp: 127.0.0.1<br>  ssl:<br>    mode: <strong>requireSSL</strong><br>    PEMKeyFile: <strong>&lt;route-to-cert-file&gt;<br>    </strong>CAFile<strong>:</strong> <strong>&lt;route-to-ca-file&gt;</strong></pre><blockquote>If you can’t find <em>mongod.conf</em> or it is named <em>mongodb.conf</em> instead, it means that you are using a really old and broken version of MongoDB. <a href="https://medium.com/mongoaudit/how-to-upgrade-mongodb-to-latest-stable-version-9607266834cf#.ae4e3ud3s">Please read this guide on how to upgrade to a more recent version</a>.)</blockquote><p>Please replace <strong>&lt;route-to-cert-file&gt;</strong> with the route of the .pem file that contains the signed SSL certificate and key., e.g.: /etc/ssl/mongodb.pem<strong> </strong>.</p><p>Also replace <strong>&lt;route-to-ca-file&gt;</strong> with the route of the .pem file that contains the root certificate chain from the Certificate Authority, e.g.: /etc/ssl/ca.pem<strong> </strong>.</p><p>Now you are ready to save the configuration file and restart mongod:</p><pre>$ sudo<strong> service mongodb restart<br></strong>[ ok ] Restarting database: mongod.</pre><p><strong>IMPORTANT</strong>: Please keep reading this guide in order to know how to configure TLS in mongo client and the official drivers.</p><h4><strong>Using TLS with the mongo shell</strong></h4><p>Remember that from now on, to connect to your MongoDB server using the mongo client, you will need to specify some additional flags:</p><pre>$ mongo <strong>--ssl --sslCAFile</strong> /etc/ssl/ca.pem <strong>--sslPEMKeyFile</strong> /etc/ssl/client.pem <strong>--host</strong> host.example.com</pre><ul><li><strong>--ssl</strong> enables TLS channel encryption.</li><li><strong>--sslPEMKeyFile</strong> is the path to the client certificate — which needs to be signed by the server certificate.</li><li><strong>--sslCAFile </strong>is the path to the root certificate of the Certification Authority (CA) that signed the server certificate. From MongoDB 3.2.6, this parameter is optional, and if not specified, the client will check the certificate against the system CA store.</li><li><strong>--host</strong> <em>(optional) </em>verifies that the hostname of the server matches the one in the certificate it presents.</li></ul><p>For more details : <a href="https://medium.com/mongoaudit/how-to-enable-tls-ssl-on-mongodb-d973a92cefa6"><strong><em>How to Enable TLS/SSL on MongoDB</em></strong></a></p><h4>4. <em>Using SSL/TLS with </em><a href="https://robomongo.org/"><strong><em>Robomongo</em></strong></a></h4><p>Robomongo announced the new Robomongo with SSL support: <br>Robomongo 0.9.0 RC10!</p><p>Here is the link for details: <a href="http://blog.robomongo.org/robomongo-rc10/"><strong><em>Robomongo RC10 brings support to SSL</em></strong></a></p><p>If you have queries you can leave the comment. I’ll reach back to you as soon as possible.</p><p>Thanks for reading this and please recommend this if you liked.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92e2addb3c89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get started with ‘CodePush’ (React-Native)]]></title>
            <link>https://rajanmaharjan.medium.com/get-started-with-wonderful-technology-d838aafdc2d3?source=rss-fed5def68520------2</link>
            <guid isPermaLink="false">https://medium.com/p/d838aafdc2d3</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[code-push]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Rajan Maharjan]]></dc:creator>
            <pubDate>Thu, 08 Jun 2017 08:55:53 GMT</pubDate>
            <atom:updated>2018-05-15T09:59:22.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*EszqC4OMkvW0yKsFb0_3Zg.png" /></figure><h3>Microsoft ”CodePush“</h3><p><a href="https://microsoft.github.io/code-push">CodePush</a> is a cloud service that enables React Native &amp; Cordova developers to deploy mobile app updates <strong>instantly</strong> to their users’ devices.</p><h4>How it works ?</h4><p>It works by acting as a central repository that developers can publish updates to (JS, HTML, CSS and images), and that apps can query for updates from (using provided client SDKs for <a href="https://github.com/Microsoft/cordova-plugin-code-push">Cordova</a> and <a href="https://github.com/Microsoft/react-native-code-push">React Native</a>).</p><p>A React Native app is composed of JavaScript files and any accompanying <a href="https://facebook.github.io/react-native/docs/images.html#content">images</a>, which are bundled together by the <a href="https://github.com/facebook/react-native/tree/master/packager">packager</a> and distributed as part of a platform-specific binary (i.e. an .ipa or .apk file). Once the app is released, updating either the JavaScript code (e.g. making bug fixes, adding new features) or image assets, requires you to <strong>recompile and redistribute the entire binary</strong>, which of course, includes any <strong>review time</strong> associated with the store(s) you are publishing to.</p><h3>Integrating CodePush for React Native Project</h3><p>I’ll share my experience, with integrating “CodePush” for React Native Project. I found <a href="https://github.com/Microsoft/code-push">code-push</a> and <a href="https://github.com/Microsoft/react-native-code-push">react-native-code-push</a> documentation too long. So, it took quite long time for proper integration.</p><h4>We will be working on :</h4><ol><li>Create a <a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#account-creation">CodePush account</a> push using the CodePush CLI</li><li>Register your <a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#app-management">app</a> with CodePush, and optionally <a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#app-collaboration">share it</a> with other developers on your team</li><li>CodePush-ify your app and point it at the deployment you wish to use (<a href="http://github.com/Microsoft/cordova-plugin-code-push">Cordova</a> and <a href="http://github.com/Microsoft/react-native-code-push">React Native</a>)</li><li><a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#releasing-updates">Release</a> an update for your app</li><li>Check out the <a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#debugging-codepush-integration">debug logs</a> to ensure everything is working as expected</li><li>Live long and prosper! (<a href="https://en.wikipedia.org/wiki/Vulcan_salute">details</a>)</li></ol><h3>Install and Setup the CLI</h3><pre># Install the CLI<br>npm install -g code-push-cli<br><br># Register for an account via github or email<br>code-push register<br><br># Register your app. We call it AwesomeApp.<br>code-push app add AwesomeApp</pre><h3>Setup React Native Project</h3><p>cd to your React Native project and install the “plugin”.</p><pre>npm install --save react-native-code-push@latest</pre><p><strong>Plugin integration in project</strong></p><p>The integration experience is different for iOS and Android, so perform the following setup steps depending on which platform(s) you are targeting.</p><ul><li><a href="https://github.com/Microsoft/react-native-code-push/blob/master/docs/setup-ios.md">iOS Setup</a></li><li><a href="https://github.com/Microsoft/react-native-code-push/blob/master/docs/setup-android.md">Android Setup</a></li></ul><p>If you want configure your application for multiple deployment</p><p><a href="https://github.com/Microsoft/react-native-code-push#multi-deployment-testing">https://github.com/Microsoft/react-native-code-push#multi-deployment-testing</a></p><p>Next, setup the sync for your component. There are more <a href="https://github.com/Microsoft/react-native-code-push#codepush">options</a> on the syncing of the code eg. frequency, install etc.</p><p>Wrap your root component with the codePush higher-order component: example: <strong>index.android.js</strong> and <strong>index.ios.js</strong></p><pre><strong>class</strong> AwesomeApp <strong>extends</strong> Component {<br>  ...<br>}<br><br><strong>let</strong> codePushOptions <strong>=</strong> { <br>  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, <br>  installMode: codePush.InstallMode.ON_NEXT_RESUME <br>}</pre><pre>AwesomeApp <strong>=</strong> codePush(codePushOptions)(AwesomeApp);<br><br>module.exports <strong>=</strong> AwesomeApp</pre><p>Done with the integration part. Now you can build the release version on both platforms.</p><p><strong>For iOS</strong> :</p><p>Release build configuration (check your scheme), and run in Simulator or device.</p><p><strong>For Android :</strong></p><pre>react-native run-android --variant=releaseStaging</pre><h3><strong>Game Time : Push Live Code</strong></h3><h4>Releasing updates</h4><pre>code-push release &lt;appName&gt; &lt;updateContents&gt; &lt;targetBinaryVersion&gt; [--deploymentName &lt;deploymentName&gt;] [--description &lt;description&gt;] [--disabled &lt;disabled&gt;] [--mandatory] [--noDuplicateReleaseError] [--rollout &lt;rolloutPercentage&gt;]</pre><p>Make some changes to AwesomeApp now. Perhaps change a &lt;Text&gt;? Or a color?</p><p>Then push it:</p><p><strong>For iOS :</strong></p><pre>code-push release-react AwesomeApp ios </pre><p><strong>For Android:</strong></p><pre>code-push release-react AwesomeApp android</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uzbDlhjfVzzRqj7PTErS_g.png" /><figcaption>code-push release-react AwesomeApp android example</figcaption></figure><p>It should show upload successful as image above.</p><p>Bring the app to foreground, and it should still be the same (though it has now fetched the update).</p><p>Bring the app to background, then foreground again, and viola! It will install the new code and reflect the changes!</p><p>Other commands:</p><pre># Release a mandatory update with a changelog</pre><pre>code-push release-react MyApp-iOS ios -m --description &quot;Modified the header color&quot;<br><br># Release an update for an app that uses a non-standard entry file name, and also capture<br># the sourcemap file generated by react-native bundle</pre><pre>code-push release-react MyApp-iOS ios --entryFile MyApp.js --sourcemapOutput ../maps/MyApp.map<br><br># Release a dev Android build to just 1/4 of your end users</pre><pre>code-push release-react MyApp-Android android --rollout 25% --dev true<br><br># Release an update that targets users running any 1.1.* binary, as opposed to<br># limiting the update to exact version name in the build.gradle file</pre><pre>code-push release-react MyApp-Android android --targetBinaryVersion &quot;~1.1.0&quot;</pre><h4>Debugging the application</h4><p>You can view the logs in the terminal if the app is using the codepush bundleURL</p><p><strong>For iOS:</strong></p><p>Debug with running simulator</p><p>code-push debug ios</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OjStuSXgY3EN76AGDTVkw.png" /><figcaption>code-push debug iOS output example</figcaption></figure><p><strong>For android:</strong></p><p>Debug with with connected android device with app running.</p><p>code-push debug android</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZgnFCZAR5vjyXVr6d_0yXw.png" /><figcaption>code-push debug android output</figcaption></figure><h4>Checking Deployment History</h4><p>code-push deployment history &lt;app name&gt; &lt;deploymentName&gt;</p><pre>code-push deployment history AwesomeApp Staging</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*N1AZJo9vzvfHqSqnK8J9kA.png" /><figcaption>Sample output for deployment history</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*deydSKoxYjh8WRo03vsw7g.png" /><figcaption>Sample output for deployment history with error</figcaption></figure><h3>Pitfall: Not Getting Updates</h3><p>There are quite some <a href="https://microsoft.github.io/code-push/docs/react-native.html#link-13">pitfalls</a>, and the long documentation doesn’t help.</p><p>I hope this guide has been more concise (:</p><p>If you are not getting the update,</p><ul><li>make sure the version of the iOS app (in Info.plist), matches that when you <a href="https://github.com/Microsoft/code-push/blob/master/cli/README.md#releasing-updates-general">code push with targetBinaryVersion</a></li><li>make sure the app is using CodePush.bundleURL()</li><li>make sure the keys are correct, and you deploy production/staging correctly</li></ul><p>Anyway thanks to the official guide and <a href="http://samwize.com/2017/01/19/guide-to-integrating-codepush-for-ios-react-native-project/">http://samwize.com/2017/01/19/guide-to-integrating-codepush-for-ios-react-native-project/</a> for their effort.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d838aafdc2d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>