Archives For November 30, 1999

As you may know, GNOME 42 adopted Microsoft RDP protocol for its built-in remote desktop feature. Ubuntu 22.04 Beta previously excluded it because of the bug due to mixed Gnome-control-center and Gnome-remote-desktop versions.

In recent updates, this feature is finally back. Users may now easily remote access to Ubuntu 22.04 desktop with the more secure and MS Windows friendly protocol.

Remote Ubuntu 22.04 desktop from Windows 11

Enable Remote Desktop in Ubuntu 22.04

1. Firstly, open system settings (Gnome Control Center) from the system tray menu.

2. Then navigate to ‘Sharing’ from left, and turn on the toggle icon on right-corner of app header. You can finally click “Remote Desktop” to enable the function and configure user, password, etc.

In my case, the first connection does not work until I re-start the remote-desktop service by running command (press Ctrl+Alt+T to open terminal):

systemctl --user restart gnome-remote-desktop.service

Connect to Ubuntu 22.04 from Windows 10/11

With RDP protocol, Windows user can simply search for and open the built-in ‘Remote Desktop Connection’ app from start menu.

Then type the computer name or IP address of Ubuntu 22.04 to connect.

In the authentication dialog, make sure the username and password you typed are correct and finally hit Enter to connect.

Connect from another Ubuntu or other Linux PC:

From another Ubuntu/Linux PC, search for and open ‘Remmina‘ (or Connections for Fedora) from the Activities overview screen.

When it opens, select ‘RDP’ and type the IP address to connection.

For laptop user, there could be a quite annoying issue that the ‘Airplane Mode’ automatically turns on when lid closed, or when the screen is tilted sideways.

For HP laptops running Ubuntu, Fedora, or other Linux using systemd, there’s a workaround by mapping the HP e057 and e058 scancodes to 240 (no-op key). So it won’t automatically turn on Airplane Mode, while the option in ‘Wi-Fi’ settings and fn + F12 key combination still function.

NOTE: This tutorial is tested and works in my Ubuntu 22.04 on HP 246 laptop. It may or may not work in your machine.

1. Create service to remap the scancode:

1.) Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to create a service file and edit via Gedit text editor:

sudo gedit /etc/systemd/system/hp-keycodes.service

Depends on your desktop environment, replace gedit in command with your system text editor (e.g., gnome-text-editor for Ubuntu 22.10+/Fedora workstation), or use nano command line editor that works in most Linux. When file opens, paste below lines and save it.

[Unit]
Description=HP setkeycodes fix

[Service]
Type=oneshot
Restart=no
RemainAfterExit=no
ExecStart=/usr/bin/setkeycodes e057 240 e058 240

[Install]
WantedBy=rescue.target
WantedBy=multi-user.target
WantedBy=graphical.target

As mentioned, this service will map e057 and e058 scancodes to no operation keycode 240.

2. Enable the service

2.) After saving the file (for nano, press Ctrl+X, type y and hit Enter), reload and enable the service by running commands below one by one:

sudo systemctl daemon-reload
sudo systemctl enable hp-keycodes.service

And finally restart your computer and check the result!

Undo the changes:

If the method does not work for you, simply run the command in terminal (Ctrl+Alt+T) to disable the service:

sudo systemctl disable hp-keycodes.service

Next remove the file:

sudo rm /etc/systemd/system/hp-keycodes.service

Finally restart your machine to apply change.

JetBrains announced the 2022.1 release of its PyCharm IDE few days ago. Here’s how to install in Ubuntu in different ways.

What’s New in PyCharm 2022.1

This is the first release of the IDE in 2022. Release highlights include (see release note for details):

  • Basic http authentication support for custom package repositories
  • Enhanced code completion for TypedDict
  • Improved TypedDict per-key warnings
  • Run commands directly from Markdown files
  • New Copy code snippet for Markdown.
  • Code cells remain in Edit mode after execution (Pro)
  • Optimized cell copy-pasting (Pro)
  • MongoDB: Editing fields in results (Pro)
  • New Services UI for Docker (Pro)

How to Install PyCharm 2022.1 in Ubuntu Linux

Method 1: Snap package

JetBrains provides official package for Ubuntu users through the Snap which runs in sandbox. Ubuntu user may just search for and install it from Ubuntu Software:

