<?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: Richard Halford</title>
    <description>The latest articles on DEV Community by Richard Halford (@rshalford).</description>
    <link>https://dev.to/rshalford</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%2F576654%2Fe434a5ef-b613-452e-b0bb-05a9f9d35ff6.jpeg</url>
      <title>DEV Community: Richard Halford</title>
      <link>https://dev.to/rshalford</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rshalford"/>
    <language>en</language>
    <item>
      <title>Setting up virtual machines on Arch Linux</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Fri, 27 Aug 2021 15:21:33 +0000</pubDate>
      <link>https://dev.to/rshalford/setting-up-virtual-machines-on-arch-linux-5gl3</link>
      <guid>https://dev.to/rshalford/setting-up-virtual-machines-on-arch-linux-5gl3</guid>
      <description>&lt;p&gt;Virtualisation is an incredibly useful tool, even for personal use. Personally, I use virtual machines for different purposes: testing out operating systems or Linux distributions without having to install them to bare metal; install my own software to test compatibility; try out the latest hyped about desktop environment or window manager. And as time goes on, I find more things to add to the list of uses.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Whilst typing this up, I read about how I can use a virtual Debian install to install (not live load) a Debian distribution onto a USB drive. So I can carry around an operating system with persistent storage, and plug it into any PC.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This article will be focussing on how to run virtual machines on &lt;strong&gt;&lt;em&gt;Arch Linux&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  KVM
&lt;/h2&gt;

&lt;p&gt;Kernel-based Virtual Machine (KVM), is a hypervisor - an &lt;em&gt;emulator&lt;/em&gt; or sorts - that comes baked into the Linux kernel. So if you run Linux, you will have this module included. And what this means to you the user is that you can quickly setup up your system for managing VMs.&lt;/p&gt;

&lt;p&gt;But even if KVM is included in the Linux kernel installed on your computer, you first need to check whether your CPU has virtualisation support.&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="nv"&gt;$ LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;C lscpu | &lt;span class="nb"&gt;grep &lt;/span&gt;Virtualization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Depending on which team you opted to support, the output will vary, but either output will confirm you support KVM.&lt;/p&gt;

&lt;p&gt;AMD&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Virtualization:                  AMD-V
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Intel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Virtualization:                  VT-x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the confirmation that virtualisation is supported, you will probably want to install some packages to make installing and managing VMs a lot more user friendly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Virtualisation made easy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; qemu libvirt iptables-nft dnsmasq virt-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;All the below installations in one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  QEMU
&lt;/h3&gt;

&lt;p&gt;QEMU is an emulator and virtualiser that can use KVM for virtualisation, by using Hardware-assisted virtualisation with your CPU. But with the &lt;code&gt;qemu&lt;/code&gt; package alone, you will not be able to use a GUI to manage your VMs, or make their sessions have persistent settings. Meaning that to make things run, you will need to use the command-line every time.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; qemu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Libvirt
&lt;/h3&gt;

&lt;p&gt;To overcome these hurdles, it is recommended to install &lt;code&gt;libvirt&lt;/code&gt;, a meta-package that contains the tools for managing your VMs in a convenient way. To do this package justice in knowing what it provides, I'd recommend viewing it's &lt;a href="https://wiki.archlinux.org/title/Libvirt" rel="noopener noreferrer"&gt;Arch Wiki page&lt;/a&gt;.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; libvirt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Libvirt daemon
&lt;/h4&gt;

&lt;p&gt;Next you will need to enable and start the libvirt daemon. This will create some necessary symlinks and also enable the &lt;code&gt;virtlogd.service&lt;/code&gt;.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;libvirtd
Created symlink /etc/systemd/system/multi-user.target.wants/libvirtd.service → /usr/lib/systemd/system/libvirtd.service.
Created symlink /etc/systemd/system/sockets.target.wants/virtlockd.socket → /usr/lib/systemd/system/virtlockd.socket.
Created symlink /etc/systemd/system/sockets.target.wants/virtlogd.socket → /usr/lib/systemd/system/virtlogd.socket.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd.socket → /usr/lib/systemd/system/libvirtd.socket.
Created symlink /etc/systemd/system/sockets.target.wants/libvirtd-ro.socket → /usr/lib/systemd/system/libvirtd-ro.socket.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then just start the service.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start libvirtd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Libvirt group
&lt;/h4&gt;

&lt;p&gt;To allow non-sudo user access to the newly enabled libvirt daemon, you should now add the necessary users to the &lt;code&gt;libvirt&lt;/code&gt; user group.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; libvirt richard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Internet
&lt;/h3&gt;

&lt;p&gt;You'll probably want to add internet connectivity to your future VM instances. Allowing you to browse the web or download and install software on another operating system.&lt;/p&gt;

&lt;p&gt;Typically for personal use, you would want to create a virtual network that uses on the host system's network connectivity. This means installing two more packages. &lt;code&gt;iptables-nft&lt;/code&gt; to replace &lt;code&gt;iptables&lt;/code&gt; - that comes with a base install of Arch Linux - and &lt;code&gt;dnsmasq&lt;/code&gt;, a DNS forwarder and DHCP server.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; iptables-nft dnsmasq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Virtual Machine Manager
&lt;/h3&gt;

&lt;p&gt;The GUI client I'd recommend using to manage your VMs is Virtual Machine Manager, or simply virt-manager. A brilliant bit of free software developed by Red Hat (they also help develop libvirt).&lt;/p&gt;

&lt;p&gt;This program allows the user to; create, start, edit, pause and stop VMs. Whilst providing performance metrics for individual VMs.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; virt-manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Creating a virtual machine
&lt;/h2&gt;

&lt;p&gt;Once all the above steps have been completed, you may need to reboot your system. Then to create a VM, find and download the operating system you want to try out. And start the virt-manager application.&lt;/p&gt;

&lt;p&gt;At first you'll be greeted with an empty list of VMs. To create a new VM, click on the monitor with the star and play button in the top left.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;File &amp;gt; New Virtual Machine&lt;/p&gt;
&lt;/blockquote&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%2Fi.imgur.com%2FsbivrYj.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%2Fi.imgur.com%2FsbivrYj.png" alt="Open virt-manager"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you will be greeted with a VM creation wizard. For this quick run-through I'm going to create a VM for Debian 11 "Bullseye", from a local install media.&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%2Fi.imgur.com%2FapQl8xa.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%2Fi.imgur.com%2FapQl8xa.png" alt="Create a new virtual machine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the downloaded ISO and find the operating system, if virt-manager does not automatically find it for you. &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%2Fi.imgur.com%2FMN0HJt6.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%2Fi.imgur.com%2FMN0HJt6.png" alt="Select installation media"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As Debian 11 is new, I had to choose &lt;code&gt;Debian testing&lt;/code&gt; manually.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then choose how much system memory and the number of CPUs you want to give whilst the VM runs.&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%2Fi.imgur.com%2Fr8OjVrS.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%2Fi.imgur.com%2Fr8OjVrS.png" alt="Memory and CPU allocation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then do the same with how much storage you want to provide. This won't automatically take up the given amount. But, sets a cap on the total amount you have made available to it.&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%2Fi.imgur.com%2FHoXtE29.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%2Fi.imgur.com%2FHoXtE29.png" alt="Storage allocation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, name your VM and select the network solution for it. This tutorial assumed that you would want to provide a virtual network, so that's what has been selected here.&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%2Fi.imgur.com%2FjyWpkZb.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%2Fi.imgur.com%2FjyWpkZb.png" alt="Name the virtual machine and select virtual network"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the new VM will be listed.&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%2Fi.imgur.com%2FIIKKkDD.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%2Fi.imgur.com%2FIIKKkDD.png" alt="New virtual machine will now be listed in virt-manager"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start it, select the VM and click on the &lt;em&gt;play&lt;/em&gt; button to power it on. Then select &lt;em&gt;Open&lt;/em&gt; to view it.&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%2Fi.imgur.com%2Fu2sJSxg.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%2Fi.imgur.com%2Fu2sJSxg.png" alt="Debian 11 "&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If you've made it this far, thanks for reading!&lt;/p&gt;

&lt;p&gt;I hope this article has been helpful in understanding some of the basics of virtualisation on Linux. How to set up your system and manage VMs with KVM, QEMU, libvirt and Virtual Machine Manager. And the steps needed to create a new VM using virt-manager.&lt;/p&gt;

&lt;p&gt;If you've got any questions about this process, or think I might have missed something, just ask below.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/setting-up-virtual-machines-on-arch-linux/" rel="noopener noreferrer"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>archlinux</category>
      <category>linux</category>
      <category>systems</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to remove Windows from Dual-Boot</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Mon, 23 Aug 2021 15:36:07 +0000</pubDate>
      <link>https://dev.to/rshalford/how-to-remove-windows-from-dual-boot-47gd</link>
      <guid>https://dev.to/rshalford/how-to-remove-windows-from-dual-boot-47gd</guid>
      <description>&lt;p&gt;Whenever anyone decides to take a dip into the world of Linux, coming from Windows. It's not normally as a straight swap from operating system to operating system. And the distribution you land on using is normally set up in dual-boot.&lt;/p&gt;

&lt;p&gt;That's how I got started. Windows paired up with Linux Mint.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Because I need Windows to play games."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But, with the progress Valve has made with their Proton compatibility layer. I soon realised that I'm never planning on booting Windows up again, and want the storage on my other drive back. So how do we go about removing Windows from a dual-boot system?&lt;/p&gt;




&lt;h2&gt;
  
  
  Finding Windows
&lt;/h2&gt;

&lt;p&gt;To find out where Windows is installed on your computer, we can use the &lt;code&gt;fdisk&lt;/code&gt; or &lt;code&gt;lsblk&lt;/code&gt; command-line utilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  List partitions using &lt;code&gt;sudo fdisk -l&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo fdisk -l
Disk /dev/nvme0n1: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: KINGSTON SA2000M8250G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 098B466C-F305-8C4E-8229-C0882B81A9A6

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1128447 1126400 550M EFI System
/dev/nvme0n1p2 1128448 9517055 8388608 4G Linux swap
/dev/nvme0n1p3 9517056 488397134 478880079 228.3G Linux filesystem

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8BF1E112-9DF8-42A4-B571-E81529CE4C89

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 239615 32768 16M Microsoft reserved
/dev/sda3 239616 975736384 975496769 465.2G Microsoft basic data
/dev/sda4 975736832 976771071 1034240 505M Windows recovery environment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List partitions using &lt;code&gt;lsblk -p&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ lsblk -p
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
/dev/sda 8:0 0 465.8G 0 disk
├─/dev/sda1 8:1 0 100M 0 part
├─/dev/sda2 8:2 0 16M 0 part
├─/dev/sda3 8:3 0 465.2G 0 part
└─/dev/sda4 8:4 0 505M 0 part
/dev/nvme0n1 259:0 0 232.9G 0 disk
├─/dev/nvme0n1p1 259:1 0 550M 0 part
├─/dev/nvme0n1p2 259:2 0 4G 0 part [SWAP]
└─/dev/nvme0n1p3 259:3 0 228.3G 0 part /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;fdisk&lt;/code&gt; is a more detailed than the simple output from &lt;code&gt;lsblk&lt;/code&gt;. Letting us identify the drive that the different Windows partitions are installed on.&lt;/p&gt;

&lt;p&gt;So now we know that for this system, Windows is installed on the &lt;code&gt;/dev/sda&lt;/code&gt; drive and has four partitions; &lt;code&gt;sda1&lt;/code&gt;, &lt;code&gt;sda2&lt;/code&gt;, &lt;code&gt;sda3&lt;/code&gt;, &lt;code&gt;sda4&lt;/code&gt;. We also know from &lt;code&gt;fdisk&lt;/code&gt; that the drive has a &lt;em&gt;GPT&lt;/em&gt; partition table: &lt;code&gt;Disklabel type: gpt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we can just delete these partitions and replace it with a single &lt;em&gt;Linux Filesystem&lt;/em&gt; partition. And format it to match the &lt;em&gt;ext4&lt;/em&gt; type that the rest of this system uses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; If you have split a single drive into partitions for both Linux and Windows. As in, partitions for Linux and Windows are both under &lt;code&gt;/dev/sda&lt;/code&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;code&gt;/dev/nvme0n1&lt;/code&gt; and &lt;strong&gt;not&lt;/strong&gt; on either drive, like in this tutorial. Make sure to note down the partition numbers for the; &lt;em&gt;Microsoft reserved&lt;/em&gt;, &lt;em&gt;Microsoft basic data&lt;/em&gt;, and &lt;em&gt;Windows recovery environment&lt;/em&gt; partitions. As you will need to keep the &lt;em&gt;EFI System&lt;/em&gt; for Linux to use when booting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deleting Windows
&lt;/h2&gt;

