I don’t think the precise code is important. Instead, I’ll give the strace output: We can see that socket 5 (IPv4) successfully bound to port any:31337, but when I try to bind socket 6 (IPv6), it fails with EADDRINUSE. You can also see that I did set SO_REUSEADDR on both sockets, so I believe this…
Tag: linux
How can i initialize and then iterate an array in linux makefile?
I need to create an array with directories and then inereate it, creating one more array in each step which will include all files found via ‘find’ command for each derictory and also iterate this array. I was trying to do something like this: but it does not work. Even this gets error: gets error…
syscall or gettid system function from Cython
I need to call gettid from Cython. Accordingly to its man page, I should use the syscall function. I’m running Linux. I can easily get the gettid function number: But I cannot find how to import, or better cimport, syscall. Any ideas? Thanks. Answer You can look up in the cython’s github repositor…
Clear last two (and more) printed lines in Linux terminal emulator
I once saw a console app that visualized a progress of multiple downloads with multiple progressbars, each on its own line. I was curious how to do that, but I found only partial solutions. Here they are: One progressbar is easy It is easy to clear one line with “carriage return” and thus visualiz…
Local CircleCI reports “Unexpected environment preparation error: error looking up self container id: Found multiple cgroups for outer container”
I am getting the following error when I run circleci build locally on Ubuntu 18.04. The build runs perfectly inside the hosted CircleCI. CircleCI version: Docker-ce version: I installed Docker exactly as specified on the website, including setting the usergroup. I used the instructions here to install CircleC…
Multithreading with Semaphor, Mutex and PThread
Me and a friend are currently working on basic multithreading examples for university in c. We’re supposed to solve the producer/consumer problem with a multithreaded buffer. We’ve got a working version using mutex and conditional variables, but trying to solve this using semaphores and mutex were…
Passing environment variables not working with Docker
I am learning how to pass environment variables to Docker containers. While the following works fine, Dockerfile Build & run commands docker ps -a gives docker logs 2a3a69aa7868 gives The following doesn’t work Dockerfile Build & run commands Here the run command gives this, While docker ps -a g…
Awk script to sum multiple column if value in column1 is duplicate
Need your help to resolve the below query. I want to sum up the values for column3,column5,column6, column7,column9,column10 if value in column1 is duplicate. Also need to make duplicate rows as single row in output file and also need to put the value of column1 in column 8 in output file input file output fi…
decimal value is not printing in bash?
I want to evaluate the expression and display the output correct to 3 decimal places i tried with below code but it is not working help me how to do that in bash. Answer With bc: Output: 17.928
Ubuntu 18.04 start mysql without root privilege
I just installed ubuntu 18.04 and installed LAMP on it, however I had trouble using mysql without the root privilege. when I write: mysql -u root -p and enter the password I configured it throws access denied. unless if I write sudo mysql -u root -p and enter the password that I’m able to connect. But I…