For choice, you may also press Ctrl+Alt+T on keyboard and run commands below to install it:

sudo snap install pycharm-community --classic

And you may replace pycharm-community with pycharm-professional in command for pro edition.

Method 2: Flatpak package

The IDE is also available to install as Flatpak, another universal package runs in sandbox.

1. First press Ctrl+Alt+T on keyboard and run command to install Flatpak daemon:

sudo apt install flatpak

2. Next, install the Python IDE as Flatpak using command:

flatpak install https://dl.flathub.org/repo/appstream/com.jetbrains.PyCharm-Community.flatpakref

For the Professional edition, use command:

flatpak install https://dl.flathub.org/repo/appstream/com.jetbrains.PyCharm-Professional.flatpakref

Method 3: Linux Tarball

For those don’t like the Snap and/or Flatpak, there’s no official .deb package available though you may keep an eye on this unofficial PPA.

There’s however Linux tarball available to download in its website:

After downloaded the package, extract and run the “pycharm.sh” file under ‘bin’ sub-folder will launch the IDE.

Create app shortcut so to launch PyCharm IDE from start menu

The Linux tarball lacks app shortcut integration. Here’s how to create one manually.

1.) For current user only, I’d recommend to move the source folder into “.local/bin” folder.

Open ‘Files’, press Ctrl+H, and then navigate to “.local -> bin (create if not exist)”. Then, move the source folder from Downloads to that directory.

2.) Press Ctrl+Alt+T on keyboard to open terminal, and verify by running command:

~/.local/bin/pycharm-*/bin/pycharm.sh

If the IDE launches, you can now create app shortcuts via the next step.

3.) In terminal (Ctrl+Alt+T), run command to create a shortcut file and edit via Gedit text editor:

gedit ~/.local/share/applications/pycharm-community.desktop

When the file opens, add following lines:

[Desktop Entry]
Name=PyCharm Community
Exec=/home/ji/.local/bin/pycharm-community-2022.1/bin/pycharm.sh
Icon=/home/ji/.local/bin/pycharm-community-2022.1/bin/pycharm.png
Terminal=false
Type=Application
Categories=Application;Development;
Keywords=ide;python;charm;
StartupWMClass=jetbrains-pycharm-ce

NOTE: you need to change the value of “Exec” and “Icon” by replacing ji with your username, and community with professional for Pro edition.

Tip: you may just Press Ctrl+L in file manager to copy the PATH to current folder quickly. And then paste in the previous text editor.

NOTE: If you write wrong value for ‘Exec’, the app won’t appear in system start menu (Show Applications) search results.

Remove PyCharm:

To remove the IDE, run the command below accordingly. Replace community to professional, or Community to Professional for Pro edition.

Remove the Snap package via command:

sudo snap remove pycharm-community

To remove the Flatpak package:

flatpak uninstall --delete-data com.jetbrains.PyCharm-Community

And, remove the tarball package via command:

rm -R ~/.local/bin/pycharm-* ~/.local/share/applications/pycharm-*.desktop

Want to play some nature sounds or ambient noise on Linux? Blanket is a really good choice with a stylish user interface.

As far as know, there are 2 good open-source applications in Linux for playing ambient sounds. They are ‘Blanket‘ who has a good design on its UI, and ‘Anoise‘ which has many more cool sounds but looks ugly.

For Ubuntu 22.04, Fedora 36 or Arch Linux user with GNOME 42, Blanket looks more native because of the dark mode support and GTK4 + libadwaita port.

As you see in the picture, it can play some nature sounds including Rain, Storm, Wind, Waves, Stream, Birdsong, Summer Night, as well as a few travels, coffee shop, and other noises.

The app starts playing either by clicking on a sound icon or moving the volume control slider. It supports multiple sounds playback. All playing sound icons are highlighted. By clicking on the icons can mute/un-mute them, though there’s a global start/stop button in the top-left.

Though it has only more than a dozen of sounds, there’s “Add Custom Sounds” button in the bottom to add your own sounds. And, it supports presets and can run in background and control via the Clock menu button.

Install Blanket in Ubuntu & other Linux:

Method 1: Install Blanket via universal Flatpak

The app is available to install as Flatpak for most Linux. Just follow the official setup guide.

For Ubuntu, press Ctrl+Alt+T on keyboard to open terminal and run command to install the daemon:

