On a Linux box I want to check if a specific socket file exists. I know the socket files exists, but my checks in bash don’t show that to me: Why oh why can’t bash see that the file exists? Answer http://www.tldp.org/LDP/abs/html/fto.html Use -S to test if its a socket. -f is for regular files. Se…
Tag: linux
How to combine DRBD, OCFs2 and LUKS?
I searched on the web a definitive answer to the following question but couldn’t find a clear YES or NO, or a clear procedure on how to enable this approach! In a two nodes setup, with DRBD as the block device replication technology, with OCFs2 as the clustered file system (which requires active/active …
Comparing two files at end of line in Linux
I would like to compare two files and get the output of matching string in one of the files at the end of the line: Let’s say I have two files:- file1: file2: I could do something like this: This gives me the following output: This is because abcdef in file2 matches both of those lines in file1. However…
bash process monitor script echo empty when no process found
I’ve created a process monitor to check for the presence of a running process, and if found we need to check its parent to determine if it is acceptable or not, it’s a security check basically. It works great when I look for running processes and gives me output that I expect. However, for some re…
Can’t locate File/Remote.pm in @INC (@INC contains:
I’m having trouble with the following. Can’t locate File/Remote.pm in @INC (@INC contains: /pkg/qct/software/perl/q4_06/.lib/site_perl/5.8.8/CPANPLUS/Shell/Default/Plugins /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/…
How to get one line from a print output in linux?
I’m trying to pull one line from a subprocess.check_output but so far I have no luck. I’m running a Python script and this is my code: and this is what I get back when I run the script: Now I want to get the 9th line (RMS amplitude) out of this list. I already tried something with sed but it
glibc ( or libc6 ) library version
I am trying to figure out what is the correlation between the version from “GCC->ABI Policy” and the version from ldd –version From ABI Policy and Guidelines I see that for my GCC 4.8.4 I should have: When I run ldd –version I get: I don’t understand the corelation between thi…
Jenkins shell string quotation replacement
I have a Jenkins job with an execute shell box. In the execute shell I use bash instead of dash (sh). In the execute shell I have strings which are supposed to be interpreted as they contain escape sequences (in this case the new line: n), so here is an example execute shell: My problem here is that the scrip…
How to know whether my program is being execute manually or by cron or from another script
My question is stated in the title: How can I discover whether my program is being execute manually or by cron or from another script, and what account is being used? I hope you guys can help me. Answer You can get the parent PID with getppid. Then finding the parent process name from its PID is non-portable.…
How do I handle POST requests in Twisted?
I’m trying to write a script where someone can type the name of a website into a box and my script will render the resources of that website. I’m not sure how to go about it, I’m thinking it would like something like this: This script just isn’t working, when the script I get an Error:…