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…
Tag: linux
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…
Tracking a program’s progress reading through a file?
Is there a way to figure out where in a file a program is reading from? It seems like might be doable with strace or dtrace? To clarify the question and give motivation, say I have a 10GB log file and am counting the number of unique lines: $ cat log.txt | sort | uniq | wc -l Can I
Display duplicate lines in two different files
I have two files and I would like to display the duplicate line. I tried this but it doesn’t work : cat id1.txt | while read id; do grep “$id” id2.txt; done I am wondering if there are any other way to display the duplicate lines in the file. Both of my 2 files contain list of ids. Thank you…