sensors command doesn’t show CPU temperature if you have Linux kernel 5.9.0-4. It is common problem of new hardware. But you can compile Linux kernel 5.10.0-rc6 where is the support for reading temperature in procesor AMD Ryzen 9 5900x.
Tag Archives: linux
Open last image file in Gimp
I use simple script for screenshots (bind on PrtSrc key). It saves picture of current screens in home directory. Usualy I want open the picture immediately. I created simple script that opens the youngest .jpg file in current directory (named gimp-last).
Continue readingFrom xterm to Termite and back
Not long ago I heard about Termite terminal emulator. It is inspired by Vim and that’s why I wanted to try it. Sadly Debian hasn’t package so I needed build it from source.
Continue readingExiting i3 without mouse
By default in i3 there is a key shortcut MOD + SHIFT + e to open bar on top of your screen. If you click on Yes button, i3 terminates. But you have to use a mouse what is not comfortable. I rewrite the shortcut to use dmenu instead of the i3-nagbar.
Continue readinghere-document and here-string in Bash and Fish
In Bash there are two well-known constructs named here-document and here-string. here-document is
wc << EOF
> one two three
> four five
> EOF
2 5 24
and here-string is
bc <<< 5*4
Continue reading Grub recovery after Windows update
Yesterday I updated Windows 10, BIOS and some drivers of my Dell and couldn’t run Grub, just Windows Boot Manager. I re-installed Grub from Debian recovery without succes, Windows started directly after reboot.
First fix was copy /boot/efi/EFI/debian/grubx64.efi to /boot/efi/EFI/Microsoft/Boot/bootmgrfw.efi (with backup of original file, of course) and then Grub started. But why BIOS didn’t read /boot/efi/debian/grubx64.efi?
In BIOS (Boot Sequence menu) I had 1. option “debian” and File System List was “HD(1,GPT,D6E…)” what was wrong. I deleted this option and add new one with File System List “PciRoot(0x0)/Pci(0x17,0x0)/Sata(0x2,0x0)/HD(1,GPT,D6E…)” and correct File Name “\EFI\debian\grubx64.efi” and then Grub started work.
Then I reverted back “first fix”, rename back /boot/efi/EFI/Microsoft/Boot/bootmgrfw.efi.backup to /boot/efi/EFI/Microsoft/Boot/bootmgrfw.efi and Grub starts after reboot again.
py3status
All time when I used i3 window manager I used i3status too. i3status is little bar on bottom of the screen which displays info about things I’m interested in, i.e. free disk space, IP address, volume level, date and time (+ tray icons).
Continue readingNetworkManager changes WiFi MAC address
If your WiFi is managed by NetworkManager and it has random MAC address after reboot, you can disable it in /etc/NetworkManager/NetworkManager.conf:
[device]
wifi.scan-rand-mac-address=no
[connection]
# ethernet.cloned-mac-address=permanent
wifi.cloned-mac-address=permanent
[connection] section shouldn’t be necessary nor ethernet line (it is commented).
imapfilter
Tool to filtering e-mail. Can be installed via:
sudo apt install imapfilter
Example configuration in ~/.imapfilter/configu.lua:
local posvic_eu = IMAP {
server = 'mail.posvic.eu',
username = 'my@posvic.eu',
password = '',
ssl = 'ssl3',
}
local test = IMAP {
server = 'test.email.com',
username = 'my@email.com',
password = '',
ssl = 'ssl3',
}
function print_subjects(o)
for _, msg in ipairs(filter) do
mbox, uid = table.unpack(msg)
text = mbox[uid]:fetch_message()
print(string.match(text, 'Subject:[^\n]*'))
end
end
posvic_eu.INBOX:check_status()
posvic_eu.INBOX
:contain_from('beacon-monitor@post.cz')
:contain_subject('Beacon Monitor Disk')
:move_messages(posvic_eu['Trash'])
test.INBOX:check_status()
test.INBOX
:contain_from('support@2n.cz')
:contain_subject('Ticket#')
:move_messages(test['INBOX/Automat'])
test.INBOX
:contain_from('apps@crashlytics.com')
:contain_subject('Meeting Room')
:move_messages(test['INBOX/Automat'])
vim cheatsheet
# Opens files in tabs
vim -p file1 file2
# Open all searched files
# :args to show file list
# :n to open next file
# :N to open prev file
vim `find . -name "strings.xml"`
# Re-sync syntax highlighting
:syntax sync fromstart