linux

Changing the owner of an existing process in Linux

I would like to start tomcat (Web Server) as a privileged user, and then bring it back to an unprivileged user once it has started. Is there a way to do this programatically, or in general with Linux? Thanks. ...

Is there a file descriptor leak when using sockets on a linux platform?

If I open and close a socket by calling for instance Socket s = new Socket( ... ); s.setReuseAddress(true); in = s.getInputStream(); ... in.close(); s.close(); Linux states that this socket is still open or at least the file descriptor for the connection is presen. When querying the open files for this process by lsof, there is an en...

Execute several programs at the same time in an initialisation/bash script

Hello I am working with a simulator that uses rcS scripts to boot, this is my script cd /tests ./test1 & ./test2 & ./test3 & ./test4 exit What I want is run all the test at the same time and that the exit command is executed only when all the previous test have finished. And not only when test 4 has finished, is this possible?. Thank...

How do I determine whether the filesystem is case-sensitive in .net?

Does .net have a way to determine whether the local filesystem is case-sensitive? ...

How do I erase printed characters in a console application(Linux)?

Hi all, I am creating a small console app that needs a progress bar. Something like... Conversion: 175/348 Seconds |========== | 50% My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I have to erase this line from the console and insert a new line. In my current ...

Linux system to manage configurations of servers?

I need a software to manage configurations of linux servers in one central location. It should be able to push changes to servers automaticly. Version control would be an advantage... ...

Linux device driver unsafe FXSAVE/FXRSTOR bug -- any precedents?

There's a nasty problem that has temporarily stumped a number of engineers at my company trying to debug it. The C++ program is normally run on a cluster of multicore computers with MPI. It will run for a very long time -- perhaps days -- and then suddenly fail. Most of engineers working on it have eliminated any reasonable possibilit...

What are coding conventions for using floating-point in Linux device drivers?

This is related to this question. I'm not an expert on Linux device drivers or kernel modules, but I've been reading "Linux Device Drivers" [O'Reilly] by Rubini & Corbet and a number of online sources, but I haven't been able to find anything on this specific issue yet. When is a kernel or driver module allowed to use floating-point r...

HTML2PDF Conversion

We're developing software for both Linux and Windows that requires CVS files to be generated into PDF reports. I've written a program in C to turn the CVS files into HTML files (td, tr etc.) and am then converting the HTML into PS using html2ps and then ps2pdf under Linux. However as mentioned above we're also developing for Windows an...

Run a command in a shell and keep running the command when you close the session

Hello, I am using Putty to connect to a remote server. What I want to know is if there is any way to write my commands and allow them to keep running after I close the session with Putty. The reason for this is that I do not want to keep the computer ON all the time. Is there any way to do this?. Update with the solution For my questio...

What happens to an STL iterator after erasing it in VS, UNIX/Linux?

Please consider the following scenario: map(T,S*) //Forward decleration map(T, S*) T2pS = GetMap(); for(map(T, S*)::iterator it = T2pS.begin(); it != T2pS.end(); ++it) { if(it->second != NULL) { delete it->second; it->second = NULL; } T2pS.erase(it); //In VS2005, after the erase, we will crash on ...

Is there any Spy++ equivalent for linux/x window?

Spy++ is a tool for windows that let the user spy on windows attributes, child windows and the message that it will process. It is handy utility to debugging UI related code. ...

Where do you download Linux source code?

Say I'm interested in the source for one particular Linux utility, like factor. Where can I find the source code for that utility? ...

Making Mac shortcuts (e.g. Cmd-C) work on linux

Is there a way to map Cmd-C to Copy in linux? (instead of Ctrl-C) Would be nice if I could also have the emacs style ones, like Ctrl-B to move left by one character. ...

How does one submit a potential patch to the Linux kernel?

We have some software which relied on certain behavior from an another (very commonly used) application that has now changed, rendering our current implementation workable, but less than optimal. We believe that this change may have affected a number of other applications, particularly in the performance monitoring arena, and we have fo...

how can I diff two sections of the same file?

I have a source file with two similar yet subtly different sections. I'd like to merge the two sections into one subroutine with a parameter that handles the subtle differences, but I need to be sure I'm aware of them all so I don't miss any. What I usually do in such cases is copy each of the sections to a separate file and then use tk...

Is there any trivial way to 'delete by date' using ´rm'- in bash?

I noticed today (after ~8 years of happily hacking away at bash) that there is no trivial way to 'delete by date' using ´rm'. The solution is therefore to pipe stuff around a combination of commands like rm, ls, find, awk and sed. Say for example I wanted to delete every file in the working directory from 2009, what would be a typical s...

HTML downloading and text extraction

What would be a good tool, or set of tools, to download a list of URLs and extract only the text content? Spidering is not required, but control over the download file names, and threading would be a bonus. The platform is linux. ...

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network?

What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.16.55.210.. ...

Linux C++ Debugger

I'm looking for the perfect Linux C++ debugger. I don't expect success, but the search should be informative. I am a quite capable gdb user but STL and Boost easily crush my debugging skills. It not that I can't get into the internals of a data structure, it's that it takes so long I usually find another way( "when in doubt, print it ...