&lt;p&gt;To delete the partitions on the &lt;code&gt;/dev/sda&lt;/code&gt; drive, just pass the path to &lt;code&gt;fdisk&lt;/code&gt;. I recommend using &lt;code&gt;fdisk&lt;/code&gt; as it's readily available, and allows for ease of mind if you think you might have messed up. As everything you do can be undone by hitting &lt;code&gt;q&lt;/code&gt;, as long as you never write the changes with &lt;code&gt;w&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To view all options available, enter &lt;code&gt;m&lt;/code&gt; and hit return. For deleting partitions, we're just going to use the &lt;code&gt;d&lt;/code&gt; command. And go through the process of deleting each partition.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to check the partitions on the drive first, type &lt;code&gt;p&lt;/code&gt; to print out the partition table.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo fdisk /dev/sda

Command (m for help): d
Partition number (1-4, default 4) 4

Partition 4 has been deleted.

Command (m for help): d
Partition number (1-3, default 3) 3

Partition 3 has been deleted.

Command (m for help): d
Partition number (1,2, default 2) 2

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating a partition
&lt;/h2&gt;

&lt;p&gt;Whilst inside of the &lt;code&gt;fdisk&lt;/code&gt; utility, we can now create a new partition, using &lt;code&gt;n&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;Command (m for help): n
Partition number (1-128, default 1):
First sector (34-976773134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-976773134, default 976773134):

Created a new partition 1 of type 'Linux filesystem' and of size 465.8 GiB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here I just hit enter to input all the default values, to get a partition that was as big as my drive could allow.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Also notice how &lt;code&gt;fdisk&lt;/code&gt; automatically selected the &lt;em&gt;Linux Filesystem&lt;/em&gt; partition type. If you want to change this to another, use &lt;code&gt;l&lt;/code&gt; to view all partition type options, and &lt;code&gt;t&lt;/code&gt; to change to one.&lt;/p&gt;

&lt;p&gt;Just in case you're curious about why the partition defaults to starting at sector 2048 (i.e. 1 MB) I found a good explanation over on &lt;a href="https://superuser.com/a/1345861"&gt;StackOverflow&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As this drive will be used to store all of my games, I will only keep this single partition. But the same process with &lt;code&gt;n&lt;/code&gt; can be repeated to create more if needed.&lt;/p&gt;

&lt;p&gt;If in the future I decide that my games library isn't that big or I want to create a video library. I can resize partition &lt;code&gt;/dev/sda1&lt;/code&gt; and create new one along side it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing table changes
&lt;/h2&gt;

&lt;p&gt;After deleting the Windows partitions and creating a new &lt;em&gt;Linux Filesystem&lt;/em&gt; partition. This is what the drive will look like when written.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Command (m for help): p
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8BF1E112-9DF8-42A4-B571-E81529CE4C89

Device Start End Sectors Size Type
/dev/sda1 2048 976773134 976771087 465.8G Linux filesystem

Filesystem/RAID signature on partition 1 will be wiped.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To commit these changes and write the table to disk and exit, type in &lt;code&gt;w&lt;/code&gt; and hit enter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Formatting the partition
&lt;/h2&gt;

&lt;p&gt;To activate this new partition to be used on my system. I need to format this new partition to be of the same type, &lt;em&gt;ext4&lt;/em&gt;, by entering the command &lt;code&gt;sudo mkfs.ext4 /dev/sda1&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;$ sudo mkfs.ext4 /dev/sda1
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 122096385 4k blocks and 30531584 inodes
Filesystem UUID: 4149ff1e-bd86-4d4f-940f-c79cc910ded0
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000

Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Mounting the new partition
&lt;/h2&gt;

&lt;p&gt;Once formatted, the drive partition needs to be mounted, and stay mounted every time the system is booted. To do that, we need to decide where to &lt;em&gt;permanently&lt;/em&gt; mount this partition.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where to mount the partition
&lt;/h3&gt;

&lt;p&gt;A common directory mentioned is in a &lt;code&gt;/media&lt;/code&gt; directory. But this is usually associated with removable media, so would be more suitable for my USB devices and CDs.&lt;/p&gt;

&lt;p&gt;Typically, the &lt;code&gt;/mnt&lt;/code&gt; directory is given as such a place. However, this is typically only meant for temporary mounts of storage devices. And if there are any drives already mounted in sub-directories of &lt;code&gt;/mnt&lt;/code&gt;, then they will be hidden whilst a drive is mounted to &lt;code&gt;/mnt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The most practical option I use as there is no &lt;em&gt;standard&lt;/em&gt; place set out for permanent secondary drives, is in a sub-directory of &lt;code&gt;/mnt&lt;/code&gt;. For example, &lt;code&gt;/mnt/games&lt;/code&gt;. So lets create a new directory there.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo mkdir -p /mnt/games/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;-p&lt;/code&gt; flag options refers to &lt;code&gt;--parents&lt;/code&gt;, which will make sure to create all parent directories to &lt;code&gt;games/&lt;/code&gt;. Although &lt;code&gt;/mnt&lt;/code&gt; should be there anyway.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Automatically mount on boot
&lt;/h3&gt;

&lt;p&gt;To make sure the system mounts the drive partition &lt;code&gt;/dev/sda1&lt;/code&gt; in &lt;code&gt;/mnt/games/&lt;/code&gt; on every boot. Edit the &lt;code&gt;/etc/fstab&lt;/code&gt; file, which will already contain your current partitions. Using the UUID of the partition, found with the &lt;code&gt;lsblk -f&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo /etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# &amp;lt;file system&amp;gt; &amp;lt;dir&amp;gt; &amp;lt;type&amp;gt; &amp;lt;options&amp;gt; &amp;lt;dump&amp;gt; &amp;lt;pass&amp;gt;
# /dev/nvme0n1p3
UUID=05ed8f02-f092-40e5-b72b-38cacce9b370 / ext4 rw,relatime 0 1

# /dev/nvme0n1p2
UUID=9a54cd9a-c6af-403a-a32a-cc08c0adc60b none swap defaults 0 0

# /dev/sda1
UUID=4149ff1e-bd86-4d4f-940f-c79cc910ded0 /mnt/games ext4 defaults 0 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Only the bottom two lines were added to this file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What we did: - Used the default of using the file system UUIDs to denote the partition identity. - Assigned the mount point directory &lt;code&gt;/mnt/games&lt;/code&gt;. - Given the &lt;em&gt;default&lt;/em&gt; options for the partition. - Kept dump as 0 to stop automatically backing up the entire drive if you use &lt;code&gt;dump&lt;/code&gt; (not always pre-installed). - Given a pass priority of 2, as the root directory should be checked first at boot time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mount without rebooting
&lt;/h3&gt;

&lt;p&gt;Once the changes have been saved, we can run &lt;code&gt;sudo mount /mnt/sda1&lt;/code&gt; without having to reboot the computer yet. This will check the &lt;code&gt;/etc/fstab&lt;/code&gt; file and use it to know to mount &lt;code&gt;/dev/sda1/&lt;/code&gt; at &lt;code&gt;/mnt/games&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now if we run &lt;code&gt;lsblk&lt;/code&gt; command, under &lt;code&gt;MOUNTPOINTS&lt;/code&gt; the file system will be mounted to the correct directory. Meaning that whenever the system is next booted, it will automatically mount to this point.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
└─sda1 8:1 0 465.8G 0 part /mnt/games
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 550M 0 part
├─nvme0n1p2 259:2 0 4G 0 part [SWAP]
└─nvme0n1p3 259:3 0 228.3G 0 part /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Giving user privileges
&lt;/h3&gt;

&lt;p&gt;This new file system is still only accessible to the root user, being in the root &lt;code&gt;/&lt;/code&gt; directory. To change this, run the following &lt;code&gt;sudo chown -R richard:users /mnt/games&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating GRUB
&lt;/h2&gt;

&lt;p&gt;At this point we have now removed Windows from the system. The Boot manager, Grub, will now need to be updated. To display the currently installed operating systems on your computer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when you next restart your system, Windows will no longer be an option in the boot menu.&lt;/p&gt;




&lt;p&gt;If you've made it this far, thanks for reading!&lt;/p&gt;

&lt;p&gt;I hope this article has been helpful in understanding some of the utilities found on Linux, such as &lt;code&gt;fdisk&lt;/code&gt; and &lt;code&gt;lsblk&lt;/code&gt;. And that you now understand the file system of your own machine bit better too.&lt;/p&gt;

&lt;p&gt;If you've got any questions about this process, or think I might have missed something, just ask below.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/how-to-remove-windows-from-dual-boot/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>systems</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Bing Wallpaper: Without Bing</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Wed, 18 Aug 2021 13:00:14 +0000</pubDate>
      <link>https://dev.to/rshalford/bing-wallpaper-without-bing-484f</link>
      <guid>https://dev.to/rshalford/bing-wallpaper-without-bing-484f</guid>
      <description>&lt;p&gt;Whilst Microsoft's Bing might not be many people's first choice of search engine. It has always had one thing going for it: daily homepage wallpapers.&lt;/p&gt;

&lt;p&gt;But what about if you don't want to use Bing just for their wallpaper's? Because if we're honest with ourselves, that's an odd reason to stick with a search engine. Let alone decide to make it your browser's homepage.&lt;/p&gt;

&lt;p&gt;Or maybe, like me, you're just too lazy and unimaginative to curate your own wallpaper collection. Don't want to keep storage of all those photos. And like the small spice in life that comes from not knowing what's today's wallpaper?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2zxP7xGA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/IVOVfSb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2zxP7xGA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/IVOVfSb.png" alt="Example use of Bing wallpaper as custom browser homepage background"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The reason I wanted to find a way of getting these wallpapers, was to create my own simple browser homepage.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Either way, keep reading on as I'll be going through a small script that will find and download the latest Bing daily wallpaper. Then you can do whatever you'd like with it. And hopefully, you'll learn a bit more about some of the cool things you can achieve from shell scripting!&lt;/p&gt;




&lt;h2&gt;
  
  
  The script
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="nv"&gt;bing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://www.bing.com"&lt;/span&gt;
&lt;span class="nv"&gt;xmlURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://www.bing.com/HPImageArchive.aspx?format=xml&amp;amp;idx=0&amp;amp;n=1&amp;amp;mkt=en-WW"&lt;/span&gt;

&lt;span class="nv"&gt;saveDir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CACHE_HOME&lt;/span&gt;&lt;span class="s1"&gt;'/bing-wp/'&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$saveDir&lt;/span&gt;
&lt;span class="nv"&gt;picName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"bing.jpg"&lt;/span&gt;

&lt;span class="nv"&gt;picURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$bing&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nv"&gt;$xmlURL&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oP&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;url&amp;gt;(.*)&amp;lt;/url&amp;gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; │ &lt;span class="s2"&gt;"&amp;gt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 2 | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 1&lt;span class="si"&gt;)&lt;/span&gt;

curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;$saveDir$picName&lt;/span&gt; &lt;span class="nv"&gt;$picURL&lt;/span&gt;

&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Requirements: &lt;a href="https://curl.se/download.html"&gt;curl&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Breaking it down
&lt;/h2&gt;

