I have a simple code that suppose to read length sized and fetch data from character device in Linux C. This is my code and errno is set to 9. I made sure the file exists and it does. And able to read it with cat /dev/mychardev-0 but why bad file descriptor error at time of read. I am getting
Tag: linux
Incorrect permissions for file with docker compose volume? 13: Permission denied
I have the following docker_compose.yaml: When I run via docker compose I get the following error: So to investigate I re-ran just the nginx container: ssh’d in and I see: I consulted the following Q and others and they seem to suggest to just restart the docker service, so I did and I still get ? permissions upon re running.
Why AWS instance not showing the correct storage that is attached externally?
I have attached an external EBS volume of 650GB to my ubuntu instance with a root volume of 250GB. 650GB is attached to /xvdg-volume But if I check the df -h command it is not displaying the entire volume. You can see that in the following image: /xvdg-volume is only 350GB Does anyone say why this is happening in my
Linux setting variables
I’m running a shell script into Linus and I have a unexpected behavior. It looks like it is not concat both strings but rather it is appending data at the beginning. Any suggestion? Regards Answer When the value of TOOLBOX_ROOT was set, it had a carriage return ($’r’) at the end of it. As a result, the value of the
Removing null bytes for shellcode results in missing char and continuous loop
Update: I have fixed the argv array pointers not being valid causing the continuous loop and have updated the assembly code. Now the only issue is the disappearing space char on compilation. I’ve been experimenting with executing shellcode after exploiting a buffer overflow on a 32-bit Linux VM. My assembly program simply uses execve to start a shell via python
How to change java version within a bash script?
I have one piece of a script that needs a different java version to the rest of the script, up till now I’ve always manually changed versions with sudo update-alternatives –config java and then just select the one I need. Is there a way to do that within a bash script? I’ve tried export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java which matches the path listed
In a ksh script find value of latest file/jar and save to a variable
I am a self-confessed beginner level when it comes to RHEL and I can navigate around, find things, run things etc. And I only have basic permissions on my DEV, INT, PROD and BCP servers at my client as most of my time is taken up in complex development. I use ksh scripts to launch Tomcat, and for the new
how to add ” to end of specific lines in linux
I have a file as below I want to add ” at the end but only to lines ending as a string I gave sed -i ‘s/$/”,/’ filename but it adds quotes to end of all the lines. Desired output is Is there a way to achieve this? Answer You can use The ‘s/:”[^”]*$/&”/’ command means: :”[^”]*$ – matches a
How do I create the same directory in every subdirectories in bash?
I’ve been trying to create the directory “a” inside all the subdirectories of “example”. What I tried is the following: But it doesn’t take the ‘*’ as a wildcard, returning mkdir: can not create «example/*/a» directory: It doesn’t exist file or directory Note that I have too much subdirectories in example, so I can’t do it by creating a list.
What does rm ** does in LINUX [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question