Friday, July 30, 2021

Сянки та Дрогобицький камінь

Nikon DSLR not listed as mounted device in Kubuntu

Accessing Nikon DSLR with Dolphin, Gwenview

Camera doesn’t connect as a mass storage device

Gwenview can't import download images from camera

Dolphin do not see Nikon D7000 as mass storage

URL cannot be listed

camera:/

Monday, July 26, 2021

Run script on startup in Ubuntu

Ctrl + Alt + T

cd /home/user/.config/

mkdir autostart


cd /home/user/.config/autostart

touch myscript.desktop


pico myscript.desktop

[Desktop Entry]

Name= myscript

Type=Application

Exec=/home/user/myscript/myscript.sh


chmod +x myscript.sh


reboot

Turn on fast startup option missing Windows 10

Sunday, July 25, 2021

Configuring X server for the NVIDIA Driver

/usr/share/X11/xorg.conf.d/10-nvidia.conf


Section "OutputClass"

    Identifier "nvidia"

    MatchDriver "nvidia-drm"

    Driver "nvidia"

    Option "AllowEmptyInitialConfiguration"

    Option "Coolbits" "28"

    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"

EndSection


Change NVIDIA graphic card power limit:

nvidia-smi -i 0 -q

sudo nvidia-smi -i 0 -pl 75

Warning: persistence mode is disabled on device 00000000:26:00.0. See the Known Issues section of the nvidia-smi(1) man page for more information. Run with [--help | -h] switch to get more information on how to enable persistence mode.

sudo nvidia-smi -i 0 -pm ENABLED

Enabled persistence mode for GPU 00000000:26:00.0.
All done.

nvidia-smi -i 0 -q

nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits // current consumption in watts

watch -n 1 nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits // -n 1 => every sec

watch -n 1 nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits >> //media/user/directory/power_log.txt && truncate -s 100M /media/user/directory/power_log.txt

sudo nano gpu_power_monitor.sh
#!/bin/bash

LOG_FILE="/media/user/directory/gpu_power_log.txt"
MAX_SIZE_MB=10

while true; do
   POWER=$(nvidia-smi --query-gpu=power.draw --format=csv,noheader,nounits)
   TEMPERATURE=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits)
   CURRENT_TIME=$(date "+%Y-%m-%d %H:%M:%S")

   echo "P: $POWER W, T: $TEMPERATURE   C $CURRENT_TIME" >> "$LOG_FILE"
   echo "P: $POWER W, T: $TEMPERATURE   C $CURRENT_TIME"

   FILE_SIZE=$(du -m "$LOG_FILE" | cut -f1)

   if [ "$FILE_SIZE" -gt "$MAX_SIZE_MB" ]; then
       sed -i '1d' "$LOG_FILE"
   fi

   sleep 1
done

chmod +x gpu_power_monitor.sh
./gpu_power_monitor.sh

Wacom tablet cursor offset not working correctly in OBS

Ctrl + Alt + T

cd /usr/share/applications/

sudo pico com.obsproject.Studio.desktop

Change Exec=obs

to Exec=QT_XCB_TABLET_LEGACY_COORDINATES=1 obs

Write terminal output of a command to a file

           || visible in terminal || visible in file || existing

  Syntax  ||  StdOut  |  StdErr  ||  StdOut  |  StdErr  ||   file   
==========++==========+==========++==========+==========++===========
    >     ||    no    |   yes    ||   yes    |    no    || overwrite
    >>    ||    no    |   yes    ||   yes    |    no    ||  append
          ||          |          ||          |          ||
   2>     ||   yes    |    no    ||    no    |   yes    || overwrite
   2>>    ||   yes    |    no    ||    no    |   yes    ||  append
          ||          |          ||          |          ||
   &>     ||    no    |    no    ||   yes    |   yes    || overwrite
   &>>    ||    no    |    no    ||   yes    |   yes    ||  append
          ||          |          ||          |          ||
 | tee    ||   yes    |   yes    ||   yes    |    no    || overwrite
 | tee -a ||   yes    |   yes    ||   yes    |    no    ||  append
          ||          |          ||          |          ||
 n.e. (*) ||   yes    |   yes    ||    no    |   yes    || overwrite
 n.e. (*) ||   yes    |   yes    ||    no    |   yes    ||  append
          ||          |          ||          |          ||
|& tee    ||   yes    |   yes    ||   yes    |   yes    || overwrite
|& tee -a ||   yes    |   yes    ||   yes    |   yes    ||  append