&lt;p&gt;This &lt;strong&gt;&lt;em&gt;shebang&lt;/em&gt;&lt;/strong&gt; simply tell the parent shell which interpreter to use when running the script.&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="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Tells the interpreter to use your system's shell. Typically this will be either &lt;em&gt;dash&lt;/em&gt; or &lt;em&gt;bash&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Here we're setting the variables to be used for creating the URL of the latest Bing wallpaper.&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="nv"&gt;bing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://www.bing.com"&lt;/span&gt;
&lt;span class="nv"&gt;xmlURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://www.bing.com/HPImageArchive.aspx?format=xml&amp;amp;idx=0&amp;amp;n=1&amp;amp;mkt=en-WW"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Then we define the location where the image will be saved to, once downloaded. By using the &lt;code&gt;mkdir&lt;/code&gt; utility, to create the folder at the location defined as &lt;code&gt;$saveDir&lt;/code&gt;. The &lt;code&gt;-p&lt;/code&gt; option flag here, is used to make sure all the necessary parent directories up the branch of &lt;code&gt;bing-wp/&lt;/code&gt; are also created. And finally, the variable &lt;code&gt;picName&lt;/code&gt; is assigned to create the image file.&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="nv"&gt;saveDir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$XDG_CACHE_HOME&lt;/span&gt;&lt;span class="s1"&gt;'/bing-wp/'&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$saveDir&lt;/span&gt;
&lt;span class="nv"&gt;picName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"bing.jpg"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;As every time this script is ran, it will write over the current image. &lt;code&gt;$XDG_CACHE_HOME&lt;/code&gt; is used to denote the appropriate location for a temporary file, using the &lt;a href="https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html"&gt;XDG Base Directory Specification&lt;/a&gt;. It merely represents in most *nix systems, the &lt;code&gt;~/.cache/&lt;/code&gt; directory.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;We can break down this nested and piped variable assignment into more understandable parts.&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="nv"&gt;picURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$bing&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nv"&gt;$xmlURL&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-oP&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;url&amp;gt;(.*)&amp;lt;/url&amp;gt;"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 2 | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 1&lt;span class="si"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Like before, this is simply reassigning Bing's base URL to a variable.&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="nv"&gt;picURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$bing&lt;/span&gt;
&lt;span class="c"&gt;# picURL=http://www.bing.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The &lt;code&gt;curl&lt;/code&gt; command silently, &lt;code&gt;-s&lt;/code&gt; - meaning without progress or error reporting - goes to the URL address assigned as &lt;code&gt;xmlURL&lt;/code&gt;, and outputs it's contents.&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="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nv"&gt;$xmlURL&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="c"&gt;# &amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&amp;lt;images&amp;gt;&amp;lt;image&amp;gt;&amp;lt;startdate&amp;gt;20210817&amp;lt;/startdate&amp;gt;&amp;lt;fullstartdate&amp;gt;202108170000&amp;lt;/fullstartdate&amp;gt;&amp;lt;enddate&amp;gt;20210818&amp;lt;/enddate&amp;gt;&amp;lt;url&amp;gt;/th?id=OHR.PochuckValley_ROW7250263541_1920x1080.jpg&amp;amp;amp;rf=LaDigue_1920x1080.jpg&amp;amp;amp;pid=hp&amp;lt;/url&amp;gt;&amp;lt;urlBase&amp;gt;/th?id=OHR.PochuckValley_ROW7250263541&amp;lt;/urlBase&amp;gt;&amp;lt;copyright&amp;gt;Stairway to Heaven trail, Wawayanda State Park, New Jersey, USA (© Leembe/Getty Images)&amp;lt;/copyright&amp;gt;&amp;lt;copyrightlink&amp;gt;https://www.bing.com/search?q=wawayanda+state+park+new+jersey&amp;amp;amp;form=hpcapt&amp;lt;/copyrightlink&amp;gt;&amp;lt;headline&amp;gt;Info&amp;lt;/headline&amp;gt;&amp;lt;drk&amp;gt;1&amp;lt;/drk&amp;gt;&amp;lt;top&amp;gt;1&amp;lt;/top&amp;gt;&amp;lt;bot&amp;gt;1&amp;lt;/bot&amp;gt;&amp;lt;hotspots&amp;gt;&amp;lt;/hotspots&amp;gt;&amp;lt;/image&amp;gt;&amp;lt;tooltips&amp;gt;&amp;lt;loadMessage&amp;gt;&amp;lt;message&amp;gt;Loading...&amp;lt;/message&amp;gt;&amp;lt;/loadMessage&amp;gt;&amp;lt;previousImage&amp;gt;&amp;lt;text&amp;gt;Previous image&amp;lt;/text&amp;gt;&amp;lt;/previousImage&amp;gt;&amp;lt;nextImage&amp;gt;&amp;lt;text&amp;gt;Next image&amp;lt;/text&amp;gt;&amp;lt;/nextImage&amp;gt;&amp;lt;play&amp;gt;&amp;lt;text&amp;gt;Play video&amp;lt;/text&amp;gt;&amp;lt;/play&amp;gt;&amp;lt;pause&amp;gt;&amp;lt;text&amp;gt;Pause video&amp;lt;/text&amp;gt;&amp;lt;/pause&amp;gt;&amp;lt;/tooltips&amp;gt;&amp;lt;/images&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;As an example, this is what that resulting XML looks like, as of writing this article. We'll use it as an example to explain the rest of the script.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Within this long line of XML are the &lt;code&gt;&amp;lt;url&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/url&amp;gt;&lt;/code&gt; tags. Containing the day's Bing wallpaper URL parameters within. To separate this information from the &lt;code&gt;curl&lt;/code&gt; commands output. We need to pipe that resulting string into &lt;code&gt;grep&lt;/code&gt;.&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;grep&lt;/span&gt; &lt;span class="nt"&gt;-oP&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;url&amp;gt;(.*)&amp;lt;/url&amp;gt;"&lt;/span&gt;
&lt;span class="c"&gt;# &amp;lt;url&amp;gt;/th?id=OHR.PochuckValley_ROW7250263541_1920x1080.jpg&amp;amp;amp;rf=LaDigue_1920x1080.jpg&amp;amp;amp;pid=hp&amp;lt;/url&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Using the &lt;code&gt;-P&lt;/code&gt; flag to perform the pattern matching with Perl-compatible regular expressions. Combined with the &lt;code&gt;-o&lt;/code&gt; option to only return the matching pattern, and not just highlight it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(.*)&lt;/code&gt; just creates a capturing group of everything between the tags.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Now we just need to remove the &lt;code&gt;&amp;lt;url&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/url&amp;gt;&lt;/code&gt; tags surrounding the resource name and parameters of the image address. This will be done by piping this text through the &lt;code&gt;cut&lt;/code&gt; command, twice.&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;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 2
&lt;span class="c"&gt;# /th?id=OHR.PochuckValley_ROW7250263541_1920x1080.jpg&amp;amp;amp;rf=LaDigue_1920x1080.jpg&amp;amp;amp;pid=hp&amp;lt;/url&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; 1
&lt;span class="c"&gt;# /th?id=OHR.PochuckValley_ROW7250263541_1920x1080.jpg&amp;amp;amp;rf=LaDigue_1920x1080.jpg&amp;amp;amp;pid=hp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Using the delimiters, &lt;code&gt;-d&lt;/code&gt;, &lt;code&gt;"&amp;gt;"&lt;/code&gt; and &lt;code&gt;"&amp;lt;"&lt;/code&gt; to separate the tags from the URL segment. And then selecting the delimiter separated fields, &lt;code&gt;-f&lt;/code&gt;, to capture the URL.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;This snippet of the image URL is then concatenated with the &lt;code&gt;$bing&lt;/code&gt; variable using &lt;code&gt;echo&lt;/code&gt;.&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="nv"&gt;picURL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$bing&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; ...&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# picURL=http://www.bing.com/th?id=OHR.PochuckValley_ROW7250263541_1920x1080.jpg&amp;amp;amp;rf=LaDigue_1920x1080.jpg&amp;amp;amp;pid=hp&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Finally, putting this altogether, we can call &lt;code&gt;curl&lt;/code&gt; to silently &lt;code&gt;-s&lt;/code&gt; get the image with &lt;code&gt;$picURL&lt;/code&gt;, now pointing towards the day's image. And direct the output &lt;code&gt;-o&lt;/code&gt; to the be saved as &lt;code&gt;bing.jpg&lt;/code&gt;, inside the &lt;code&gt;$XDG_CACHE_HOME/bing-wp/&lt;/code&gt; directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;$saveDir$picName&lt;/span&gt; &lt;span class="nv"&gt;$picURL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Remembering to &lt;code&gt;exit&lt;/code&gt; the script at the bottom of the file.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Options for Running the Script
&lt;/h2&gt;

&lt;p&gt;I won't get into how to do it here, but just as a pointer on how you can now take this script to run and get the latest Bing wallpaper. Here are a few options on how you might want to go about running the script everyday.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;.xinitrc&lt;/li&gt;
&lt;li&gt;systemd Timer&lt;/li&gt;
&lt;li&gt;CronJob&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Hopefully, after reading this tutorial on how to get Bing's latest daily wallpaper, you have learnt something new about shell scripting along the way. Thanks for reading through to the end, and if you've got any questions, ask below!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/bing-wallpaper-without-bing/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to improve the Arch Linux package manager</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Fri, 13 Aug 2021 17:01:53 +0000</pubDate>
      <link>https://dev.to/rshalford/how-to-improve-the-arch-linux-package-manager-1fo0</link>
      <guid>https://dev.to/rshalford/how-to-improve-the-arch-linux-package-manager-1fo0</guid>
      <description>&lt;p&gt;Pacman is the package manager for Arch Linux. And out of the box, it's just black and white, and single threaded all over. But, even if you're one to tout "I use Arch btw." and what it's like living on the bleeding edge with it's rolling release updates. You'll likely still want to make those updates take as little time as possible, with important information being colour highlighted.&lt;/p&gt;

&lt;p&gt;Luckily pacman comes with a way to make both of these the case, with no more than an edit to it's configuration file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Colour Output
&lt;/h2&gt;

&lt;p&gt;To make sure pacman produces a colourful output in the terminal. Open up &lt;code&gt;/etc/pacman.conf&lt;/code&gt; in your editor of choice, with &lt;code&gt;sudo&lt;/code&gt;/&lt;code&gt;doas&lt;/code&gt; privileges. Then simply delete the &lt;strong&gt;&lt;em&gt;#&lt;/em&gt;&lt;/strong&gt; before &lt;code&gt;Color&lt;/code&gt;, under the &lt;code&gt;# Misc options&lt;/code&gt; sub-heading.&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="c"&gt;# Misc options&lt;/span&gt;
  &lt;span class="c"&gt;#UseSyslog&lt;/span&gt;
- &lt;span class="c"&gt;#Color&lt;/span&gt;
+ Color
  &lt;span class="c"&gt;#TotalDownload&lt;/span&gt;
  CheckSpace
  &lt;span class="c"&gt;#VerbosePkgLists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now save and exit, and the next time you update your system packages, pacman will use the same colour scheme as your terminal/tty.&lt;/p&gt;




&lt;h2&gt;
  
  
  Multi-threaded Performance
&lt;/h2&gt;

&lt;p&gt;With the release of Pacman v6.0.0, comes the ability to have parallel package downloads. Meaning all of your small system packages can be downloaded, all whilst getting the latest Linux kernel.&lt;/p&gt;

