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…
What is the proper place to put named pipes on Linux?
I’ve got a few processes that talk to each other through named pipes. Currently, I’m creating all my pipes locally, and keeping the applications in the same working directory. At some point, it’s assumed that these programs can (and will) be run from different directories. I need to create t…
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:
Retrieving data from moz_places in places.sqlite in a shell script
I am using Ubuntu, my firefox version is 19.02.I am using sqlite3 version 3.7.9.I want to build a shell script that kind of involves retrieval of url from moz_places table in places.sqlite file location of places.sqlite file–>/home/akshayaj/.mozilla/firefox/x3epy44.default/places.sqlite location of m…
How should functionality that requires root privileges be added to a Common Lisp library?
Original Question I’m trying to create a Lisp library that can, among other things, edit my system’s /etc/hosts file and nginx configurations. The problem I’m facing is that, because my Lisp image operates as an unprivileged user, my library can’t do these things. Ideally, when root po…
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…