This was my attempt: I’m on hackerRank. I have this file that is delivered to my stdin. I need as a result lines that contains : Answer In a POSIX BRE pattern, when you use a “shorthand character class” like s, w, even in GNU grep, these escape sequences are treated as separate chars, a back…
Tag: linux
“/usr/bin/ld: cannot find -llibopencv_calib3d” when compiling an opencv project in Ubuntu 20.04
I have installed opencv in Ubuntu 20.04 following the instructions in OpenCV Installation in Linux. As per the instructions, sudo make install copies all the .so files to /usr/local/lib. However, when compiling a program, using the command g++ –std c++17 -g opencv/Basic.cpp -o output -I/usr/local/includ…
authentication failed when I use postgresql with django
My environment OS: AWS linux python 3.7 psql (PostgreSQL) 13.3 I am trying to use PostgreSQL with Django. I changed setting.py like below: I created a password for PostgreSQL and I successfully logged in as this user. However, when I tried to execute this: I got this error: pg_hba.conf looked like this first:…
Question about using #define value in if condition and code generation: debug vs release build
Question is related to release and debug build. Something related to this and this But I have a simple doubt for example if I do following: (file is debug-test.c) So my doubt/question is if I do #define debug 0 will compiler eliminate/optimize out all the code (that if condition) from final binary? Or code wi…
How to install uidmap package for docker rootless
I am using photonos and it is required that you install uidmap to run docker in rootless mode. Find it strange photonos dosent have this package. is there a reason for this? is photon os secure enough not to require this? If not and it is advised to use docker in rootless mode how do i install uidmap? Thank y…
ERROR 1 (HY000) at line 1: (Errcode: 13 “Permission denied”)
I have to save my SQL query output in a text file. When i run the needed query: ..it throws this error: Why does this happen. I am using Ubuntu 20.04. Answer You have no access to directory /root/sql because of secure_file_priv. Please do SHOW VARIABLES LIKE “secure_file_priv”; and see what direct…
Wayland client get compositor name
Is it possible for a c application using libwayland-client.so to get the name of the compositor / display server it opened a connection to (e.g. KWin, Sway, …)? I fail to find it in the docs. For reference, in X11 this is possible using XProps specified by EWMH: _NET_SUPPORTING_WM_CHECK to get the windo…
xsetwacom unable to find output
Xrandr shows two monitors. I want to use xsetwacom to move all devices to HDMI-0 however the xsetwacom command towards the bottom does not recognize HDMI-0 Outputs: So I try to xsetwacom to HDMI-0 After I get this to work I can make a script to do it on startup but I can’t find any resources on how to f…
linux replace string in files recursively
I have a folder which is full of *.java files. it has the following method in it: i wanted to change this as following: I have searched in the forum and found some solutions, replce string is what i wanted so tried the following: But it throwing me the following error: I guess the old_string and new_string fo…
Unable to connect to SSH on Google Cloud VM Instance
I have run into a problem today where I am unable to connect via SSH to my Google Cloud VM instance running debian-10-buster. SSH has been working until today when it suddenly lost connection while docker was running. I’ve tried rebooting the VM instance and resetting, but the problem still persists. Th…