&lt;p&gt;Because of reasons beyond the scope of this article (&lt;em&gt;read: I don't feel like writing about it&lt;/em&gt;), this &lt;strong&gt;shouldn't&lt;/strong&gt; throttle the speed of each download stream. As the Arch repository mirrors you're getting your package updates from, probably aren't sending packets of data to you as fast as your network connection can handle. Making parallel downloads only seem like a good thing. With resulting average install times that are &lt;strong&gt;less&lt;/strong&gt; than just downloading package updates sequentially.&lt;/p&gt;

&lt;p&gt;To add this latest feature, you will have to make the following edit, just like with the &lt;code&gt;Color&lt;/code&gt; option mentioned above.&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="c"&gt;# Misc options&lt;/span&gt;
  &lt;span class="c"&gt;#UseSyslog&lt;/span&gt;
  Color
  &lt;span class="c"&gt;#TotalDownload&lt;/span&gt;
  CheckSpace
  &lt;span class="c"&gt;#VerbosePkgLists&lt;/span&gt;
+ ParallelDownloads &lt;span class="o"&gt;=&lt;/span&gt; 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your install of Arch Linux comes after the release of Pacman v6.0.0, you should find that &lt;code&gt;ParallelDownloads&lt;/code&gt; option is already there. And just needs to be &lt;em&gt;'un-commented'&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The number you assign to &lt;code&gt;ParallelDownloads&lt;/code&gt; denotes how many download streams you want to enable. By default, this value is set equal to 5, but can be changed depending on your system's hardware. A rule of thumb being adopted seems to be to match the number of threads on your CPU. But, you may find that testing above this may be beneficial, without resulting in performance drops.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/how-to-improve-the-arch-linux-package-manager/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Using hook scripts with Certbot</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Fri, 13 Aug 2021 11:28:00 +0000</pubDate>
      <link>https://dev.to/rshalford/using-hook-scripts-with-certbot-3n12</link>
      <guid>https://dev.to/rshalford/using-hook-scripts-with-certbot-3n12</guid>
      <description>&lt;p&gt;Today there are a number of ways to setup your email server. Regardless of how, you will have to create an SSL certificate for the domain you plan to host your email on. And a common and convenient way of doing this, is through the instruction generator &lt;a href="https://certbot.eff.org/"&gt;&lt;em&gt;Certbot&lt;/em&gt;&lt;/a&gt;. A free and open-source (FOSS) tool created by the Electronic Frontier Foundation (EFF).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Certbot is a free, open source software tool for automatically using Let’s Encrypt certificates on manually-administered websites to enable HTTPS. Certbot offers domain owners and website administrators a convenient way to move to HTTPS with easy-to-follow, interactive instructions based on your webserver and operating system." - EFF&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One of my favourite features of Certbot has come from the convenience of automatically checking and renewing my certificates for all the websites I host. Without having to worry whether or not I should log on to my server and manually renew them. Allowing the ability to fetch my email's to read and reply with, from desktop or mobile. And not be told that my email server isn't trusted without an SSL certificate.&lt;/p&gt;

&lt;p&gt;A problem I have found regarding the certificate renewals, however, comes from the way the IMAP server (Dovecot in my case) doesn't reload in order to use the updated certificate. Leaving me email-less until I reload the service.&lt;/p&gt;

&lt;p&gt;Online you might find the solution to be as simple as issuing &lt;code&gt;$sudo systemctl reload dovecot&lt;/code&gt;, after Certbot has finished doing it's business. But, when I'm trying to check email on my phone, away from a command-line to &lt;code&gt;ssh&lt;/code&gt; into. This isn't exactly practical. And I don't want to set a 60 day reminder to just run this command.&lt;/p&gt;

&lt;p&gt;Luckily, Certbot comes with the ability to run pre-, post- and deploy-hooks. Simply by adding a shell script to the appropriate folder, found under the &lt;code&gt;/etc/letsencrypt/renewal-hooks/&lt;/code&gt; directory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't forget to make the file executable with the &lt;code&gt;sudo chmod +x /path/to/file&lt;/code&gt; command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just add the following script to a file - named whatever you want - and put it in &lt;code&gt;/etc/letsencrypt/renewal-hooks/deploy/&lt;/code&gt;.&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="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="k"&gt;do
        if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$domain&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; mail.example.com &lt;span class="o"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;then
                &lt;/span&gt;systemctl reload dovecot
        &lt;span class="k"&gt;fi
done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Now every time Certbot runs and successfully issues a certificate to the email server's &lt;code&gt;mail.example.com&lt;/code&gt; domain. This little convenience script will run, and subsequently reload Dovecot, the IMAP server.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/using-hook-scripts-with-certbot/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>systems</category>
    </item>
    <item>
      <title>GoDo: A command line todo list application</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 18:48:53 +0000</pubDate>
      <link>https://dev.to/rshalford/godo-a-command-line-todo-list-application-4oj4</link>
      <guid>https://dev.to/rshalford/godo-a-command-line-todo-list-application-4oj4</guid>
      <description>&lt;h1&gt;
  
  
  Table of Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;About&lt;/li&gt;
&lt;li&gt;
Getting Started

&lt;ul&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Recommendations&lt;/li&gt;
&lt;li&gt;Configuration&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
GoAPI

&lt;ul&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;Server&lt;/li&gt;
&lt;li&gt;Daemonize&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Licence&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  About
&lt;/h1&gt;

&lt;p&gt;GoDo aims to help you get organised with your tasks. Designed to be simple and accessible.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Usage:
  godo &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

Available Commands:
  add         add a new todo
  &lt;span class="k"&gt;done        &lt;/span&gt;toggle todo as &lt;span class="k"&gt;done
  &lt;/span&gt;edit        edit a todo
  find        search &lt;span class="k"&gt;for &lt;/span&gt;a given string
  &lt;span class="nb"&gt;help        help &lt;/span&gt;about any &lt;span class="nb"&gt;command
  &lt;/span&gt;list        list your todos
  priority    label a todo as a priority
  remove      remove a todo
  version     print godo&lt;span class="s1"&gt;'s version

Flags:
      --datafile string   data file to store todos
  -h, --help              help for godo

Use "godo [command] --help" for more information about a command.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Go get things done and checked off the list.
&lt;/h3&gt;




&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;The best way to ensure GoDo will work on your machine, is to compile it yourself.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go (to compile applications)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To do this, all you need is to have Go - &lt;a href="https://golang.org/doc/install"&gt;the programming language&lt;/a&gt; - installed on your computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To install GoDo, all you have to do is run the &lt;code&gt;go get&lt;/code&gt; command.&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="nv"&gt;$ &lt;/span&gt;go get &lt;span class="nt"&gt;-u&lt;/span&gt; github.com/rsHalford/godo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Recommendations
&lt;/h2&gt;

&lt;p&gt;If you want to have your GoDo list available online, and accessible to other computers. There is GoAPI. A REST API which can handle the JSON created by GoDo.&lt;/p&gt;

&lt;p&gt;To edit the necessary variables to hook up GoAPI with a database. You will need to clone the &lt;a href="https://github.com/rsHalford/goapi"&gt;GoAPI repository&lt;/a&gt;.&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="nv"&gt;$ &lt;/span&gt;git clone github.com/rsHalford/goapi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then after making the necessary changes to the source code. Build the GoAPI binary, for the operating server it will be ran on.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;env &lt;/span&gt;&lt;span class="nv"&gt;GOOS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;linux &lt;span class="nv"&gt;GOARCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;amd64 &lt;span class="nv"&gt;CGO_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 go build github.com/rsHalford/goapi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This example command will build GoAPI to be executable on Debian 10.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then you would need to have a web server installed and a way to run GoAPI as a daemon.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apache2 (ProxyPass to your web address)&lt;/li&gt;
&lt;li&gt;Systemd (daemonize GoAPI to run in the background)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;These recommendations are based on what I found to work best for my setup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;config.yaml&lt;/code&gt; can be edited to set-up a connection to &lt;a href="https://github.com/rsHalford/goapi"&gt;GoAPI&lt;/a&gt;. As well as, select your preferred text editor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This file will read from &lt;code&gt;${XDG_CONFIG_HOME:-$HOME/.config}/godo/config.yaml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;admin"&lt;/span&gt;
&lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;secret"&lt;/span&gt;
&lt;span class="na"&gt;api&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://example.com/api/v1/todo"&lt;/span&gt;
&lt;span class="na"&gt;editor&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vim"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you prefer to use a local JSON file to store your todo list, leave the api address blank - &lt;code&gt;""&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;By default, GoDo will use whatever text editor you have set as your system's default - &lt;code&gt;$EDITOR&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  GoAPI
&lt;/h1&gt;

&lt;p&gt;GoAPI was built to support the GoDo application, in providing a RESTful API.&lt;/p&gt;

&lt;p&gt;To setup the server application, there a three changes that need to be made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;

&lt;p&gt;To secure your todo list online, you will need to change the &lt;code&gt;api_username&lt;/code&gt; and &lt;code&gt;api_password&lt;/code&gt; variables, required to access the API endpoints. These variables are found in the &lt;code&gt;config.yaml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;These values will be what you send to the API with each request, using Basic Authentication.&lt;/p&gt;

&lt;p&gt;An example of the &lt;code&gt;config.yaml&lt;/code&gt; can be found in the &lt;a href="https://github.com/rsHalford/goapi/blob/main/config.yaml"&gt;project's repository&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;api_username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;username"&lt;/span&gt;
&lt;span class="na"&gt;api_password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;password"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Currently GoAPI only supports PostgreSQL. To link up the server to a database, make sure to edit the &lt;code&gt;config.yaml&lt;/code&gt;. Providing the &lt;code&gt;db_username&lt;/code&gt;, &lt;code&gt;db_password&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt; - relating to your database address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;db_username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;username"&lt;/span&gt;
&lt;span class="na"&gt;db_password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;password"&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;goapi"&lt;/span&gt;
&lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;5432"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Server
&lt;/h2&gt;

&lt;p&gt;GoAPI by default serves on port &lt;code&gt;:8080&lt;/code&gt;. As an example, below is a basic Apache configuration file to relay GoAPI to your domain.&lt;/p&gt;

&lt;p&gt;Apache Configuration Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="nc"&gt;ServerName&lt;/span&gt; goapi.example.com
        &lt;span class="nc"&gt;ServerAdmin&lt;/span&gt; webmaster@example.com
        &lt;span class="nc"&gt;ProxyRequests&lt;/span&gt; &lt;span class="ss"&gt;Off&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;Proxy&lt;/span&gt;&lt;span class="sr"&gt; *&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;                &lt;span class="nc"&gt;Require&lt;/span&gt; &lt;span class="ss"&gt;all&lt;/span&gt; granted
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;Proxy&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="nc"&gt;ProxyPass&lt;/span&gt; / http://127.0.0.1:8080/
        &lt;span class="nc"&gt;ProxyPassReverse&lt;/span&gt; / http:127.0.0.1:8080/
        &lt;span class="nc"&gt;ErrorLog&lt;/span&gt; ${APACHE_LOG_DIR}/goapi-error.log
        &lt;span class="nc"&gt;CustomLog&lt;/span&gt; ${APACHE_LOG_DIR}/goapi-access.log combined
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Daemonize
&lt;/h2&gt;

&lt;p&gt;To have GoAPI run at all times in the background. You will need to make it run as a daemon. This is possible by creating one as a service with your init system - such as with systemd.&lt;/p&gt;

&lt;p&gt;Systemd Service Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Unit]&lt;/span&gt;
&lt;span class="py"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;GoAPI&lt;/span&gt; &lt;span class="err"&gt;RESTful&lt;/span&gt; &lt;span class="err"&gt;API&lt;/span&gt;

&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;/path/to/goapi/excutable&lt;/span&gt;
&lt;span class="py"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;/path/to/goapi&lt;/span&gt;
&lt;span class="py"&gt;StandardOutput&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;journal&lt;/span&gt;
&lt;span class="py"&gt;StandardError&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;inherit&lt;/span&gt;
&lt;span class="py"&gt;SyslogIdentifier&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;goapi&lt;/span&gt;
&lt;span class="py"&gt;User&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;user&lt;/span&gt;
&lt;span class="py"&gt;Group&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;group&lt;/span&gt;
&lt;span class="py"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;simple&lt;/span&gt;
&lt;span class="py"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;on-failure&lt;/span&gt;

&lt;span class="nn"&gt;[Install]&lt;/span&gt;
&lt;span class="py"&gt;WantedBy&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="err"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Licence
&lt;/h1&gt;

&lt;p&gt;GoDo and GoAPI are both released under the GNU General Public License v3.0.&lt;/p&gt;

</description>
      <category>go</category>
      <category>linux</category>
    </item>
    <item>
      <title>Part 5: Arch Linux Installation Guide</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 15:20:53 +0000</pubDate>
      <link>https://dev.to/rshalford/part-5-arch-linux-installation-guide-1fa1</link>
      <guid>https://dev.to/rshalford/part-5-arch-linux-installation-guide-1fa1</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/part-5-arch-linux-installation-guide/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In part 5 of this &lt;strong&gt;series&lt;/strong&gt;, we will be creating a user, adding access to more programs and setting up a graphical environment. Then we can finally boot up into out fresh install of Arch Linux. This follows on from installing Arch, configuring it's setup and boot process in &lt;a href="https://www.xhalford.com/part-4-arch-linux-installation-guide/"&gt;previous part&lt;/a&gt; of this guide series.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Notes:&lt;/strong&gt; There are a few presumptions being made for this guide. Regarding yourself and your current setup.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;You will be moving from another *nix system.&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;This will help with the initial steps, with the programs being used to download the image and write it to a USB drive.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;If you are coming from Windows, I will try to link to articles explaining this fairly trivial difference.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Have access to this guide on another device.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;As once we get to installing Arch Linux, we'll be stuck in a terminal for some major steps.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Can handle looking deep into the empty void of the tty.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Make sure not to make any typos - as I try to do the same throughout these guides.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What you'll need:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The patience to re-read every command you type, and output given.&lt;/li&gt;
&lt;li&gt;It's not the end of the world if you "mess up" at any stage here. You'll just save yourself the time of redoing anything, if you do.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Creating a User
&lt;/h1&gt;

