Saturday, July 31, 2021

GoldenDict Dark theme creation with CSS styles

Ctrl + Alt + T

cd /home/user/.goldendict/styles/

mkdir Dark

cd Dark

touch qt-style.css

pico qt-style.css

Friday, July 30, 2021

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

Remove boot option in bios boot menu UEFI

user@PC:~$ sudo fdisk -l

[sudo] password for user: 

Disk /dev/nvme0n1: 238,49 GiB, 256060514304 bytes, 500118192 sectors

Disk model: TS256GMTE110S                           

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: gpt

Disk identifier: 6A76AEF7-D60C-4CA8-A4F2-9053CCDB5F29

Saturday, July 24, 2021

Thursday, July 22, 2021

No access to shared folders on Windows

No access to shared folders on Ubuntu from Windows

This works on Windows Vista, Windows 7, Windows 8.1 and Windows 10:

Go to Network and Sharing Center.

Change advanced sharing settings

All networks (at the bottom)

Turn off password protected sharing

Install Google Chrome in Ubuntu Terminal

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb

wine folder not found after install wine /home/user/.wine/

wine --version

winecfg

wine control

wine explorer

wine program.exe

Wednesday, July 21, 2021

Ubuntu Software and Updates Settings

Show info about current operation system - OS:
cat /etc/*release
cat /etc/*ease
hostnamectl // system info
lsb_release -a // system information

smb.conf - samba configuration - ubuntu mounted ntfs drive

sudo apt update
sudo apt install samba
sudo apt install smbclient
smbd -V
sudo smbstatus
sudo service smbd restart
sudo service nmbd restart
sudo service smbd status
sudo service nmbd status
sudo systemctl enable smbd.service nmbd.service
sudo service smbd stop
sudo service nmbd stop
sudo nano /etc/samba/smb.conf // old configuration files... see link on previous line!!!

Thursday, July 15, 2021

Яйко-Ілемське чи Мізунка?

12.07.2021 виїзд електричкою на Стрий, пересадка на автобус і я в Долині! Автостанція закрита, жодних розкладів - супер! Сиджу на вокзалі, думаю, гадаю, куди податися: Мислівка чи Новий Мізунь? Зважаючи на хмарки, які інтенсивно скупчувалися на небосхилі, вирішив їхати в Мислівку, бо добре знаю, що таке дощі на Мізунці. Там зграї комарів, мух, слизька вузькоколійка та важкий брід + маршрут сам по собі не дуже цікавий. Не встиг вийти з автобуса Львів-Хуст у Мислівці, як почався дощ. Вгадав! Шлях до Яйка-Ілемського незмінний, але перед підйомом на полонину Мшану його частково спердолили лісоруби + природа допомогла: трапився 1 серйозний смерековий бурелом.

13.07.2021 йду глянути на хатку під Яйко-Ілемське. Краще б я цього не робив, але загалом більш-менш приємно прогулявся. Ось залишки колиби під Яйком-Ілемським:

Saturday, July 3, 2021

Linux standard directories and their contenrs

/bin

Core operating system commands

/boot

Boot loader, kernel, and files needed by the kernel

/compat

On FreeBSD, files and libraries for Linux binary compatibility

/dev

Device entries for disks, printers, pseudo-terminals, etc.

/etc

Critical startup and configuration files

/home

Default home directories for users

/lib

Libraries, shared libraries, and commands used by /bin and /sbin

/media

Mount points for filesystems on removable media

/mnt

Temporary mount points, mounts for removable media

/opt

Optional software packages (rarely used, for compatibility)

/proc

Information about all running processes

/root

Home directory of the superuser (sometimes just /)

/run

Rendezvous points for running programs (PIDs, sockets, etc.)

/sbin

Core operating system commands a

/srv

Files held for distribution through web or other servers

/sys

A plethora of different kernel interfaces (Linux)

/tmp

Temporary files that may disappear between reboots

/usr

Hierarchy of secondary files and commands

/usr/bin

Most commands and executable files

/usr/include

Header files for compiling C programs

/usr/lib

Libraries; also, support files for standard programs

/usr/local

Local software or configuration data; mirrors /usr

/usr/sbin

Less essential commands for administration and repair

/usr/share

Items that might be common to multiple systems

/usr/share/man

On-line manual pages

/usr/src

Source code for nonlocal software (not widely used)

/usr/tmp

More temporary space (preserved between reboots)

/var

System-specific data and a few configuration files

/var/adm

Varies: logs, setup records, strange administrative bits

/var/log

System log files

/var/run

Same function as /run; now often a symlink

/var/spool

Spooling (that is, storage) directories for printers, mail, etc.

/var/tmp

More temporary space (preserved between reboots)

Поширені помилки Ford Mondeo MK4 2014

Ford BS71-13A602-BD

Ford BS71-13A602-BC

JX7B13A602DA, 32D1884T, 1717230, 1738520, 354997081, 9EL354997081, 1 764 009

(OK) [11:17:47.895] Read system monitor status has been started
(OK) [11:17:47.932] Malfunction Indicator Lamp (MIL) Status: Off
(WARN) [11:17:47.935] Misfire monitoring: Not supported
(OK) [11:17:47.937] Fuel system monitoring: Complete
(OK) [11:17:47.939] Comprehensive component monitoring: Complete
(WARN) [11:17:47.941] Catalyst monitoring : Not supported
(WARN) [11:17:47.943] Heated catalyst monitoring : Not supported
(WARN) [11:17:47.945] Evaporative system monitoring: Not supported
(OK) [11:17:47.947] Secondary air system monitoring: Complete
(WARN) [11:17:47.950] A/C system refrigerant monitoring: Not supported
(OK) [11:17:47.952] Oxygen sensor monitoring: Complete
(OK) [11:17:47.954] Oxygen sensor heater monitoring: Complete
(OK) [11:17:47.956] EGR system monitoring: Complete
(OK) [11:17:56.140] Test completed successfully, no errors found

(WARN) [18:12:40.035] Checking FTDI #1:A50285BI...
(OK) [18:12:50.763] Connection to adapter has been established: FTDI #1:A50285BI
(OK) [18:12:50.764] Adapter:  STN1170 v3.3.1 (ELM327 v1.3a)
(ERR) [18:12:50.844] This adapter uses ********** STN chip
(OK) [18:12:51.157] Connection to vehicle has been established
(OK) [18:13:00.799] Vehicle: Ford Mondeo Duratorq Turbo Diesel Common Rail Injection Stage V 2.0L 2014 ( 2011 MY ), VIN: *****************
(OK) [18:13:03.953] Found module:  PCM - Powertrain Control Module
(WARN) [18:13:04.117] DTCs in PCM: P003A:00-28
(OK) [18:13:04.224] Found module:  OBDII - On Board Diagnostic II
(OK) [18:13:04.466] Found module:  SASM - Steering Angle Sensor Module
(OK) [18:13:04.754] Found module:  ABS - Antilock braking system
(WARN) [18:13:05.114] DTCs in ABS: B1B69:16-08
(OK) [18:13:05.134] Found module:  RCM - Restraint Control Module
(OK) [18:13:06.403] Found module:  PSCM - Power Steering Control Module
(OK) [18:13:06.974] Found module:  BCMii - Body Control Module
(OK) [18:13:07.104] Found module:  SRM - Speech Recognition Module
(OK) [18:13:07.181] Found module:  PDM - Passengers Door Control Unit
(WARN) [18:13:07.463] DTCs in PDM: U2101:00-28
(OK) [18:13:07.485] Found module:  DDM - Drivers Door Module
(OK) [18:13:07.620] Found module:  HVAC - Heating Ventilation Air Conditioning
(OK) [18:13:07.697] Found module:  ACM - Audio Control Module
(OK) [18:13:08.342] Found module:  IPC - Instrument Panel Control Module
(WARN) [18:13:08.494] DTCs in IPC: U0401:68-2A, U0416:68-AE

===PCM DTC P003A:00-28===
Code: P003A - Turbocharger/Supercharger Boost Control A Position Exceeded Learning Limit
https://mondeoclub.ru/forums/topic/142781/
Status:
 - Previously Set DTC - Not Present at Time of Request
 - Malfunction Indicator Lamp is Off for this DTC

Module: Powertrain Control Module

 Freeze Frame :
-GLOBTIM: 244546761 s - Global real time
-TOTDIST: 229666.0 km - Total Distance
-MAINECUV: 13.50 V - Main ECU voltage supply
-ESTSERUN: No  - Engine status - engine running
-ESTSECRK: No  - Engine status - engine in crank
-INCARTMP: 27 °C - In car temperature
-OUTTMP: 4 °C - External Temperature From Sensor
===END PCM DTC P003A:00-28===

===ABS DTC B1B69:16-08===
Code: B1B69 - 12 Volt Supply Circuit

Additional Fault Symptom:
 - Circuit Voltage Below Threshold

Status:
 - Previously Set DTC - Not Present at Time of Request
 - Malfunction Indicator Lamp is Off for this DTC

Module: Antilock braking system
===END ABS DTC B1B69:16-08===

===PDM DTC U2101:00-28===
Code: U2101 - Control Module Configuration Incompatible
https://www.autocodes.com/u2101_ford.html Body Control Module (BCM) ABS
This code will also appear when updating the A-3 to A-12 map card. Simply erase code or after driving approx 100 miles it will reset itself. Also if the ignition key cylinder ( not the switch) starts wearing as mine did it will throw the U2-101 code. This code does not affect the operation of the vehicle or throw a "check engine" light.
Status:
 - Previously Set DTC - Not Present at Time of Request
 - Malfunction Indicator Lamp is Off for this DTC

Module: Passengers Door Control Unit
 Freeze Frame :
-GLOBTIM: 265782172 s - Global real time
-TOTDIST: 241976.0 km - Total Distance
-MAINECUV: 11.50 V - Main ECU voltage supply
===END PDM DTC U2101:00-28===

===IPC DTC U0401:68-2A===
Code: U0401 - Invalid Data Received from  ECM/PCM A
https://www.troublecodes.net/ucodes/u0401/ ABS PCM TCM BCM
Additional Fault Symptom:
 - Event Information

Status:
 - DTC Present at Time of Request
 - Malfunction Indicator Lamp is Off for this DTC

Module: Instrument Panel Control Module
===END IPC DTC U0401:68-2A===

===IPC DTC U0416:68-AE===
Code: U0416 - Invalid Data Received From  Vehicle Dynamics Control Module
https://www.troublecodes.net/ucodes/u0416/ ABS PCM
Additional Fault Symptom:
 - Event Information

Status:
 - DTC Present at Time of Request
 - Malfunction Indicator Lamp is On for this DTC

Module: Instrument Panel Control Module
===END IPC DTC U0416:68-AE===

Friday, July 2, 2021

JavaScript Cheatsheet

let – block-scoped var – function-scoped === NEVER USE!!!

Prefer const userNa = and template literal `I ${userNa} pay ${bill + tip}`; No need for \n === newline in ` `. const value can be changed in array. only primitive const value  is immutable

Use ===, !==. Do not use ==, !=

'Let\'s go!' // with ' ' escaping with \ should be used

'Tommy is ' + age + ' years old.';  // String concatenation

`Tommy is ${age} years old.`; // String interpolation


https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics

Data types: Number (always float 10.0, 5.0), String, Boolean, Null, Undefined, BigInt (integers Number can't use) // check type with typeof

type conversion – manual conversion

type coercion – automatic covenrsion by JS – AVOiD!!!

Number(constName): converts string to number but original value still be a string

String(constName)

NaN – Not a Number === invalid number


Falsy values: 0, ' ', undefined, null, NaN converted to Boolean(constName); others are truethy

Linux Console Tutorial

This document is intended to provide a foundation of skills for using Linux in console or shell mode. The reader is not expected to have any prior knowledge of how Linux works, although in this case the reader should at least look through Linux Concepts and Running Commands before moving on to the Command Reference. The Command Reference introduces the core set of Linux commands categorized by the type of functionality they provide. The final section on Advanced Features illustrates several techniques that will help you get the most out of Linux. 

Заливає свічки AUDI 80 B4 1994 2.0 бензин не заводиться

Одного чудового дня AUDI 80 B4 1994 із 2-літровим моноінжектором не заводиться. Іскри є, акумулятор заряджений, стартер крутить, інжектор поливає свічки пальним, а толку...

Як визначив причину проблеми? На холодному авто 

1) поміряв опір контактів датчика температури вхідного повітря - датчик температуры всасываемого воздуха (крайні лівий і правий контакти під повітряним фільтром з боку акумулятора на блоці інжектора - клема на 4 піни), 

2) поміряв опір на сірому 3-контактному датчику температури (подає сигнал на табло, знаходиться на блоці циліндрів - див. патрубок антифризу) та 


3) поміряв опір на блакитному 2-контактниому датчику температури антифризу (на блоці циліндрів  - див. патрубок антфризу).


При температурі навколишнього середовища +25, опір на датчику температури вхідного повітря становив 0,9 кОм, на сірому 3-контактному датчику температури - 0,85 кОм і на блакитному 2-контактниому датчику температури антифризу - 0 кОм.

Опір на цих трьох датчиках має бути більш-менш однаковим і припускаю, що може коливатися в межах 0.8-1.2 кОм при температурі навколишнього середовища +20-25 градусів.

Поміняв 2-контактниий датчик температури антифризу й AUDI 80 B4 завелася з півоберта.

Зорієнтувало це відео https://www.youtube.com/watch?v=OtEjh8PNEd4

Діагностика https://www.drive2.ru/l/513807832047419503/