setup a ubuntu desktop computer

I set up Ubuntu for the 1st time since several years ago.

Set up basic configuration

Settings

Open Show Applications > Settings and set each configuration.

Displays

Set a resolution

I ended up to set 1920x1080.

  • At first, I set 3920x2160 but, there was a performance issue with my graphics card.
  • I reduced the resolution to 2880x1620 (16:9), but there was a garbled issue on many applications.

Enable Night light mode

  • Open Night Light tab
  • Enable Night Light toggle

Mouse & Touchpad

Change the scroll direction on the middle button of a mouse by turning on Mouse > Natural Scrolling.

Support Multi gestures of Touchpad

Note that most of gestures still doesn’t work.

Folllow this article to set up this. Install Gestures and its dependencies.

> sudo apt install python3 python3-gi meson xdotool libinput-tools gettext

Then install libinput-gestures.

sudo gpasswd -a $USER input
ghq get github.com/bulletmark/libinput-gestures
cd /path/to/libinput-gestures
sudo make install
libinput-gestures-setup autostart start

Next, install a flatpak to download Gestures.

sudo apt install flatpak gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Before next step, restart your computer for the flatpak setup.

Then download Gestures from FLATHUB.

Troubleshooting

Error No module named 'packaging

I got an error No module named 'packaging when I ran libinput-gestures-setup autostart start for some reasons. Following this stackdriver question, I ran sudo apt install python3-packaging and restarted my desktop, and then it started successfully.

Swipe left and right to go back and forward on a browser doesn’t work

I haven’t been able to solve it yet. The configuration uses xdotool, but it looks it has an issue to get a window on the tool. I couldn’t even get an active window on the CLI.

> xdotool getactivewindow
XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error

Keyboard

Before setting a keyboard, install Gnome tweaks by next command.

sudo apt install gnome-tweaks

Use Emacs shortcut keys everywhere

  • Run gnome-tweaks
  • Open Keyboard & Mouse tab and enable Emacs Input There are other ways described in this thread

Swap Caps Lock key with a Ctrl key.

  • Run gnome-tweaks
  • Open Keyboard & Mouse > Additional Layout Options > Caps Lock behavior and choose Caps Lock is also a Ctrl.

See this page for more details.

Region & Language

In order install a language other than English, go to Manage Installed Languages > Install/Remove Languages and choose a language you wanna install. Then restart a computer

Use clipboard history

Follow this article.

sudo apt install gnome-shell-extension-gpaste

Also, to manage extensions, install next tool if you haven’t installed it yet.

sudo apt install gnome-shell-extension-prefs

Once you restart your GNOME shell, you can use them.

There are shortcut keys for this tool to use this clipboard more efficiently. See the full list in this article

  • Ctrl + Alt + H: Open the GPaste history on the top bar
  • Ctrl + Alt + S: Mask the current item as a password

Themes

Change themes based on time

From this article. First of all, GNOME shell extension and “chrome-gnome-shell” need to be installed, following this document. Then run gnome-tweaks and see there is Extensions > User themes. If not, restart a computer and check it again. Then install a browser extension for gnome extension and install Night Theme Switcher.

Install applications

Install development tools

Run next commands to install git, emacs, and tmux

sudo apt git emacs tmux fish

Install gh

