I’m try to install rails on Debian. when run this command gem install rails I gave this error: even when I try this command: gem install I gave this error: I used this link to build ruby from sources ruby 2.1.2 build instruction what can I do to overcome this error? Answer For who compile from source, t…
GNU ARM – nano.specs not found
Last days I’ve been trying to compile a STM32F4xx project with Ubuntu 14.04LTS, Eclipse and GNU ARM plugin for Eclipse. Now it says that nano.specs is missing. Here is my build log: I found some nano.specs files on my computer. What should I do? Just remove linker flag (I can’t actually do that, b…
Given a PPID, how to find all of associated PID?
It might be a weird question as I searched and found many people asking about how to find the PPID given a PID. However, I’m interested in finding out all the PID of a given PPID. The incentive was to run a process check using pidstat and from my test with pidstat, it seems to be that pidstat only repor…
SIGALRM, interval timers and problems with sleep()
I am working with porting one of our embedded microcontroller libraries to linux and writing a python wrapper around it. One of my low level modules depends on a callback that gets called every 10ms. This callback counts up software timers that each have callbacks of their own. These timers are used all over …
Making an RPM which sets POSIX files capabilities
How does one make an RPM which sets the POSIX capabilities of a file? If I try doing rpmbuild as a non-root user then I get an error when my makefile’s install hooks try to run setcap, but if I don’t run setcap how will rpmbuild copy the capabilities? There doesn’t seem to be any way to set …
__builtin_return_address returns null for index >0?
I want to get the return address of the caller function. I’m using __builtin_return_address() funtion, but if I give index value greater than 0 it is returning NULL. Please help me with this or tell me any other function to get the same. Answer See this answer to a related question. __builtin_return_add…
How to check a disk for partitions for use in a script in Linux?
I’m scripting something in Bash for Linux systems. How would I check a disk for partitions in a robust manner? I could use grep, awk, or sed to parse the output from fdisk, sfdisk, etc., but this doesn’t seem to be an exact science. I could also check if there are partitions in /dev, but it is als…
Communicating with CashCode bill acceptor in linux
I’ve implemented CCNET protocol to communicate with CashCode bill acceptor from my software on Linux. Initially I spent lots of time trying to figure out why the device does not respond to the commands I’m sending. Using trial-and-error method I found the solution to set the following options for …
cmake linking shared libraries on ubuntu
Hi I am having problems with linking two libraries on ubuntu using cmake 2.8.12 Directory structure CMakeLists.txt for lib1 This builds fine. Then for lib2 I have the following CMakeLists.txt Here I get Linking CXX shared library ../build/liblib2.so /usr/bin/ld: cannot find -llib1 I am not clear how to correc…
why file with hole has smaller disk block than file without hole?
I’m newbie in unix system programming There is code making file with hole. Output result is: Why file with hole has fewer disk block than file without hole? In my thinking, file without hole takes smaller disk blocks Because file with hole is more spreaded than without hole.. From “Advanced Progra…