Configuring Arch Linux

If you’re installed Arch Linux, the next step is configuring the system to work as desired. In this guide, I walk through my general configuration of a newly installed Arch Linux instance.

Configure Internet

Set up networkmanager and if wireless, connect to an internet source:

sudo systemctl enable NetworkManager.service
sudo systemctl start NetworkManager.service

# connect to wireless
nmcli device wifi list
nmcli device wifi connect SSID password PASSWORD

Confirm access using ping.

Set up Desktop Environment

Set up xorg by install the following packages:

  • xorg
  • xterm
  • xorg-xinit
  • xorg-xclock
  • xorg-twm

Test by starting startx.

Install the following packages to set up the window and display manager

  • awesome
  • lightdm
  • lightdm-gtk-greeter
  • (if desktop)
    • nvidia
    • nvidia-settings
    • pkg-config

Configure LightDM:

sudo systemctl enable lightdm.service
sudo systemctl start lightdm.service

You should now have a graphical display running.

Configure Desktop Environment

First, set up firefox and sign in to sync all current changes.

Set up Multi-Monitors

If using multiple monitors, set them up:

sudo nvidia-xconfig

Reboot computer, then run:

sudo nvidia-settings

Save settings to the X config file.

Set up Dropbox

To configure the graphical system, get Dropbox synced to be able to use saved entries. First, install yay:

sudo pacman -S base-devel
git clone
cd yay
makepkg -si

Then import public key:

gpg --recv-keys --keyserver hkp:// FC918B335044912E

Install Dropbox:

yay -S dropbox

Finally, start and sign in to Dropbox.

Link Existing Configurations

Make symlinks for the following:

mkdir ~/.config/awesome
ln -s ~/Dropbox/config/rc.lua ~/.config/awesome/rc.lua
ln -s ~/Dropbox/config/Xresources-desktop ~/.Xresources


Setting up Laptop

Install the following packages:

  • cbatticon
  • acpilight

To make backlight changes using keyboard shortcuts, edit the /etc/rc.local file.

