Friday, June 2, 2023

[DevOps] Debug MongoDB pipelines

Sometime, MongoDB server is crash when tried to run some pipelines (aggregations). The main problem – it's happens without logs and hardly to detect it and debug. 

For debugging, you can use this command in MongoDB client for getting latest logs before crash and for detecting what aggregation is evoking error.

db.adminCommand( { getLog:"global" })

This command requires some additional admin permissions for getting logs and not available for regular users

[DevOps] Remove all docker logs

Sometimes are needs to remove logs for all containers, for example, when you not have enough disk space

sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"

Saturday, February 11, 2023

[Ubuntu&Gnome42.5] Support multiple key combinations for switching input sources for keyboard

By default, the latest version of Gnome (42.5) and Ubuntu (22.04.1 LTS) is multiple combinations for input disabled, and you must use only <Super>+Space combination. And you can't change it without the tool 'gnome-tweaks'.

But, if you are is Windows or Mac user, you can want to use multiply combinations. So, I will hint you how to do it. 

With using the terminal: 

gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Shift>Alt_L', '<Super>Space']"

With using the gnome-tweaks:


Sunday, May 15, 2022

[DevOps][Note] How enable ssh authentication without password on Fedora

Hello,  

cd ~/.ssh
ls

 Should be <fileName>.pub and <fileName> (private key) 

ssh-copy-id -f -i <filename>.pub <username>@<host>

Based on:

  1. link 1
  2. link 2

Tuesday, May 10, 2022

[NodeJS] How the solve problem with building of node-saas(7.0.1) on nodejs 17

Hello, because in some projects I have legacy dependencies (locked versions), I got some problems with modern versions of Node.js interpreter, you will just get errors on trying to build.

You can reproduce it on macOS 12.3.1 and Node.js 17/18. One of the issues – python2, it has issues on modern versions of mac, so you can't install it using brew command.

So, algorithm for solving it:

  1. Install python2 from official site (https://www.python.org/downloads/release/python-2718/)
  2. which python2
  3. npm config set python /Library/Frameworks/Python.framework/Versions/2.7/bin/python2
  4. Install GCC/clang C++ compiler (hint: you can install Xcode)
  5. CXXFLAGS="--std=c++17" npm i

Sunday, May 8, 2022

[Notes] How check warranty of Huawei and Apple products

Hello, it's the short post with links where you can check warranty of Huawei and Apple products and accessories in Russian segment of internet

Huawei

Where to find S/N for check on Huawei devices

Wednesday, April 13, 2022

Вопросы с собеседования С++ (2018)

 Выкладываю свою памятку, которая должна помогать вспоминать теорию, при подготовке к собесам.