Skip to content

Netcat uses different port than requested

I have the following problem. I’m using Debian GNU/Linux Stretch and I am trying to use netcat as a simple server. I start it using following command: It starts just fine and accepts connections but on a different port than requested: This behavior is independent of requested port, user or ufw status. R…

libusb for USB target user space driver

I would like to implement a USB device driver in user space by means of libusb. I’m using a Linux machine supporting a USB OTG controller which is switched to device mode. The USB host is another machine which needs to communicate with my Linux machine by means of a USB vendor specific interface with a …

using watch , tail and ccze together

I have used watch and tail together like this: Also I have used tail and ccze for colorizing log file as below: But I dont know how should I use all of these three together in a single command. Does any one have any idea? Answer Recent versions of watch has -c | –color option, so perhaps this will work

aapt missing but its there

I had to reinstall ubuntu-14.04-64 due to reasons. After this reinstall, when I try to build my android projets, I get a bunch of these lines (among others) in output: Now, I know this file exists in my setup because this: I have installed all sdk tools from v19 onwards. Changing project settings to any of th…

Match two lines, replace with three lines

I need to use sed to replace every matching two-line pattern with a three line pattern. Here’s my input file (tempfile.txt). Basically, if a client-hostname “HOSTNAME”; is missing, then it should be replaced with a tab and then a newline. My attempt: sed ‘N; /hardware.*}/d; P; D’…

Delete a single line from a file with a unix shell script

I’m working with a simple shell script that needs to delete a single line from a file if a string entered at command line is found. Instead it deletes the entire contents of the file. the data file is like this(each entry is on a new line): my code: Answer N means the line number , begin from 1