воскресенье, 21 февраля 2021 г.

Firmware upgrade on Thinkpad X1 Extreme Gen 2 on Ubuntu 20.04

 It's actually pretty simple process, just run this in Terminal:

fwupdmgr update

Output may look the following way:

Upgrade available for Thunderbolt Controller from 42.00 to 59.00

Thunderbolt Controller and all connected devices may not be usable while updating. Continue with update? [Y|n]: Y

Downloading 59.00 for Thunderbolt Controller...

Fetching firmware

Downloading…             [***************************************] Less than one minute remaining…

Decompressing…           [***************************************]

Authenticating…          [***************************************]

Updating Thunderbolt Controller…                                 ]

Restarting device…       [***************************************]

Successfully installed firmware

суббота, 20 февраля 2021 г.

Ubuntu 14.04 LTS kernel with drop_monitor support

In this guide, I'll describe how you could build kernel for Ubuntu 14.04 with CONFIG_NET_DROP_MONITOR option. It's pretty standard reference copy-n-pasted from official manual of Ubuntu with very small changes.

If you got this error:

sudo ./dropwatch 
Unable to find NET_DM family, dropwatch can't work
Cleaning up on socket creation error

Then it means that your kernel does not have CONFIG_NET_DROP_MONITOR option compiled.

I use Ubuntu 14.04 and could provide guide how you could rebuild kernel with this option.

Rebuild kernel:

apt-get source linux-image-$(uname -r)

Install build deps:

sudo apt-get build-dep linux-image-$(uname -r) libncurses5-dev

Start process:

cd linux-lts-vivid-3.19.0 

Change options:

chmod a+x debian/rules
chmod a+x debian/scripts/*
chmod a+x debian/scripts/misc/*
fakeroot debian/rules clean 

fakeroot debian/rules editconfigs # you need to go through each (Y, Exit, Y, Exit..) or get a complaint about config later

Then specify it:

Do you want to edit config: amd64/config.flavour.generic? [Y/n] Y

Required option you could find here:

Networking support - Networking options - Network testing - Network packet drop alerting service - [M]

Build it:

fakeroot debian/rules binary-headers binary-generic binary-perarch 

Check it:

cat ./debian.vivid/config/amd64/config.flavour.generic
# Config options for config.flavour.generic automatically generated by
# CONFIG_HZ_1000 is not set
# CONFIG_PREEMPT is not set 


And finally load it when you restart to new kernel:

modprobe drop_monitor 






Using Dropwatch to monitor UDP drops in Linux

What is Dropwatch?

This tool will show place where Linux kernel drops/discards UDP packets.

Example screen:

Install dependencies:

sudo apt-get install -y libnl-3-dev libnl-genl-3-dev binutils-dev libreadline6-dev

Then clone repo, cd to src folder and run make.

And finally run tool:

./dropwatch -l kas 

пятница, 22 января 2021 г.

How to switch keyboard layout in Ubuntu 20.04 LTS via Caps Lock?

 It's pretty easy, you need to create this folder:

sudo mkdir /etc/X11/xorg.conf.d

And then you need to create following file /etc/X11/xorg.conf.d/00-keyboard.conf with this content:

Section "InputClass"

        Identifier "system-keyboard"

        MatchIsKeyboard "on"

        Option "XkbLayout" "us,ru"

        Option "XkbModel" "pc104"

        Option "XkbOptions" "grp:caps_toggle"


To apply changes you need to reboot your PC or laptop.  Tools like Tweak Gnome will not help because for some reasons in 20.04 Gnome resets configuration of custom keyboard layout when it set to Caps Lock.