Skip to content

Tag: linux

How to tell CMake where to put build files?

I want to tell CMake to output files and folders to a different folder instead of the current folder. I’m talking about the generated files by CMake below: file: CMakeCache.txt dir: CMakeFiles/ file: Makefile dir: bin/ file: cmake_install.cmake Is there a way to let CMake output these files and folders …

Nonblocking Get Character

Platform: Linux 3.2.0 x86 (Debian 7) Compiler: GCC 4.7.2 (Debian 4.7.2-5) I am writing a function that reads a single character from stdin if a character is already present in stdin. If stdin is empty the function is suppose to do nothing and return -1. I googled nonblocking input and was pointed to poll() or…

Node.js bash: /usr/local/bin/node: Permission denied

I’m installing Node.js on Ubuntu machine. I followed official instructions: So, I got node binary in /usr/local/bin/node and all dependencies. But when I run it from command line I get permission error: How can I fix it? How can I run it under my account? sudo node doesn’t work too. Answer You nee…

Process permanently stuck on D state [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …

bash wildcard n digits

So I’ve got the following files in the tmp directory: if I wanted to list only the files that end in ‘.digits’ (0, 1, 22, 4444) but not (t9) I could try and use wildcards such as this: however I get the following results with the ugly error I’ve also tried using {0..999} but that also …

Combining sento() write writev()?

I’ve set a udp socket and call sendto() with a different recipient at each call. I would like to use writev() in order to benefit scater/gather io but writev() does not allows me to specify the recipient addr/port as in sendto(). Any suggestions? Answer You can use writev to send a coalesced set of buff…

verify email address on Linux

I am using command like sendmail -bv example@othesite.com to verify some email address to confirm the address is valid or not before sending actual email to people. it works for most sites I tested. But sometimes, I am using the sendmail for some website that will give me all pass no matter what the address n…

How to grep a group of files within a specific time range

I’m trying to write a script used on a buffer box that does full packet capture of network traffic. As it’s for a fairly big network we split the captures into 100MB segments. At times of high network traffic oftentimes over a one minute period we will have multiple pcaps which cover that period. …