<?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: Wojciech Wernicki</title>
    <description>The latest articles on DEV Community by Wojciech Wernicki (@wojciech_space).</description>
    <link>https://dev.to/wojciech_space</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%2Fuser%2Fprofile_image%2F195511%2F7e4f0974-ed34-4298-987f-f05057c9827c.JPG</url>
      <title>DEV Community: Wojciech Wernicki</title>
      <link>https://dev.to/wojciech_space</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wojciech_space"/>
    <language>en</language>
    <item>
      <title>#TIL WebAPI: Intl.NumberFormat</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Mon, 31 Jul 2023 15:00:00 +0000</pubDate>
      <link>https://dev.to/wojciech_space/til-webapi-intlnumberformat-d9o</link>
      <guid>https://dev.to/wojciech_space/til-webapi-intlnumberformat-d9o</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qKE5l6Bs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uait70rphcanonzeu2wn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qKE5l6Bs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uait70rphcanonzeu2wn.png" alt='Picture displaying formatted money value "123.456.79 €" in the center of picture and JavaScript logo in the bottom' width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting. The Intl object provides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.&lt;sup id="fnref1"&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Recently I found very handful function for formatting numbers, currency or units — &lt;code&gt;Intl.NumberFormat&lt;/code&gt;, which formats values for given language and region.&lt;/p&gt;

&lt;p&gt;Documentation: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat"&gt;Intl.NumberFormat on MDN&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Image of JavaScript logotype used in thumbnail is licensed on &lt;a href="https://github.com/voodootikigod/logo.js/blob/master/LICENSE"&gt;MIT license&lt;/a&gt;, author: &lt;a href="https://github.com/voodootikigod"&gt;Christopher Williams&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://dev.toMDN%20Web%20Docs"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Migrate React project from create-react-app to Vite.js</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Sun, 30 Jul 2023 15:30:31 +0000</pubDate>
      <link>https://dev.to/wojciech_space/migrate-react-project-from-create-react-app-to-vitejs-1c57</link>
      <guid>https://dev.to/wojciech_space/migrate-react-project-from-create-react-app-to-vitejs-1c57</guid>
      <description>&lt;p&gt;Recently I had to replace create-react-app with Vite.js in one project at work. This is a thread of what I did to make that work:&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove CRA &amp;amp; install Vite.js
&lt;/h2&gt;

&lt;p&gt;This is pretty straight-forward, I uninstalled CRA and installed Vite.js packages. I followed an example for react-ts available at Vite documentation&lt;sup id="fnref1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add support for tests (Jest, React Testing Library)
&lt;/h2&gt;

&lt;p&gt;That one was tricky, but thanks to 2 articles&lt;sup id="fnref2"&gt;2&lt;/sup&gt; &lt;sup id="fnref3"&gt;3&lt;/sup&gt; on Medium (I will link to privacy-friendly versions) I managed to run tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vite config
&lt;/h2&gt;

&lt;p&gt;95% of config was easy to set up, the only thing I had to search online was how to force Vite into using HTTPS with some sort of certificate. It was possible with vite-plugin-basic-ssl&lt;sup id="fnref4"&gt;4&lt;/sup&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  All set up!
&lt;/h2&gt;

