Diogo Ferreira


Prevent Ubuntu 20.04 from changing audio device to USB headset on boot

This was bothering me.

I'm using an wireless headset (HyperX Cloud Flight Wireless Gaming Headset) that has an USB receptor and some old Logitech speakers on my desktop, currently running Ubuntu 20.04 (in dual boot with my Windows 10).

Every time I reboot or turn on my computer and boot Ubuntu the default output audio device is set to my headset, which most of the time is off (I only use it when gaming).

Going to Settings - Sound and choosing the correct output device (Line Out) only changes it for the current session.

You can solve this by doing the following:

Edit the file default.pa:

$ sudo vim /etc/pulse/default.pa

And comment the following lines:

#.ifexists module-switch-on-connect.so
#load-module module-switch-on-connect

Reboot. Now your computer should leave the output device you select in settings alone. My guess is that every time you turn on the computer it finds the USB receptor and change to it.

How to install Grocy with Apache on Debian 10

This took me longer than I'd like to admit, but, to be honest, their documentation is not on point.

Grocy is a web-based self-hosted groceries & household management solution for your home.

I already have a few services running on my home server, sitting behind my faithful Apache, accessible from a custom domain.

I don't want it running as a subdomain. Every explanation I found assumes that.

TL:DR: If you want Grocy running behind an Apache proxy, set it up like this:

  • Get Grocy:
$ cd /tmp
$ wget https://releases.grocy.info/latest
$ sudo unzip latest -d /var/www/html/grocy/
  • Copy the Grocy configuration file and change it to your liking:
$ sudo cp /var/www/html/grocy/config-dist.php /var/www/html/grocy/data/config.php
  • The important settings here are:
Setting('BASE_PATH', '');
Setting('BASE_URL', '/');
Setting('DISABLE_URL_REWRITING', false);

And they should be setup just like this for usage with a subdomain and Apache.

  • Create a configuration file in Apache for Grocy:
$ sudo vim /etc/apache2/sites-available/grocy.home.your-domain.pt.conf
  • Adapt the following to your configuration. The relevant part here is the DocumentRoot, and the Directory. Don't forget to set the full path to the Grocy public folder :
<VirtualHost *:80>
    ServerName grocy.home.your-domain.pt
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/grocy/public
    ErrorLog /var/log/apache2/grocy-error.log
    CustomLog /var/log/apache2/grocy-access.log combined

<Directory /var/www/html/grocy/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  • Enable the site:
$ sudo a2ensite grocy.home.your-domain.pt
  • Reload Apache:
$ sudo systemctl reload apache2

And your instance if running on http://grocy.home.your-domain.pt!

I've made a few assumptions here (you have your own local domain, have Apache already setup with PHP, etc), but I hope is helpful to someone.

Maybe later I'll update this post with a more detailed explanation.

Unblock LDAP or Active Directory user in GitLab

If you're running a self-hosted GitLab instance and use LDAP or Active Directory authentication you may notice that sometimes users get "Blocked" and you can't unblock them using the web interface.

When this situation occurs, you can unblock them using the gitlab-rails console directly in the server.

Run the following:

$ gitlab-rails console production

And then inside the console you can find the user by email and set it to "Active" like this:

> user = User.find_by_email("[USER-EMAIL]")
> user.state = "active"
> user.save
> exit

Replace [USER-EMAIL] with the actual email you're looking for. The user should now be active and ready to login.

Missing icons on Fedora 25 Xfce spin

If you use the Fedora 25 Xfce spin you may already noticed that some icons are missing on the default theme.

This is the easy to fix it:

$ sudo dnf install gnome-icon-theme-symbolic gnome-icon-theme-extras gnome-icon-theme-legacy gnome-icon-theme

How to install the new Skype for Linux on Fedora 25

Skype now has a repository for RPM based distributions. It’s still labeled as beta, but they are retiring the old 4.3 version after June 2017, so this is the version you should be using.

Installation is straightforward:

$ sudo dnf config-manager --add-repo=https://repo.skype.com/data/skype-stable.repo
$ sudo dnf install skypeforlinux