Post

Linux daily-use and development tools - part 1

Linux daily-use and development tools - part 1

I’m writing a blog post series on the Linux tools I use daily, including development tools and their configurations. Here’s the first post of many.

Kubuntu LTS

Earlier, I was using Debian Sid and broke my system several times. After recovering the system, I realized I needed a stable system rather than a cutting-edge one. I could have installed Debian stable, but due to display driver support being officially available only for Ubuntu and my fondness for the KDE desktop environment, I opted for Kubuntu.

During the installation, checkmark the essential third-party apps, and update the packages. This step ensures the installation of some useful tools, including git.

Change the system settings

Default Breeze Dark theme is nice for those who like a system-wide dark theme. Install it by going to: System Settings -> Appearance -> Global Theme -> Breeze Dark -> Apply

Setting up ssh credentials

If you are a developer like me, you may also need to set up SSH credentials for access to resources such as private GitHub repositories or your personal remote server. Here are the steps to generate SSH keys and export them to server:

Generate SSH keys

Check if you already have SSH keys in the .ssh directory. If not, run:

1
2
3
ssh-keygen -t ed25519 -C "your_email@example.com" #Keep pressing Enter key until command prompt appears
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

This creates two files: a private key - id_ed25519 and a public key - id_ed25519.pub in the default directory called ~/.ssh.

Export public key to Github

Copy the SSH public key generated in the previous step and add it to your GitHub account by navigating to GitHub Settings -> SSH and GPG keys. This enables seamless pull or push operations with your GitHub repository.

Here is a nice tutorial by Github.

Export public key to remote server.

Transfer the same public key to the remote server using the following command for seamless login access.

1
ssh-copy-id <username>@<server_ip_addr>

The above step copies your SSH public key to the file ~/.ssh/authorized_keys on the remote server. Now you can login to the remote server using *ssh @<server_ip_addr* and it shouldn't ask any password.

Set git configuration

Git is a version control system that tracks changes to files and folders in a project, allowing multiple contributors to maintain a documented history of contributions. It’s essential to set your identity before contributing to any project.

If you have a full install of Kubuntu, the git tool should already be installed. Set your identity using the following commands:

1
2
git config --global user.name <Full Name>
git config --global user.email <email addr>

Add flatpak support

Flatpak is a universal package manager for Linux-based systems. I authored a guide on enabling and installing Flatpak packages on Debian-based systems.

A reboot is necessary to search for your favorite packages using the Software Center. It is also required to search for Flatpak apps in the system menu.

Install LogSeq package

LogSeq is an open-source note-taking app. I prefer it over Obsidian and other note-taking apps, mainly because of the daily journal feature and its simplicity. Install the flatpak with:

1
flatpak install flathub com.logseq.Logseq

Open the app, scroll to the bottom, and select a new or existing LogSeq directory.

Push notes to Github (or any git hosting site) with the LogSeq git plugin. To install, go to Menu (…) -> Plugins -> Marketplace -> Search for git and install the plugin (plugin ID:logseq-git).

My private LogSeq Github backup is here, but it’s not accessible to others 😉.

Additional settings: Menu -> Settings -> General -> Theme -> Dark. I chose violet for accent color.

Pin LogSeq to the task manager for easy access.

If you happen to have a ThinkPad Linux laptop with the ThinkPad Hybrid USB-C dock, follow these steps to install DisplayLink drivers for connecting external monitors via the dock.

Download the .deb file from here to add the Synaptics apt repository to your Ubuntu system.

1
sudo apt install ./Downloads/synaptics-repository-keyring.deb

Update and install the drivers.

1
2
sudo apt update
sudo apt install displaylink-driver

During installation, you might be asked to set a password. This password must be entered at the next reboot. Failure to provide the correct password will result in non-functional DisplayLink drivers.

Once installation is complete, restart the device. During boot, choose Enroll MOK -> Change secure boot state and input the password.

Install dropbox

Dropbox is the only cloud service I prefer that offers robust native Linux support. Download the .deb file from the Dropbox website and install it using the following command:

1
sudo dpkg -i ~/Downloads/dropbox*amd64.deb

Force installation, even if dependencies are missing, using this command:

1
sudo apt-get install -f

Install brave browser

Brave is a privacy-centric web browser built on open-source Chromium, featuring a built-in ad blocker. You can install the Brave browser on Ubuntu by following the instructions on this page.

Remove snap support in Ubuntu

Here is the rationale for my dislike of Snap. In essence, the Snap Store is centralized unlike apt repositories, feels like bloatware, and it forcefully installs Snap packages when using the apt tool, such as with Firefox.

