<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: The Coders Blog</title>
    <description>The latest articles on DEV Community by The Coders Blog (@thecodersblog).</description>
    <link>https://dev.to/thecodersblog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1210%2Fbce064d6-77a8-4683-a485-7ba1c6eff62e.png</url>
      <title>DEV Community: The Coders Blog</title>
      <link>https://dev.to/thecodersblog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thecodersblog"/>
    <language>en</language>
    <item>
      <title>Top E-commerce Security Threats to Online Shopping Sites</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sun, 03 Nov 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/top-e-commerce-security-threats-to-online-shopping-sites-36f</link>
      <guid>https://dev.to/thecodersblog/top-e-commerce-security-threats-to-online-shopping-sites-36f</guid>
      <description>&lt;p&gt;It doesn’t take a degree in computer science to know that the Internet is not a safe place. There are a lot of people out there that are &lt;em&gt;constantly trying to find new ways to hurt, shut down and steal from websites&lt;/em&gt; and from the people who use them. And, as you might guess, a lot of those people focus squarely on shopping sites, as they are quite closely linked to actual money. So, in this article, &lt;strong&gt;we are going to take a look at some eCommerce security threats&lt;/strong&gt; to online shopping sites that we feel pose the highest threat in modern times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common E-Commerce security threats to online shopping sites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to run a safe shopping site, there are a couple of things you need to do. By installing proper software, keeping your website updated and &lt;a href="https://thecodersblog.com/Insightful-Strategies-to-Improve-Your-Working-Folder"&gt;managing your files and folders properly&lt;/a&gt;, you should be safe from most eCommerce security threats to online shopping sites. But, &lt;em&gt;it doesn’t hurt for you to have an idea of what threats to online shopping sites are actually out there&lt;/em&gt;. Know that even a single breach in your security system can lead to multiple lawsuits. If that happens, &lt;strong&gt;it will be almost impossible to regain the necessary trust&lt;/strong&gt; for people to use your online shop.&lt;/p&gt;

&lt;p&gt;Therefore, it is essential that you &lt;strong&gt;have a clear idea of how to tackle your online shop safety&lt;/strong&gt;. And, to be aware of the common eCommerce security threats to online shopping sites.  Only then will you be able to properly run your shop and keep your customers’ info safe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bots&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even though bots can sometimes be useful in the &lt;a href="https://thecodersblog.com/javascript-in-2019/"&gt;front end developing of your website&lt;/a&gt;, they can be a serious threat to online safety. Namely, &lt;em&gt;some bots can infect your online shop and scrape it for inventory and pricing information&lt;/em&gt;. The hackers behind these bots will then use that information to alter the pricing and availability of your online store. They can even block your shopping carts by adding multiple products from different IP’s. This &lt;strong&gt;prevents your customers from buying the product&lt;/strong&gt; as they will only see that it is out of stock. This can easily lead to reduced revenue and bad shopping experience for your customers.&lt;/p&gt;

&lt;p&gt;There are even certain types of bots that simply reduce the efficiency of your website by choking your bandwidth. While this may seem trivial, &lt;em&gt;it often leads to reduced revenue and poor sales&lt;/em&gt;. So, if you feel that your website is not running in usually speed, make sure to check it out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Financial fraud&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Financial frauds are as old as the online shopping industry. Ever since it was conceived, &lt;em&gt;people have tried and sometimes succeeded in con online shops&lt;/em&gt;. Either through unauthorized transactions, fake refunds, or misrepresentation, they manage to swindle online shops and hurt their revenue. The oldest trick in the book is to &lt;strong&gt;request refunds for products that were illegally acquired&lt;/strong&gt; or simply damaged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spam&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have you implemented a commenting system on your online shop in order to make leaving reviews easier? &lt;em&gt;Then your website might be vulnerable to spam&lt;/em&gt;. Similar to email spams, these are useless or harmful messages left in your comment section. They can either simply fill up your comment section with frivolous information, thus &lt;strong&gt;worsening&lt;/strong&gt;  &lt;strong&gt;the shopping experience for your customers&lt;/strong&gt; , or they can even bring harmful websites that can cause further harm. Furthermore, spamming can affect your website performance. So you best pay close attention to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Phishing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Phishing is a hacking technique where a hacker will &lt;strong&gt;use your website to present themselves as a legitimate business&lt;/strong&gt;. They will email one of your potential or current clients and suggest a business deal. And they will probably stress that the current deal is tailor-made for them and that it has a narrow time limit. &lt;em&gt;If the client doesn’t go the extra mile to check up with you about the deal&lt;/em&gt;, they will inevitably fall into a trap. They will most likely give the hackers important information that is bound to do them harm. Unfortunately, the only way to deal with this is to always double-check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Malware&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Malware is a term used to describe &lt;em&gt;a malicious program made by hackers to automatically do harm to a website&lt;/em&gt;. This includes online shops, as they have their own set of vulnerabilities. They are the most common &lt;a href="https://thecodersblog.com/the-most-common-online-security-threats/"&gt;type of online security threats&lt;/a&gt;. Now, you have malware programs that will simply alter your online shop and either drop its performance or make it crash. Others will &lt;strong&gt;attempt to steal valuable information&lt;/strong&gt; , thus making your entire website unusable.&lt;/p&gt;

