Domů

Aerc e-mail client

aerc - a pretty good email client

Offlineimap, mutt, notmuch with Proton bridge

…CLI: Protonmail -> offlineimap -> notmuch -> Mutt | Strange Adventures In…

Convert Markdown to Asciidoc

pandoc -t asciidoc -f markdown file1.md > file1.adoc also, --wrap=auto|none|preserve, jinak zalamuje na cca 80 znaku

Který shell mi běží?

(BASH nebo ZSH třeba) echo $0

Nastaveni jasu externiho displeje

System config / session info

inxi --admin --verbosity=7 --filter --no-host --width (vhodné pro popsání konfigurace PC, údaje identifikující mě by měly být vyfiltrované těmi parametry)

Check session type (X11/Wayland)

echo $XDG_SESSION_TYPE

Řešení problému s připojením modrozubných sluchátek Momentum 4 na Debian 12 s KDE Plasma

2025-06-21

Když se rozesere připojení sluchátek, resp. všechna audiozařízení, tak pomohlo restartovat pipewire (obě služby), což rozesralo zase hlasitost sluchátek, ale ty stačilo vypnout a zapnout (Momentum 4) a už všechno dobrý: $ systemctl --user restart pipewire.*

Potenciální řešení problému se zastavením zvuku a odpojením sluchátek

Can you help Debian 12 come with PipeWire & WirePlumber for KDE Plasma too? : r/kde (konkretne tento komentar)

  1. sudo apt install pipewire
  2. sudo apt install libspa-0.2-bluetooth
  3. sudo apt install wireplumber
  4. sudo apt install pipewire-pulse
  5. sudo apt install pipewire-alsa
  6. systemctl –user daemon-reload
    • ensures that any changes made to user service definitions are recognized and applied by the systemd system manager for that user.
    • When you create or modify user service files (typically located in ~/.config/systemd/user/ or /etc/systemd/user/), those changes are not automatically recognized by systemd. Running daemon-reload tells systemd to reload the configuration files for user services. This is necessary for any changes to take effect.
  7. systemctl –user –now disable pulseaudio.service pulseaudio.socket
  8. systemctl –user –now enable pipewire pipewire-pulse
  9. systemctl –user –now enable wireplumber.service
  10. LANG=C pactl info grep ‘^Server Name’
  11. Get this equal to Gnome: Server Name: PulseAudio (on PipeWire 0.3.65)

Another common issue is related to the Bluetooth stack itself. For instance, the bt_uhid_send: Invalid argument (22) error has been observed in several cases, which might indicate a problem with the Bluetooth driver or the Bluez software. Users have found that commenting out specific lines in configuration files, such as /etc/bluetooth/input.conf, can sometimes resolve these issues. SOLVED Bluetooth connects then disconnects immediately / Multimedia and Games / Arch Linux Forums

Wrong notification system in KDE Plasma

KDE Plasma does indeed have its own notification system, but it conflicts with the one from XFCE, which is what the dialog box is telling you.

If you do not use XFCE4 anymore, you can uninstall the xfce4-notifyd package which provides the XFCE nofications. If you do still use XFCE4, but want to prioritize the KDE Plasma notification system over the XFCE one, you can symlink the notification service to .local which should be prioritized by dbus:

mkdir -p ~/.local/share/dbus-1/services/
ln -s /usr/share/dbus-1/services/org.kde.plasma.Notifications.service \
  ~/.local/share/dbus-1/services/org.kde.plasma.Notifications.service

Then restart.

(nevyzkoušeno)

Non Snap Firefox

  1. sudo snap remove firefox
  2. sudo install -d -m 0755 /etc/apt/keyrings
  3. wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
  4. echo "deb \[signed-by=/etc/apt/keyrings/packages.mozilla.org.asc\] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null 5. ```bash echo ‘ Package: * Pin: origin packages.mozilla.org Pin-Priority: 1000

Package: firefox* Pin: release o=Ubuntu Pin-Priority: -1’ | sudo tee /etc/apt/preferences.d/mozilla

7. `sudo apt update && sudo apt remove firefox` 
8. `sudo apt install firefox`
9. optionally, install localization: `sudo apt install firefox-l10n-fr`
... a nebo prostě použij Debian (ten má ESR), Manjaro, ...