Note that it’s not recommended to install it via snap according to this comment I also got the issue on the above. So, follow an official document to install this cli.

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
echo deb [arch=(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh

Install docker

First, install docker. I forgot how I did, so please check the Internet. Then in order to run docker commands without sudo, add your user into docker group, by following this article

sudo usermod -aG docker $USER

Then restart your machine.

Install 1Password GUI and CLI

Follow official documents to install them

To set up CLI, run the next command at first

> op signin my.1password.com example@example.com

ULauncher

I installed ULauncher as a launcher in Ubuntu. To download it, run next command.

sudo add-apt-repository ppa:agornostal/ulauncher && sudo apt update && sudo apt install ulauncher

But it didn’t work as expected. In order to make it work, I have to update a few things by following this document

YouTube

In order to play live streaming videos on Firefox, we need to install “ffmpeg” by sudo apt install ffmpeg and restart Firefox. I found this on this page.

Google Drive

Set up Google account on online accounts at first.

Then run next commands to install, make a mounted directory, and mount a Google Drive to the directory.

sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse
google-drive-ocamlfuse
mkdir ~/GoogleDrive
google-drive-ocamlfuse ~/GoogleDrive

This is from this page.

However, this mount is only active until I shutdown a computer. In order to keep mounting even after shutdown, the command google-drive-ocamlfuse /home/username/GoogleDrive to be added on Startup Applications. This page describes about Startup Applications on Ubuntu.

Grub

  • In order to set the default boot option as the last OS you chose, edit /etc/default/grub and set GRUB_DEFAULT=saved and GRUB_SAVEDEFAULT=true.
  • In order to fix grub boot errors, boot-repair may be helpful to install and use it, run

      sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt update
      sudo apt install -y boot-repair && boot-repair
    

Troubleshotings

Solve garbled fonts on a console

According to this question, “ttf-ubuntu-font-family” is required. Install it by sudo apt ttf-ubuntu-font-family.

.deb file cannot be installed on Nautilus or Firefox

Install gdebi by next command and open .deb file using GDebi Package Instaler.

sudo apt install gdebi

I followed this question and answers.

TODOs

  • On tmux, copy the text to a system clipboard
  • Set up a copy text history

2024

Back to Top ↑

2023

Follow Kubernetes the Hard way

4 minute read

This article was written by just following Kelsey Hightower’s Kubernetes Hardway document to understand Kubernetes internal architecture.

Gcp Billing Analyze

less than 1 minute read

There are a few documents to manage billing data in BigQuery Attribution of committed use discount fees and credits How to export to BigQuery Structur...

Prometheus Metrics Overview on Grafana

1 minute read

In this post, some variables defined in Grafana are used for Prometheus metrics, including $__rate_interval: This article describes the benefit of this va...

Use Google Secret Manager in a GKE cluster

3 minute read

There are an awesome article about the options to use the Google Secret Manager and their pros and cons. In this article, use Secrets Store CSI Driver by fol...

Working around MySQL lock metadata

2 minute read

There are multiple documents about innodb locks on MySQL 5.7: InnoDB locking Locks Set by Different SQL Statements in InnoDB Using InnoDB Transaction ...

Upgrade Windows 10 to Windows 11

3 minute read

I used to use Windows 11, but for some reasons, the OS stopped working and I needed to clean-install it from Windows 10 from windows recovery environment.

Back to Top ↑

2022

MySQL backup and restore

1 minute read

In this article, explain how to backup MySQL database using Percona Xtrabackup. There are two binaries, innobackupex and xtrabackup. innobackupex is a wrappe...

tmux

1 minute read

Basic configuration

Back to Top ↑

2021

MySQL Replication

1 minute read

This configuration is for the version 5.7 and it’s minimum configuration in the official document.

jq cheetsheet

less than 1 minute read

jq is used to parse JSON result, format and output on the cli.

Compare static site generator

less than 1 minute read

There are many web sites to compare static site generator, but they miss some explanations that require to me. For some people, these features are important ...

Back to Top ↑

2020

Getting Started with Kubernetes Deployment

less than 1 minute read

The deployment is many use cases and in this page, they’re not described. For the details for those use cases or the concept of deployment, see official page.

Overview about MySQL Lock

2 minute read

This document is written for MySQL 5.7, so these contents may be not correct for other versions.

MySQL Performance

2 minute read

This document is written for MySQL 5.7, so these contents may be not correct for other versions. In this page, performance_schema is mainly discussed.

Git hooks

less than 1 minute read

Configurations

gitHub pages

3 minute read

Getting Started See Official tutorial for detail steps.

Gitconfig

1 minute read

Configuration The detail for gitconfig is written in official page.

git cli

less than 1 minute read

Written in March 2020.

MySQL Tuner

less than 1 minute read

MySQL Tuner tool This is a tool to review a configuration for MySQL server.

kubectl cheetsheet

less than 1 minute read

Collect recent error logs If the logs are outputted by zap, error messages are aggregated by checking level = error. This log does not work very well if the ...

Introduction to GCP Cloud endpoints

less than 1 minute read

The Cloud endpoint is actually the NGINX proxy which offers the following features on GCP. Authentication and validation Logging and monitoring in GCP

HTTP/2 for Go

1 minute read

http package in golang supports HTTP/2 protocols. It’s automatically configured.

Back to Top ↑

2019

Terraform overview

1 minute read

Basic concepts There are some basic components for terraform.

Protocol Buffers for Go with Gadgets

less than 1 minute read

gogo/protobuf is the library to store some extensions from golang/protobuf in this repository. There are some useful packages that golang/protobuf does not p...

Introduction to GCP Cloud CDN

less than 1 minute read

Target upstream services Cloud CDN can have only GCP load balancer as the upstream services. And GCP load balancer can configure one of followings for backen...

Getting Started with Google closure library

less than 1 minute read

Some JavaScript library depends on Google Closure. If you need to understand the behavior of such a library, you have to know closure. The official document ...

Back to Top ↑