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 …
Tag: linux
Linux command line for find & replace not working
Im having an issue with this code in the command line: For some reason i think it isnt working since the ’email’ but that is how the code is & i cant change it. Also im running it through the shell_exec for php. but i tried it directly and it wasnt working as well. any ideas? Answer Because yo…
Sending linux commands in Perl – Grep piped to grep
The basic code: Why wont Perl complete these commands correctly? $fail2ban is already defined to 0, so that’s not the issue. The fail2ban.log does contain a line that should match(when running command from shell it matches): The error i keep getting is: All the commands run fine from bash/shell, seems a…
Simultaneous TCP termination and subsequent connect(): EADDRNOTAVAIL
My company releases a special TCP stack for special purposes and I’m tasked with implementing RFC793 compliant closing sequence. One of the unit tests has a server working on top of the special TCP stack talking to a normal Linux TCP client, and I’m running into some strange behaviour that I’…
Transition of multi-core processor from real mode to protected mode in Linux
I’m trying to learn more about operating systems and I am currently taking a look how the Linux kernel is loaded and initialized. Thanks to several related questions and this book, I was mostly able to understand how the transition from real mode to protected mode works. However, the one thing I donR…
Remove newline before a match – Linux
I want to remove the newline before the </script> in my HTML file with a Linux command (sed, awk…). Sample input: Sample output: I tried different syntax, but none of them could do. Answer First of all, as mentioned in the comments Don’t parse XML with Regex! Never do it, never think about i…
Starting container process caused “exec: \”tail -f /dev/null\”: stat tail -f /dev/null: no such file or directory
Because I am trying to keep a container running I specified the “tail -f /dev/null” as command in the docker compose file: After I run docker-compose up I get the following error: ERROR: for serviceName Cannot start service serviceName: b’OCI runtime create failed: container_linux.go:348: st…
How to grep within a loop to exclude?
I have a NPM_RESERVED_SCOPE that contains a comma-separated list of forbidden scope. I have a NPM_ALLOWED_DEV_DEPENDENCIES_PACKAGES that contains a comma-separated list of exception. I want this script to passe if the devDependencies does not contains any of the NPM_RESERVED_SCOPES, except the list of excepti…
Teradata DBS state is 7: System is operational without PEs – Sessions are not allowed
I have installed Vmware teradata player TDExpress14.10_Sles11_40GB on Ubuntu. I am getting “DBS state is 7: System is operational without PEs – Sessions are not allowed” when using “pdestate -a”; I found some solutions related with vproc manager like; http://teradata-suresh.blogs…
C code to access environment variables
I created an environment variable SHELLCODE which contains a 200-byte long NOP sled and a shellcode. It is stored at 0x7fffffffe285, but I’ll try to access 0x7fffffffe2e5, which is around the middle of the NOP sled. Then I wrote the following code to try to access the variable. I used gdb to see the mem…