Skip to content

Linux driver for embedded Linux

I’m looking to attach some USB devices to my embedded Linux board. It is an TI-ARM processor running embedded Linux, but I guess it could be any embedded Linux board. If I purchase an USB device which has Linux support/driver, can this driver (generally) be re-compiled to work with the ARM architecture?…

File size in human readable format

Given the size of a file in bytes, I want to format it with IEC (binary) prefixes to 3 significant figures with trailing zeros, e.g. 1883954 becomes 1.80M. Floating-point arithmetic isn’t supported in bash, so I used awk instead. The problem is I don’t how to keep the trailing zeros. Current solut…

C code with ncurses compiled with libtinfo dependency

I’ve recently written a minesweeper implementation in C using ncurses on linux; everything works fine on my pc, but if I try to give the compiled binaries to someone else they often get the error: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or direct…

how to make SSH command execution to timeout

I have a program like this: In the above code, I am trying to SSH to the remote server, and tries to check if I can connect or not. I have few servers, which is password less is activated and few servers for which passwords are still not yet deactivated. So my concern, if there is a password, it will

search for files not accessed for x days

How can I find files in Linux that were not accessed for X days? I found that command, but it will show files that were viewed for the last x days: Answer Use -atime +60 to see files that have not been accessed within the last 60 days:

How to capture all the commands typed in Unix/Linux by any user?

I would like to capture all the commands typed in Unix/Linux by any user. There are few alternatives like using script command or acct utility. But the problem with them is they dumb everything from the terminal to a file or just provide the summary of the commands. I am looking for a utility where it will pr…

Sending signal to pthread to abort sleeping

I’m have a pthread function, which sleeps most of the time using usleep() I would like to send a signal from the main process to the thread to interrupt the sleeping sometimes. The problem is that I can’t find any reference of which signal exactly to send using pthread_kill() the usleep() man page…