This section explains how to purge snap from the Ubuntu.

Disabling systemd services

Disable all snap related systemd services first. The following commands disable the Snap services:

1
2
3
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.seeded.service

Uninstall snap packages

List the all snap packages installed already on Ubuntu system with following command:

1
snap list

Uninstall each snap package individually using snap remove. In my case, I removed the following snap packages, in order:

1
2
3
4
5
6
7
sudo snap remove firefox # You might want to install a different browser before uninstalling the firefox
sudo snap remove firmware-updater
sudo snap remove gnome-42-2204
sudo snap remove gtk-common-themes
sudo snap remove thunderbird
sudo snap remove core22
sudo snap remove bare

Remove snapd and trails

Complete removal of Snapd and its associated data can be achieved with the following:

1
2
3
4
5
6
7
sudo apt autoremove --purge snapd

sudo rm -rf /var/cache/snapd/
rm -rf ~/snap
sudo rm -rf /snap
sudo rm -rf /var/snap
sudo rm -rf /var/lib/snapd

Prevent apt from installing snap packages

To ensure Snap packages are not installed in the future, configure apt preferences:

1
2
3
4
5
sudo cat <<EOF | sudo tee /etc/apt/preferences.d/nosnap.pref
Package: snapd
Pin: release a=*
Pin-Priority: -10
EOF

Installing the firefox browser

For users who prefer the Firefox browser without using Snap, follow these steps to install it from the Mozilla PPA:

First, add the Mozilla PPA repository:

1
2
3
4
5
sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

sudo add-apt-repository ppa:mozillateam/ppa

Set priorities to ensure the Mozilla PPA is preferred:

1
2
3
4
5
6
7
8
echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000

Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/mozilla

Finally, update your package lists and install Firefox:

1
2
sudo apt update
sudo apt install firefox

Tip: To make Firefox tabs more compact, enter about:config in the address bar, search for browser.uidensity, and set its value to 1.

Install Jekyll

Jekyll is a static site generator built with Ruby. While understanding Ruby isn’t necessary to use Jekyll, familiarity with Markdown is essential.

Here are the installation steps to get you started with blogging:

Install RubyGems package manager

RubyGems is a package manager that we’ll use to install Jekyll. The packages it manages are called gems. Let’s start by installing RubyGems.

1
2
3
4
5
6
7
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/shims:$PATH"' >> ~/.bashrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
source ~/.bashrc
1
eval "$(rbenv init -)"
1
2
3
4
sudo apt install libyaml-dev zlib1g-dev
sudo apt purge ruby
rbenv install 3.2.2
rbenv global 3.2.2 # set ruby version to 3.2.2

Install bundler and jekyll gems

Let’s install the gems jekyll and bundler. Bundler manages the exact versions of gems to ensure consistent deployments.

1
gem install jekyll bundler

Setting up blog

Check out the official Jekyll site to begin your blogging journey. I maintain my Jekyll blog as a repository on GitHub, which I’ll use as an example here.

1
2
3
4
git clone git@github.com:ItsNayabSD/nayab.dev.git
cd nayab.dev/
bundle install
bundle exec jekyll serve

Add the following line to ~/.bashrc to simplify entering the date in post front matter.

1
alias jdate='echo "date: $(date "+%F %T") +5:30"'

Installalling mullvad vpn

Mullvad VPN is a highly privacy-centric VPN service that doesn’t require personal information like your email address or phone number. It supports multiple payment methods, including cryptocurrencies. I prefer this VPN because it prioritizes privacy and remains unlinked to personal data.

Here are the installation steps:

1
2
3
4
sudo curl -fsSLo /usr/share/keyrings/mullvad-keyring.asc https://repository.mullvad.net/deb/mullvad-keyring.asc
echo "deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mullvad.list
sudo apt update
sudo apt install mullvad-vpn

Install mullvad browser

The Mullvad browser, created by the Mullvad team, provides default private browsing, refrains from collecting data, blocks third-party trackers, and prioritizes user privacy.

Here are the installation steps to install the browser:

1
2
3
4
5
6
7
8
9
# Download the Mullvad signing key
sudo curl -fsSLo /usr/share/keyrings/mullvad-keyring.asc https://repository.mullvad.net/deb/mullvad-keyring.asc

# Add the Mullvad repository server to apt
echo "deb [signed-by=/usr/share/keyrings/mullvad-keyring.asc arch=$( dpkg --print-architecture )] https://repository.mullvad.net/deb/stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mullvad.list

# Install the package
sudo apt update
sudo apt install mullvad-browser

Stay tuned for future blog posts featuring more tools and insights.

This post is licensed under CC BY 4.0 by the author.