&lt;p&gt;The common thing about malware is that they are automatic. &lt;em&gt;These programs install and run on their own&lt;/em&gt;, which is why there is no brute way to fight them. The only way for you to keep your online shop safe from malware is by updating your site regularly and by &lt;a href="https://www.antivirusguide.com/best-anti-malware/?lp=default&amp;amp;utm_source=google&amp;amp;utm_medium=cpc&amp;amp;sgv_medium=search&amp;amp;utm_campaign=1911536381&amp;amp;utm_content=70051037185&amp;amp;utm_term=&amp;amp;cid=350136487431&amp;amp;pl=&amp;amp;feeditemid=71903152143&amp;amp;targetid=dsa-773688322724&amp;amp;mt=b&amp;amp;network=g&amp;amp;device=c&amp;amp;adpos=1t2&amp;amp;p1=&amp;amp;p2=&amp;amp;geoid=9077170&amp;amp;gclid=Cj0KCQjwjOrtBRCcARIsAEq4rW7AG8Xl2U315Rw4cP_rylbhDmC4v49wSLo1RJy-nwfL0D0shf4l0l0aAia8EALw_wcB"&gt;having the proper anti-malware software&lt;/a&gt;. Keep in mind that there is an ongoing battle between malware hackers and anti-malware providers. This is why it is so &lt;strong&gt;important to update your security system&lt;/strong&gt; as often as possible.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simple and Quick Guide to Install and Manage Elgg Project</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Thu, 26 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/simple-and-quick-guide-to-install-and-manage-elgg-project-pbf</link>
      <guid>https://dev.to/thecodersblog/simple-and-quick-guide-to-install-and-manage-elgg-project-pbf</guid>
      <description>&lt;p&gt;Elgg is a PHP based open-source software used for social networking in individuals and organizations. It has all the component needed to create an online social environment such as blogging, microblogging, file sharing, networking, group and number of other feature.&lt;/p&gt;

&lt;p&gt;Let’s dive into the setup process.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1. Install Composer
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://getcomposer.org/download/"&gt;https://getcomposer.org/download/&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2. Intall Elgg as a Composer Project
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer self-update
composer global require fxp/composer-asset-plugin
composer create-project elgg/starter-project:dev-master ./path/to/my/project
cd ./path/to/my/project
composer install

## go to your browser and install Elgg via the installation interface

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3. Setup version controls
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ./path/to/my/project
git init
git add .
git commit -a -m 'Initial commit'
git remote add origin &amp;lt;git repository url&amp;gt;
git push -u origin master

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3. Install plugins
&lt;/h4&gt;

&lt;p&gt;Install plugins as composer depencies. This assumes that a plugin has been registered on &lt;a href="https://packagist.org/"&gt;https://packagist.org/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer install hypejunction/hypefeed
composer install hypejunction/hypeinteractions
# whatever else you need

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 4. Commit
&lt;/h4&gt;

&lt;p&gt;Make sure &lt;code&gt;composer.lock&lt;/code&gt; is not ignored in &lt;code&gt;.gitignore&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -a -m 'Add new plugins'
git push origin master

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 5. Deploy to production
&lt;/h4&gt;

&lt;h6&gt;
  
  
  Initial Deploy
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ./path/to/www

# you can also use git clone
git init
git remote add origin &amp;lt;git repository url&amp;gt;
git pull origin master

composer install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Subsequent Deploys
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ./path/to/www
git pull origin master

# never run composer update in production
composer install

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Working on plugin repositories during project development
&lt;/h4&gt;

&lt;p&gt;It happens often that you want to make pull requests or update your plugins while you are working on a project. What I do is require plugins with –prefer-source flag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require hypejunction/hypefeed --prefer-source

# make some changes
cd hypeFeed
git checkout master
git commit -a -m 'Changes made'
git push origin master

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  References:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt; Image: Unsplash&lt;/li&gt;
&lt;li&gt;Elgg officail Guide.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Event-Driven Programming and Node JS Quick Review</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sun, 22 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/event-driven-programming-and-node-js-quick-review-1fe2</link>
      <guid>https://dev.to/thecodersblog/event-driven-programming-and-node-js-quick-review-1fe2</guid>
      <description>&lt;p&gt;&lt;strong&gt;Event-driven programming&lt;/strong&gt; is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads. In practice, it means that applications act on events.&lt;/p&gt;