&lt;p&gt;When using the new installation, we don't want to be the root user. Therefore, we should now create a user, and give it a password.&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="nv"&gt;$ &lt;/span&gt;useradd &lt;span class="nt"&gt;-m&lt;/span&gt; richard
&lt;span class="nv"&gt;$ &lt;/span&gt;passwd richard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When logged in as this new user, we probably want to be able to have access to some necessary functions. Here we will use the &lt;em&gt;usermod&lt;/em&gt; command to do this. Selecting a few appropriate groups to add the user to.&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="nv"&gt;$ &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; wheel,audio,video,input,storage richard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This command will output and error if you use spaces between commas.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Sudo Privileges
&lt;/h2&gt;

&lt;p&gt;As we want to give this user root privileges, by adding it to the wheel group. Without having to rely on entering root with &lt;em&gt;su&lt;/em&gt;, and exiting out of the interactive shell every time. We can install the package, &lt;em&gt;sudo&lt;/em&gt;, for the ability to perform one-off root commands.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; &lt;span class="nb"&gt;sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make sure this user has the privileges of root, thanks to being added to the wheel group. We need to comment out the following line in the sudoers file.&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="nv"&gt;$ EDITOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nano visudo

%wheel &lt;span class="nv"&gt;ALL&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;ALL&lt;span class="o"&gt;)&lt;/span&gt; ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;So that you don't need to enter a password to use sudo, as a wheel group member. You can also uncomment the next line in the file, &lt;code&gt;%wheel ALL=(ALL) NOPASSWD: ALL&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Network Manager
&lt;/h1&gt;

&lt;p&gt;For future's sake, and making life easier every time you boot up your computer. You'll want to automatically connect to the internet. For this, a very useful package is &lt;em&gt;NetworkManager&lt;/em&gt;. Which comes with both a CLI (nmcli) and TUI (nmtui) program, to view, edit and activate network connections.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; networkmanager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to make sure the init system, &lt;em&gt;systemd&lt;/em&gt;, has &lt;em&gt;NetworkManager&lt;/em&gt; enabled and will run when the computer starts up.&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="nv"&gt;$ &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;NetworkManager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Extending Program Availability
&lt;/h1&gt;

&lt;p&gt;At the moment, the only way to download and install, comes from Arch's official stable repositories; core, extra and community.&lt;/p&gt;

&lt;p&gt;If you want to have access to the &lt;a href="https://aur.archlinux.org/"&gt;Arch User Repository, &lt;em&gt;AUR&lt;/em&gt;&lt;/a&gt;. Which will provide you with an endless amount of programs. We will first need to install the &lt;em&gt;base-devel&lt;/em&gt; metapackage, to provide the tools necessary to for compiling software. Including &lt;em&gt;git&lt;/em&gt;, a version control system, which will allow you to clone programs from online repositories.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; &lt;span class="nt"&gt;--needed&lt;/span&gt; base-devel git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make life easier when installing packages from the AUR, it's recommended to install an AUR helper. My recommendation here is to use &lt;em&gt;Yay&lt;/em&gt;, as it works in a similar way to pacman. &lt;/p&gt;

&lt;p&gt;We will move into the &lt;em&gt;/opt/&lt;/em&gt; directory to install yay, as it seems like an appropriate directory. Given it's meant for installing add-on application software packages. Then we will clone yay, give our new user access to it and then build it.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /opt
&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://aur.archlinux.org/yay.git
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; richard:wheel ./yay
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;yay/
&lt;span class="nv"&gt;$ &lt;/span&gt;makepkg &lt;span class="nt"&gt;-si&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it for extending software availability on Arch Linux. Now we can focus on making the operating system user friendly, and add a graphical user interface.&lt;/p&gt;




&lt;h1&gt;
  
  
  Rebooting Arch
&lt;/h1&gt;

&lt;p&gt;With Arch Linux finally installed, added to the bootloader menu, and with a user to log in with. We can now after all this time, reboot the computer. First we need to exit the chroot environment, unmount all partitions, and shutdown the computer.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;umount &lt;span class="nt"&gt;-R&lt;/span&gt; /mnt
&lt;span class="nv"&gt;$ &lt;/span&gt;shutdown now
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this done all you have to do is remove the USB installation media and hit the power button.&lt;/p&gt;

&lt;p&gt;With that done. You should now be prompted to enter the desktop (hostname) login and password for your user.&lt;/p&gt;

&lt;p&gt;🥳 You're done! 🎉&lt;/p&gt;

&lt;p&gt;But... things still look the same.&lt;/p&gt;




&lt;h1&gt;
  
  
  Graphical User Interface
&lt;/h1&gt;

&lt;p&gt;So far, we've spent our lives in tty purgatory. Staring at a black screen with harsh white text. We need to get out of this. We need to add a display server and graphical environment.&lt;/p&gt;




&lt;h2&gt;
  
  
  Display Server &amp;amp; Graphics Drivers
&lt;/h2&gt;

&lt;p&gt;On Linux there a two major display servers available, Xorg and Wayland. In this tutorial I am going to go over installing and setting up with Xorg. It's got more support, and a greater user-base. If you have problems in the future, it'll be easier to solve with Xorg.&lt;/p&gt;

&lt;p&gt;To make sure you get all necessary utilities that go along with Xorg. We will install the &lt;em&gt;xorg&lt;/em&gt; meta package.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; xorg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Followed by installing the hardware drivers relating to your current system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8lKY3sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/L4eTm7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8lKY3sq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/L4eTm7v.png" alt="GPU Driver Table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have an NVIDIA GPU, I would actually suggest using their proprietary drivers 😱&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For further explanations for your specific graphics driver.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Intel_graphics"&gt;Intel graphics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/AMDGPU"&gt;AMDGPU&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/AMDGPU_PRO"&gt;AMDGPU PRO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/NVIDIA"&gt;NVIDIA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Nouveau"&gt;Nouveau&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Desktop Environment or Window Manager
&lt;/h2&gt;

&lt;p&gt;Traditionally, operating systems and Linux distributions come bundled with a desktop environment and programs. You might already be used to using one, but here are a few that you can check out. Including what packages and configurations you may need to get it working.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/GNOME"&gt;GNOME&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/KDE"&gt;KDE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/index.php/Xfce"&gt;Xfce&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These desktop environments come with a; file manager, terminal emulator, text editor, icons, browser, etc.&lt;/p&gt;

&lt;p&gt;If you want to have a more custom and light-weight graphical user interface. You might want to opt for a window manager like &lt;a href="https://dwm.suckless.org/"&gt;dwm&lt;/a&gt;, &lt;a href="https://i3wm.org/"&gt;i3&lt;/a&gt;, or &lt;a href="https://wiki.archlinux.org/index.php/Openbox"&gt;Openbox&lt;/a&gt;. Then you can decide what extra programs you want to have without the added "bloat" of what comes with desktop environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  Display Manager
&lt;/h2&gt;

&lt;p&gt;If you chose to use a desktop environment, you will most likely have a display manager. But, if you installed a window manager, you will either have to install one yourself or forgo having one. Without a display manager, you will have to start your Xorg server with the &lt;code&gt;startx&lt;/code&gt; command. To make this command run automatically when you log in, edit the systems shell initialisation file.&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="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;tty&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/dev/tty1"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;exec &lt;/span&gt;startx
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Remove &lt;code&gt;exec&lt;/code&gt; and just have &lt;code&gt;startx&lt;/code&gt; if you want to kill the server but remain logged in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This if statement will run &lt;code&gt;startx&lt;/code&gt; if you log in on tty1. But will keep you in the tty if you need to, when using the other five. Which can be helpful if you need to debug a graphical problem. Accessing these other tty's with, Ctrl+Alt+F2 up to F6 on Arch Linux.&lt;/p&gt;




&lt;h1&gt;
  
  
  User Directories
&lt;/h1&gt;

&lt;p&gt;To create all the standard directories within you user's home directory (Documents, Downloads, etc.). It is useful to install the &lt;em&gt;xdg-user-dirs&lt;/em&gt; packager. Which helps keep your /home/ directories organised, by using the &lt;a href="https://wiki.archlinux.org/index.php/XDG_Base_Directory"&gt;&lt;em&gt;XDG Base Directory&lt;/em&gt; specification&lt;/a&gt;.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; xdg-user-dirs
&lt;span class="nv"&gt;$ &lt;/span&gt;xdg-user-dirs-update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The generated &lt;em&gt;~/.config/user-dirs.dirs&lt;/em&gt; file can be edited to fit your use case. This is what mine looks like given I don't have a desktop with my window manager.&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="nv"&gt;XDG_DESKTOP_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_DOWNLOAD_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Downloads"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_DOCUMENTS_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Documents"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_MUSIC_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Media/Music"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_PICTURES_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Media/Pictures"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_VIDEOS_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Media/Videos"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_TEMPLATES_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Templates"&lt;/span&gt;
&lt;span class="nv"&gt;XDG_PUBLICSHARE_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="s2"&gt;/Public"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Notice how I have also consolidated my pictures, videos and music directories within a Media/ directory. To remove even more /home/user/ clutter.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;At the end of this final part in the Arch Linux Installation Guide, we have covered a lot.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a user account and given it root priveleges.&lt;/li&gt;
&lt;li&gt;Installed a way to manage our internet connection.&lt;/li&gt;
&lt;li&gt;Provided ourselves with a way of downloading programs from almost anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Finally&lt;/strong&gt; rebooted our system, and into our new home.&lt;/li&gt;
&lt;li&gt;Added a graphical server and looked at potential desktop environments and window mangers.&lt;/li&gt;
&lt;li&gt;Gone through two methods to automatically login and keep things clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If after all five parts of this guide you have questions. I will try my best to answer them in the comments below. The best resource really is the &lt;a href="https://wiki.archlinux.org/index.php/"&gt;Arch Wiki&lt;/a&gt;. And would be my recommended first stop before installing, configuring or debugging a problem.&lt;/p&gt;

&lt;p&gt;Thank you for taking the time to read through this guide, and I hope you have managed to get your Arch Linux installed and operational.&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://twitter.com/intent/user?screen_name=richardhalford_"&gt;Twitter!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Part 4: Arch Linux Installation Guide</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 15:17:54 +0000</pubDate>
      <link>https://dev.to/rshalford/part-4-arch-linux-installation-guide-5cic</link>
      <guid>https://dev.to/rshalford/part-4-arch-linux-installation-guide-5cic</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/part-5-arch-linux-installation-guide/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In part 4 of this &lt;strong&gt;series&lt;/strong&gt;, we will be installing essential packages. Configuring the system. And adding a boot loader to the system. This follows on from the drive partitioning, formatting and mounting in the &lt;a href="https://www.xhalford.com/part-3-arch-linux-installation-guide/"&gt;previous part&lt;/a&gt; of this guide series.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Notes:&lt;/strong&gt; There are a few presumptions being made for this guide. Regarding yourself and your current setup.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;You will be moving from another *nix system.&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;This will help with the initial steps, with the programs being used to download the image and write it to a USB drive.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;If you are coming from Windows, I will try to link to articles explaining this fairly trivial difference.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Have access to this guide on another device.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;As once we get to installing Arch Linux, we'll be stuck in a terminal for some major steps.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Can handle looking deep into the empty void of the tty.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Make sure not to make any typos - as I try to do the same throughout these guides.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What you'll need:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Maintain the internet connection you &lt;a href="https://www.xhalford.com/part-2-arch-linux-installation-guide/#make-sure-were-online"&gt;setup in part 2&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The patience to re-read every command you type, and output given.&lt;/li&gt;
&lt;li&gt;It's not the end of the world if you "mess up" at any stage here. You'll just save yourself the time of redoing anything, if you do.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Installing Arch Linux
&lt;/h1&gt;

&lt;p&gt;Arch Linux uses the package manager, &lt;em&gt;pacman&lt;/em&gt;. The Debian equivalent to &lt;em&gt;apt&lt;/em&gt; or Fedora's &lt;em&gt;dnf&lt;/em&gt;. Before we can do any of that, we need to install three essential packages. That provide everything necessary for you to tell other people that you "use Arch Linux by the way."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the future I may write about pacman's repository system, and the different ways to use it. But carrying out the commands later on in this tutorial are simple enough.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For now we'll be using the &lt;em&gt;pacstrap&lt;/em&gt; script to install packages to the new root directory. Installing the &lt;a href="https://archlinux.org/packages/core/any/base/"&gt;&lt;em&gt;base&lt;/em&gt; package&lt;/a&gt;, the Linux kernel, and the Linux firmware package to help support common hardware on your device.&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="nv"&gt;$ &lt;/span&gt;pacstrap /mnt base linux linux-firmware
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;em&gt;linux&lt;/em&gt; kernel package can be changed for the &lt;em&gt;linux-hardened&lt;/em&gt;, &lt;em&gt;linux-lts&lt;/em&gt; or &lt;em&gt;linux-zen&lt;/em&gt; kernels.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Leave that to do it's work for a few minutes...&lt;/p&gt;

