So I was working on a project that need some libraries . so I decided to made an .sh script to just install all at once but I don’t know why it fails . I was searching about it , but just found how to create installer like .deb , etc here are the commands lines that I use install.sh
Tag: linux
How to apply ‘Qt.WA_X11NetWmWindowTypeDesktop’ attribute to my QML window by using PyQt5
I am working on a desktop environment and I want my QML window as my main desktop window. I am integrating QML with PyQt5. here is my code main.qml main2.qml I tried adding window.setAttribute(Qt.WA_X11NetWmWindowTypeDesktop, True) in code but it doesn’t work. Also I tried adding Qt.Desktop flag also th…
GCJ throws error: “Undefined reference to main” when compiling
I´d wanted to compile a simple Java “Hello World” program like it was repesented on the GeeksforGeeks Hello World Tutorial, by using gcj in Linux Ubuntu. This is the source code: But gcj threw two errors: (.text+0x18): undefined reference to main collect2: error: ld returned 1 exit status Original…
How to set and record alerts for Jenkin server down and up
I have Jenkins pipeline job which goes thought all our Jenkins servers and check the connectivity (runs every few minutes). ksh file: I would like to add another piece of code, which record all the times that server was down (it should include the name of the server and timestamp) into a file, and in case the…
use cat <> to insert actual strings and escape logic
I am writing a script to automatically create SWAP on an AWS ephemeral volume. Part of that process requires the script to ‘sense’ which nvme to apply swap to since AWS Linux can reorder the nvme names at stop/start. I am using Terraform to run a ‘start-up’ script which does a ton of s…
Bash script to pull variable credentials from another file using “. filename”
Running Ubuntu 18.04 subsystem on Windows 10, but have also tried to do this on a Ubuntu 18.04 Google cloud virtual machine. I’ve realised that baking my login credentials into my scripts is a rather dumb idea, not just for the security risks but because I’ll have to edit every script if I change …
Delete logs that ended with date format
I created the following cli in order to delete the logs with date format that oldest then 500 min date format is: the cli that should removed the logs as we can see the logs still exists where I am wrong? Answer Your regex does not match the files. Change ‘.*.log.[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2,10}$&…
Scripting in linux
Why java -version gives empty string when executing in subprocess.Popen. Is there any alternative to get the exact text given by java -version command in Linux? Answer I think you are getting some error so capture the stderr from the process. Then try to print the error.
Exiting bash script without terminating ssh connection
I’m pretty new to bash scripting and I’m attempting to write a script that does some basic operations. I want to check certain conditions and if they are met, terminate the script. So for example, I want to check whether the zip of files was successful: What happens though is that the exit 1 signa…
hwloc + lstopo Failing to Generate Topology on Dual-CPU Machine for Open-MPI
I’ve been attempting to setup a dual-cpu workstation (Dell Precision 7820) to run local parallel jobs utilizing openmpi 2.1.1-8 (as preinstalled on Ubuntu 18.04) however it fails to run with the following error: Examining the source code of pci-common.c you can find a comment before the assert(0) line t…