&lt;p&gt;It took me about an hour to set up Vite.js into desired configuration to allow that specific React+TypeScript project into running. I hope it will also help you to kickstart your migration CRA =&amp;gt; Vite.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://vitejs.dev/guide/#trying-vite-online"&gt;https://vitejs.dev/guide/#trying-vite-online&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;&lt;a href="https://scribe.rip/quick-jest-setup-with-vitejs-react-typescript-82f325e4323f"&gt;https://scribe.rip/quick-jest-setup-with-vitejs-react-typescript-82f325e4323f&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;&lt;a href="https://scribe.rip/how-to-setup-jest-and-react-testing-library-in-vite-project-2600f2d04bdd"&gt;https://scribe.rip/how-to-setup-jest-and-react-testing-library-in-vite-project-2600f2d04bdd&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn4"&gt;
&lt;p&gt;&lt;a href="https://github.com/vitejs/vite-plugin-basic-ssl"&gt;https://github.com/vitejs/vite-plugin-basic-ssl&lt;/a&gt; ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>react</category>
      <category>vite</category>
    </item>
    <item>
      <title>Add leading zeros to a number in JavaScript</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Sat, 14 Jan 2023 17:00:00 +0000</pubDate>
      <link>https://dev.to/wojciech_space/add-leading-zeros-to-a-number-in-javascript-2e3p</link>
      <guid>https://dev.to/wojciech_space/add-leading-zeros-to-a-number-in-javascript-2e3p</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ddu9c8eS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wojciech.space/content/images/2023/01/trailing-zeros.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ddu9c8eS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wojciech.space/content/images/2023/01/trailing-zeros.png" alt="Add leading zeros to a number in JavaScript" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I was looking for a more subtle solution for inserting leading zeros to a number than &lt;code&gt;if (number &amp;lt; 10) return `0${number}`;&lt;/code&gt;, I found &lt;a href="https://stackoverflow.com/questions/8089875/show-a-leading-zero-if-a-number-is-less-than-10/8089938#8089938"&gt;this answer on StackOverflow&lt;/a&gt;, which I want to expand to near-one line code snippet.&lt;/p&gt;