# Certbot
`$ sudo certbot renew --dry-run`
  pokud je vše v pořádku, vyreportuje něco na tento způsob:

Congratulations, all simulated renewals succeeded: /etc/letsencrypt/live/edison23.net/fullchain.pem (success) /etc/letsencrypt/live/kmurtinger.cz/fullchain.pem (success) /etc/letsencrypt/live/sb.edison23.net/fullchain.pem (success)



# Obecné

**Grep - vyhledat vzor a vyradit z vysledku podvzor**
`grep -nriw gui | grep -v "admin-gui"` - hleda rekurzivne nehlede na velikost cela slova “gui” a vyradi z vysledku ta, co jsou “admin-gui”
nevyhoda je, ze se tou pajpou ztrati zvyrazneni vysledku prvniho grepu

**port forward / “mount” via SSH**
`$ ssh -L 4000:127.0.0.1:4000 edison23@192.168.50.222`

**Nastavit vychozi editor v terminalu**: `sudo update-alternatives --config editor`

**Ovládání hlasitosti z terminálu - set audio volume in terminal**
https://unix.stackexchange.com/a/412926

**Vyřadit ze záloh**
/var/lib/snapd/cache

**Set up OpenVPN server**
https://www.cyberciti.biz/faq/howto-setup-openvpn-server-on-ubuntu-linux-14-04-or-16-04-lts/

**List user groups / add user to a group**
- list groups for `dakle` user: `$ getent group | grep dakle`
- add `dakle` user to the `docker` group: `$ sudo usermod -a -G docker dakle`

**Skype na Ubuntu**
- reseni, aby AppArmor nevyhazoval do logu porad zakazy pristupu Skype-u nekam: https://github.com/AJRepo/apparmor-skype

**Control battery charge levels**
  _work on Lenovo Thinkpad_
  `$ echo 60 | sudo tee /sys/class/power\_supply/BAT0/charge\_start\_threshold`
  `$ echo 80 | sudo tee /sys/class/power\_supply/BAT0/charge\_stop\_threshold`

**Scroll in screen**
1. `Ctrl+A`, then `Esc`  
2. This turns on copy mode. Use `↑`, `↓`, `PgUp`, `PgDn` or mouse wheel to move the cursor and scroll with that.
  - In this mode, press `Space` or `Enter` to start selection; finish it also with `Space`/`Enter`. You can then paste using `ctrl+A` and then `[`.
4. Return control: `Q` or `Esc`

**Grep with file mask**
- search for `how-to-use-lifecycle-state.adoc[]` in all `.adoc` files:
  `$ grep -nr --include \*.adoc "how-to-use-lifecycle-state.adoc[]"`
    `-n`: print line numbers in files
    `-r`: recurse

**Less - display line numbers**
`-N`

