linux

What is the command to match brackets in Emacs?

Hi, What is the command to match brackets in Emacs (the equivalent of the '%' command in vim)? ...

How to make Java execute jars from the current directory in Gnome?

On Ubuntu Linux with Gnome, running my Swing application by double clicking on the jar file in Gnomes file browser leads to errors because required libraries that are dynamically loaded via the Java Plugin Framework (residing in subdirectories) are not found. The base libraries for the framework itself are resolved correctly, as stated ...

How to kill a linux process by STIME (dangling svnserve processes)

I'm new to Linux and have inherited keeping our single linux server running. It's our SVN server so it's relatively important. Turns out the guy who maintained it before me had a cron task to email him when there are too many svnserve processes running, as they seem to be left dangling instead of terminating correctly. First part of th...

Is it possible to change the Environment of a parent process in python?

In Linux When I invoke python from the shell it replicates its environment, and starts the python process. Therefore if I do something like the following: import os os.environ["FOO"] = "A_Value" When the python process returns, FOO, assuming it was undefined originally, will still be undefined. Is there a way for the python process (o...

Is Ubuntu an acceptable distro for running a production server?

I'm not a great Linux expert, but I'm comfortable running my Ubuntu desktop. I've also got a little experience running Ubuntu as a server as well, for my home network. At work, we're considering switching away from our current Solaris based setup to something Linux based. Our sysadmin is pushing for something like RedHat Enterprise or...

Run binary with ./ in ubuntu

I decided to learn c++ (I program in c at work) and I have been reading some tutorials (and lots of posts here on SO). Ok, so I typed in the standard c++ "hello word", compiled with gcc on my ubuntu machine as "test". Then I tried to run it by typing "test" and hitting enter. Nothing. Turns out I must run it with "./test". Ok,fine, I'll...

Redundant Linux Kernel System Calls

I'm currently working on a project that hooks into various system calls and writes things to a log, depending on which one was called. So, for example, when I change the permissions of a file, I write a little entry to a log file that tracks the old permission and new permission. However, I'm having some trouble pinning down exactly wh...

How can I ask for root password but perform the action at a later time?

I have a python script that I would like to add a "Shutdown when done" feature to. I know I can use gksudo (when the user clicks on "shutdown when done") to ask the user for root privileges but how can I use those privileges at a later time (when the script is actually finished). I have thought about chmod u+s on the shutdown command s...

What is the best way to make files live using subversion on a production server?

Currently I have subversion set up so that when I make changes in Eclipse PDT, I can commit the changes and they will be saved in /home/administrator/Project File. This file has the /branches /tags and /trunk directories recommended by subversion. I have no problem properly uploading files to the repository, but do I have to "mv" the f...

Are real-time linux extensions obsolete?

Do the new real-time and low latency patches from Ingo Molnar render previous real-time extensions for Linux (such as RTAI, Xenomai) obsolete? ...

How to discover what Linux distro is in use

Sometimes I need to access some servers running Linux (or maybe another Unix-like SO), but I don't know how to verify which distro is in use on the server (there are times that even the "responsible" for the server doesn't know). Is there a easy and reliable way to discover that, one that is uniform and consistent across all of them? ...

Linux equivalent of the Mac OS X "open" command

I've found the "open" command in Mac OS X very handy in the command line. From "man open": The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via LaunchServices is used to open the specified files. That is,...

How can the master pty detect if a slave tty has exited?

I am using BSD style pty/tty pairs to implement running a sub shell. When the user exits the sub shell, how do I detect in the master process that this has occurred? I am using select(nfds, &read_fds, NULL, NULL, &timeout); with the master pty file descriptor set in the read_fds on the master side. ...

What IDE / Editor do you use for Ruby on Linux?

I've been using vim, but after reading this question was wondering what is being used in the linux world. ...

Task run manually works, running from cron I get a sigfault

Hello, I've inherited someone else's monster of a BASH script. The script was written in such a way that it uses a ridiculous amount of memory (around 1GB). I can run it from a shell with out issue, but if I run it from cron I crashes with a sig fault. Apart from digging into the poorly commented behemoth, is there a way to run it ...

Nested templates gcc compiler 4.1.2 error

I'm trying to create a template class to insulate the users from a data type. I would have preferred to use an adapter class, but the function signatures needed to change requiring a template. In the code sample below(not the actual project just a simplified version to illustrate the problem), while in the main routine I'm able to use ...

How do I find the file handles that my process has opened in Linux?

When we perform a fork in Unix, open file handles are inherited, and if we don't need to use them we should close them. However, when we use libraries, file handles may be opened for which we do not have access to the handle. How do we check for these open file handles? ...

Determine target architecture of binary file in Linux (library or executable)

We have an issue related to a Java application running under a (rather old) FC3 on a Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI. Via C3 processor is suppossed to be i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the sam...

On QCoreApplication and QProcess...

I'm on the path to write a QCoreApplication supposed to create an external process via Qprocess. I've just noticed that even if the waitForStarted() is called and the process state is Running before the event handler is executing, the external process does not start until the exec() method is invoked on the QCoreApplication. That sai...

When to build your own buffer system for I/O (C++)?

I have to deal with very large text files (2 GBs), it is mandatory to read/write them line by line. To write 23 millions of lines using ofstream is really slow so, at the beginning, I tried to speed up the process writing large chunks of lines in a memory buffer (for example 256 MB or 512 MB) and then write the buffer into the file. This...