&lt;h3&gt;
  
  
  TypeScript:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pad-number.ts&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;padNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;leadingZeros&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;leadingZeros&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JavaScript:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pad-number.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;padNumber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;leadingZeros&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;}${&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;padStart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;leadingZeros&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>typescript</category>
    </item>
    <item>
      <title>[Day 6] Securing MongoDB</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Wed, 19 Aug 2020 20:11:37 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-6-securing-mongodb-5f2p</link>
      <guid>https://dev.to/wojciech_space/day-6-securing-mongodb-5f2p</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;After installing MongoDB on my machine, it's time to secure access to databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change default port
&lt;/h2&gt;

&lt;p&gt;In file &lt;code&gt;/etc/mongod.conf&lt;/code&gt; in section &lt;code&gt;net&lt;/code&gt; I changed value of &lt;code&gt;port&lt;/code&gt; from default 27017 to 5652:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;net&lt;/span&gt;:
  &lt;span class="k"&gt;port&lt;/span&gt;: &lt;span class="m"&gt;5652&lt;/span&gt;
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and restarted service with the command &lt;code&gt;sudo systemctl restart mongod&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a user with administrative rights
&lt;/h2&gt;

&lt;p&gt;After I changed default port when I want to access MongoDB in console, I have to provide new port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;mongo&lt;/span&gt; --port &lt;span class="m"&gt;5652&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful access, it's time to create a new user with administrative rights:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="k"&gt;admin&lt;/span&gt;

&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;"JohnDoe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;passwordPrompt&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;"userAdminAnyDatabase"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;"admin"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nv"&gt;"readWriteAnyDatabase"&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After confirmation, I need to pass a new password for the user, all thanks to &lt;code&gt;passwordPrompt&lt;/code&gt;. To be sure I can access MongoDB via new user, I &lt;code&gt;exit&lt;/code&gt; and log in again with the expended command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;mongo&lt;/span&gt; --port &lt;span class="m"&gt;5652&lt;/span&gt; -u JohnDoe -p --authenticationDatabase admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and type in the password.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enforcing login credentials
&lt;/h2&gt;

&lt;p&gt;Once again I'm heading into &lt;code&gt;/etc/mongod.conf&lt;/code&gt; file, where I should change &lt;code&gt;security&lt;/code&gt; section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="err"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;security&lt;/span&gt;:
  &lt;span class="k"&gt;authorization&lt;/span&gt;: "enabled"
&lt;span class="err"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and restarted once again service with the command &lt;code&gt;sudo systemctl restart mongod&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From now accessing MongoDB with authorization won't trigger any alert or access denial, but after typing in &lt;code&gt;show dbs&lt;/code&gt; nothing will be returned. If I want to see databases, I have to authorize myself the same way after I check if my new account does work.&lt;/p&gt;




&lt;p&gt;That was a pretty long process to secure databases. At this moment, I don't want to allow any external access to MongoDB, so it is hidden behind the firewall.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.mongodb.com/manual/mongo"&gt;https://docs.mongodb.com/manual/mongo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-secure-mongodb-on-ubuntu-20-04"&gt;https://www.digitalocean.com/community/tutorials/how-to-secure-mongodb-on-ubuntu-20-04&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@dtopkin1?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Dayne Topkin&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/security?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>[Day 5] Installing MongoDB</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Tue, 18 Aug 2020 22:19:16 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-5-my-100-days-of-configuring-vps-installing-mongodb-39cl</link>
      <guid>https://dev.to/wojciech_space/day-5-my-100-days-of-configuring-vps-installing-mongodb-39cl</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;After short &amp;amp; unexpected break, I'm back and ready to set up yet another thing on my VPS — today it's a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why MongoDB?
&lt;/h2&gt;

&lt;p&gt;I have two main reasons behind that choice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I don't have much experience with MongoDB;&lt;/li&gt;
&lt;li&gt;Which I want to use with GraphQL, also pretty unknown for me at the moment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installing MongoDB
&lt;/h2&gt;

&lt;p&gt;I followed the official tutorial provided by MongoDB, available &lt;a href="https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/"&gt;here&lt;/a&gt;. I need to install MongoDB in version 4.0 or above, otherwise, GraphQL won't work. Current documentation for MongoDB suggests installing version 4.4, so I will go with that.&lt;/p&gt;

&lt;p&gt;Most important steps of install process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;wget&lt;/span&gt; -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - &lt;span class="c1"&gt;# add Mongo's key to APT&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list &lt;span class="c1"&gt;# add MongoDB 4.4 to list of APT sources&lt;/span&gt;

&lt;span class="k"&gt;sudo&lt;/span&gt; apt update &lt;span class="c1"&gt;# update packages&lt;/span&gt;

&lt;span class="k"&gt;sudo&lt;/span&gt; apt install mongodb &lt;span class="c1"&gt;# install MongoDB&lt;/span&gt;

&lt;span class="k"&gt;sudo&lt;/span&gt; systemctl start mongod &lt;span class="c1"&gt;# start MongoDB service&lt;/span&gt;

&lt;span class="k"&gt;sudo&lt;/span&gt; systemctl enable mongod &lt;span class="c1"&gt;# allow MongoDB to self-start after server is rebooted&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After all these steps, MongoDB is installed, running in the background and ready to be started after machine reboot. I checked that by typing in &lt;code&gt;mongo&lt;/code&gt; into open SSH console.&lt;/p&gt;




&lt;p&gt;That's all for today! In the next post I will talk about how I secured database.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/"&gt;https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.mongodb.com/realm/graphql/"&gt;https://docs.mongodb.com/realm/graphql/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@jankolar?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Jan Antonin Kolar&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/database?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>[Day 4] Installing and configuring nginx</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Sat, 15 Aug 2020 19:36:04 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-4-my-100-days-of-configuring-vps-installing-and-configuring-nginx-3f1c</link>
      <guid>https://dev.to/wojciech_space/day-4-my-100-days-of-configuring-vps-installing-and-configuring-nginx-3f1c</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;It's time for me to set up a WWW server on my VPS! I will both set up nginx and secure it by adding an SSL certificate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing nginx
&lt;/h2&gt;

&lt;p&gt;This one is pretty straight-forward.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;sudo&lt;/span&gt; apt update
&lt;span class="k"&gt;sudo&lt;/span&gt; apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Firewall
&lt;/h2&gt;

&lt;p&gt;Next thing is to allow nginx to connect outside the server. I need to update UFW settings. First thing is to check up what nginx rules I should allow connecting through the firewall:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;sudo&lt;/span&gt; ufw app list
&lt;span class="c1"&gt;# Output&lt;/span&gt;
&lt;span class="k"&gt;Available&lt;/span&gt; applications:
  &lt;span class="k"&gt;Nginx&lt;/span&gt; Full
  &lt;span class="k"&gt;Nginx&lt;/span&gt; HTTP
  &lt;span class="k"&gt;Nginx&lt;/span&gt; HTTPS
  &lt;span class="k"&gt;OpenSSH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will allow &lt;code&gt;Nginx Full&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;sudo&lt;/span&gt; ufw allow "Nginx Full"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I should be able to see default nginx page when I hit the IP address of my machine:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N2tnzkdY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/hjxxxdp8utxmj00fhy26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N2tnzkdY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/hjxxxdp8utxmj00fhy26.png" alt="Default page served by nginx on my machine" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will skip here part of configuring a domain for nginx. I followed &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04#step-5-%E2%80%93-setting-up-server-blocks-(recommended)"&gt;this Digital Ocean&lt;/a&gt; — only step 5.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSL
&lt;/h2&gt;

&lt;p&gt;I followed instructions from &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04"&gt;this tutorial&lt;/a&gt; on Digital Ocean, all the steps that are written up there. In step 4. I chose that nginx should redirect all requests to secure HTTPS version.&lt;/p&gt;




&lt;p&gt;That's all for today's session. In the next one, I want to set up a database. See you tomorrow!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04"&gt;https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04"&gt;https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@neonbrand?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;NeONBRAND&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/internet?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>[Day 3] Additional server securing</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Fri, 14 Aug 2020 22:12:48 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-3-my-100-days-of-configuring-vps-additional-server-securing-56pf</link>
      <guid>https://dev.to/wojciech_space/day-3-my-100-days-of-configuring-vps-additional-server-securing-56pf</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;Today I want to strengthen the security of my server. I want to make it in two different ways: first using dependency &lt;code&gt;fail2ban&lt;/code&gt;, second is to enforce using SSH key when logging in.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;fail2ban&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Fail2ban scans log files (e.g. &lt;code&gt;/var/log/apache/error_log&lt;/code&gt;) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc. &lt;a href="https://www.fail2ban.org/wiki/index.php/Main_Page"&gt;(source)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;sudo apt install fail2ban&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;There won't be big changes for my needs, although it's recommended to make a local copy of config files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;sudo&lt;/span&gt; cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
&lt;span class="k"&gt;sudo&lt;/span&gt; cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only thing I will change in the default configuration of &lt;code&gt;fail2ban&lt;/code&gt; is to ban suspicious connections permanently except for 10 minutes. In &lt;code&gt;/etc/fail2ban/jail.conf&lt;/code&gt; I changed the value of field &lt;code&gt;bantime&lt;/code&gt; to a negative number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using SSH key for logging in
&lt;/h2&gt;

&lt;p&gt;I've already had my SSH key, so I will skip part of creating it. For interested people, I will leave a link to the documentation of creating SSH keys in References section.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration
&lt;/h3&gt;

&lt;p&gt;1) Copy SSH key to the server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;ssh&lt;/span&gt;-copy-id johndoe@XXX.XXX.XXX.XXX -p &lt;span class="m"&gt;12345&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ssh-copy-id&lt;/code&gt; will scan a computer for local SSH keys and copy them on the server. I had to confirm that I want to copy key by inputting password.&lt;/p&gt;

