I’m trying to replace document.querySelector(‘.popup’).classList.add(‘active’) by document.querySelector(‘.popup’).classList.add(‘noactive’) Answer You can use See the online demo. The regex is POSIX BRE compliant and matches (document.querySelector(‘…
Tag: linux
A flask website, when it delete a file (os.remove(“abc.txt”)), the file is removed but the space is not reclaimed
The program is a standard flask program, and it does some cleanup as part of the initialization. In the cleanup() procedure, using os.remove(“abc.txt”), I noticed that the file is removed, but not reclaimed by the OS. I use both “python website.py” and “gunicorn website:app”…
Pine script -How to write a script that detects eight similar consecutive candles
Want to write a pine script that gives an alert after 8 consecutive similar candles and gives an alert after the 8th or on the 8th candle. Answer
How to create file with folders for all users in home directory
So for example we have 4 users in /home directory: What I am trying to achieve is that I create directories with files inside for all these users. For one user I can try something like: mkdir -p /home/user/dir/anotherdir && touch /home/user/dir/anotherdir/somefile. But I want a dynamic solution when I…
Changing the file’s creation timestamp in Linux programmatically in C/C++
The statx() system call was added to Linux kernel and now it is possible to get the creation (birth) time of the file from statx.stx_btime stucture field on supported filesystems. But I can’t find any support in utimensat() of similar system calls. Is it possible to change file’s creation timestam…
How to list all concurrent python processes in my CLI?
I have opened several terminals in parallel: And in two of those terminals, I have launched a python file, which includes iterations, to keep the process running. And I would like to have the list of all python processes running. When I type: $ ps -ef | grep python or $ps -elf | grep python I only get the cur…
How should I deploy a web application to Debian?
Ideally I’d like to build a package to deploy to Debian. Ideally the installation process would check the system has the required dependencies installed, as well as configure Cronjobs, set up users etc. I’ve tried googling around and I understand a .deb is the format I can distribute in – but that is as…
Vim use different config or shell enviroment variable when spawning new terminal
Ok, so lets say I spawned a new terminal in vim using :terminal and I want to immediately have a shell enviroment with different/additional enviroment variables within that new terminal window without typing for example VAR=”something”. How do i do that? Answer You can set an environment variable …
gstreamer between two raspberry pis. Can’t decode stream
I am trying to setup gstreamer to send a video feed between two raspberry pis but I get an error. -“Could not decode stream” -“received buffer without first receiving caps” This is the command I use to create the stream: raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o – | …
Why cant I get mv to rename and copy file?
The last thing I want to do in this script is take the userinput to rename the corresponding files to include .bak extension rather then .txt which will copy into a backup directory. I keep receiving an error messaging saying e.g. The snippet in question (right at the bottom of full code): Full code: Answer T…