2023 m. liepos 19 d., trečiadienis

How to disable pylint messages

 Command line example:

--disable=logging-format-interpolation,subprocess-run-check,missing-module-docstring


In visual studio code setting.json

    "pylint.args": [
        "--disable=logging-format-interpolation,subprocess-run-check,missing-module-docstring,consider-using-f-string,pointless-string-statement,logging-fstring-interpolation"
    ],

 

2023 m. liepos 10 d., pirmadienis

linux time and date

$ systemctl status systemd-timesyncd.service

$ timedatectl set-time "2000-01-01 11:11:11"
$ timedatectl set-ntp true
$ timedatectl set-timezone UTC
$ timedatectl timesync-status
$ timedatectl show-timesync --all

NTP servers conf file
/etc/systemd/timesyncd.conf

 

 

More to read:

https://linuxreviews.org/HOWTO_ensure_your_clock_is_accurate_and_showing_the_correct_time_using_the_Network_Time_Protocol

https://man.linuxreviews.org/man5/timesyncd.conf.5.html

2023 m. birželio 28 d., trečiadienis

Update git timestamp

How to update git timestamp

GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"

2023 m. birželio 27 d., antradienis

How to fix wsl2 ntp error

$ sudo sed -i 's/ConditionVirtualization=!container/#ConditionVirtualization=!container/' /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service

$ systemctl daemon-reload 

$ sudo systemctl restart systemd-timesyncd

Source: https://1kko.com/2460635

2023 m. birželio 11 d., sekmadienis

Naudongos linux programos

tldr - programų naudojimas

mcfly - Protiga paieška Ctrl + F

ncdu - Stebint disko vietą

bat - teksto stebejimui

2023 m. birželio 8 d., ketvirtadienis

EOF

 Run python in bash scripts:

#!/bin/bash
python3 <<EOF
print("test")
EOF

Modify resolv file:

#!/bin/bash
cat << EOF > /etc/resolv.conf
nameserver 8.8.4.4
EOF

2023 m. birželio 7 d., trečiadienis

Wach useful commands

Watch largest system files 

$ watch -n 5 -d "sudo find / -xdev -type f -size +100M | xargs ls -lah" 

Largests files in directory

$ du -h /var/log | sort -rh | head -n 10

Monitor open sockets

watch -d "ss -xls | grep dbus.sock