&lt;p&gt;2) Disable login by password&lt;/p&gt;

&lt;p&gt;After I was sure that I can log in with my key, I changed SSH configuration in file &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="err"&gt;.&lt;/span&gt; &lt;span class="err"&gt;.&lt;/span&gt; &lt;span class="err"&gt;.&lt;/span&gt;
&lt;span class="k"&gt;PasswordAuthentication&lt;/span&gt; &lt;span class="no"&gt;no&lt;/span&gt;
&lt;span class="err"&gt;.&lt;/span&gt; &lt;span class="err"&gt;.&lt;/span&gt; &lt;span class="err"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After save, I restarted SSH with &lt;code&gt;sudo systemctl restart ssh&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Discussion &amp;amp; suggestions
&lt;/h2&gt;

&lt;p&gt;I would like to ask you, especially when you're more experienced in setting up machines like mine: what should I do to secure my server better? Which dependencies or config should I install/change? Thank you for your comments down below!&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.fail2ban.org/wiki/index.php/MANUAL_0_8"&gt;&lt;code&gt;fail2ban&lt;/code&gt; documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/enterprise/2.15/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent"&gt;Creating SSH keys — GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-20-04"&gt;Setting up log in by SSH key&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@jaye_haych?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Jaye Haych&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/keys?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>[Day 2] Securing server with firewall</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Thu, 13 Aug 2020 21:31:35 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-2-my-100-days-of-configuring-vps-securing-server-with-firewall-4cho</link>
      <guid>https://dev.to/wojciech_space/day-2-my-100-days-of-configuring-vps-securing-server-with-firewall-4cho</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;As I mentioned in previous post, today I will begin securing my server. Today's topic is disabling &lt;code&gt;root&lt;/code&gt; access and setting up firewall.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disable &lt;code&gt;root&lt;/code&gt; and changing default SSH port