sudo apt install flatpak

Then install Blanket as Flatpak via command:

flatpak install https://dl.flathub.org/repo/appstream/com.rafaelmardojai.Blanket.flatpakref

Method 2: Install Blanket via Ubuntu PPA

For those prefer the classic .deb package, there’s an official Ubuntu PPA. Though the package there may not be the latest due to dependency issue.

To add the PPA, press Ctrl+Alt+T and run command in terminal:

sudo add-apt-repository ppa:apandada1/blanket

To install the Blanket via deb package, run command:

sudo apt install blanket

How to Remove Blanket:

For the Flatpak package, remove it via command:

flatpak uninstall --delete-data com.rafaelmardojai.Blanket

To remove the package from PPA, use command:

sudo apt remove --autoremove blanket

And remove the Ubuntu PPA by running command in terminal:

sudo add-apt-repository --remove ppa:apandada1/blanket

This simple tutorial shows how to install Google Earth Pro or Enterprise Client in Ubuntu 22.04 step by step.

Today we can use Google Earth easily in web browser or mobile phone. For those still need a desktop app, Google’s official apt repository provides the .deb packages for Debian/Ubuntu Linux.

1. Setup the key:

To add the Google Earth repository, you need to first install the key so your Ubuntu will trust the package from that repository.

To do so, press Ctrl+Alt+T on keyboard to open terminal and run the command below:

wget -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/earth.gpg

This is a single command that download the key file, dearmor it, and install as ‘earth.gpg’ file under ‘/etc/apt/trusted.gpg.d’ to follow the new Debian policy.

In case the command STUCK at blinking cursor, type user password (no visual feedback) and hit Enter for sudo authentication. And it should finally output un-readable messy code.

2. Add Google Earth repository:

After setup the key, run the command below will add the Google Earth apt repository into your system:

sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

This command will create google.list file under ‘/etc/apt/sources.list.d’ directory, and write the line “deb [arch=amd64] http://… main” (without quotes) into that file.

3. Install Google Earth

Finally, refresh system package cache via command:

sudo apt update

And, then install the application by running command:

sudo apt install google-earth-pro-stable

You may replace google-earth-pro with google-earth-ec for Enterprise Client

After installation, search for and launch it from ‘Activities’ overview screen and enjoy!

Remove Google Earth and its repository

After installed the package, it setup the apt repository again so you’ll get duplicated warning next time you run apt update.

To fix it, launch “Software & Updates” and remove one of the sources under “Other Software” tab.

Or remove all of them if you don’t want to get updates from the repository any more.

And to remove the Google Earth package, run the command below in terminal (Ctrl+Alt+T):

sudo apt remove google-earth-*-stable

That’s all. Enjoy!

For Linux users want to configure the boot menu screen, Grub Customizer is always a good choice for beginners.

I’ve written quite a few tutorials about the default boot-loader, which is called Grub, including set default OS to boot, install themes, add kernel parameters for hibernate, custom screen resolution, etc. All of them can be done via Grub-Customizer besides editing the configuration file.

Grub Customizer – Set default entry, menu visibility, & Kernel parameters

Why Grub Customizer Removed from Ubuntu Repository:

Grub Customizer is removed from Ubuntu 22.04 repository due to its broken logic issue. See this bug for details

However, there are some customizations that are apparently not doable by simply editing the existing configuration scripts. For those, the program moves all existing conf scripts out of the way, and instead installs “proxy scripts” written in a custom language that basically filter the output of the original scripts…

In general, Grub Customizer works for what it does, but it has logic issue about how it do the customizations that might cause issues (especially for upgrading system). So Ubuntu developer team remove the package from the universe repository.

How to Install Grub Customizer via PPA in Ubuntu 22.04/24.04

The software developer has updated the app claimed that the bug mentioned above has been fixed. And, the package has been published in its official Ubuntu PPA.

1. Add Grub Customizer PPA

Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to add the PPA:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer

Type user password when it asks (no asterisk feedback), then hit Enter to continue.

2. Add Grub Customizer PPA

After adding the PPA, you may run the apt command to install the tool in Ubuntu:

sudo apt install grub-customizer

NOTE: For Ubuntu based system, it may need to run sudo apt update to update package cache first.

Once installed, click on top-left ‘Activities‘ then search for and open the tool.