&lt;p&gt;Then, once done, we'll go through some configurations for the system.&lt;/p&gt;




&lt;h1&gt;
  
  
  Generating the fstab File
&lt;/h1&gt;

&lt;p&gt;As the &lt;a href="https://wiki.archlinux.org/index.php/Fstab"&gt;Arch Wiki&lt;/a&gt; states;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"The fstab file can be used to define how disk partitions, various other block devices, or remote filesystems should be mounted into the filesystem."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To generate this &lt;em&gt;fstab&lt;/em&gt; file, enter the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;genfstab &lt;span class="nt"&gt;-U&lt;/span&gt; /mnt &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /mnt/etc/fstab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Change Root Into Your New System
&lt;/h1&gt;

&lt;p&gt;Chroot command to change root into this new installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;arch-chroot /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use the &lt;em&gt;ls&lt;/em&gt; command to view what the file structure of your new home will look like. Look's nice, huh?&lt;/p&gt;




&lt;h1&gt;
  
  
  Set Time Zone
&lt;/h1&gt;

&lt;p&gt;As we are now in a new installation, we need to set the time zone. To do this, we need to know which region we are from.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /usr/share/zoneinfo/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And what city is the nearest one to your location.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /usr/share/zoneinfo/region/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Remembering to replace &lt;em&gt;/region/&lt;/em&gt; with one that is appropriate to yourself.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we know the closest location. We'll use the following command to force create a symbolic link - using the &lt;em&gt;-sf&lt;/em&gt; arguments.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-sf&lt;/span&gt; /usr/share/zoneinfo/REGION/CITY /etc/localtime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Entering the following, will generate the &lt;em&gt;adjtime&lt;/em&gt; file.&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="nv"&gt;$ &lt;/span&gt;hwclock &lt;span class="nt"&gt;--systohc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Localisation
&lt;/h1&gt;

&lt;p&gt;With the system's time zone set, we need to select and then generate the locales. Which are required for certain programs and libraries to function as expected.&lt;/p&gt;

&lt;p&gt;We do this by editing the &lt;em&gt;/etc/locale.gen&lt;/em&gt; file. Uncommenting locales that relate to you. For example, in the US, this will likely be &lt;code&gt;en_US.UTF-8 UTF-8&lt;/code&gt; - found on line 177.&lt;/p&gt;




&lt;h2&gt;
  
  
  Using an Editor
&lt;/h2&gt;

&lt;p&gt;As Arch doesn't come with a text editor installed with the &lt;em&gt;base&lt;/em&gt; package. We need to install one to make the edit to the locale.gen file.&lt;/p&gt;

&lt;p&gt;My recommendations here are to use the beginner-friendly command-line interface editor &lt;em&gt;nano&lt;/em&gt;. As it shows the appropriate Ctrl, &lt;em&gt;^&lt;/em&gt;, commands to save and exit the program, once done uncommenting the locales.&lt;/p&gt;

&lt;p&gt;Otherwise, install and use &lt;em&gt;vim&lt;/em&gt;. And let your mind expand.&lt;/p&gt;

&lt;p&gt;To do this, enter the following command - with your chosen editor as the argument.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; nano
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can edit that &lt;em&gt;locale.gen&lt;/em&gt; file. Once the correct lines have been uncommented, generate the locales.&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="nv"&gt;$ &lt;/span&gt;locale-gen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Set the LANG Variable
&lt;/h2&gt;

&lt;p&gt;Next up is to create and then set the LANG variable.&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="nv"&gt;$ &lt;/span&gt;nano /etc/locale.conf

&lt;span class="nv"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;en_GB.UTF-8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Entering the same information for the variable, as you uncommented from the locale.gen file.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Keyboard Layout
&lt;/h2&gt;

&lt;p&gt;Like we did in &lt;a href="https://xhalford.com/part-2-arch-linux-installation-guide/#keyboard-layout"&gt;part 2 of this series&lt;/a&gt;, we need to set the keyboard layout for our region. Refer to that article section, to find your KEYMAP value.&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="nv"&gt;$ &lt;/span&gt;nano /etc/vconsole.conf

&lt;span class="nv"&gt;KEYMAP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;uk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Network Configuration
&lt;/h1&gt;

&lt;p&gt;Create and edit the &lt;em&gt;hostname&lt;/em&gt; file. Here you will enter the name you want your device to be known as on your network.&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="nv"&gt;$ &lt;/span&gt;nano /etc/hostname

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

&lt;/div&gt;



&lt;p&gt;Then we need to add our hosts to the &lt;em&gt;/etc/hosts&lt;/em&gt; file. Using our &lt;em&gt;hostname&lt;/em&gt; (e.g. &lt;em&gt;desktop&lt;/em&gt;) where appropriate.&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="nv"&gt;$ &lt;/span&gt;nano /etc/hosts

127.0.0.1   localhost
::1         localhost
127.0.1.1   desktop.localdomain desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Setting the Root Password
&lt;/h1&gt;

&lt;p&gt;So we don't have to &lt;em&gt;chroot&lt;/em&gt; when we load back up. It's best to set the root password now. Using the &lt;em&gt;passwd&lt;/em&gt; script, create your password and confirm it.&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="nv"&gt;$ &lt;/span&gt;passwd
New password:
Retype new password:
passwd: password updated successfully
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Bootloader
&lt;/h1&gt;

&lt;p&gt;Before we're done with setting up the base install and configuring it. We need to to install a few packages to make sure the UEFI firmware can find and start the bootloader, which is in the EFI system partition.&lt;/p&gt;

&lt;p&gt;Basically, when you start your computer, Arch Linux will be listed and can be started.&lt;/p&gt;

&lt;p&gt;The almost "standard" bootloader these days is &lt;em&gt;GRUB&lt;/em&gt;. As it can support our chosen firmware (UEFI), partition table (GPT), can multi-boot, and supports our Linux file system partition (ext4).&lt;/p&gt;

&lt;p&gt;To setup &lt;em&gt;GRUB&lt;/em&gt;, we also need to install a few other packages that will support it's installation.&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="nv"&gt;$ &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; grub efibootmgr os-prober dosfstools mtools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;grub&lt;/em&gt; is the bootloader.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;efibootmgr&lt;/em&gt; writes the boot entries, making Arch Linux discoverable.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;os-prober&lt;/em&gt; is used to discover other installed operating systems on your computer.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;dosfstools&lt;/em&gt; allows the system to create, check and label FAT32 file systems.

&lt;ul&gt;
&lt;li&gt;e.g. format a USB to FAT32.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;mtools&lt;/em&gt; allows you to access FAT file systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we need to create an EFI directory in &lt;em&gt;/boot/&lt;/em&gt;.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; /boot/efi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can now mount the EFI system partition to that new directory.&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="nv"&gt;$ &lt;/span&gt;mount /dev/nvme0n1p1 /boot/efi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need to run the GRUB installation script, &lt;em&gt;grub-install&lt;/em&gt;. Which will install the GRUB EFI application and install it's modules.&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="nv"&gt;$ &lt;/span&gt;grub-install &lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;x86_64-efi &lt;span class="nt"&gt;--efi-directory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/boot/efi &lt;span class="nt"&gt;--bootloader-id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;grub_uefi &lt;span class="nt"&gt;--recheck&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the computer starts up, it loads the GRUB configuration file, &lt;em&gt;/boot/grub/grub.cfg&lt;/em&gt;. So we need to generate this file.&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="nv"&gt;$ &lt;/span&gt;grub-mkconfig &lt;span class="nt"&gt;-o&lt;/span&gt; /boot/grub/grub.cfg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  We're Done! (mostly)
&lt;/h1&gt;

&lt;p&gt;At this point you can &lt;code&gt;exit&lt;/code&gt; the chroot environment, &lt;code&gt;umount -R /mnt&lt;/code&gt; and enter &lt;code&gt;reboot&lt;/code&gt;. Before doing that, however, this is a good place to your user account and install a few more packages. Making your new home a bit nicer to look and easier to use, than this black void.&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://twitter.com/intent/user?screen_name=richardhalford_"&gt;Twitter!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Part 3: Arch Linux Installation Guide</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 15:10:50 +0000</pubDate>
      <link>https://dev.to/rshalford/part-3-arch-linux-installation-guide-3p3o</link>
      <guid>https://dev.to/rshalford/part-3-arch-linux-installation-guide-3p3o</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/part-3-arch-linux-installation-guide/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In part 3 of this &lt;strong&gt;series&lt;/strong&gt;, we will be partitioning, formatting and mounting a drive to install Arch on. This follows on from the live environment setup completed in the &lt;a href="https://www.xhalford.com/part-2-arch-linux-installation-guide/"&gt;previous part&lt;/a&gt; of this guide series.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Notes:&lt;/strong&gt; There are a few presumptions being made for this guide. Regarding yourself and your current setup.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;You will be moving from another *nix system.&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;This will help with the initial steps, with the programs being used to download the image and write it to a USB drive.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;If you are coming from Windows, I will try to link to articles explaining this fairly trivial difference.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Have access to this guide on another device.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;As once we get to installing Arch Linux, we'll be stuck in a terminal for some major steps.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Can handle looking deep into the empty void of the tty.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Make sure not to make any typos - as I try to do the same throughout these guides.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What you'll need:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The patience to re-read every command you type, and output given.&lt;/li&gt;
&lt;li&gt;It's not the end of the world if you "mess up" at any stage here. You'll just save yourself the time of redoing anything, if you do.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Partitioning
&lt;/h1&gt;

&lt;p&gt;First, we need to partition our hard drive. Creating a space for the boot, file system and swap partitions. For this, we'll use &lt;strong&gt;fdisk&lt;/strong&gt;, a common Linux utility.&lt;/p&gt;

&lt;p&gt;To get started, use the below command to list view the hard drive and it's current partitions.&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="nv"&gt;$ &lt;/span&gt;fdisk &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should give you a similar view as the &lt;strong&gt;lsblk&lt;/strong&gt; command. Used when &lt;a href="https://www.xhalford.com/part-1-arch-linux-installation-guide/#preparing-the-usb-drive-for-installation"&gt;preparing the USB drive in part 1&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now you should be able to identify which drive you have to partition. Next, you will input this drive path as an argument to the fdisk command.&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="nv"&gt;$ &lt;/span&gt;fdisk /dev/nvme0n1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Remembering to replace the path given above, with one that corresponds with your system (e.g. &lt;em&gt;fdisk /dev/sda&lt;/em&gt; or &lt;em&gt;fdisk /dev/nvme0n1&lt;/em&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This will then prompt you with a series of commands to enter. To save some time I have provided you with some pretty standard options. You can tailor these to what you require - if you know what you're doing.&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="nv"&gt;$ &lt;/span&gt;fdisk /dev/nvme0n1
&lt;span class="nv"&gt;$ &lt;/span&gt;m
&lt;span class="nv"&gt;$ &lt;/span&gt;g
&lt;span class="nv"&gt;$ &lt;/span&gt;n
&lt;span class="nv"&gt;$ &lt;/span&gt;1
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;+550M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;m = shows the help message&lt;/li&gt;
&lt;li&gt;g = creates a gpt partition table&lt;/li&gt;
&lt;li&gt;n = creates a new partition&lt;/li&gt;
&lt;li&gt;1 = partition number using the default&lt;/li&gt;
&lt;li&gt;return = first sector starts at 2048 as default&lt;/li&gt;
&lt;li&gt;+550M = gives the partition a size of 550M&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This should now have created the first partition, that will be used for the EFI system.&lt;/p&gt;

&lt;p&gt;You can list this new partition by entering &lt;em&gt;p&lt;/em&gt;. This will show device start and end sectors (in mebibits, Mi) and type as "Linux filesystem".&lt;/p&gt;