**RedShift configuration**
`~/.config/redshift.conf`
```bash
; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
;temp-day=5700
temp-night=3000

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1

; Set the location-provider: 'geoclue', 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values.
; 'randr' is the preferred method, 'vidmode' is an older API.
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=49.3
lon=16.4

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
;screen=1

Process state codes (STAT column in ps aux)

D    uninterruptible sleep (usually IO)
I    Idle kernel thread
R    running or runnable (on run queue)
S    interruptible sleep (waiting for an event to complete)
T    stopped by job control signal
t    stopped by debugger during the tracing
W    paging (not valid since the 2.6.xx kernel)
X    dead (should never be seen)
Z    defunct ("zombie") process, terminated but not reaped by its parent

For BSD formats and when the stat keyword is used, additional characters may be displayed:

<    high-priority (not nice to other users)
N    low-priority (nice to other users)
L    has pages locked into memory (for real-time and custom IO)
s    is a session leader
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+    is in the foreground process group

Source: https://askubuntu.com/a/360253

Signals meaning

# Signal      Default     Comment                              POSIX
  Name        Action

 1 SIGHUP     Terminate   Hang up controlling terminal or      Yes
                          process 
 2 SIGINT     Terminate   Interrupt from keyboard, Control-C   Yes
 3 SIGQUIT    Dump        Quit from keyboard, Control-\        Yes
 4 SIGILL     Dump        Illegal instruction                  Yes
 5 SIGTRAP    Dump        Breakpoint for debugging             No
 6 SIGABRT    Dump        Abnormal termination                 Yes
 6 SIGIOT     Dump        Equivalent to SIGABRT                No
 7 SIGBUS     Dump        Bus error                            No
 8 SIGFPE     Dump        Floating-point exception             Yes
 9 SIGKILL    Terminate   Forced-process termination           Yes
10 SIGUSR1    Terminate   Available to processes               Yes
11 SIGSEGV    Dump        Invalid memory reference             Yes
12 SIGUSR2    Terminate   Available to processes               Yes
13 SIGPIPE    Terminate   Write to pipe with no readers        Yes
14 SIGALRM    Terminate   Real-timer clock                     Yes
15 SIGTERM    Terminate   Process termination                  Yes
16 SIGSTKFLT  Terminate   Coprocessor stack error              No
17 SIGCHLD    Ignore      Child process stopped or terminated  Yes
                          or got a signal if traced 
18 SIGCONT    Continue    Resume execution, if stopped         Yes
19 SIGSTOP    Stop        Stop process execution, Ctrl-Z       Yes
20 SIGTSTP    Stop        Stop process issued from tty         Yes
21 SIGTTIN    Stop        Background process requires input    Yes
22 SIGTTOU    Stop        Background process requires output   Yes
23 SIGURG     Ignore      Urgent condition on socket           No
24 SIGXCPU    Dump        CPU time limit exceeded              No
25 SIGXFSZ    Dump        File size limit exceeded             No
26 SIGVTALRM  Terminate   Virtual timer clock                  No
27 SIGPROF    Terminate   Profile timer clock                  No
28 SIGWINCH   Ignore      Window resizing                      No
29 SIGIO      Terminate   I/O now possible                     No
29 SIGPOLL    Terminate   Equivalent to SIGIO                  No
30 SIGPWR     Terminate   Power supply failure                 No
31 SIGSYS     Dump        Bad system call                      No
31 SIGUNUSED  Dump        Equivalent to SIGSYS                 No

Get total memory usage https://unix.stackexchange.com/a/326797 $ Web Content $ smem -t -k -c pss -P web content # ??? dafaq $ smem -t -k -c pss -P firefox - tohle je ten, který chceš, protože je /usr/bin/firefox je rodič všech těch web content-ů atp.


Rozbalit, upravit a zpátky zabalit DEB:

dpkg -x brscan-skey-0.3.2-0.amd64.deb brscan-skey
dpkg -e brscan-skey-0.3.2-0.amd64.deb brscan-skey/DEBIAN
sed -i  -e 's/, libsane (>= 1.0.11-3)//g' brscan-skey/DEBIAN/control
sed -i  -e 's/, libsane (>= 1.0.11-3)//g' brscan-skey/DEBIAN/control.tmp
dpkg-deb -b brscan-skey brscan-skey-0.3.2-0.amd64.deb

(zde odstranění závislosti na libsane)


DPKG allow 32bit architecture $ sudo dpkg --add-architecture i386


Mutt configs http://ledaqua.yenn.ulegend.net/muttconfig/
https://zuttobenkyou.wordpress.com/2010/11/05/mutt-multiple-gmail-imap-setup/


@secalertsasia: find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} \; | awk ‘{ print $9 “: “ $5 }’ Search or find big files Linux (50MB) in current directory, enter:$ find . https://cstu.io/45c401 via @nixcraft #InformationTechnology


Quick Linux tip 💡
You can see show the running processes in a pretty manner and with the hierarchical relationship between
parent and child processes:
👉 ps -AH | less
Here’s an example 👇 https://t.co/tETmjKCO1H


BASH string manipulation: https://twitter.com/nixcraft/status/1348246609717387269


FOSS


Gnome boxes - nahrada za virtual box


Xubuntu login screen issue: https://ubuntuforums.org/showthread.php?t=2232730


CLI translate: wget git.io/trans && chmod +x trans && sudo mv ~/trans /usr/bin/ && trans -t ja ‘Hello, Mr. Edison’


DPKG - pridat architekturu dpkg --print-architecture dpkg --add-architecture i386 dpkg --print-foreign-architectures