Configuring boot menu requires root (administrator) permission, so it will ask for password authentication on app start.

In the first tab, you may edit the text to display, add, remove, and/or re-arrange the menu entries.

For dual-boot or multi-boot machine, it’s possible to select which entry as default under General settings page. There are as well menu visibility and kernel parameters options (see the first screenshot).

Just like editing ‘/etc/default/grub‘ files, the bottom-right ‘advanced settings‘ button adds ability to add/edit/remove more rules.

And, ‘Appearance settings’ page offers options to configure text font, background, themes etc. Though, I prefer to install themes directly via source tarball (find Grub Themes here).

After configuration, remember to click ‘save‘ button to apply changes. That’s all.

How to Enable SSH Service in Ubuntu 22.04 LTS

Last updated: November 30, 2023 — 3 Comments

This simple tutorial shows how to enable Secure Shell (SSH) in Ubuntu 22.04, so you can login remotely and transfer data securely via the cryptographic network protocol.

Ubuntu uses OpenSSH to provide Secure Shell services. The client is pre-installed with out-of-the-box support for connecting to remove SSH server. The server package is available in system repository but not installed by default.

1. Install SSH Server:

Firstly, connect to your Ubuntu server, or press Ctrl+Alt+T on keyboard to open terminal in Ubuntu desktop.

When it opens, run the command below to install the server package:

sudo apt install ssh

Type user password for sudo authentication, though there’s no asterisk feedback

Once installed the service should run automatically. If not, use commands below to enable and start it:

sudo systemctl enable sshd && sudo systemctl start ssh

And, check the service status using command:

systemctl status ssh.service

2. Configure SSH Server:

After step 1, you should be able to connect to this Ubuntu server or desktop remotely via ssh and/or scp commands.

You may however configure it to listen on a different port, specify which users allowed to login, change the authentication methods, etc.

To do so, edit the “/etc/ssh/sshd_config” via the command below:

sudo nano /etc/ssh/sshd_config

For Ubuntu Desktop, replace nano with gedit to edit the config file with a graphical interface.

When the file opens, by removing ‘#‘ at the beginning and changing the number after ‘Port’ will change the listening port; Enable “PermitRootLogin prohibit-password” (remove # at the beginning will enable it) will allow root login via authentication key. To allow password login, change the value to ‘yes’, and you need to enable “PasswordAuthentication yes”.

For more configurations, see this document. And, if you want to setup an authentication key to login without password, try this tutorial.

After saving the file, remember to restart the SSH service to apply changes:

sudo systemctl restart sshd

3. Login or transfer data via SSH:

After setup the remote SSH server, you may run the command below to login remotely:

ssh server_user@server_ip -p 22890

Change the port number 22890 to yours or skip the -p flag if the default port is in use.

And, copy data from local to server via scp command:

scp -P 22890 /PATH/TO/FILE server_user@server_ip:/PATH/TO/DESTINATION

Or, grab data from server to local machine’s current directory via command:

scp -P 22890 server_user@server_ip:/PATH/TO/FILE ./

This simple tutorial shows how to hide user list and/or enable touchpad tap clicking in login screen of Ubuntu 22.04 LTS.

GNOME, the default desktop environment, has some hidden keys to configure the login screen options. However, you need gdm (Gnome Display Manager) user privilege who handles the default login.

After following this tutorial, Ubuntu will no longer display usernames in login screen. Instead, you need to manually type user-name and then password to login.

Option 1: Single command to hide user list from login screen

Firstly press Ctrl+Alt+T keyboard shortcuts to open terminal. When it opens, run the commands below as you need.

1.) Install dbus-x11 inter-process messaging system by running command:

sudo apt install dbus-x11

Without the package, you’ll get following output when running command in step 2.) to hide user list or enable tap to click.

dconf-WARNING **: 15:23:16.101: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

2.) To hide your usernames from login screen, use command:

xhost SI:localuser:gdm && sudo -u gdm gsettings set org.gnome.login-screen disable-user-list true

This command will first add user gdm into access control list. Then toggle the hidden ‘disable-user-list’ key via that user privilege.

For choice, you may also run the command below to enable tap-clicking in login screen.

xhost SI:localuser:gdm && sudo -u gdm gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true