&lt;/h2&gt;

&lt;p&gt;This one is very easy to achieve. With &lt;code&gt;nano&lt;/code&gt; I edited file &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; by adding rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;PermitRootLogin no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also I learned that you should change port for SSH from default 22. In the same file I entered new value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Port 12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, SSH service restart is needed by command &lt;code&gt;sudo service ssh restart&lt;/code&gt;. Now to log in to the server, I have to specify to which port I want to connect myself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh login@XXX.XXX.XXX.XXX &lt;span class="nt"&gt;-p&lt;/span&gt; 12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Firewall
&lt;/h2&gt;

&lt;p&gt;Most common dependency for firewall is UFW. It was preinstalled on my machine, so all I have to do is to set up necessary rules.&lt;/p&gt;

&lt;p&gt;The list of allowed communication both for IPv4 and IPv6 will be for now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH (only for new port)&lt;/li&gt;
&lt;li&gt;HTTP&lt;/li&gt;
&lt;li&gt;HTTPS
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;sudo&lt;/span&gt; ufw default deny incoming &lt;span class="c1"&gt;# by default ban all incoming connections&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw default allow outgoing &lt;span class="c1"&gt;# by default allow all outgoing connections&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw allow &lt;span class="m"&gt;12345&lt;/span&gt; &lt;span class="c1"&gt;# allow to connect to new SSH port&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw deny &lt;span class="m"&gt;22&lt;/span&gt; &lt;span class="c1"&gt;# deny to connect to old SSH port&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw allow http &lt;span class="c1"&gt;# allow to connect with HTTP connection (port 80)&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw allow https &lt;span class="c1"&gt;# allow to connect with HTTP connection (port 443)&lt;/span&gt;
&lt;span class="k"&gt;sudo&lt;/span&gt; ufw enable &lt;span class="c1"&gt;# enable firewall&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And very basic server securing is done! Tomorrow I will give a try with some other dependencies to prevent unauthorized access to my machine.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://askubuntu.com/questions/27559/how-do-i-disable-remote-ssh-login-as-root-from-a-server"&gt;Disabling &lt;code&gt;root&lt;/code&gt; access&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ubuntu18.com/ubuntu-change-ssh-port/"&gt;Changing SSH port&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04"&gt;Setting up firewall UFW&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@sonance?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Viktor Forgacs&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/firewall?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>[Day 1] Initial login to the server</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Wed, 12 Aug 2020 21:11:47 +0000</pubDate>
      <link>https://dev.to/wojciech_space/day-1-my-100-days-of-configuring-vps-initial-login-to-the-server-3bk6</link>
      <guid>https://dev.to/wojciech_space/day-1-my-100-days-of-configuring-vps-initial-login-to-the-server-3bk6</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;Today is my very first day of my challenge. I'm going to log in to my server for first time and configure all necessary settings: updating server's dependencies and setting up user's permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update
