Random things, I think I know

Removing recent network playlist in VLC media player.

If you have used VLC to stream videos online, then you might have noticed that there is no way for you to clear the recently played URLs from the dropdown list. This list will persist even if you clear the recent media by Media -> Open Recent Media -> Clear.

It took me 2 hours to find it, by digging through the source code. That is the beauty of open source.

The solution, on Linux, VLC stores the list of recently played files in path, /home/<USER>/.config/vlc/vlc-qt-interface.conf where <USER> is the name of your user name.

Open the vlc-qt-interface.conf file and search for netMRL, there will be comma separated list of URLs assigned to the netMRL variable. Remove everything after the equal sign till the end of line. Or you can remove particular URLs from the CSV.

Similary, you will also find the recentMRL in the same file. You can edit that as well.
Continue Reading

Configure sudo to set $HOME to the home directory of the target user.

According to the documentation if the Defaults        env_reset is set, the $HOME will be set to the home directory of the target user. On the surface it might look straight forward, but if you read carefully, you might notice that the contents of env_keep and env_check also affects this behavior.

The problem is, even if you don't see env_keep configured in your sudoers file, there is a default list that comes when you install sudo. To check the default env_keep variables, login as root sudo su and run sudo -V. Under the section Environment variables to preserve: you will see the list of environment variables that get preserved when you run a sudo command.


So, even though the $HOME is set to the home directory of the target user initially, it gets over-written by these default env_keep variables.

To avoid this, you can configure the Defaults with always_set_home. So setting Defaults        always_set_home will set the $HOME to home directory of the target user despite the list of env_keep variables.
Continue Reading