<?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: postrecord</title>
    <description>The latest articles on DEV Community by postrecord (@postrecord).</description>
    <link>https://dev.to/postrecord</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%2F561236%2F7727362a-ae10-41c0-8bdb-3cac21fee124.png</url>
      <title>DEV Community: postrecord</title>
      <link>https://dev.to/postrecord</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/postrecord"/>
    <language>en</language>
    <item>
      <title>Year of the Linux Desktop 2021</title>
      <dc:creator>postrecord</dc:creator>
      <pubDate>Sun, 17 Jan 2021 00:37:24 +0000</pubDate>
      <link>https://dev.to/postrecord/year-of-the-linux-desktop-2021-4h1n</link>
      <guid>https://dev.to/postrecord/year-of-the-linux-desktop-2021-4h1n</guid>
      <description>&lt;p&gt;This year is the year of the Linux desktop... again.&lt;/p&gt;

&lt;p&gt;Linux is not a complete operating system like Windows, Mac or BSD Unix. They take the different free software packages and put them together with the Linux kernel, this is called a Linux distribution.&lt;/p&gt;

&lt;p&gt;Picking a &lt;a href="https://en.wikipedia.org/wiki/List_of_Linux_distributions" rel="noopener noreferrer"&gt;Linux distribution&lt;/a&gt; is hard. Besides many choices, you have to pick the right one for your needs. Do you need high performance or security? &lt;/p&gt;

&lt;p&gt;There are so many different Linux distributions.&lt;/p&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%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Fmemegenerator.net%252Fimg%252Finstances%252F62821409%252Fmind-blown.jpg%26f%3D1%26nofb%3D1" 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%2Fexternal-content.duckduckgo.com%2Fiu%2F%3Fu%3Dhttps%253A%252F%252Fmemegenerator.net%252Fimg%252Finstances%252F62821409%252Fmind-blown.jpg%26f%3D1%26nofb%3D1" alt="mind blown"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For getting work done, people usual use Ubuntu, OpenSuse or Fedora. Their packages are quite up to date and they are stable. But that doesn't mean they're &lt;a href="https://bsdnerds.org/zero-days-hitting-fedora-and-ubuntu/" rel="noopener noreferrer"&gt;secure&lt;/a&gt; by default. &lt;/p&gt;

&lt;p&gt;Ubuntu uses snap and apt packages at the same time, I don't like that. OpenSuse doesn't use the deb package management system but zypper and rpm. So you would go&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;zypper &lt;span class="nb"&gt;install &lt;/span&gt;package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of the Debian way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I don't trust Fedora, because Red Hat pulled the plug out of CentOS. Who's to say they don't do the same with Fedora?&lt;/p&gt;

&lt;h2&gt;
  
  
  Distros and forks
&lt;/h2&gt;

&lt;p&gt;There are only a handful core distributions. Most Linux distributions are fork of distributions. There are &lt;a href="https://futurist.se/gldt/wp-content/uploads/12.02/gldt1202.png" rel="noopener noreferrer"&gt;many&lt;/a&gt; of them.&lt;/p&gt;

&lt;p&gt;As the Debian folks would call it &lt;em&gt;a frankenlinux&lt;/em&gt;. Some of them are gone overnight or don't have long term support. That's why it wise to pick one that has long support.&lt;/p&gt;

&lt;p&gt;Debian, Slackware and RedHat have been around since 1993. RedHat is orientated to servers.&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F525kmgm94svxroqkofkp.jpeg" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F525kmgm94svxroqkofkp.jpeg" alt="linux distros"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Personal use
&lt;/h2&gt;

&lt;p&gt;Switching operating systems. I like to use &lt;a href="https://www.debian.org/" rel="noopener noreferrer"&gt;Debian&lt;/a&gt; based systems, because it has a really large user base. So if you run into a problem, you can quickly find a solution.&lt;/p&gt;