chgrp -R backlighters /sys/class/backlight
chmod g+w /sys/class/backlight/*/*

Then add your user to the ‘backlighters’ group:

sudo groupadd backlighters
sudo usermod -aG backlighters dfar

Restart and test the ability to inc/dec backlight with Fn+F11/F12

Installing and Configure Software


Install nautilus, flameshot, evince, and calc.

Using yay, install systemd-numlockontty, and then enable numLockOnTty

sudo systemctl enable numLockOnTty

Web Browsing/Mail/Chat

Install qbittorrent, gnome-keyring, and libsecret.

Install mailspring via yay, then add accounts, set to dark, and set signature.

Install franz via yay and sign in to all accounts, then turn on dark more and turn off todos.

Sound/Video Management

Install vlc, pulseaudio, pasystray, and pavucontrol.

Software Development

Install the following packages:

  • code
  • dotnet-sdk
  • otf-fira-code
  • nodejs
  • terraform
  • intellij-idea-community-edition
  • insomnia (yay)
  • azure-cli (yay)
  • azure-functions-core-tools-bin (yay)
  • azuredatastudio (yay)

Sync settings in VSCode.


For VPN, install openvpn, network-manager-applet, and networkmanager-openvpn. Connect to all OpenVPN instances (log in using web and download profiles).

For RDP, install remmina and freerdp, then connect to all RDP boxes.


Install gnome-boxes, then create a Win10 box with 8GB memory, 100GB HDD. Install the following software using chocolatey:

  • git
  • visualstudio2019community
  • sql-server-management-studio
  • sql-server-express


Install sane and imagescan. Then run utsushi for scanning.

For printing, install cups, nss-mdns, avahi, python-gobject, pygtk, python-dbus, and then enable and start the services:

sudo systemctl enable org.cups.cupsd.service
sudo systemctl start org.cups.cupsd.service
sudo systemctl start avahi-daemon.service

Edit /etc/nsswitch.conf and change the hosts line to include before resolve and dns:

mdns_minimal [NOTFOUND=return]

Now find the printer’s IP address:


And add the printer:

lpadmin -p OfficePrinter -E -v ipp://IP_ADDRESS/ipp/print -m everywhere

Installing Arch Linux

Setting up USB Boot Media

Windows – use Rufus (you may need to use GPT && DD image mode)


First, boot the Arch Linux USB stick onto the computer of choice. After finished loading, you should see a command terminal.

To increase font size during install, use:

setfont /usr/share/kbd/consolefonts/latarcyrheb-sun32.psfu.gz

Connect To Internet

Wired, use ping to confirm access.

Wireless – run: wifi-menu -o, select a network, then verify access using ping.

Synchronize Clock

To set the clock, run:

timedatectl set-ntp true
timedatectl status

Set up Partitions

If needed, set up partitions for the overall system. First, use parted -l to determine both:

  • Which disk you want to use
  • Whether partition table is GPT

If needed, convert to GPT using fdisk disk.

Use cfdisk to create the following partitions (remember when sizing, you can use +512M for ease):

Mount PointPartitionPartition TypeSize
/mnt/boot/dev/sda1EFI System512MB
/mnt/dev/sda2Linux root (x86-64)remaining
SWAP/dev/sda3Linux swap8GB

Format & Mount Partitions

Now format the partitions (using parted -l to list disks):

mkfs.fat <EFI_DISK>
mkfs.ext4 <PRIMARY_DISK>
mkswap <SWAP_DISK>
swapon <SWAP_DISK>

Mount the newly formatted partitions:

mount <PRIMARY_DISK> /mnt
mkdir /mnt/boot
mount <EFI_DISK> /mnt/boot

Perform Arch Installation

Edit the /etc/pacman.d/mirrorlist file and set it to have just 12 United States entries.

Install base Arch Linux:

pacstrap /mnt base linux linux-firmware nano grub efibootmgr networkmanager git firefox sudo

Generate an fstab file:

genfstab -U /mnt >> /mnt/etc/fstab

Change root into the new system to set time zone and localization:

arch-chroot /mnt

ln -sf /usr/share/zoneinfo/America/Detroit /etc/localtime
hwclock --systohc

Change the default console font size at /etc/vconsole.conf:


Generate locales and set locale:

# comment out needed locales
nano /etc/locale.gen

nano /etc/locale.conf

# set content to LANG=en_US.UTF-8

Set up network configuration (computer name):

# set computer name
nano /etc/hostname 

# configure hosts file, add contents below
nano /etc/hosts	localhost
::1		localhost	YOUR_HOSTNAME.localdomain	YOUR_HOSTNAME

Create a root password with passwd.

Configure GRUB boot loader:

grub-install /dev/sda --efi-directory=/boot

grub-mkconfig -o /boot/grub/grub.cfg

(Optional) Create Non-Root User

You’ll want to perform your daily activities without using the root user.

useradd -m dfar
passwd dfar
usermod -aG wheel,audio,video,optical,storage dfar

Edit the /etc/sudoers file and allow users of wheel group to execute any command.


Finally, reboot the system:


shutdown now

To verify, remove the USB stick used for installation, and turn on the computer.

You should be able to log in as either the root user or the newly created user specified earlier. If you end up at the terminal, you’ve successfully installed Arch Linux!

Next step involves configuring the base system.

Test Disk I/O Benchmarks in Linux

To test read/write speeds of a drive in Linux, you can run dd to check write speed:

dd if=/dev/zero of=./test bs=512k count=2048 oflag=direct

and read speed (need to clear cache beforehand to get an accurate reading, read more):

sudo /sbin/sysctl -w vm.drop_caches=3
dd if=./test of=/dev/zero bs=512k count=2048

Should get a result like the following for write speed:

and read speed:

Forcing Delete of Azure Recovery Services Vault

When trying to delete a Recovery Services vault, you can run into issues with trying to actually delete the vault from the tenant – to solve this issue, you’ll have to use the CLI and Azure CLI to do this.

Before starting, make sure to disable soft delete within the vault as well, and then delete any currently existing soft delete items.

#login to tenant
az login

#get the item's container and item name
az backup item list --vault-name VAULT_NAME --resource-group RESOURCE_GROUP

#disable protection
az backup protection disable --container-name "CONTAINER_NAME" --delete-backup-data true --item-name "ITEM_NAME" --resource-group RESOURCE_GROUP --vault-name VAULT_NAME --yes --backup-management-type AzureIaasVM

#get list of policies
az backup policy list --vault-name VAULT_NAME --resource-group RG

#delete each policy
az backup policy delete --name POLICY_NAME --vault-name VAULT_NAME --resource-group RG

#delete vault
az backup vault delete --name VAULT_NAME --resource-group RG

Setting Up Ubuntu

Recently switched over to using Ubuntu from Windows due to having some issues with running Windows 10 on the desktop. Here’s a quick guide on what I did to get everything set up.


Pretty simple, just set up a USB stick with Ubuntu on it. When install, using the following configurations:

  • Minimal installation
  • Install third party tools (save time later)

Once the installation completes, I make sure to set up the display correctly for monitors, including:

  • Setting scale to %200
  • Turning on the night light

And then a few steps before installing software:

  • Set up Livepatch (security updates)
  • Unpin favorites
  • Signing into Firefox with my Firefox account.
  • Move Dock to the bottom.


I install the following:

  • Dropbox
  • Franz (login, set dark mode, turn off todos, notifications)
  • Mailspring (dark theme, add accounts, turn notifications off)
  • VSCode (download FiraCode, sync settings)
  • PyGrid (set xdivs to 3, automatic startup)
  • Azure CLI
  • MySQL Workbench
  • OpenVPN Connect (sudo apt-get install openvpn, set up server profiles)
  • Remmina (for remoting into Windows PCs)
  • Terraform
  • kubectl
  • Gnome Tweak Tools (animations off, set dark theme, application menu off, 1 static workspace)
  • .NET Core SDK
    • Azure Functions Core Tools
  • VirtualBox (with a Windows 10 VM with 8GB memory, 100GB hard drive space) with the following installed:
    • VS2019
    • SSMS
    • SQL Server Express
    • Dropbox
    • Git

Setting Up WordPress With An Azure VM

This guide will walk though setting up a WordPress site using an Azure VM. Some of the perks of doing this are:

  • Cost-wise, you can spend as little as ~$8 a month to get a fully functional WordPress site running. If you try using MySQL and App Services in Azure, you’ll looking to spend ~$40 a month for worse specs.
  • You can scale the site up as needed if performance demands arise.


Step 1: Create An Azure VM

First, create an Azure VM with the following specs:

  • Image of Ubuntu 18.04 LTS
  • Size of B1s (anything less and you’ll run into issues)
  • Azure Backup (optional, provides a means to restore VM from scratch)

Once the VM is set, set the following Network Security Group rules:

  • Public Access – ports 80/443
  • Private Access (such as your IP address) – ports 22/3306

Step 2: Set up LAMP Server

SSH into the server and install a LAMP server with the following:

sudo apt update && sudo apt -y install lamp-server^ php-curl php-dom php-mbstring php-imagick php-zip

After installation, verify correct installation:

apache2 -v && mysql -V && php -v

Step 3: Configure MySQL

Run the following:

sudo mysql_secure_installation

Do the following:

  • Install the Validate Password Plugin at “Medium”
  • Say yes to all options except “Disallow root login remotely”

Run a query to allow access:

sudo mysql -u root -p



Edit the file /etc/mysql/mysql.conf.d/mysqld.cnf and comment out the bind-address line.

Restart MySQL:

sudo service mysql restart

Finally, test connecting to the database server using a tool like MySQL Workbench. When connected to the database server, do the following:

  • Create a DB (either copied from a migration or a fresh database)
  • Create a user that has access to the DB above.

Step 4: Install WordPress

Download and unzip WordPress into /var/www/html:

sudo tar -xzf latest.tar.gz -C /var/www/html --strip-components=1

Configure /etc/apache2/apache2.conf and allow AllowOverride to All in the /var/www directory.

Set the correct permissions for Apache:

sudo chown -R www-data:www-data /var/www/html
sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo find /var/www/html -type f -exec chmod 644 {} \;

sudo a2enmod rewrite && sudo systemctl restart apache2

As a final step, delete the index.html file from Apache:

sudo rm /var/www/html/index.html

You should now be able to run the WordPress installer and connect the database.

Once the WordPress Installer has run, log into the backend and check the site health to see if there are any misconfigurations within the system:

Optional Steps

Setting Up SSL With Let’s Encrypt

Before setting up SSL, you’ll need to set up a domain and set the appropriate DNS settings to be able to run the Let’s Encrypt process.

Enable SSL and restart Apache:

sudo a2enmod ssl && sudo a2ensite default-ssl && sudo systemctl reload apache2

Run the commands provided by CertBot.

Enable Mail

The easiest way to enable mail is to use the WP Mail SMTP plugin. Once configured, you can use the plugin to set up alongside the email carrier of choice and test the submission functionality.

Increase Upload Size

To increase upload size (for things like uploading themes/plugins/media), edit the /etc/php/7.2/apache2/php.ini file:

upload_max_filesize = 16M
post_max_size = 16M

Then restart Apache:

sudo service apache2 restart

Restore from a Backup

If opted into backup when creating the VM, the VM will have an automatic daily backup progress that you can use to restore the VM at any point.

To restore a new VM, access the Recovery Vault and go to Backup Items -> Your VM Name -> Restore VM. Once you go this, you have two options:

  • Completely create a new VM with the data restored.
  • Restore the disks into your current VM (VM must be turned off to do this).

Automatically Apply EF Core Database Migrations in Azure Function App on Startup

To apply database migrations to an Azure Function app on startup, you’ll need to have the following set up first:

Once the above is set up, you can set up the application to apply all migrations on startup, making for a link between the running application and the database it is dependent on. This is especially useful for local development – as you won’t run into cases where a local schema is outdated.

Add the following code to the Startup.cs file:


[assembly: FunctionsStartup(typeof(YOUR_NAMESPACE.Startup))]

  class Startup : FunctionsStartup
    public override void Configure(IFunctionsHostBuilder builder)

    private void ConfigureDatabase(IFunctionsHostBuilder builder)
      string SqlConnection =

      if (SqlConnection == null)
        throw new ArgumentNullException(
          $"Environment variable {Constants.ConnectionStringKey} not set.");

        options => options.UseSqlServer(SqlConnection));

      var optionsBuilder = new DbContextOptionsBuilder<Context>();

      using (var context = new Context(optionsBuilder.Options))
        catch (Exception e)
          throw new Exception(
            $"Error when migrating database: {e.Message}");

Checking Validity of a Private Key, CSR and Certificate

If you’re working with a certificate and need a means to check if the combination of the private key, CSR and certificate are all matching, you can run the following OpenSSL commands:

To check the private key:

openssl rsa -modulus -noout -in YOUR_KEY.pem | openssl md5

To check the CSR:

openssl req -noout -modulus -in YOUR_CSR.csr | openssl md5

To check the certificate:

openssl x509 -modulus -noout -in CERTIFICATE.crt | openssl md5

With each of these commands, you will have a value generated besides the (stdin) declaration, which needs to match across all of the different types to show compatibility.

Copying a nopCommerce Environment

Copying a nopCommerce environment to a destination such as your local machine or to another environment requires two major steps:

  • Copying the database
  • Cloning the source code and configuring to use the copied database

Copy The Database

  1. Using SSMS, log in to the source database server using administrative credentials (usually the remote environment).
  2. On source database server, right-click on database and click Tasks -> Export Data-tier Application
  3. Save the .bacpac file to the destination machine.
  4. Connect to the destination database server (usually local).
  5. Right-click ‘Databases’ on the destination server and click ‘Import Data-tier Application’.
  6. Use the .bacpac file created from the source database.

Copy and Configure the Source Code

  1. Clone the source code to the destination machine.
  2. Create the /Presentation/Nop.Web/App_Data/dataSettings.json file with the following content:
  "DataProvider": "sqlserver",
  "DataConnectionString": "Data Source=<YOUR_DB_SERVER_NAME>;Initial Catalog=<YOUR_DB_NAME>;Integrated Security=True;",
  "RawDataSettings": {}


  "DataProvider": "sqlserver",
  "DataConnectionString": "Data Source=localhost\\SQLEXPRESS;Initial Catalog=uesaka;Integrated Security=True;",
  "RawDataSettings": {}

Next, verify the site can be accessed.

Finally, make sure to change the store URL to the new URL being used.

Troubleshooting with Nop-templates

If you’re using nop-templates, you’ll run into some issues when trying to copy.

I had to delete all contents from the following SQL table:

delete from SS_C_Condition

Of course, this currently disables all HTML Widgets – so there must be a better way to do this. Take a look at

Converting nopCommerce to Store Images In Filesystem Instead of Database

By default, nopCommerce stores all of the images in the database, making for simple access. However, with a lot of images, this puts a lot of load on the database, alongside making for a larger database to maintain.

Some research shows that the performance doesnt differ greatly between the two options, but here’s a few reasons you might use either:

Storing in Database

  • Allows for easier backups & environment clones (only need to clone codebase and DB)
  • Single place for image storage (useful with multiple systems)

Storing on Fileserver

  • Separates large portion of data from DB (allows for smaller DB)
  • Lowers load on DB server.

First, back up your database – since this is a process that can cause major issues if something were to go wrong (or if you decide to revert back to storing images in the database).

To convert from storing images in the database to the file server, go to Admin -> Settings -> Media Settings. Click on ‘Change’:

After the conversion completes, nopCommerce will automatically convert all images into the /Content/Images folder. You’ll also notice the binaries no longer being stored in the Picture table.

Shrink Database

Once this is done, you have the potential to open a good amount of space on the database, since the binaries of the images are now stored on the fileserver themselves.

To reclaim this space, you’ll need to shrink the database. Run the following command in SQL: