Writing an application with command line interface and I would like to know at any time if F1 or ESC or an arrow key is pressed. What is the simplest way of doing this? I would like to avoid using a readline type library. This is a Linux specific question; the program is not multithreaded. Answer An implementation of kbhit()
How do I find the size of mounted USB flash drive in C?
I have a flash drive device (/dev/sda1) mounted to /mnt on an embedded linux system (kernel 2.6.23). Using C how do I work out the size of the drive? Answer On Linux, if you’re not worried about portability (C doesn’t know about drives, so any such specific code will be unportable), use statfs():
Best compiled language for Mac OS X and Linux compatibility [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago. Improve this question We need to write some software that will compile and run on both an Mac OS X server and Ubuntu. We
WX_CONFIG_OPTIONS: command not found
I’m trying to build Aegisub on linux mint, I’m getting the following error during ./autoget.sh Is there a specific package that I need to install or what exactly is the problem here? Answer There used to be an Arch Linux packaging page which stated that aegisub only supported version 2.9 of wxGTK and not earlier versions however the link I
How to display the process currently holding a semaphore?
In userspace Linux, I have a process blocking on a semaphore, as found by strace. Once the error condition occurs, the blocking is repeatable, so there must be another process that holds the semaphore and did not release it. Is there a way to know which other process is currently holding the semaphore? ipcs lists the semaphore, so does /proc/sysvipc/sem.
Can you recommend a free light-weight MySQL GUI for Linux? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. Closed 9 years
How can I get name of the user executing my Perl script?
I have a script that needs to know what username it is run from. When I run it from shell, I can easily use $ENV{“USER”}, which is provided by bash. But apparently – then the same script is run from cron, also via bash – $ENV{“USER”} is not defined. Of course, I can: But it doesn’t look nice – is
Check the open FD limit for a given process in Linux
I recently had a Linux process which “leaked” file descriptors: It opened them and didn’t properly close some of them. If I had monitored this, I could tell – in advance – that the process was reaching its limit. Is there a nice, Bash or Python way to check the FD usage ratio for a given process in a Ubuntu
How to remove all .svn directories from my application directories
One of the missions of an export tool I have in my application, is to clean all .svn directories from my application directory tree. I am looking for a recursive command in the Linux shell that will traverse the entire tree and delete the .svn files. I am not using export, as this script will be used for some other
Deploy ASP.NET MVC on Linux: Best Practices, Tools & Surprises
I’m wondering about best practices to develop ASP.NET MVC apps with an option to deploy on Linux. If you are creating these kinds of MVC apps, What Linux/Mono platform are you targeting? How much of the development are you doing on Windows and how much on Linux? Are you using an ORM to abstract the database? Which one? Are you