Mono and WebRequest Speeds - A test

In mono 4.6.2 / linux, I'm noticing huge differences between the speed wget can download files, vs webclient.DownloadString, so I made a little test to investigate. Why is wget significantly faster than C#? From my own experiments, it's faster to swa...
more »

2017-02-14 09:02 (0) Answers

Linux execute script based on usb port

Hello I am working on debian system installed on embedded system. The PC has 3 ports usb let's call it A, B, C. I want to execute different script based on the usb port. How can I achieve this? I found a lot of articles about the udev rules and I ha...
more »

2017-02-13 21:02 (1) Answers

Why can't I find the int value in a binary

I compiled the following program on a 64-bit linux machine: #include <stdio.h> main() { int a = 12345; if (a == 12346) printf ("YES\n"); return; } If I output the binary file using hexdump, I can find the 12346 (which ...
more »

2017-02-13 11:02 (2) Answers

Start a line in bash script with !! (double bang)

How would I start a line in a bash/shell script with a double bang in order for the last input to be run again? I want to pipe the past output of the last run program into a new program. For example, if I ran ls -l last, and now i run this script, ...
more »

2017-02-12 22:02 (1) Answers

How to test if calling process is a fork

Is there a method or C api in Linux/POSIX to determine if the current process is a fork? I.e. if it has been created by calling fork() without a subsequent call to the execve() family? I do not control the code leading up to this point (it runs with...
more »

2017-02-11 15:02 (4) Answers

Trying to print a part of each line in sed

I'm trying to use sed to print just the last part of the url from a list of data. I want it to be using sed not awk. Input data is like this: Place,AF,http://en.wikipedia.org/wiki/Benin Place Mat,NA,http://en.wikipedia.org/wiki/Saint_Barthelemy Ori...
more »

2017-02-11 10:02 (1) Answers

grep with continuous pipe does not work

(maybe it is the "tcpflow" problem) I write a script to monitoring http traffic, and I install tcpflow, then grep it works (and you should make a http request, for example curl www.163.com) sudo tcpflow -p -c -i eth0 port 80 2>/dev/null | grep ...
more »

2017-02-10 12:02 (2) Answers

linux hangs when reading SPI registers on Imx6

I have a project of embbeded linux runing on the NXP's Imx6 SoC and I am trying to use its SPI. As there is no driver that supports both master and slave mode, I first tried to handle it myself from the user space. I used mmap to access SPI's registe...
more »

2017-02-10 11:02 (1) Answers

CPU not transitioning into higher C-states

An issue that has been bugging me for a while now is that my computer's CPU for some reason refuses to go to higher C-states when idle and stays almost exclusively in C1, as shown from the sample output of i7z below: Socket [0] - [physical cores=2, ...
more »

2017-02-09 19:02 (1) Answers

docker COPY .env file fail

I have a Dockerfile and there is a syntax like this COPY ["Gemfile", "Gemfile.lock", "Procfile", ".env", "/huginn/"] I use RUN /bin/bash -l -c "ls -a" to check file cope status, I find .env file doen't be copied to the image. I change the .env file...
more »

2017-02-09 10:02 (3) Answers