Send program's serial output to pseudo-terminal used by serial sniffer such as jpnevulator I am running an application that communicates through a real serial port e.g. /dev/ttyS0 to a remote device.  I can configure this application to use /dev/ttyS0, /dev/ttyS1, etc., by passing the numeric suffix to the program, not the fully-qualified name. I would like to sniff the traffic going through this serial port using something like jpnevulator.  This jpnevulator opens a pseudo-terminal to which the application to be monitored is supposed to connect.   Is there any way to re-assign the name of the ports, for example /dev/ttyS1 to an actual pseudo-terminal such as /dev/pty/23, so that the application transparently connects to /dev/pty/23 via /dev/ttyS1?  Would a file link ln achieve this?
How do I use jpnevulator to capture and log the serial traffic between an application and hardware serial port? OK, I've been googling for hours so I obviously have not been able to understand the answers to the various questions that have already been asked about this subject.  I am hoping that, by asking the question again in a more specific way, I will be able to get an answer I can understand.  I have some application running in linux that communicates with an external device attached to a serial port.  I want be able to capture and log the data sent in both directions between the application and the device, with timestamps at the beginning of each line in the file.  As a test case, I am using minicom as the application I want to monitor, connected via a null modem cable to another computer also running minicom.  I have already confirmed that, if I type characters on either of the computers, characters appear in the other computer's terminal.  So far, so good.  I then found this question:    In the answer to this question, the program jpnevulator is suggested.  However, when reviewing the man page, I could not figure out the right way to use jpnevulator to get what I want.  Here is what I tried to do:  First, I opened a terminal window and typed the following command:  $jpnevulator --tty=/dev/ttyS0 --pty --pass --read --ascii --timing-print --file=serial.log   I saw the output:     jpnevulator: slave pts device is /dev/pts/18  I then opened another terminal window and typed the following command:  minicom -D/dev/pts/18 -b115200   Minicom opened without complaint.  However, when I typed characters in either terminal (local and remote), nothing appeared in either terminal.  jpnevulator only logged the data written to /dev/pts/18.  My expectation is that jpnevulator :   reads data from /dev/pts/18 and "passes" this data on to /dev/ttyS0 while also writing this data to the specified file. reads data from /dev/ttyS0 and "passes" this data on to /dev/pts/18 while also writing this data to the specified file.   I am aware of the remark in the faq that says "Jpnevulator was never built to sit in between the kernel and your application. I'm sorry."  However the very same faq states in the second paragraph down: "Now with a little bit of luck some good news: A little while ago Eric Shattow suggested to use pseudo-terminal devices to sit in between the kernel and your application."  That is the approach I am trying to take but I am having no success.  What am I missing?  Thanks to all in advance.  Cheers, Allan  p.s. I was successfully able to capture the back and forth traffic using the socat method mentioned in the existing question I referenced but this method did not offer any way of timestamping the traffic.  I was hoping that jpnevulator would have provided this for me.
Replace arbitrary characters in the middle of an IP address string with sed I need to find and replace either one or two numerical characters in strings in a file.  The strings are IP addresses of the form:   10.xx.y.z    Where xx can be one or two characters.    I want to replace the xx with the single character 0, so I have  10.0.y.z    preserving the values of y and z.   The string may appear multiple times in the file.  What is the sed invocation to do this? I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values.  In my script I want to pass the results from bc into another variable say var3 so that I can work with var3 for other calculations.  So far I have been able write the result to a file which is not what I'm looking for and also I've been able to echo the result in the terminal but I just want to pass the result to a variable at moment so that I can work with that variable.  echo "scale=2;$var1/var2" | bc Why I can't apply mirror modifier? Here's screen Is Linux Virtual Server old, or is it standing still? Based on this question: , LVS may be the right solution for my problem.   But when I went to its homepage , I found that LVS has been updated since Nov, 2008. The world's moving fast, and I don't know if LVS was obsolete or not.  Is LVS standing still, or there're some better solutions to replace it?  Thank you so much. Appending the same string to a list of strings in Python How do I open the user folder of a hard drive that I transfered? My Windows 10 notebook died but fortunately I was able to rescue the hard drive and put it into another PC.   Unfortunately, the other PC can't open the C/Users/Joe folder. What do I have to do to open the folder? JavaFX accordion with multiple open panes How do I show that $\sum_{cyc} \frac {a^6}{b^2 + c^2} \ge \frac {abc(a + b + c)}2?$ Let $a, b, c$ be positive real numbers, show that  $$\frac {a^6}{b^2 + c^2} + \frac {b^6}{c^2 + a^2} + \frac {c^6}{a^2 + b^2} \ge \frac {abc(a + b + c)}2.$$  I think this is likely to turn out to be proved by Hölder, but I can't see how. Any hints will be appreciated. Conditional expectation of $X$ given $\sin(X)$ Click Answer your own question Check community wiki A dialog box     Are you sure you want to make this post Community Wiki?   will appear, Click OK or Cancel; The same dialog will appear again.   Google Chrome 44.0.2403.107 / Windows8.1 / site rev 2015.7.25.3609 How to deploy wsp to single web application How to create a random math problem in LaTeX? I want to create a math problem-solution sheet. The coefficients a, b, c must be assigned on the fly at random so the generated pdf will show a numeric quadratic equation rather than a symbolic quadratic equation. Note a must not be zero.  \documentclass{article} \begin{document} \section{Problem} Let \(x_1\) and \(x_2\) be the roots of \(a x^2 +bx +c=0\). Find  \(x_1x_2\).  \section{Solution} \[ x_1x_2=\frac{c}{a} \] \end{document}   Please kindly make the solution get automatically simplified. For example: \frac{c}{a}=3 when a=2 and c=6.    Actually the real case is more complex than this one. Not only the equations must be generated at random, but also the associated graphic plots that I write in PSTricks.     I chose Paulo's answer because using Maxima as the computation engine is very very great idea. Other answers are also good and creative, especially Altermundus'. say by has the meaning of      6. indicating the period in which something happens: ‘this animal always hunts by night’   Then do we need to say, ‘Why does the sky glitter by night?’ And can’t we say, ‘Why does the sky glitter at night?’?   If we can use both, what’s the difference between the two? I was having trouble playing the game on my android so I downloaded it to my wife's phone (Galaxy S6). I read some posts on how to get it running on my android and it worked but, my level 7 account is on my wife's phone.  How do I get it back to my android? When I sign out and back in it doesn't ask for any sign in info. I've tried deleting the app's data and even uninstalling and re-installing, but it still doesn't ask for sign-in info. Why does copying the same amount of data take longer if spread across many separate files? I noticed that copying 24Mb worth of data from one folder to another took about 30 seconds because (I'm assuming this is the reason) it was over 1,000 separate files. Copying 24Mb shouldn't take so long. Why does the number of files make a different?  I'm running Windows 7 on a MacBook (4GB ram, Intel(R) Core(TM)2 Duo CPU P7450 @ 2.13GHz, 32-bit Operating System)  EDIT: NTFS is the file system used on the drive Detect whether Excel workbook is already open How do I troubleshoot high 'svchost.exe' usage in Windows 7? Visual Studio Editor does not underline errors anymore My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).  Does anyone know the problem and how to restore this functionality again? How can I find the source of a mysterious bad smell? We have recently moved home, and all is fine appart from a mystery smell which I'm unable to track down. It's driving me crazy (actually, my wife thinks I am crazy as she can't smell it).  I'm hoping someone on here could offer some tips on how to track it down, or what it might be.  Here's some info:  Background: The house is a two floor (plus basement) block/concrete construction.  There is a wide hallway on the groundfloor connecting the rooms (including kitchen, toilet/shower room, stairwell).  The stairs are wood-board on concrete.  The floor in the hall and kitchen  is tiles over concrete, the rest woodblock/parquet over concrete.  Location of the smell: I usually smell it when coming down the stairs, seems to be strongest about half way down.  However sometimes it doesn't smell on the stairs at all, but rather in the ground floor hallway.  Seems to move around quite a lot. Occasionally I have felt it upstairs, but assume this is it drifting. The basement smells fine.  The Smell: The best description of the smell I can give is something like old rubbish.  What I've investigated so far:  1) Something died somewhere?  This was my initial thought, and since I usually notice the smell on the stairs I thought I'd try there first.  I've taken up some of the wood on the stairs (not all yet) but not looking promising, as there really isn't much space between the wood boards and the concrete.  Not really sure where else something could have gotten, as everything seems to be tight against the concrete.  2) Smell from kitchen moving into rest of house? I never really detected a bad smell in the kitchen, but thought I'd rule it out anyway. I thought maybe it was the bin under the kitchen sink that might be causing it.  So I moved the bin to a small storage room at the back of the kitchen (and kept the door closed) and thoroughly cleaned inside the cupboard under the sink. No change.  I also looked behind all of the cabinets for a problem, but could not see anything.  3) Gas from drains? The sink doesn't smell in the kitchen, and it's got a P-bend trap on the pipe - so I can't see a problem there.  Cant detect a smell from the plugholes in the bathroom either.  The bathroom sink waste pipe has a bottle-trap on it.   Don't know if there is a trap on the shower as it's a sealed unit, but I'm guessing yes (and can't smell anything).  Can any one think of something I might have missed, or give any advice? How do you do load testing and capacity planning for databases? This is a  about capacity planning for databases. Related:      I'm looking to create a canonical question of tools and methods of capacity planning for databases. This is intended to be a canonical question. Obviously, the general workflow is:  Put your scenario in place Add monitoring Add traffic Evaluate results Remediate based on results Rinse, repeat until reasonably happy  Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices.