Determine Client WiFi Channel on Linux

If you have network with the same name on both 2.4 and 5 GHz it might not be obvious which network you are connected too. Well, on Linux, it’s easy enough – use iwlist utility.

If you run it with frequency as an argument you’ll get list of all supported channels followed by currently used channel.

iwlist frequency
wlp4s0 32 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 36 : 5.18 GHz
Channel 40 : 5.2 GHz
Channel 44 : 5.22 GHz
Channel 48 : 5.24 GHz
Channel 52 : 5.26 GHz
Channel 56 : 5.28 GHz
Channel 60 : 5.3 GHz
Channel 64 : 5.32 GHz
Channel 100 : 5.5 GHz
Channel 104 : 5.52 GHz
Channel 108 : 5.54 GHz
Channel 112 : 5.56 GHz
Channel 116 : 5.58 GHz
Channel 120 : 5.6 GHz
Channel 124 : 5.62 GHz
Channel 128 : 5.64 GHz
Channel 132 : 5.66 GHz
Channel 136 : 5.68 GHz
Channel 140 : 5.7 GHz
Current Frequency=2.462 GHz (Channel 11)

LXQt High DPI Settings For Surface Go

Ubuntu Unity on the Surface Go is not the lightest environment out there. And on device with low memory (mine has only 4 GB) there is a definite need for something lighter. Based on my research, there are three comfortable alternatives: Xfce, LXDE, and LXQt. After a bit of testing, I decided to go with LXQt.

Installing LXQt into existing ubuntu is as easy as installing its package and selecting it on next login:

sudo apt install lxqt

What greets you are really small window elements and almost impossible to read interface. LXQt does not detect high-DPI environment and thus 1800×1200 Surface Go has to offer is used as if screen was 24″ and not mere 10″ in size.

Fortunately, there is a forum with high DPI advice. Unfortunately, a lot of those advices are not really applicable when it comes to Ubuntu 19.10. To spare you a lot of research, here is what worked for me.

The first argument you will want to adjust is QT_AUTO_SCREEN_SCALE_FACTOR=2. Forum advice is to adjust QT_SCALE_FACTOR=2 but I found this to be counter productive as properly written Qt applications will have their size quadrupled. Yes, you can use QT_SCALE_FACTOR=2 combined with QT_AUTO_SCREEN_SCALE_FACTOR=0 but that still leaves you with increased toolbar icons in high-DPI aware applications. So, for my use case, just setting QT_AUTO_SCREEN_SCALE_FACTOR=2 worked the best.

Small cursor is also a problem but there is an easy way to correct this. Most often I found setting XCURSOR_SIZE=32 mentioned but I personally like to go with XCURSOR_SIZE=48.

That said, where do you set them? Just go to Preferences, LXQt settings, Session Settings, Environment (Advanced) and add those two environment variables.

Those two changes will make your Qt applications look bigger but non-Qt applications like Chrome will still look way too tiny. For those you need to set Xft.dpi in ~/.Xresources.

echo "Xft.dpi: 192" > ~/.Xresources

With these three changes I find windows once again reasonably sized on my Surface Go.

For Your Protection

I rarely game these days but I do occasionally join my kids in play. Sometimes it’s Starcraft, sometimes Unreal Tournament, sometimes good old Minecraft.

But sometime they want to play something else online. Like when my son asked me to play Hypixel with him. And I joined. Only to be banned 2 seconds after – before even being able to do anything. Fortunately there is an appeal process and surprisingly it works fast. I had a response to my appeal within an hour. And that’s where the good news stops.

First they force you to go through the process of changing Minecraft password for no reason whatsoever. Instead of telling why you got banned, they will just point to generic list of reasons why you could get banned without any specifics on which of those reasons was the one for banning me. Although that did shed a bit of light as one of the reasons might be a VPN usage.

On my computer I have VPN turned on by default and I believe any sane person should do the same. While not bullet-proof, VPN does increase both privacy and security. However, looking over at Hypixel’s forum, getting banned for using VPN is quite common. Excuse is tracking cheaters but that doesn’t pass smell test for me. You are already using Minecraft account for this – and that costs money. Isn’t blocking Minecraft account actually more painful than indiscriminately blocking the whole IP range? Those wanting to cheat will simply use range you haven’t insta-banned.

In any case, my appeal was accepted. So permanent ban was changed into 30-day temporary ban in order “give you enough time to properly secure your account.” Their server, their rules I guess. However, suggesting that using VPN is somehow not “properly securing my account” is next-level of nonsense responses. Are they really training kids (and yes, most of their audience are kids) that VPN=not secure? I guess those advertisements really need you location that badly. :)

Surface Go Touchscreen Not Working in Ubuntu 19.10

Those using Ubuntu 19.10 might have noticed this suddenly stopped working. And this can be directly correlated with the latest kernel update.

If you dwelve into details, you can see the following with kernel 5.3.0-40 (previous, working version):

uname -a
Linux 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

sudo journalctl -b | grep multitouch
hid-multitouch 0018:04F3:261A.0001: input,hidraw0: I2C HID v1.00 Device [ELAN9038:00 04F3:261A] on i2c-ELAN9038:00
hid-multitouch 0003:045E:096F.0005: input,hiddev2,hidraw4: USB HID v1.11 Mouse [Microsoft Surface Type Cover] on usb-0000:00:14.0-7/input3

If you check it under latest kernel 5.3.0-42, you’ll see a bit of an issue:

uname -a
Linux 5.3.0-42-generic #34-Ubuntu SMP Fri Feb 28 05:49:40 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

sudo journalctl -b | grep multitouch
hid-multitouch 0018:04F3:261A.0001: report is too long
hid-multitouch 0018:04F3:261A.0001: item 0 1 0 8 parsing failed
hid-multitouch: probe of 0018:04F3:261A.0001 failed with error -22
hid-multitouch 0003:045E:096F.0005: input,hiddev2,hidraw3: USB HID v1.11 Mouse [Microsoft Surface Type Cover] on usb-0000:00:14.0-7/input3

If you browse kernel team Bugzilla, you’ll find there is already a bug report for this issue and issue has already been merged to kernels 5.5 and 5.6. Unfortunately, Ubuntu 19.10 uses a 5.3 kernel so we’ll need to wait a bit.

The next best thing is to temporarily downgrade our kernel. For this the easiest method is to just update /etc/default/grub to use third entry of the second menu (Advanced, old kernel) as the default:

sudo sed -i 's!GRUB_DEFAULT=.*!GRUB_DEFAULT="1>2"!' /etc/default/grub
sudo update-grub2

Once patch propagates to the current version of kernel, simply restore the default:

sudo sed -i 's!GRUB_DEFAULT=.*!GRUB_DEFAULT=0!' /etc/default/grub
sudo update-grub2

PS: To discover which menu entries you have available, you can use the following generalized command:

grep -Ei 'submenu|menuentry ' /boot/grub/grub.cfg | sed -re "s/(.? )'([^']+)'.*/\1 \2/; s/(submenu|menuentry) +//"