&lt;/h2&gt;

&lt;p&gt;After logging in, the very first thing you have to do is make sure all dependencies are up to date. For updating in Ubuntu there are two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;apt&lt;/span&gt; update
&lt;span class="k"&gt;apt&lt;/span&gt; upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;If you're getting error related to permissions, because you're not logged in as &lt;code&gt;root&lt;/code&gt;, put &lt;code&gt;sudo&lt;/code&gt; before each command.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Optionally, you can remove outdated packages by running command &lt;code&gt;apt autoremove&lt;/code&gt;, which I did.&lt;/p&gt;

&lt;h2&gt;
  
  
  New user
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;root&lt;/code&gt; account on daily basis is not the best move as it is the most powerful one on the machine, especially when you want to use it from SSH. I need to create new user that will have administrative rights.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I recommend you to use password manager for keeping your login informations. My first choice for storing passwords for free is &lt;a href="https://keepass.info/"&gt;KeePass&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To create new user, I typed in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;adduser&lt;/span&gt; johndoe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First I entered password and repeated it, then skipped all remaining fields and confirmed them. Second step of creating user is to grant permissions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;usermod&lt;/span&gt; -aG sudo johndoe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! For confirmation, I logged in to new account and run &lt;code&gt;sudo reboot now&lt;/code&gt; command.&lt;/p&gt;




&lt;p&gt;In next post I will talk about securing server by setting up firewall and disable &lt;code&gt;root&lt;/code&gt; access from ssh. See you tomorrow!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04"&gt;Digital Ocean documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Markus Spiske&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/sandbox?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>My 100 days of configuring VPS</title>
      <dc:creator>Wojciech Wernicki</dc:creator>
      <pubDate>Tue, 11 Aug 2020 21:55:30 +0000</pubDate>
      <link>https://dev.to/wojciech_space/my-100-days-of-configuring-vps-3fhj</link>
      <guid>https://dev.to/wojciech_space/my-100-days-of-configuring-vps-3fhj</guid>
      <description>&lt;p&gt;Hello guys!&lt;/p&gt;

&lt;p&gt;With this post, I want to start my journey with servers. My main challenge is to configure and maintain my own VPS machine. I'm going to describe how and why install and setup certain packages or optimize my applications and websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  VPS choice
&lt;/h2&gt;

&lt;p&gt;I picked VPS from OVH. In my opinion they have pretty good and cheap offer for private servers (starting from $3.50/month). I decided to go with "Essential" package that comes with 2 vCores, 4 GB RAM and 80 GB storage, which I consider to be enough for my needs. Also, during ordering server I chose Ubuntu 20.04 as operating system as that is my most favourite and known OS which I used to set up servers in the past.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why VPS?
&lt;/h2&gt;

&lt;p&gt;My current position is software developer, I specialize in frontend. I have a bunch of ideas I would love to create in the near future, also I wanted to connect this with learning how to set up and maintain private server, as I've forgotten how to do that during past few years.&lt;/p&gt;




&lt;p&gt;I hope you will enjoy this series and knowledge that I will share with you. Bear in mind that it won't be my original content, rather compilation of my new knowledge thanks to the Internet. At the end of each post I'm going to leave some links to documentation and sources which I used for each part of this process.&lt;/p&gt;




&lt;p&gt;Cover image: &lt;span&gt;Photo by &lt;a href="https://unsplash.com/@tvick?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Taylor Vick&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/server?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
