Tuesday, October 12, 2021

KDE: How to make firefox to open kde's file manager (Dolphin) when saving or open file in KDE

 Make sure your Mozilla Firefox is version > 78. Mine is version 93 as of 12 Oct 2021.

1. Open firefox and type in the address bar : about:config

2. Ignore the warning by clicking "Accept the risk and Continue" button

3. type in the search bar: widget.use-xdg-desktop-portal and change the value to true

4. Restart the browser

 Have fun!


Thursday, July 29, 2021

How to enable hardware acceleration on firefox

 Below are the steps to check and enable harware acceleration on Firefox browser:

1. launch firefox and type in address bar: about:config

2. Accept the risk if prompted.

3. Type layers.acceleration.force-enabled in the search bar

4. Turn it to true

5. Close all browser's windows and restart firefox to make it effective

Cheers.

How to run firefox in Wayland?

Firefox is not running in wayland mode by default. The command below is to run firefox browser in wayland:

MOZ_ENABLE_WAYLAND=1 firefox &
  
You can also put this in your desktop's shortcut for firefox in wayland environment.
To verify whether Wayland support is enabled, go to about:support,and check “WebGL 1 Driver 
WSI Info” and/or “WebGL 2 Driver WSI Info”. If they say something about GLX, Wayland support 
is not enabled. If they say something about EGL, it is. 
 
That's all there is to it. Cheers 

Tuesday, July 6, 2021

Wireguard on Linux : A basic approach using Ubuntu 20.04 LTS server and client

 We begin with a fresh installation of Ubuntu server 20.04 LTS

Server

  1. Install wireguard
    • sudo apt install wireguard
  2. Generate server and client keys
    • umask 077
    • wg genkey | tee server_private_key | wg pubkey > server_public_key
    • wg genkey | tee client_private_key | wg pubkey > client_public_key
  3. Create server config
    • Create a file wg0.conf in /etc/wireguard/
    • [Interface] Address = 10.199.0.1/24 SaveConfig = true PrivateKey = <insert server_private_key> ListenPort = 51820 [Peer] PublicKey = <insert client_public_key> AllowedIPs = 10.199.0.2/24 <-- it means 254 IPs allowed to connect
    • Note: If you only want 1 IP to connect,change /24 to /3You can change filename from wg0.conf to vpn.conf or whatever name you want
  4. Running the wireguard's service
    • sudo systemctl enable wg-quick@wg0 <-- need to run for the first time only
    • sudo systemctl start wg-quick@wg0
  5. Enable IP forwarding (Applicable for internet-enabled vpn connection. See client's note below)
    • echo 1 > /proc/sys/net/ipv4/ip_forward
    • sudo sysctl -p <-- to make the above change effective without reboot
Client
  1. Install wireguard package
    • sudo apt install wireguard
  2. Create a file in /etc/wireguard called wg0.conf
    • [Interface] Address = 10.199.0.2/24 PrivateKey = <insert client_private_key> DNS = 1.1.1.1 [Peer] PublicKey = <insert server_public_key> Endpoint = <insert vpn_server_address>:51820 AllowedIPs = 10.199.0.0/24 PersistentKeepalive = 60
    • Note: Address parameter is the IP address for the client
      • you can also change the name of the file wg0.conf to something else
      • EndPoint is the wireguard server's IP address above.You can use IP or domain name
      • DNS is the IP of DNS server for the client.
      • *IF* the AllowedIPs is 0.0.0.0/0, it means all the traffic from the client
        • will go through vpn server and if you want the client to be able to go to
        • the internet, you must add this rule in the server:
        • iptables -t nat -A POSTROUTING -s 10.199.0.0/24 -o eth0 -j MASQUERADE or
        • You can put the iptables command above in server's wireguard config as below under [Interface]:
        • PostUp = iptables -t nat -A POSTROUTING -s 10.199.0.0/24 -o eth0 -j MASQUERADE 
  3. Connect the client
    • sudo systemctl enable wg-quick@wg0 <-- run only this time
    • sudo systemctl start wg-quick@wg0
    • Test the connection: ping 10.199.0.1
That'sall there is to it. Hope it is working for you.

Cheers!

PS: Check this out! Easy setup for wireguard : https://github.com/burghardt/easy-wg-quick
            

Wednesday, June 10, 2020

DNS error: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP

I saw a lot of errors like below in my /var/log/syslog:

Jun 10 11:06:39 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jun 10 11:06:48 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jun 10 11:06:51 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jun 10 11:06:51 zabbix systemd-resolved[30232]: message repeated 4 times: [ Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.]
Jun 10 11:07:02 zabbix systemd-resolved[30232]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.

I checked my /etc/resolv.conf and it symlinked to a file which was not exist.

ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Apr 27  2018 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

So I removed it and symlinked it to /run/systemd/resolve/resolv.conf which is systemd's resolv.conf file because I am using systemd's resolver.

So,

ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Then restart the relevant service: systemctl restart systemd-resolved

I checked again and the errors was gone.

That's all there is to it.

Thursday, June 4, 2020

How to upgrade Ubuntu 19.04 to 19.10

Steps to upgrade from 19.04 to 19.10

1. sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list
2. sudo sed -i -e 's|cosmic|eoan|g' /etc/apt/sources.list
3. sudo apt update
4. sudo apt upgrade


Happy upgrading!

How to upgrade ubuntu 18.10 to 19.04

Since 18.10 no longer supported you can upgrade manually to 19.04
Steps to upgrade:

1. mkdir /tmp/upgrade
2. cd /tmp/upgrade
3. wget http://old-releases.ubuntu.com/ubuntu/dists/disco-updates/
   main/dist-upgrader-all/current/disco.tar.gz
4. tar -xvf disco.tar.gz
5. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
6. /etc/apt/sources.list change all links prefix to ->
    http://old-releases.ubuntu.com/
7. sudo python3 dist-upgrade.py or run do-release-upgrade

If you run do-release-upgrade, answer yes to all the questions asked.

Happy upgrading!

Nvidia new hotplug feature on Linux

 If you use nvidia driver for your GPU, you probably wonder why in some config, you can't hotplug your second monitor. You need to reboo...