When a client try to connect to a server, if client and server are both localhost, self-connection may happen(source port and destination port happened to be the same.). But my problem is, client is not listening to that port, how can self-connection be possible? Answer We can simple reproduce this phenomenon with the following python program when we try to
Tag: unix
Grouping common elements using awk
The following table illustrates a brief snapshot of the data that I wish to manipulate. I am looking for an awk script that will group similar elements into one group. For eg. if you look at the table below: Numbers (1,2,3,4,6) should all belong to one group. So row1 row2 row4 row8 will be group “1” Number 9 is unique
Pass parameter to an awk script file
If I want to pass a parameter to an awk script file, how can I do that ? Here I want to print the first argument passed to the script from the shell, like: Answer your hash bang defines the script is not shell script, it is an awk script. you cannot do it in bash way within your script.
Physical disk block size on POSIX using C/C++
I’m working on a high performance I/O program and I’m trying to find the best way to determine the _physical_ (and not the _logical_) byte size of a device’s disk blocks with C++. My research so far has led me to the following code snippet: The man pages says the following about st_blksize: The st_blksize field gives the “preferred” blocksize
how to make SSH command execution to timeout
I have a program like this: In the above code, I am trying to SSH to the remote server, and tries to check if I can connect or not. I have few servers, which is password less is activated and few servers for which passwords are still not yet deactivated. So my concern, if there is a password, it will
How should functionality that requires root privileges be added to a Common Lisp library?
Original Question I’m trying to create a Lisp library that can, among other things, edit my system’s /etc/hosts file and nginx configurations. The problem I’m facing is that, because my Lisp image operates as an unprivileged user, my library can’t do these things. Ideally, when root powers were needed I’d have the ability to provide a password to my library
How to capture all the commands typed in Unix/Linux by any user?
I would like to capture all the commands typed in Unix/Linux by any user. There are few alternatives like using script command or acct utility. But the problem with them is they dumb everything from the terminal to a file or just provide the summary of the commands. I am looking for a utility where it will provide me all
How can I use an at command in a shell script?
I am trying to use the Unix at command (for setting a job to run at a certain time) in a shell script. The time will be specified by user input using getopts and optarg which seem to be working fine, the problem is at. How do I write the at command into the script to run at a certain
Run script on completion of sge job
I am using sun grid engine 6.2u5 version . where requirement is when I submit job on using qsub command on completion job i want to run some script(bash scripts). how can i use -notify option or any other way to track job completion and after completion execute script. Thanks Answer I think hold_jid is what you’re looking for: You
How can I print a specific range of lines from a file in linux? [closed]
It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. If I have a file with 100,000 lines, how can I print lines