I can’t understand what’s wrong with my code. I’m trying to make it so that if the passed in username and group are both not found in /etc/group and etc/passwd echo both not found. If one but not the other is found echo one is found and finally if they are both found then echo both exist. Here is my
Tag: linux
How can I combine the commands leave and say?
Is there a way to make use of the command leave and the command say (MacOS) to be notified by the built in voice system? I can do echo hello | say on the command line. leave outputs Time to leave! how can this output be piped to say once it appears? When I issue this command it’s just hanging.
Linux signals program doesn’t return the same value on each execution
I have this code: this program to my understanding should always print cpt = 5 but when i run it on my machine it returns different values (3,4,5) why is that? Answer The SIGCHLD signal is a little funny and doesn’t work like you’d expect: we think we should get one signal per child death, but that’s not it. Instead,
Python script not able to find package when executed from terminal at bootup, what am I doing wrong? [Raspbian]
sorry in case this is obvious or redundant, I’ve been looking around on this site for an answer to this problem but I couldn’t find anything that would fix it What I am trying to achieve is executing a Python script when my raspberry pi turns on (after the desktop loads in) I’ve been trying to do so by adding
Where/how does the kernel loads statically linked modules?
Looking at init/main.c#start_kernel it’s not clear where the statically linked kernel modules are loaded, neither how the kernel gets a list of them. So, where are the statically linked kernel modules loaded? Answer For compiling a module “as a module”, the corresponding Kconfig is set to m. If set to y, all the module code is compiled just like all
How to connect BLE devices using Linux bluetooth C library
Description of the problem I am trying to connect my Bluetooth devices with BLE to a Linux system using the Bluetooth C libraries (I am programming using C++), so here is the code I am currently using: NOTE: You need to set a specific MAC in connect function parameter. I am also compiling with g++ using the following command: Here
gdb: how to learn which shared library loaded a shared library in question
I need to get the list of shared libraries used by an app in runtime. Most of them can be listed by ldd, but some can be seen only with gdb -p <pid> and by running the gdb command info sharedlib. It would really help, if I could learn in some way: for a chosen library (in the list, output
How to set app icon for linux revisited and how does xfreerdp do it
I discovered that my appimag-ed application does not show any app icon in the window manager when launched, even though it has the icon inside itself. By the way, e.g., Obsidian app does suffer from this problem. In general, from searching on the Web, it looks like appimage fails with icons. Here e.g., a person also answers that appimage fails
Can you bind the default network interface of the host into the container to read network stats?
I have a project where I read system information from the host inside a container. Right now I got CPU, RAM and Storage to work, but Network turns out to be a little harder. I am using the Node.js library https://systeminformation.io/network.html, which reads the network stats from /sys/class/net/. The only solution that I found right now, is to use –network
Loopback/Echo bytes received over serial port
On an embedded Linux system running Busybox I am trying to receive bytes over a serial port and echo back everything received. The system setup is like this: Linux <-USB-> FTDI chip <-UART-> MCU On the UART line I have a logic analyser monitoring the data between the FTCI chip and the MCU. Both the MCU and Linux have the