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 …
Combining find command conditions
I am trying to combine 2 find commands to pipe to a grep pattern match. my 3 commands are: get files modified in the last 24 hours: ignore a couple of directories: find pattern in the file’s lines: I have gotten below to work but cant seem to add directory skipping into the mix. get files modified in th…
how to output only when command finish
I’m running multiple commands using &: This doesn’t work well because the output lines are interleaved. I want each curl to hold its output, until it’s done. How to do that? I understand I can use temp files, concat together and delete afterwards. Are there better ways? Answer You could …
How to use nix’s ioctl?
I want to call ioctl from Rust. I know that I should use the nix crate, but how exactly? From the documentation it’s not clear. I have this C: How would I do that same thing using the nix crate? There are no TUN* constants in the nix crate and it isn’t clear how to use the ioctl macro. Answer
Why does python xmlrpc call get PermissionError when run through apache?
Here’s /home/blakeh/test.py, which doesn’t really do anything but illustrate the problem with minimal code: If I run this directly as the apache user, there’s no permission problem with making the RPC “foo” call. It only occurs if I run it through apache. I’m using python 3…
Checking if errno != EINTR: what does it mean?
I’ve found this piece of code used several times (also a similar one where it’s used open() instead of write()). Why it is checked if && errno != EINTR here ? Looking for errno on man I found the following text about EINTR, but even if I visited man 7 signal that doesn’t enlighten me…
Re-arranging lines after a pattern in a file according to a specific order
I have a large log file with the below format I have created a shell script that insert those values in the database in the same order val1, val2, val3 ,val4 The problem is that the files sometimes gets corrupted and the variables come in different order, like below for example: Using shell script, I want to …
Convert Binary Strings (ASCII) to Binary File
I have several large files (3-6 Gb) of 1’s and 0’s characters in ASCII and I would like to convert it to a simply binary file. Newlines are not important and should be discarded. test.bin below is 568 bytes, I would like the 560 bit file. I’ve found several solutions going the other way, con…
Should I be using parameters or export environment variables?
I’ve always developed my shell scripts using parameters, on a daily-basis or even when developing some automation scripts. However, recently I’ve tried a different approach, exporting environment variables to my scripts. This ensures a smaller code, easy checks if all the required variables are in…
Bash : Configuring email-provider for bash-script
I am working on writing a script to run on our Debian server(Debian 3.2.68-1+deb7u5 x86_64 GNU/Linux), which will monitor a specific port we have and when there is no process running on that port, or that port is available, then I will have to send out an email. I intend to run the script every 15 minutes and…