&lt;h4&gt;
  
  
  NodeJS Thread Model
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;NodeJS is single-threaded.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Event Loop&lt;/em&gt; provides NodeJS event-driven programming.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Event Loop&lt;/em&gt; schedule tasks(/events)&lt;/li&gt;
&lt;li&gt;Each time an event occurs, it is placed in the Node’s event queue&lt;/li&gt;
&lt;li&gt;On each iteration of the event loop, a single event is dequeued and processed.&lt;/li&gt;
&lt;li&gt;If during the process, the event creates any additional events, they are simply added to the end of the queue along with a callback&lt;/li&gt;
&lt;li&gt;NodeJS uses callbacks to avoid waiting for blocking I/O.&lt;/li&gt;
&lt;li&gt;When the event is executed, control is returned to the event loop and another event is processed.&lt;/li&gt;
&lt;li&gt;When all events on NodeJS event queue are executed, NodeJS terminates the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Nodejs System
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthecodersblog.com%2Fuploads%2F687474703a2f2f692e737461636b2e696d6775722e636f6d2f4c6273397a2e706e6770.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthecodersblog.com%2Fuploads%2F687474703a2f2f692e737461636b2e696d6775722e636f6d2f4c6273397a2e706e6770.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Building blocks of NodeJS:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reactor Pattern&lt;/li&gt;
&lt;li&gt;libuv&lt;/li&gt;
&lt;li&gt;Set of Bindings&lt;/li&gt;
&lt;li&gt;V8&lt;/li&gt;
&lt;li&gt;Core JS Library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;I/O is Slow: *&lt;/em&gt; I/O is the fundamental operation of a computer and it is slow. Accessing the RAM is a matter of nanoseconds while accessing the data on disk or network is a matter starts in milliseconds.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Blocking I/O: *&lt;/em&gt; Traditionally, a system calls an I/O request that comes to a webserver and is assigned to an available thread or each concurrent connection there is a thread. The request is handled continuously on that thread until the request is complete and response is sent.  While handling the data between functions such as GetFile(file) &amp;amp; Open(File) there will be some amount of idle time. Thread consumes memory, so a long-running thread for each connection &amp;amp; not using it is not efficient.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traditional Non-Blocking I/O:&lt;/strong&gt;  A system call is returned immediately without waiting for the data to be read or written (&lt;em&gt;aka operation to complete&lt;/em&gt;) *&lt;em&gt;. *&lt;/em&gt; If no results are available at the moment of the call, the function will simply return a predefined constant, indicating that there is no data available to return at that moment. A loop iterate over the resource and when the resource is found (&lt;em&gt;the operation is completed&lt;/em&gt;) it is returned. This loop consumes CPU for iterating over the resource that is unavailable most of the time. This is called busy-waiting. Traditional Non-Blocking I/O.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Event Demultiplexing: *&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s a modern way of Non-Blocking I/O.&lt;/li&gt;
&lt;li&gt;For efficient Non-Blocking I/O there is synchronous event-demultiplexer (&lt;em&gt;aka&lt;/em&gt;:&lt;em&gt;event notification interface&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;It collects and queues I/O events that come from requests and block (&lt;em&gt;sits idly&lt;/em&gt; ) until new events are available to process.&lt;/li&gt;
&lt;li&gt;Each event is associated with a specific operation.&lt;/li&gt;
&lt;li&gt;Event notifier is set on the group of resources to be watched.

&lt;ul&gt;
&lt;li&gt;This call is synchronous and blocks(&lt;em&gt;idle time&lt;/em&gt;) until any of the watched resources are ready for a read.&lt;/li&gt;
&lt;li&gt;Event Demultiplexer returns from watched resources when they are being processed and a new set of events is available to be processed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Each event returned by the event demultiplexer is processed.&lt;/li&gt;

&lt;li&gt;When all the events are processed, the flow will block again(&lt;em&gt;there will be an idle time in between&lt;/em&gt;) on the event demultiplexer until new events are again available to be processed. &lt;strong&gt;This is called the event loop.&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;This way &lt;strong&gt;several I/O operations can be handled in a single thread.&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Advantages&lt;/strong&gt; :

&lt;ul&gt;
&lt;li&gt;minimalize idle time&lt;/li&gt;
&lt;li&gt;having a single thread handle multiple requests&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Reactor Pattern&lt;/strong&gt;
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Reactor Pattern have a handler(_in case of Nodejs, have a  &lt;strong&gt;callback function&lt;/strong&gt; _) associated with each I/O operation.&lt;/li&gt;
&lt;li&gt;This handler/callback function is invoked when event is produced &amp;amp; processed by Event Loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  What happens in an Application using the Reactor Pattern?
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Application generates I/O request by submitting request to Event Demultiplexer

&lt;ul&gt;
&lt;li&gt;The application also specifies handler/callback function which will be invoked when operation completes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Submitting a new request to the Event Demultiplexer is a non-blocking call and it immediately returns the control back to the application.&lt;/li&gt;

&lt;li&gt;When I/O operation completes, the Event Demultiplexer pushes the new events into the Event Queue.&lt;/li&gt;

&lt;li&gt;At this point, the Event Loop iterates over the items of the Event Queue.&lt;/li&gt;

&lt;li&gt;For each event, the associated callback function is invoked.&lt;/li&gt;

&lt;li&gt;callback function will give control to the event loop when its execution completes.&lt;/li&gt;

&lt;li&gt;New asynchronous operations might be requested during the execution of the callback function, causing new operations to be inserted in the Event Demultiplexer&lt;/li&gt;

&lt;li&gt;When all items in Event Queue are processed, and there no pending operations in Event Demultiplexer, Node.js application will exit automatically.&lt;/li&gt;

&lt;/ul&gt;

&lt;h6&gt;
  
  
  libuv - Non-Blocking I/O Engine
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;It’s pronounced as “lib u v”&lt;/li&gt;
&lt;li&gt;Each operating system has its own interface for the Event Demultiplexer

&lt;ul&gt;
&lt;li&gt;eg:  &lt;strong&gt;epoll on Linux, kqueue on Mac OS X &amp;amp; IOCP on Windows&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Each I/O operation can behave quite differently depending on the type of the request, even within the same OS.

&lt;ul&gt;
&lt;li&gt;This creates inconsistency&lt;/li&gt;
&lt;li&gt;To overcome this inconsistency, &lt;strong&gt;Nodejs Core team built libuv&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;libuv&lt;/strong&gt;  is a C library, created to make Node.js compatible with every OS &amp;amp; normalize the non-blocking behavior of the different OS types.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;libuv is a low-level I/O Engine&lt;/strong&gt;&lt;/li&gt;

&lt;li&gt;it implements &lt;a href="https://gist.github.com/amandeepmittal/aa55378c964184fa23c3d21f6848c27d#reactor-pattern" rel="noopener noreferrer"&gt;Reactor Pattern&lt;/a&gt;, providing an API for creating even loop, managing event queue, running asynchronous I/O operation.&lt;/li&gt;

&lt;/ul&gt;

&lt;h6&gt;
  
  
  Set of Bindings
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Responsible for wrapping and exposing libuv and other low-level functionality to JavaScript.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  V8
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript runtime engine&lt;/li&gt;
&lt;li&gt;Compiles and executes JS&lt;/li&gt;
&lt;li&gt;Developed by Google for Chrome browser&lt;/li&gt;
&lt;li&gt;Reason why Nodejs is fast&lt;/li&gt;
&lt;li&gt;V8 is acclaimed for its revolutionary design, its speed, and for its efficient memory management.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Core JS library
&lt;/h6&gt;

&lt;p&gt;A core JavaScript library (called node-core) that implements the high-level Node.js API&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>Complete List of Intelij Idea Shortcuts.</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sat, 21 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/complete-list-of-intelij-idea-shortcuts-550p</link>
      <guid>https://dev.to/thecodersblog/complete-list-of-intelij-idea-shortcuts-550p</guid>
      <description>&lt;p&gt;IntelliJ IDEA is one of the favorite IDE of Java developer. If you spend most of the time in this IDEA then this list is for you.&lt;/p&gt;

&lt;h3&gt;
  
  
  IntelliJ
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;F10&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Stop &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;F2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Enter&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Space&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sout&lt;/code&gt; + &lt;code&gt;Enter&lt;/code&gt; -&amp;gt; &lt;code&gt;System.out.println();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Click on Variable / Mehod / Class...&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Settings &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;S&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Project Structure &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;S&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Replace &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;F&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Find in path &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;F&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Duplicate Line &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;D&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Toggle Case &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;U&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Project View &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;F1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;TODO View &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;6&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;GOTO Class &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;N&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;GOTO File &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;N&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Generate Code &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Insert&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Surround with … &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;T&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Autoformat &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;L&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Switch Tool Windows &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Tab&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Line Comment &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Multi-Line Comment &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Move Statement &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;Arrowkeys&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Move Single Line &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;Arrowkeys&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Refactor&lt;/em&gt; Rename &lt;code&gt;Shift&lt;/code&gt; + &lt;code&gt;F6&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Structure &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;7&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;VCS &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;9&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;VCS&lt;/em&gt; Commit &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;K&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - &lt;em&gt;Git&lt;/em&gt; Revert &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;Alt&lt;/code&gt; + &lt;code&gt;Z&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;VCS Tab&lt;/em&gt; Show Diff &lt;code&gt;Ctrl&lt;/code&gt; + &lt;code&gt;D&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Packages, Repository and Package Manager in Linux</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Tue, 17 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/understanding-packages-repository-and-package-manager-in-linux-2jn0</link>
      <guid>https://dev.to/thecodersblog/understanding-packages-repository-and-package-manager-in-linux-2jn0</guid>
      <description>&lt;p&gt;One of the most important feature while choosing Linux distribution is its packaging system. Packages and Linux distribution keeps releasing frequently and to keep up with this blizzard of software we need good tools for package management.&lt;/p&gt;

&lt;h4&gt;
  
  
  Package Management
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Package Management&lt;/strong&gt; is a way of installing and maintaining software on the system. In the early days, one had to compile source code to install the software. Although, nothing wrong with compiling sources, these days we can install packages from their Linux distributor.&lt;/p&gt;

&lt;h5&gt;
  
  
  Packaging System
&lt;/h5&gt;

&lt;p&gt;Different distribution of Linux use a different packaging system and package intended for one distribution is not compatible with another distribution. Broadly, distribution falls into one of the two camps of packaging.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debian .deb&lt;/li&gt;
&lt;li&gt;Red Hat .rpm&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How a package system Works
&lt;/h4&gt;

&lt;p&gt;Unlike distribution found in proprietary software industry usually entails buying a pieces of installation media such as “install disk” or visiting vendor’s website and downloading the product and installing, mostly Linux application will be provided by the distribution vendor in the form of package files and rest will be available in source code form that can be installed manually.&lt;/p&gt;

&lt;h4&gt;
  
  
  Package Files
&lt;/h4&gt;

&lt;p&gt;In Linux, the package file is the basic unit of software. A packages file is a compressed collection of files that comprise the software packages. Additionally, it includes metadata about the packages. These packages are created by the developer know as &lt;strong&gt;package maintainer&lt;/strong&gt;. The package maintainer gets the software in source code form from the upstream provider (the author of the program), compiles it, and creates the package metadata and any necessary installation scripts. Often, the package maintainer will apply modifications to the original source code to improve the program’s integration with the other parts of the Linux distribution.&lt;/p&gt;

&lt;h4&gt;
  
  
  Repositories
&lt;/h4&gt;

&lt;p&gt;Those packages are made available to the user of distribution in central repository. Such repositories include many thousands of packages, each specially built and maintained for the distribution.&lt;/p&gt;

&lt;h4&gt;
  
  
  Dependencies
&lt;/h4&gt;

&lt;p&gt;Programs are seldom “stand-alone”; rather, they rely on the presence of other software components to get their work done. Common activities, such as input/output, for example, are handled by routines shared by many programs. These routines are stored in shared libraries, which provide essential services to more than one program. If a package requires a shared resource such as a shared library, it is said to have a dependency. Modern package management systems all provide some method of dependency resolution to ensure that when a package is installed, all of its dependencies are installed, too.&lt;/p&gt;

&lt;h4&gt;
  
  
  High- and Low-Level Package Tools
&lt;/h4&gt;

&lt;p&gt;Package management systems usually consist of two types of tools. • Low-level tools that handle tasks such as installing and removing package files • High-level tools that perform metadata searching and dependency resolution&lt;/p&gt;

&lt;h4&gt;
  
  
  Common Package Management Tasks
&lt;/h4&gt;

&lt;h5&gt;
  
  
  Finding a Package in a Repository
&lt;/h5&gt;

&lt;p&gt;Here is the package search command for two main distribution.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;apt-get update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;apt-cache search search_string&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;yum search search_string&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Installing a Package from a Repository
&lt;/h5&gt;

&lt;p&gt;High-level tools permit a package to be downloaded from a repository and installed with full dependency resolution&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;apt-get update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;apt-get install package_name&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;yum install package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Installing a Package from a Package File
&lt;/h5&gt;

&lt;p&gt;If a package file has been downloaded from a source other than a repository, it can be installed directly (though without dependency resolution) using a low-level tool.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;dpkg -i package_file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;rpm -i package_file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Because this technique uses the low-level rpm program to perform the installation, no&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;dependency resolution is performed. If rpm discovers a missing dependency, rpm will exit with an error. Also, it is similar for dpkg.&lt;/p&gt;

&lt;h5&gt;
  
  
  Removing a Package
&lt;/h5&gt;

&lt;p&gt;Packages can be uninstalled using either the high-level or low-level tools.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;apt-get remove package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;yum erase package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Updating Packages from a Repository
&lt;/h5&gt;

&lt;p&gt;The most common package management task is keeping the system up-to-date with the latest versions of packages. The high-level tools can perform this vital task in a single step&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;apt-get update; apt-get upgrade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;yum update&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Upgrading a Package from a Package File
&lt;/h5&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;dpkg -i package_file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;rpm -U package_file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;dpkg does not have a specific option for upgrading a package versus installing one as&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;rpm does.&lt;/p&gt;

&lt;h5&gt;
  
  
  Listing Installed Packages
&lt;/h5&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;dpkg -l&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;rpm -rq&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Determining Whether a Package Is Installed
&lt;/h5&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;dpkg -s package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;rpm -q package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Displaying Information About an Installed Package
&lt;/h5&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;apt-cache show package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;yum info package_name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h5&gt;
  
  
  Finding Which Package Installed a File
&lt;/h5&gt;

&lt;p&gt;To determine what package is responsible for the installation of a particular file.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Style&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Debian&lt;/td&gt;
&lt;td&gt;dpkg -S file_name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Red hat&lt;/td&gt;
&lt;td&gt;rpm -qf file_name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Step by step guide for hosting static site in github.</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sat, 14 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/step-by-step-guide-for-hosting-static-site-in-github-1pkh</link>
      <guid>https://dev.to/thecodersblog/step-by-step-guide-for-hosting-static-site-in-github-1pkh</guid>
      <description>&lt;p&gt;Github allow us to host static site in github for free. It also support static site builder like &lt;code&gt;jekyll&lt;/code&gt;. But let’s limit this article on hosting plain static site.&lt;/p&gt;

&lt;h5&gt;
  
  
  Simple steps for hosting static sites.
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Create a github account if you already don’t have one &lt;a href="https://github.com"&gt;here”&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Advance user can use git &amp;amp; terminal to sync and push it to github&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Download either GitHub for Mac or GitHub for Windows, depending on your operating system. Open the app and log in using the account you just created. [For the advance user, you can use terminal and ssh to clone repository].&lt;/li&gt;
&lt;li&gt;[For Mac:]After you login, click advanced and make sure that your name and email are correct. Then, click “Install Command Line Tools”, just in case you want to start using the command line later in life.&lt;/li&gt;
&lt;li&gt;Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the “Push to GitHub?” box is checked.&lt;/li&gt;
&lt;li&gt;Move your website’s files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called “index.html”, and it must exist in the top-level directory.&lt;/li&gt;
&lt;li&gt;Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a message in the text box called “commit summary”, something like “initial commit.” Then, click the commit button.&lt;/li&gt;
&lt;li&gt;Click the “Publish repo” button in the top right corner.&lt;/li&gt;
&lt;li&gt;Give it about 10 minutes, then check your-username.github.io. Your website should be there!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Using a custom domain name
&lt;/h4&gt;

&lt;p&gt;You can just leave your website at that address (it’ll give you some serious street cred in the developer world), but if you have a custom domain you would like to use, it is very simple to make GitHub redirect your page.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your domain registrar and find where to change your host records. If you don’t know, you can usually Google “(domain registrar) change host records”, and your registrar will have an explainer telling you how to do it.&lt;/li&gt;
&lt;li&gt;Change your domain’s A Record to 185.199.108.153. This is GitHub’s IP address, which allows GitHub to resolve your URL and serve the correct files.&lt;/li&gt;
&lt;li&gt;In your website’s directory folder on your computer, create a file called “CNAME”. On the first line, type your domain name. Save the file.&lt;/li&gt;
&lt;li&gt;In your GitHub application, you should see the file in the left column. Make sure it is checked and enter your commit message. Have it say something like “Adding CNAME file.”&lt;/li&gt;
&lt;li&gt;Click “Sync branches.”&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It can take as long as 48 hours for your domain to resolve to your GitHub page. However, it is usually pretty quick, so check back in an hour or so.&lt;/p&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Reset root or user password of linux (Ubuntu/debian) OS</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sat, 14 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/reset-root-or-user-password-of-linux-ubuntu-debian-os-8h5</link>
      <guid>https://dev.to/thecodersblog/reset-root-or-user-password-of-linux-ubuntu-debian-os-8h5</guid>
      <description>&lt;p&gt;If you accidentals locked-out or want to change the root/user password at any cost - you can reset it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Side effect &amp;amp; Note: Previous users &lt;code&gt;login.keyring&lt;/code&gt; will not work. Hence, you will loss all previously saved wifi/network drives as well as Google Chrome profile settings (until you remember the old password and unlock it).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  To reset follow the following steps.
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Reboot pc&lt;/li&gt;
&lt;li&gt;Hold &lt;em&gt;SHIFT&lt;/em&gt; during boot to start &lt;em&gt;GRUB&lt;/em&gt; menu&lt;/li&gt;
&lt;li&gt;Highlight your image and press &lt;em&gt;E&lt;/em&gt; to edit &lt;em&gt;GRUB&lt;/em&gt; config (change will reset after reboot)&lt;/li&gt;
&lt;li&gt;Find the line starting with “linux”&lt;/li&gt;
&lt;li&gt;Append &lt;code&gt;rw init=/bin/bash&lt;/code&gt; at the end of that line&lt;/li&gt;
&lt;li&gt;Press &lt;em&gt;CTRL + X&lt;/em&gt; to continue the boot&lt;/li&gt;
&lt;li&gt;Change password with command &lt;code&gt;passwd USERNAME&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reboot with CTRL+ALT+DEL&lt;/li&gt;
&lt;li&gt;Log in using the new password&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to backup your keyring file to try unlocking it later save the following file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/home/user/.local/share/keyrings/login.keyring
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
    </item>
    <item>
      <title>Guide to expert, an awesome tool to automatically interact with applications that run in terminal</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sat, 14 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/guide-to-expert-an-awesome-tool-to-automatically-interact-with-applications-that-run-in-terminal-166e</link>
      <guid>https://dev.to/thecodersblog/guide-to-expert-an-awesome-tool-to-automatically-interact-with-applications-that-run-in-terminal-166e</guid>
      <description>&lt;p&gt;&lt;strong&gt;Expect&lt;/strong&gt; is an awesome tool to automatically interact with applications that run in terminal. &lt;strong&gt;Expect&lt;/strong&gt; script allows us to start an application, then to monitor the &lt;strong&gt;stdout&lt;/strong&gt; and to send messages to the &lt;strong&gt;stdin&lt;/strong&gt; of that application when it detects a certain &lt;strong&gt;stdout&lt;/strong&gt; pattern occurs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic concept
&lt;/h2&gt;

&lt;p&gt;Core functionality of &lt;strong&gt;Expect&lt;/strong&gt; consists of: &lt;strong&gt;spawn&lt;/strong&gt; , &lt;strong&gt;expect&lt;/strong&gt; , and &lt;strong&gt;send&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;spawn&lt;/strong&gt; : start the process that we want to monitor/control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;expect&lt;/strong&gt; : wait and only do the next action when other detect a certain pattern in the monitored stdout or timeout is triggered.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;send&lt;/strong&gt; : send text to the stdin of the monitored application.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Other build-in variables and functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;timeout&lt;/strong&gt; : setting timeout for expect. (&lt;em&gt;-1&lt;/em&gt;) means disabling timeout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;puts&lt;/strong&gt; : write text to the interactive screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;wait&lt;/strong&gt; : wait until the monitored process stops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sleep&lt;/strong&gt; : sleep the expect script for a certain amount of time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$argv&lt;/strong&gt; : array of input parameters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;eof&lt;/strong&gt; : the pattern that occurs when a spawn process is closed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;lindex&lt;/strong&gt; : access array element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;interact&lt;/strong&gt; : give user the interaction control.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expect&lt;/strong&gt; also provides the concept of global and local variables and functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following pseudo-code defines function &lt;strong&gt;runcmd&lt;/strong&gt; with three parameters: &lt;strong&gt;X&lt;/strong&gt; , &lt;strong&gt;Y&lt;/strong&gt; , &lt;strong&gt;Z&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Keyword &lt;strong&gt;global&lt;/strong&gt; is used to access &lt;strong&gt;VAR&lt;/strong&gt; from inside &lt;strong&gt;runcmd&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$X&lt;/strong&gt; refers to variable &lt;strong&gt;X&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Line with &lt;strong&gt;#&lt;/strong&gt; at the beginning indicates comments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;arg1&lt;/strong&gt; and &lt;strong&gt;arg2&lt;/strong&gt; capture input parameters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set arg1 [lindex $argv 0]
set arg2 [lindex $argv 1]

set VAR "..."

# define function runcmd
proc runcmd{ X , Y , Z } {

    global VAR
    ...
    puts "X=$X"
}
# call function runcmd with X=A,Y=B,Z=C
runcmd A,B,C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;p&gt;The following function tries to access to a ssh server that requires to enter password and run a script in a certain directory. Script, directory, and server are input parameters of that function. In the main script, that function is called to &lt;em&gt;stop tomcat service&lt;/em&gt; inside &lt;em&gt;/opt/tomcat&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET SSHPWD "xxxxxx"
#--------------------------------------------------------------------
# run cmd in directory of remote server 
#--------------------------------------------------------------------
proc runcmd { script , dir , server } {

    global SSHPWD

    puts "------------------------------------------------------------"
    puts " run - $script - in - $dir - of - $server -"
    puts "------------------------------------------------------------"

    # never timeout
    set timeout -1 

    # login remote server
    spawn ssh $server
    expect "password:"
    send "$SSHPWD\r"

    # change to root
    expect "\[user@"  
    send "sudo -s\r"
    expect "root@"

    # run cmd  
    send "cd $dir\r"
    send "pwd\r"
    send "\r"
    send "$script \r"
    send "\r"

    # logout    
    send "exit\r"
    send "exit\r"

    # connection is closed
    expect "closed\."

    puts "------------------------------------------------------------"
    puts " finish - $script -"
    puts "------------------------------------------------------------"

    sleep 10

}

runcmd "service tomcat7 stop" , "/opt/tomcat/" , "server"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
    </item>
    <item>
      <title>How to enable swap in ubuntu and debian?</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Sat, 14 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/how-to-enable-swap-in-ubuntu-and-debian-5i5</link>
      <guid>https://dev.to/thecodersblog/how-to-enable-swap-in-ubuntu-and-debian-5i5</guid>
      <description>&lt;h5&gt;
  
  
  What is swap space?
&lt;/h5&gt;

&lt;p&gt;Swap space in any operating system is amount of disk space reserve for moving inactive pages from RAM. Swap space are of two type dedicate swap or of swap files in linux OS. Here we will create a swap file for the linux system.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We assume that the system does have not swap partition for this guide.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h5&gt;
  
  
  Check if your system already exist swap partition.
&lt;/h5&gt;

&lt;p&gt;Open the terminal, and enter the following command to check.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swapon --show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Check free memory and disk.
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;free h
 //or
 df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have sufficient space in you hard-disk then lets continue.&lt;/p&gt;

&lt;h5&gt;
  
  
  Step:1 Make swap off
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swapoff /var/swapfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 2: Resize the swapfile
&lt;/h5&gt;

&lt;p&gt;Here let us increase to 2GB (assuming existing one has 1GB space as given in the article)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dd if=/dev/zero of=/var/swapfile bs=1024k count=2000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 3: Make swapfile usable
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkswap /var/swapfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 4: Make swapon
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swapon /var/swapfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 5: Change permission to 0600
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 0600 /var/swapfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 6: Verify the swapfile
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;swapon -show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  Step 7: Make swap file permanent
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo '/var/swapfile none swap sw 0 0' | tee -a /etc/fstab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
    </item>
    <item>
      <title>How to run meteor in windows and Ubuntu using vagrant?</title>
      <dc:creator>Mohan Upadhyay</dc:creator>
      <pubDate>Thu, 12 Sep 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/thecodersblog/how-to-run-meteor-in-windows-and-ubuntu-using-vagrant-1ejh</link>
      <guid>https://dev.to/thecodersblog/how-to-run-meteor-in-windows-and-ubuntu-using-vagrant-1ejh</guid>
      <description>&lt;p&gt;Here are the steps for running meteor in windows and Ubuntu using vagrant.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.virtualbox.org/wiki/Downloads"&gt;Download VirtualBox&lt;/a&gt; [Vagrant runs on top of VirtualBox, so you need it]&lt;/li&gt;
&lt;li&gt;&lt;a href="http://downloads.vagrantup.com/"&gt;Download latest Vagrant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://git-scm.com/download/win"&gt;Download git&lt;/a&gt; [It will install ssh binaries required by Vagrant and let you connect to the VM]&lt;/li&gt;
&lt;li&gt;Create a folder to store your Vagrant files + Meteor project&lt;/li&gt;
&lt;li&gt;Copy script below and save it as meteor.sh into that folder.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install -y git mongodb-10gen curl
cd /usr/local
wget http://nodejs.org/dist/v0.8.23/node-v0.8.23-linux-x86.tar.gz
sudo tar -xvzf node-v0.8.23-linux-x86.tar.gz --strip=1
rm -f node-v0.8.23-linux-x86.tar.gz
curl https://install.meteor.com | sudo sh
sudo npm install -g meteorite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Steps on Windows command-line:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to Start Menu &amp;gt; Type cmd &amp;gt; SHIFT + ENTER (to login as Administrator)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd C:\path\to\your\vagrant+meteor\project\folder&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;set PATH=%PATH%;C:\Program Files (x86)\Git\bin&lt;/code&gt; (Append git binaries to path so vagrant can run ssh)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vagrant init precise32 http://files.vagrantup.com/precise32.box&lt;/code&gt; (To install Ubuntu 10.04 x86)&lt;/li&gt;
&lt;li&gt;Edit the Vagrantfile with your preferred editor and add those four lines anywhere inside the &lt;code&gt;Vagrant.configure(“2”)&lt;/code&gt; block:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config.vm.provision :shell, :path =&amp;gt; "meteor.sh"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.provider "virtualbox" do |v|
    v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;vagrant up&lt;/code&gt; (It will download box, configure meteor and get it up)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;vagrant ssh&lt;/code&gt; (It will connect on the VM and expose its command-line)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that you are inside the VM command-line, you can use it as your server:&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps on Ubuntu command-line:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;cd /vagrant&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mrt create ~/meteorapp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mrt create meteorapp &amp;amp;&amp;amp; cd meteorapp &amp;amp;&amp;amp; rm -rf .meteor &amp;amp;&amp;amp; mkdir .meteor/&lt;/code&gt; (Check your Windows folder you’ve created. It will be there!)&lt;/li&gt;
&lt;li&gt;Input these lines:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mount --bind /home/vagrant/meteorapp/.meteor/ /vagrant/meteorapp/.meteor/
echo “sudo mount --bind /home/vagrant/meteorapp/.meteor/ /vagrant/meteorapp/.meteor/” &amp;gt;&amp;gt; ~/.bashrc &amp;amp;&amp;amp; source ~/.bashrc
mrt run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;It should be running on &lt;code&gt;http://localhost:3000&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The point here is to use the &lt;code&gt;.meteor&lt;/code&gt; folder of your app pointing to another place inside the VM (run &lt;code&gt;ls -la .meteor/&lt;/code&gt; on command-line and you will see the symbolic link), so Meteor uses the VM folder, not Windows folder, and won’t have permissions problems. You will also need to do all git flow inside Ubuntu command-line, because Windows can’t follow those links.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hints
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you do version control INSIDE THE VM, so the software can follow the symlink.&lt;/li&gt;
&lt;li&gt;To halt a vagrant VM: &lt;code&gt;vagrant halt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;To restart a vagrant VM without running all Meteor installation again: &lt;code&gt;vagrant reload --no-provision&lt;/code&gt; or just remove the shell path you’ve put on Vagrantfile on line 10.&lt;/li&gt;
&lt;li&gt;To destroy a VM: &lt;code&gt;vagrant destroy&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reference
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Meteor in Windows using Vagrant gist by @gabrielhpugliese.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>meteor</category>
    </item>
  </channel>
</rss>
