Users & Groups

Apt

Snap

SMB

Installing SMB server on Ubuntu

C/C++

Java

Go

Python

LLVM

GitHub

NodeJS

AWS

Installation

Installing Ubuntu the hard way

hdiutil convert ~/Downloads/ubuntu.iso -format UDRW -o ~/Downloads/ubuntu.img
mv ~/Downloads/ubuntu.img.dmg ~/Downloads/ubuntu.img
diskutil list
diskutil unmount /dev/disk2
sudo dd if=${HOME}/Downloads/ubuntu.img of=/dev/disk2 bs=1m
diskutil eject /dev/disk2

Enabling automatic login

Using privileged admin account open up terminal or your favorite text editor and edit the configuration file /etc/gdm3/custom.conf

Change the following snippet from

Before you begin editing, your configuration might look like this:

[daemon]
# Uncoment the line below to force the login screen to use Xorg
#WaylandEnable=false

# Enabling automatic login
#  AutomaticLoginEnable = true
#  AutomaticLogin = USERNAME

Change the file so that it instead looks like this:

[daemon]
# Uncoment the line below to force the login screen to use Xorg
#WaylandEnable=false

# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = USERNAME

You will need root/administrator privileges to perform this operation. Uncommenting the above lines will enable automatic login for the linuxconfig user. Change the username to suit your needs.

Snap Packages

Ubuntu is migrating away from using Debian's Apt to manage packages, and toward using Canonical's Snapcraft

They wrote an article titled How to keep your Linux disk usage nice and and tidy where I learned you can reduce the number of prior package versions that Snapcraft keeps, which by default, is three.

snap set system refresh.retain=2

Distribution Upgrades

Ubuntu 20.04 "Focal Fossa" has just released, so I thought I'd write a guide on how to upgrade.

  1. Sign in to the root user

    sudo -i
    
  2. Update the /etc/apt/sources.list, replace any entries of bionic or eoal with focal

    sed -i 's/bionic/focal/g' /etc/apt/sources.list
    
  3. Run the apt commands below

    apt update
    apt upgrade
    apt full-upgrade
    apt install -y update-manager-core
    reboot
    do-release-upgrade -d
    
  4. Verify successful upgrade by checking the current distribution number

    lsb_release -a
    

Google Cloud SDK

Vim

PowerShell

For more information, see Installation via Package Repository in the PowerShell documentation.

# Install pre-requisite packages.
sudo apt update && sudo apt install -y \
    wget \
    apt-transport-https \
    software-properties-common \

# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb

# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb

# Update the list of packages after
# we added packages.microsoft.com,
# then install PowerShell
sudo apt update && sudo apt install -y powershell

Mounting Files

If you are running Ubuntu from within Windows Subsystem for Linux, you can mount a remote filesystem on another host, such as a host running macOS, with the hostname HOENN, and a share named Macintosh HD, as follows:

mkdir /mnt/s
mount -t drvfs '\\HOENN\Macintosh HD' /mnt/s

Alternatively, you can mount the volume as a network drive within Windows in the File Explorer, and run the following command to mount the network drive:

mkdir /mnt/m
mount -t drvfs 'M:\' /mnt/m

Convert SVG to PNG

Install librsvg, which is built by GNOME

If you want to convert example.svg into a 1024x1024 PNG file, you have a few choices. These are ordered from best to worst.