linux

How to disassociate a wireless interface with an access point?

I'm trying to make a script that sleeps my wireless card in linux. For that I'm using the deepsleep command of iwpriv: iwpriv wlan0 deepsleep 1 The problem is that this command only works if the wireless card is disconnected and disassociated. When it's connected there is no problem because if I disconnect, it disassociates automatica...

Setting up a Programming Environment in Linux

I recently started using Linux as my primary OS. What are the tools that I will need to set up a complete programming environment in Linux for C and C++? ...

detecting keyboard, mouse activity in linux

Hi all, I need some way to detect mouse/keyboard activity on Linux. something similar to what any IM program would do, if no actiivty is dected for say 5minutes, it will set your IM status to "I'm not here right now" Any help towards this is appreciated. Thanks ...

Determining the reason for a stalled process on Linux

I'm trying to determine the reason for a stalled process on Linux. It's a telecom application, running under fairly heavy load. There is a separate process for each of 8 T1 spans. Every so often, one of the processes will get very unresponsive - up to maybe 50 seconds before an event is noted in the normally very busy process's log. ...

Linux Programming environment configuration.

The other day I set up an unbuntu installation in a VM and went to gather the tools and libraries I figured I would need for programming moslty in C++. I had a problem though, where to put things such as 3rd party source libraries, etc. From what I can gather, a lot of source distributions assume that a lot of their dependencies are alr...

What is an uninterruptable process?

Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptable process and continue running forever until I restart my computer (even if I log out). My questions are: What causes a process to become uninterruptable? How do I stop that from happening? This is probably a dumb qu...

C and modern practices/examples in Linux

I'm looking for programs/projects that are small to moderate size that show good modern practices for developing applications in C on Linux. I'd like to learn by example and curious how things are done out in the real world. ...

Provide password using Shell script

I had setup my clients & server for passwordless login. Like passwordless login by copying RSA key of server to all client's /root/.ssh/id-rsa.pub. but this, I have done manually. I like to automate this process using shell script and providing password to the machines through script. If this problem is solved then I also want to use rsy...

Tips for optimizing an sqlite database with over a gig of data in it?

I am working with a larger than average sqlite database (for use on both on windows and linux) and am looking to maximize the performance I get out of it. The database is to be installed on commodity hardware along with an sqlite gui. The users I am delivering this to are sql savvy but are unlikely to undertake their own optimizations (c...

Can I reliably create Excel documents from a PHP application on a Linux server?

What is the state generating Excel documents from a PHP application on a Linux server? I am interesting in creating Office 97 (xls) Excel files. My limited research on the subject has turned up this Pear package. It appears to be in beta status since 2006. Can you share your success or failures in generating Excel files from PHP? Is...

How do I prompt for input in a Linux shell script?

I want to pause input in a shell script, and prompt the user for choices. The standard 'Yes, No, or Cancel' type question. How do I accomplish this at a typical bash prompt? ...

Loading multiple shared libraries with different versions

I have an executable on Linux that loads libfoo.so.1 (that's a SONAME) as one of its dependencies (via another shared library). It also links to another system library, which, in turn, links to a system version, libfoo.so.2. As a result, both libfoo.so.1 and libfoo.so.2 are loaded during execution, and code that was supposed to call func...

Linux default file permission

Is there someway to set the default file permission in Linux? That is, the file permission for a newly created file (regardless of the context for which it was created ). I know about putting umask in the shell startup but that only works for shell sessions. When I transfer files to a Linux box using pscp, the file is always created with...

How do I clear the console in BOTH Windows and Linux using C++

I need a cross platform solution for clearing the console in both Linux and Windows written in C++. Are there any functions in doing this? Also make note that I don't want the end-user programmer to have to change any code in my program to get it to clear for Windows vs Linux (for example if it has to pick between two functions then the ...

redirection and vim

Hi I was wondering if there's a way to see the output of any command, straight inside vim, rather than first redirecting it into a file and then opening that file. E.x. I need something like $ gvim < diff -r dir1/ dir2/ This gives ambiguous redirect error message I just want to see the diffs between dir1 and dir2 straight inside gv...

How can I have MySQL write outfiles as a different user?

I'm working with a MySQL query that writes into an outfile. I run this query once every day or two and so I want to be able to remove the outfile without having to resort to su or sudo. The only way I can think of making that happen is to have the outfile written as owned by someone other than the mysql user. Is this possible? Edit: ...

What is the difference between sigaction and signal?

I was about to add an extra signal handler to an app we have here and I noticed that the author had used sigaction to set up the other signal handlers. I was going to use signal. To follow convention I should use sigaction but if I was writing from scratch, which should I choose? ...

How to Mount a Linux directory from a different PC to your local Linux PC?

Is there a way to mount a Linux directory from a different PC to your local Linux PC? How? ...

How to set up a computing cloud and how it works?

Is it possible to have all the computing capacity of all the hardware nodes allocated to one instance (for eg. one basic linux installation)? How to manage the cloud? ...

pass password to su/sudo/ssh

I'm writing a C/Shell program that will be doing su or sudo or ssh. They all want their passwords in consol input rather than stdin. Does anybody know a solution? Setting up password-less sudo is not an option. Expect could be an option, but it's not present on my stripped-down system. ...