&lt;p&gt;I don't have time for Gentoo, Arch etc.. work to do. It should just work. One issue I have with Debian is that the packages are outdated, but I found you can install &lt;a href="https://www.kali.org/" rel="noopener noreferrer"&gt;Kali Linux&lt;/a&gt; on the desktop (Debian + rolling release + some security tools). Perfect for my use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development on Linux
&lt;/h2&gt;

&lt;p&gt;You can do most of your programming on Linux, depends on what field you are working on. You can use C, C++, Python, Go all the web dev stuff like &lt;a href="http://vuejsexamples.net/" rel="noopener noreferrer"&gt;vue&lt;/a&gt; and a lot more.&lt;/p&gt;

&lt;p&gt;In fact most of the times it's one single command to install it, while on Windows or Mac you have to struggle a bit. Something like Go is a one line &lt;a href="https://golangr.com/install/" rel="noopener noreferrer"&gt;install&lt;/a&gt;. Linux really is the programmers OS. &lt;/p&gt;

&lt;p&gt;As IDE you can use any of the JetBrains stuff, Sublime (if you must), Visual Studio Code or vim (perfection).&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F537axwjuxk76n9aq5h1m.jpeg" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F537axwjuxk76n9aq5h1m.jpeg" alt="vim"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Why use virtual environments?</title>
      <dc:creator>postrecord</dc:creator>
      <pubDate>Sat, 16 Jan 2021 20:31:06 +0000</pubDate>
      <link>https://dev.to/postrecord/why-use-virtual-environments-bio</link>
      <guid>https://dev.to/postrecord/why-use-virtual-environments-bio</guid>
      <description>&lt;p&gt;A virtual environment (venv) in &lt;a href="https://python.org"&gt;Python&lt;/a&gt; is isolated from the rest of the system. This is necessary, because packages can conflict and sometimes packages are malicious.&lt;/p&gt;

&lt;p&gt;First install the program &lt;em&gt;virtualenv&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt; &lt;span class="n"&gt;apt&lt;/span&gt; &lt;span class="n"&gt;install&lt;/span&gt; &lt;span class="n"&gt;virtualenv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can create a new project (hello):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;virtualenv -p /usr/bin/python3 hello  
cd hello
source bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On my machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\home\frank\example&amp;gt; ls
hello
C:\home\frank\example&amp;gt; cd hello 
C:\home\frank\example\hello&amp;gt; ls
bin  lib  pyvenv.cfg
C:\home\frank\example\hello&amp;gt; source bin/activate        
(hello) C:\home\frank\example\hello&amp;gt; ls             
bin  lib  pyvenv.cfg
(hello) C:\home\frank\example\hello&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can add any Python files you want. Install modules with &lt;a href="https://pythonbasics.org/how-to-use-pip-and-pypi/"&gt;pip&lt;/a&gt;, they will exist only in this virtual environment. &lt;/p&gt;

&lt;p&gt;This prevents package conflicts. You can even set a custom Python version. Added bonus: Even if the module contains malware, it won't affect your operating system. &lt;/p&gt;

&lt;p&gt;To exit your virtual environment, just type exit.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(hello) C:\home\frank\example\hello&amp;gt; exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Automatic venv
&lt;/h2&gt;

&lt;p&gt;If you use an &lt;a href="https://pythonprogramminglanguage.com/python-ide/"&gt;IDE&lt;/a&gt;, then the IDE will create the virtual environments for you. For beginners, that's the recommended way. &lt;/p&gt;

&lt;p&gt;In PyCharm for example, you don't have to do anything except create a new project or open an existing project. It takes care of everything for you. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G3NG6uwE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9m1jse8rp0x488vyewnu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G3NG6uwE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9m1jse8rp0x488vyewnu.png" alt="pycharm virtual environment"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm not 100% sure what other Python IDE's do in terms of the virtual environment, but I'm quite sure they set it up too.&lt;/p&gt;

&lt;p&gt;An IDE will also help you with &lt;a href="https://pythonspot.com/python-debugging/"&gt;debugging&lt;/a&gt;, but you can do that from the terminal too.&lt;/p&gt;

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