&lt;p&gt;At this point you haven't actually committed any changes yet to your drive. So don't worry if you think you've messed up. As you can &lt;em&gt;fdisk /dev/nvme0n1&lt;/em&gt; and select &lt;em&gt;d&lt;/em&gt; to delete a partition, or &lt;em&gt;q&lt;/em&gt; to quit without saving all changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Swap Partition
&lt;/h2&gt;

&lt;p&gt;To some, the creation of a swap partition is an optional step. But, given how affordable storage space is, the impact of having one is almost negligible. Especially when compared to losing all unsaved work, when your RAM fills up. And your computer needs to be restarted. Also, if you're still one to use hibernation, you will need at least the same amount of swap space as you do RAM, to store your system's state.&lt;/p&gt;

&lt;p&gt;So creating this partition is much like the previous step. Hit &lt;em&gt;n&lt;/em&gt;, and we'll create the swap partition. Enter &lt;em&gt;2&lt;/em&gt; for the partition number. Go with the default start position. And finally select how much swap space you want to assign.&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="nv"&gt;$ &lt;/span&gt;n
&lt;span class="nv"&gt;$ &lt;/span&gt;2
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;+4G
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'm choosing a swap space partition size of 4GB as I have 16GB of RAM. Some might see this as too much and some as too little. Here's an &lt;a href="https://help.ubuntu.com/community/SwapFaq#How_much_swap_do_I_need.3F"&gt;easy to use table&lt;/a&gt; by people who know more about this than I do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lvw3eAUi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sF6DC1E.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lvw3eAUi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sF6DC1E.png" alt="Ubuntu's table showing how much swap space you might need"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  File System Partition
&lt;/h2&gt;

&lt;p&gt;Now to create the partition for the system file system. Where your root directory will be created. Again this means following similar steps as before.&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="nv"&gt;$ &lt;/span&gt;n
&lt;span class="nv"&gt;$ &lt;/span&gt;3
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Selecting the default partition size, by entering &lt;em&gt;return&lt;/em&gt; for the deault value. You will be assigning all remaining drive space for the Linux file system.&lt;/p&gt;




&lt;h2&gt;
  
  
  Assigning Partition Types
&lt;/h2&gt;

&lt;p&gt;Before assigning a type to each partition. We will view what we have done so far, by entering &lt;em&gt;p&lt;/em&gt;, to show the current partition table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Device          Start   End       Sectors   Size    Type
/dev/nvme0n1p1  2048    1128447   1126400   550M    Linux filesystem
/dev/nvme0n1p2  1128448 9517055   8388608   4G      Linux filesystem
/dev/nvme0n1p3  9517056 488397134 478880079 228.3G  Linux filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This is what my table looks like with a 256GB drive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So far, all partitions are of the type "Linux filesystem". But we need to change the first two, to create both the EFI System and Linux swap partitions.&lt;/p&gt;

&lt;p&gt;First up will be the 550M partition (1). Entering the below key presses to;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;change partition type, &lt;em&gt;t&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;select the correct partition, &lt;em&gt;1&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;list available partition types, &lt;em&gt;L&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;choose the EFI System partition type, &lt;em&gt;1&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;t
&lt;span class="nv"&gt;$ &lt;/span&gt;1
&lt;span class="nv"&gt;$ &lt;/span&gt;L
&lt;span class="nv"&gt;$ &lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we will do the same to the sencodn partition, creating the swap partition.&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="nv"&gt;$ &lt;/span&gt;t
&lt;span class="nv"&gt;$ &lt;/span&gt;2
&lt;span class="nv"&gt;$ &lt;/span&gt;L
&lt;span class="nv"&gt;$ &lt;/span&gt;19
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the third partition is already of the right type to hold the root directory we can leave it as is. We can then view the partition table, &lt;em&gt;p&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Device          Start   End       Sectors   Size    Type
/dev/nvme0n1p1  2048    1128447   1126400   550M    EFI System
/dev/nvme0n1p2  1128448 9517055   8388608   4G      Linux swap
/dev/nvme0n1p3  9517056 488397134 478880079 228.3G  Linux filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're happy with how everything looks. Hit &lt;em&gt;w&lt;/em&gt;, and this new table will be saved.&lt;/p&gt;




&lt;h1&gt;
  
  
  Formatting Partitions
&lt;/h1&gt;

&lt;p&gt;Now the drive partitions have been created and assigned a type. They will now need to be formatted.&lt;/p&gt;




&lt;h2&gt;
  
  
  EFI System Partition
&lt;/h2&gt;

&lt;p&gt;As the EFI system partition is independent of the operating system being run. This means you can add a Windows operating system to your computer. Either as a separate drive or another set of future partitions.&lt;/p&gt;

&lt;p&gt;With the EFI system partition, we will choose to go with a FAT32 file system. Instead of the standard Linux format, ext4. The &lt;a href="https://wiki.archlinux.org/index.php/EFI_system_partition"&gt;Arch Wiki&lt;/a&gt; has a handy page all about the EFI system partition, if you have any further questions.&lt;/p&gt;

&lt;p&gt;To format the partition, enter the following.&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="nv"&gt;$ &lt;/span&gt;mkfs.fat &lt;span class="nt"&gt;-F32&lt;/span&gt; /dev/nvme0n1p1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Notice the additional partition number, &lt;em&gt;p1&lt;/em&gt;, added to the end of the drive path.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Linux Swap Partition
&lt;/h2&gt;

&lt;p&gt;Then we will initialise the swap partition, &lt;em&gt;p2&lt;/em&gt;.&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="nv"&gt;$ &lt;/span&gt;mkswap /dev/nvme0n1p2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Linux File System Partition
&lt;/h2&gt;

&lt;p&gt;Finally before mounting, we will format the Linux filesystem as ext4.&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="nv"&gt;$ &lt;/span&gt;mkfs.ext4 /dev/nvme0n1p3 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;When it starts to create the journal it may take a few seconds.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  Mounting the Formatted Partitions
&lt;/h1&gt;

&lt;p&gt;Now we can mount the formatted partitions and enable the swap space.&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="nv"&gt;$ &lt;/span&gt;swapon /dev/nvme0n1p2
&lt;span class="nv"&gt;$ &lt;/span&gt;mount /dev/nvme0n1p3 /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done. 🎉&lt;/p&gt;

&lt;p&gt;We're almost there!&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://twitter.com/intent/user?screen_name=richardhalford_"&gt;Twitter!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Django: Creating An App</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 14:48:20 +0000</pubDate>
      <link>https://dev.to/rshalford/django-creating-an-app-4hbe</link>
      <guid>https://dev.to/rshalford/django-creating-an-app-4hbe</guid>
      <description>&lt;h2&gt;
  
  
  Projects vs Apps?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Django Apps
&lt;/h3&gt;

&lt;p&gt;Django apps are essentially individual feature sets for a website. A few examples of Django apps could be;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blog app that helps you create and edit your own articles online.&lt;/li&gt;
&lt;li&gt;User authentication app, where you can create a login system for your website.&lt;/li&gt;
&lt;li&gt;Chat app where you can connect users who can then message each other.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The possibilities are endless, but the idea is to create apps that serve one specific purpose. Then you can use that app in other Django projects. For example, your login system app can be plugged into any future Django projects that need user account creation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Django Projects
&lt;/h3&gt;

&lt;p&gt;Projects are a collection of apps, and they provide the configurations necessary for the apps to work with each other. As the official Django documentation puts it, "A project can contain multiple apps. An app can be in multiple projects."&lt;/p&gt;

&lt;p&gt;There is also a Django apps website &lt;a href="https://djangopackages.org"&gt;djangopackages.org&lt;/a&gt;. Where you can find apps that other developers have created, that you can add to your project.&lt;/p&gt;




&lt;h2&gt;
  
  
  Creating the app
&lt;/h2&gt;

&lt;p&gt;First, make sure to be in the correct directory and activate your python virtual environment.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;django_project
django_project &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source &lt;/span&gt;project_venv/bin/activate
django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should be in the same directory as manage.py. To create the app, that we'll call "app".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;python manage.py startapp app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should have created the app directory, and filled it with the following files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project/
    project_venv/
    project/
    app/
        migrations/
           __init__.py
        __init__.py
        admin.py
        apps.py
        models.py
        tests.py
        views.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before you can use this new app in your project, you must register it in project/settings.py.&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="c1"&gt;# Application definition
&lt;/span&gt;
 &lt;span class="n"&gt;INSTALLED_APPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.admin'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.auth'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.contenttypes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.sessions'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.messages'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s"&gt;'django.contrib.staticfiles'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;    &lt;span class="s"&gt;'app'&lt;/span&gt;
 &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Hello, World!
&lt;/h2&gt;

&lt;p&gt;Getting started with this new app, we &lt;em&gt;have to&lt;/em&gt; start with the "Hello, World!" test.&lt;/p&gt;

&lt;p&gt;To do this we need to edit the app/views.py file, to define the index function.&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="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.shortcuts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;render&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.http&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;HttpResponse&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;HttpResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we have to create an app specific app/urls.py file, that will define the location of this index function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;app/
app &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;urls.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason for creating this file, is to keep this a modular app, as mentioned earlier. Making it easier to edit the app when more code gets added, and plug in to future projects.&lt;/p&gt;

&lt;p&gt;Add the following to this file.&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="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;.&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;views&lt;/span&gt;

&lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;views&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;'index'&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;Finally, we connect the this app view to the project's root URL. By adding this code to the project/urls.py file.&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="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;

 &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.contrib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.urls&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;

 &lt;span class="n"&gt;urlpatterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;    &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'app.urls'&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
     &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'admin/'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;urls&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;Now you can start the server, by running the following command.&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="nv"&gt;$ &lt;/span&gt;python manage.py runserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you should see a rather plain but working index page like the one below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YRB8eaXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/H0Gi0pO.pngi" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YRB8eaXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/H0Gi0pO.pngi" alt="Hello, World! Index Page"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Before we're done
&lt;/h2&gt;

&lt;p&gt;Before summarising what was covered in this article. You might have noticed there is already an "admin" app added to the project/urls.py urlpatterns.&lt;/p&gt;

&lt;p&gt;This was created when you ran the command &lt;code&gt;django-admin startproject project&lt;/code&gt; in the previous Django tutorial. And is &lt;em&gt;technically&lt;/em&gt; the first user app you installed for your project.&lt;/p&gt;

&lt;p&gt;At the moment when you visit the &lt;em&gt;/admin&lt;/em&gt; page you'll be greeted with a login screen. But we'll go over Django super-users and project administration in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dAQtNtQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/AWwm5Vv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dAQtNtQ6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/AWwm5Vv.png" alt="Django adminisrtation login"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;After going through this post, you should now;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Know the difference between Django projects and apps.&lt;/li&gt;
&lt;li&gt;Create your first app, and add it to the project's settings.py file.&lt;/li&gt;
&lt;li&gt;Define an index page for your project, by creating a simple "Hello, World!" function.&lt;/li&gt;
&lt;li&gt;Add your new web page to the project urlpatterns, and be able to view it on your browser.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Hopefully, you have been able to follow these first few steps for creating and setting up your first Django app. If you have any questions, recommendations or found any errors with this post. Please let me know, in the comments below.&lt;/p&gt;

&lt;p&gt;Thank you! ✌&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Django: Getting Started</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Thu, 12 Aug 2021 14:40:20 +0000</pubDate>
      <link>https://dev.to/rshalford/django-getting-started-1m3a</link>
      <guid>https://dev.to/rshalford/django-getting-started-1m3a</guid>
      <description>&lt;p&gt;First, create a directory to keep your new Django project nice and organised.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;django_project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then move into that created folder.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;django_project/
django_project &lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Installing Django
&lt;/h2&gt;

&lt;p&gt;Before installing Django and starting a project, it is good practice to create a virtual environment (venv) first. That way all package installations are locally installed, and you can then create a list of all the dependencies for the project.&lt;/p&gt;

&lt;p&gt;Since Python 3.5 the module &lt;strong&gt;venv&lt;/strong&gt; is the default way to make virtual environments, replacing pyvenv.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="nv"&gt;$ &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv project_venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you can run the following command to activate your created virtual environment. And install the latest version of Django onto it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source &lt;/span&gt;project_venv/bin/activate
django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;Django
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This will also install the required packages; &lt;strong&gt;sqlparse&lt;/strong&gt;, &lt;strong&gt;asgiref&lt;/strong&gt; and &lt;strong&gt;pytz&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can then verify which version of Django you installed. Which can be helpful in the future when debugging your code. As the &lt;a href="https://docs.djangoproject.com/en/3.2/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; is viewable for specific major releases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; django &lt;span class="nt"&gt;--version&lt;/span&gt;
3.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Creating the base project
&lt;/h2&gt;

&lt;p&gt;In comparison to other Python web frameworks, such as Flask. Django comes with some very useful setup files, after you initialise the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;django-admin startproject project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the following directories and files in your root directory (django_project/):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project/
    project_venv/
    project/
        manage.py
        project/
            __init__.py
            asgi.py
            settings.py
            urls.py
            wsgi.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  manage.py
&lt;/h3&gt;

&lt;p&gt;This Python file is used to run several important project specific commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  wsgi.py and asgi.py
&lt;/h3&gt;

&lt;p&gt;WSGI = Web Server Gateway Interface&lt;/p&gt;

&lt;p&gt;ASGI = Asynchronous Server Gateway Interface&lt;/p&gt;

&lt;p&gt;When deploying your website in the future, it's required to have either one of these files. So that you can direct an application server towards your project (e.g. gunicorn, mod_wsgi, daphne).&lt;/p&gt;

&lt;h3&gt;
  
  
  settings.py
&lt;/h3&gt;

&lt;p&gt;The settings.py file is used as a configuration file for your Django project. &lt;/p&gt;

&lt;h3&gt;
  
  
  __init__.py
&lt;/h3&gt;

&lt;p&gt;With all Python packages, there needs to be an __init__.py file, to let Python know that this directory should be viewed as a package.&lt;/p&gt;




&lt;h2&gt;
  
  
  Running the development server
&lt;/h2&gt;

&lt;p&gt;Now the basic initial setup of your Django project is complete. You can open up a browser and verify if your Django project works.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;django_project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;project/
project &lt;span class="o"&gt;(&lt;/span&gt;project_venv&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$ &lt;/span&gt;python manage.py runserver

Watching &lt;span class="k"&gt;for &lt;/span&gt;file changes with StatReloader
Performing system checks...

System check identified no issues &lt;span class="o"&gt;(&lt;/span&gt;0 silenced&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

You have 18 unapplied migration&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; Your project may not work properly &lt;span class="k"&gt;until &lt;/span&gt;you apply the migrations &lt;span class="k"&gt;for &lt;/span&gt;app&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;: admin,
 auth, contenttypes, sessions.
Run &lt;span class="s1"&gt;'python manage.py migrate'&lt;/span&gt; to apply them.
April 25, 2021 - 15:57:20
Django version 3.2, using settings &lt;span class="s1"&gt;'project.settings'&lt;/span&gt;
Starting development server at http://127.0.0.1:0000/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should then be greeted with the following web page.&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%2Fi.imgur.com%2FVCxWWhu.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%2Fi.imgur.com%2FVCxWWhu.png" alt="The installation worked successfully! Congratulations!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, when you get the success message. You can quit the server by entering Ctrl-C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Quit the server with CONTROL-C.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you may have noticed, there was an error on "unapplied migrations" for certain Django apps. For now this can be ignored. As applying database migrations will be something you will become used to when building out your Django project.&lt;/p&gt;

&lt;p&gt;You will also find a created "db.sqlite3" file created alongside your manage.py file and project/ directory. This will be project database, until you change it within project/settings.py.&lt;/p&gt;




&lt;h3&gt;
  
  
  Selecting an alternative port
&lt;/h3&gt;

&lt;p&gt;You can change which port the development server runs on. By adding a port number argument at the end of the runserver command.&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="nv"&gt;$ &lt;/span&gt;python manage.py runserver 1234
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, you can also change the ip address if you want to run a development server on different servers on your network.&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="nv"&gt;$ &lt;/span&gt;python manage.py runserver 0:1234
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;After going through this post, you should now be able to;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup your Django project root directory.&lt;/li&gt;
&lt;li&gt;Install Django and it's dependencies onto a virtual environment.&lt;/li&gt;
&lt;li&gt;Create the basic Django project file structure.&lt;/li&gt;
&lt;li&gt;Run a development server in you browser, and know how to change which ip address and/or port to run it on.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next advised steps to take now, would be to start creating your first Django app! And I'd always recommend to combine this guide with the many others found online (i.e. documentation, youtube, other articles). That way any knowledge gaps can be filled and preferred development techniques can be worked out.&lt;/p&gt;

&lt;p&gt;Hopefully, you have been able to follow these first few steps for getting started with a Django web project. If you have any questions, recommendations or found any errors with this post. Please let me know, in the comments below.&lt;/p&gt;

&lt;p&gt;Thank you! ✌&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Part 2: Arch Linux Installation Guide</title>
      <dc:creator>Richard Halford</dc:creator>
      <pubDate>Tue, 10 Aug 2021 16:18:30 +0000</pubDate>
      <link>https://dev.to/rshalford/part-2-arch-linux-installation-guide-126g</link>
      <guid>https://dev.to/rshalford/part-2-arch-linux-installation-guide-126g</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.xhalford.com/part-2-arch-linux-installation-guide/"&gt;xhalford.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In part 2 of this &lt;strong&gt;series&lt;/strong&gt;, we will be booting into a live Arch Linux environment. With the use of the USB drive we setup in the &lt;a href="https://www.xhalford.com/part-1-arch-linux-installation-guide/"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Notes:&lt;/strong&gt; There are a few presumptions being made for this guide. Regarding yourself and your current setup.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;You will be moving from another *nix system.&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;This will help with the initial steps, with the programs being used to download the image and write it to a USB drive.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;If you are coming from Windows, I will try to link to articles explaining this fairly trivial difference.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Have access to this guide on another device.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;As once we get to installing Arch Linux, we'll be stuck in a terminal for some major steps.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Can handle looking deep into the empty void of the tty.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Make sure not to make any typos - as I try to do the same throughout these guides.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What you'll need:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;USB drive&lt;/strong&gt; which will have our installation medium loaded to it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disable Secure Boot&lt;/strong&gt; for the installation image to be supported. This can be re-enabled once the install has finished.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internet connection&lt;/strong&gt; available.

&lt;ul&gt;
&lt;li&gt;Preferably via Ethernet.&lt;/li&gt;
&lt;li&gt;If you will be using WiFi there are a few steps that I will cover. Every install I've done has been this way and it's really no bother.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Loading up the live environment
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Before booting the USB, make sure to turn off secure boot in the UEFI.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Plug in your USB and turn on you computer. Making sure to enter the boot menu and select the installation medium on your USB.&lt;/p&gt;

&lt;p&gt;The key to press to enter the boot menu will vary depending on your motherboard. If you never see this boot menu option, and you load straight into your original operating system (likely Windows). This will mean you also need to turn off &lt;a href="https://www.windowscentral.com/how-disable-windows-10-fast-startup"&gt;Fast Startup&lt;/a&gt; in you UEFI settings.&lt;/p&gt;

&lt;p&gt;Now you should be greeted with the virtual console, and see that you are logged in as the root user.&lt;/p&gt;




&lt;h1&gt;
  
  
  Setting up the live environment for installation
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Boot mode
&lt;/h2&gt;

&lt;p&gt;Before anything, we need to verify that we are booting into UEFI mode.&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /sys/firmware/efi/efivars
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should hopefully output the directory. If it didn't, you may be using a different boot mode than UEFI (e.g. BIOS).&lt;/p&gt;

&lt;p&gt;Next, we will make sure your keyboard, clock and internet are connected. Before we move onto partitioning the hard drive to make space for our Arch install to live.&lt;/p&gt;




&lt;h2&gt;
  
  
  Keyboard layout
&lt;/h2&gt;

&lt;p&gt;To get a list of all available key-maps available:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /usr/share/kbd/keymaps/&lt;span class="k"&gt;**&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;.map.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To narrow down your search, you can be little more advanced and pipe this list into &lt;strong&gt;grep&lt;/strong&gt;, to make the listing easier to read. A simple example to get all Dvorak key-maps:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /usr/share/kbd/keymaps/&lt;span class="k"&gt;**&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;.map.gz | &lt;span class="nb"&gt;grep &lt;/span&gt;dvorak
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, once you've found your key-map of choice, load it up with the following command. Remembering to leave off the &lt;strong&gt;.map.gz&lt;/strong&gt; file extension:&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="nv"&gt;$ &lt;/span&gt;loadkeys uk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;For the "/usr/share/kbd/keymaps/i386/qwerty/uk.map.gz" keymap.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now everything should be inserted correctly when you type out the remaining commands.&lt;/p&gt;




&lt;h2&gt;
  
  
  Make sure we're online
&lt;/h2&gt;

&lt;p&gt;We first need to make sure our computer's network devices are recognised. As an example, my computer's Ethernet (eth13s0) and WLAN (wlp14s0) interfaces are listed with the following command:&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="nv"&gt;$ &lt;/span&gt;ip &lt;span class="nb"&gt;link
&lt;/span&gt;1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    &lt;span class="nb"&gt;link&lt;/span&gt;/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp13s0: &amp;lt;NO-CARRIER,BROADCAST,MULTICAST,UP&amp;gt; mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    &lt;span class="nb"&gt;link&lt;/span&gt;/ether 40:8d:5c:50:76:63 brd ff:ff:ff:ff:ff:ff
3: wlp14s0: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    &lt;span class="nb"&gt;link&lt;/span&gt;/ether a4:34:d9:09:77:57 brd ff:ff:ff:ff:ff:ff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're connected with an Ethernet cable, you should be okay with connecting to the internet. We can test this by pinging a popular domain we expect to be running. Once we can see that we can connect to the outside world, we can move on to the next step.&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="nv"&gt;$ &lt;/span&gt;ping wikipedia.com
PING wikipedia.com &lt;span class="o"&gt;(&lt;/span&gt;91.198.174.194&lt;span class="o"&gt;)&lt;/span&gt; 56&lt;span class="o"&gt;(&lt;/span&gt;84&lt;span class="o"&gt;)&lt;/span&gt; bytes of data.
64 bytes from ncredir-lb.esams.wikimedia.org &lt;span class="o"&gt;(&lt;/span&gt;91.198.174.194&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;27.0 ms
64 bytes from ncredir-lb.esams.wikimedia.org &lt;span class="o"&gt;(&lt;/span&gt;91.198.174.194&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;28.6 ms
64 bytes from ncredir-lb.esams.wikimedia.org &lt;span class="o"&gt;(&lt;/span&gt;91.198.174.194&lt;span class="o"&gt;)&lt;/span&gt;: &lt;span class="nv"&gt;icmp_seq&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3 &lt;span class="nv"&gt;ttl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55 &lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;154 ms
^C
&lt;span class="nt"&gt;---&lt;/span&gt; wikipedia.com ping statistics &lt;span class="nt"&gt;---&lt;/span&gt;
3 packets transmitted, 3 received, 0% packet loss, &lt;span class="nb"&gt;time &lt;/span&gt;2002ms
rtt min/avg/max/mdev &lt;span class="o"&gt;=&lt;/span&gt; 26.984/69.917/154.174/59.581 ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Entering Ctrl-C to stop this call (^C shown above)&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  WiFi connection setup
&lt;/h3&gt;

&lt;p&gt;For wireless connectivity, we will use the preinstalled &lt;strong&gt;iwd&lt;/strong&gt; command line tool, with the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To enter the tool's interactive prompt.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;iwctl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Getting the name of the WiFi device. Mine was labelled as &lt;strong&gt;wlan0&lt;/strong&gt;, so remember to replace the following commands with the name of your device.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;device list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start a scan for available networks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;station wlan0 scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Bring up a list of the available networks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;station wlan0 get-networks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Connect to the network. Replace &lt;strong&gt;SSID&lt;/strong&gt; with the name of the network you want to connect to. You will then be prompted to enter and submit the password for this network.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;station wlan0 connect SSID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Hopefully show that you are now connected to your network.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;station wlan0 show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exiting the interactive prompt with &lt;code&gt;Ctrl-d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To make sure things are running as they should.&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="nv"&gt;$ &lt;/span&gt;ping wikipedia.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Updating the system clock
&lt;/h2&gt;

&lt;p&gt;This is a simple step.&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="nv"&gt;$ &lt;/span&gt;timedatectl set-ntp &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Follow me on &lt;a href="https://twitter.com/intent/user?screen_name=richardhalford_"&gt;Twitter!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>archlinux</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