To undo the changes, simply re-run the commands in step 2.) by replacing value ‘true‘ to ‘false‘.

Option 2: Use a graphical tool to configure login screen

There’s a new configuration tool, gdm-settings, under development for Ubuntu, Debian, Fedora, Arch and other Linux using GNOME Desktop.

The tool provides an elegant user interface specifically for configuring the GDM login screen, including:

  • change login screen background. (Not work for Ubuntu 22.04 so far, at least in my case)
  • Change fonts, scaling factor.
  • Configure login screen top bar.
  • Configure sound, touchpad behavior, nightlight, and more.

1.) Firstly, download gdm-settings from its project releases page:

So far, it’s AppImage package that works on most Linux!

2.) Right-click on the ‘AppImage’ package, and open its “Properties” dialog. Then enable ‘Allow executing file as program‘ under Permissions tab. Finally, right-click and select run it to launch the tool.

3.) When it opens, enable ‘tap-to-click’ under Touchpad tab, and disable user list under Miscellaneous.

After clicking ‘Apply’ and typing user password for authentication, you’ll see the changes in next login.

Want to open folder or edit file as administrator (aka root in Linux)? Here’s how to do the trick by adding menu option in Ubuntu 22.04 file manager.

The ‘Files’ (aka nautilus) has an extension called nautilus-admin to do administrative operations. With it, you may right-click on folder and select “Open as Administrator“, or right-click on file and select “Edit as Administrator“.

Don’t like MS Windows, it however does not support running an app as root.

1. Open Terminal

Firstly, open terminal either by pressing Ctrl+Alt+T key combination on keyboard, or by searching from the ‘Activities’ overview screen.

2. Install nautilus-admin

When the terminal opens, paste the command below into it and hit Enter.

sudo apt install nautilus-admin

Type user password (no asterisk feedback) for sudo authentication and hit Enter to continue.

3. Apply change

Once installed the extension, you need to restart the file manager to apply change.

Not just close and re-open the file manager window, but you need to run command to quit the background service and let it start again automatically:

nautilus -q

That’s all. Enjoy!

This simple tutorial shows how to install the tiny sound recording app “Audio Recorder” in Ubuntu 22.04 and Ubuntu 24.04 LTS.

Audio Recorder” is a little open-source app that can record audio from your system’s sound card, microphone, browsers, webcams and any sound that your PC plays out.

The tool has a built-in timer that automates audio recording on given clock time or after time period, auto stop when the recorded file size exceeds a limit. And, it can be controlled via Rhythmbox, VLC, Audacious and other MPRIS2 compatible players. For Skype users, it can automatically record all your Skype calls without any user interaction.

Sounds can be saved as OGG audio, Flac, MP3, WAV, M4A, and OPUS. And, it has command line options to control app interface as well as recording actions.

Install Audio Recorder in Ubuntu 22.04:

The PPA also contains old version packages for Ubuntu 16.04, Ubuntu 18.04, and Ubuntu 20.04

The app has been more than 10 years old! The developer team maintains an official PPA with all Ubuntu releases and their derivatives (e.g., Linux Mint) support. Somehow, it does not available in Ubuntu’s universe repository.

1. Add the PPA

First press Ctrl+Alt+T on keyboard to open terminal. When it opens, paste the command below and hit Enter:

sudo add-apt-repository ppa:audio-recorder/ppa

Type user password (no asterisk feedback) for sudo authentication and hit enter to continue.

NOTE: For Ubuntu 24.04 and 23.10, the run command below to add this PPA instead.

sudo add-apt-repository ppa:ubuntuhandbook1/audio-recorder

2. Install Audio Recorder package

After adding the PPA and updating the package cache (which is done automatically), just run the apt command below to install the tool:

sudo apt install audio-recorder

Some Ubuntu based systems need to run sudo apt update to manually refresh package cache after adding PPA. While it’s done automatically in Ubuntu.

Once installed, search for and open the tool from ‘Activities’ overview screen and enjoy!

How to Remove Audio Recorder:

To remove the Ubuntu PPA, either launch “Software & Updates” utility and remove the source from Other Software tab, or run the command below in terminal:

sudo add-apt-repository --remove ppa:audio-recorder/ppa

And to remove the sound recording app, simply use command:

sudo apt remove --autoremove audio-recorder

That’s all. Enjoy!