Change Timezone on Ubuntu

From a Terminal

export TZ=America/Los_Angeles
timedatectl

Example Output

$ timedatectl
                      Local time: Sun 2022-09-18 18:28:01 UTC
                  Universal time: Sun 2022-09-18 18:28:01 UTC
                        RTC time: Sun 2022-09-18 18:28:03
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Another way

sudo timedatectl set-timezone America/Los_Angeles

Inside a Docker Container

ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata

Interactive Way

dpkg-reconfigure tzdata

Register an AppImage as a desktop application in Linux

Refer: https://dev.to/tqbit/how-to-register-an-appimage-as-a-desktop-application-in-linux-31c7

The Scenario:

You have an .AppImage file and would like to treat it like an installed Linux app.

The solution:

Create a custom .desktop file

For this article, I'll use the following constraints:

  • Register the Electron.js app Marktext on an Ubuntu 20.04 distro
  • Use this icon from icon-library.com or some other place

Let's do it.

NOTE: You might have to use sudo commands to access files in the /bin and /use directories

  • Download the .AppImage file and an icon you would like to register it with
  • Move the .AppImage file to the path /bin, e.g. sudo mv ~/Downloads/Marktext.AppImage /bin/
  • Make it executable with sudo chmod +x /bin/Marktext.AppImage
  • Save the icon under /use/share/icons/custom/markdown.png e.g. sudo mkdir --parents /use/share/icons/custom && sudo mv ~/Downloads/markdown.png /use/share/icons/custom/
  • Create a .desktop file under ~/.local/share/applications/marktext.desktop
  • Paste the following content into it:
[Desktop Entry]
Name=Image Name                           # NAME YOUR IMAGE HERE
Comment=What this program does            # COMMENT ABOUT USAGE
Exec=/bin/marktext-x86_64.AppImage        # REPLACE WITH YOUR .AppImage
Terminal=false
Type=Application
Icon=/usr/share/icons/custom/markdown.png # REPLACE WITH YOUR ICON
Categories=Utility                        # SET THE CATEGORY, CAN HAVE MULTIPLE ENTIRES SEPARAGED BY ;
MimeType=text/markdown;                   # SET MimeType
Keywords=marktext;markdown;               # ADD SEARCHABLE KEYWORDS
StartupWMClass=filename.AppImage          # USE PROGRAM BINARY NAME HERE
Actions=NewWindow;

That should do it. Try pressing the Super key now and search for the app.

Ubuntu 22.04 Network Connection Has Question Mark Through it

Refer: https://www.ucartz.com/clients/index.php?rp=/knowledgebase/1406/Network-icon-shows-question-mark-in-Ubuntu-18.04.html

This Question Mark means the internal connectivity test fails and instead of a network icon, there is a question mark. Apparently, there are no network issues, but that question mark is annoying.

How to turn it off:
Go to Settings > Privacy > Connectivity Checking

Set it OFF. (Then, restart your WiFi connection)

Ubuntu Battery Saver TLP and Slimbook

Refer: https://ubuntuhandbook.org/index.php/2020/06/improve-battery-life-ubuntu-20-04-lts/
Refer: https://www.omgubuntu.co.uk/2021/10/slimbook-battery-4-released

How to Install TLP in Ubuntu 20.04

Simply open terminal either from application menu or by pressing Ctrl+Alt+T on keyboard. When terminal opens, run command:

sudo apt install tlp

Install Slimbook Battery from its official PPA

Run following commands in terminal one by one in terminal:

sudo add-apt-repository ppa:slimbook/slimbook
sudo apt update
sudo apt install slimbookbattery

Remove Slimbook and TLP

sudo add-apt-repository --remove ppa:slimbook/slimbook
sudo apt remove --autoremove slimbookbattery
sudo apt remove --autoremove tlp