linux

Need to merge multiple pdf's into a single PDF with Table Of Contents sections

Will have 50-100 single PDF's that we'll be generating with a php script. PDF's are generally grouped into groups of 10-20. Each group needs to have it's own Table of Contents or Index, and then there also needs to be a Master Table of Contents or Index at the beginning. Or if that is too difficult we could get away with a single Table...

How do I get CPU Clock Speed in C++ (Linux)?

How can I get the CPU clock speed in C++? I am running Ubuntu 9.10 if that makes any difference. ...

How to debug a segmentation fault while the gdb stack trace is full of '??' ?

My executable contains symbol table. But it seems that the stack trace is overwrited. How to get more information out of that core please? For instance, is there a way to inspect the heap ? See the objects instances populating the heap to get some clues. Whatever, any idea is appreciated. ...

Benchmark Test Software Running on Windows and Linux/Ubuntu

Just wondering if there is any benchmark software that I can download that will run on both Windows (preferable Windows 7) and Linux (Ubuntu 9.10)? I have a brand new system and I'd like to run some standardized benchmarks with Ubuntu and also with Windows 7. The Passmark Performance test only runs under Windows. ...

What's the single best reference on the topic of (POSIX) signals?

Signals seem to be one of those areas that should be conceptually simple and easy to explain but I have never come across one source that is both comprehensive, lucidly written, and up to date. In part this seems to be because of historical cruft, lots of exceptions to rules, different programming standards, the confusion threads throw ...

Creating an installer for Linux application

Hi, I'm developing a small cross-platform application and I need some advice on how to install it in Linux. I am using InnoSetup in Windows and an application bundle in OSX but I have no idea how to get my app installed in Linux, are there any opensource installer creators for Linux? Thanks. ...

Standard Buffer not getting cleared before system() call

#include<stdio.h> #include<signal.h> #include<stdlib.h> void handler(int signo) { printf("First statement"); system("date"); exit(EXIT_SUCCESS); } int main() { signal(SIGINT,handler); printf("Waiting for KeyboardInterrupt\n"); for(;;); return 0; } Test run:- shadyabhi@shadyabhi-desktop:~/c$ gcc main.c shad...

What does "pcntl_fork(): Error 12" mean?

I've searched until I was blue in the face and cannot find the answer to this question. Where I can find a table listing the meanings of all the error codes for pcntl_fork()? Or even the C fork() function, for that matter. ...

JFileChooser and browsing networked machines

Good afternoon, I am working on a little program that needs the ability to let users browse files and directories on networked machines as well as the local filesystem. I made the mistake of developing this component on a Windows machine... it worked fine there, but hid the fact that JFileChooser doesn't really "see" networked drives. O...

windows equivalent of inet_aton

I'm converting some code written for a linux system to a windows system. I'm using C++ for my windows system and wanted to know the equivalent of the function inet_aton. ...

Using gdb to single-step assembly code outside specified executable causes error "cannot find bounds of current function"

I'm outside gdb's target executable and I don't even have a stack that corresponds to that target. I want to single-step anyway, so that I can verify what's going on in my assembly code, because I'm not an expert at x86 assembly. Unfortunately, gdb refuses to do this simple assembly-level debugging. It allows me to set and stop on app...

Zombie Processes Appearing When I Spawn Processes

I have a pieces of code where i spawn off children processes to make it more efficient. However, they appear to create all sorts of zombie processes which block sockets and bring down the site. spawn(:method => :thread) do if @login_user.suggested_group_info.new_record? xxx end end 1) Why is this creating zombie processe...

In my Apache2 access.log, how do I filter what gets displayed?

Someone told me to do this in order to keep track of latest people hitting my server: tail -f access.log However, this shows all the "includes", including the JS file, the graphics, etc. What if I just want to see the pages that people hit? How do I filter that using tail -f? ...

Are there any platforms where using structure copy on an fd_set (for select() or pselect()) causes problems?

The select() and pselect() system calls modify their arguments (the 'fd_set *' arguments), so the input value tells the system which file descriptors to check and the return values tell the programmer which file descriptors are currently usable. If you are going to call them repeatedly for the same set of file descriptors, you need to e...

How can I run an external program without waiting for it to exit?

Hi - I'm trying to execute an external program from inside my Linux C++ program. I'm calling the method system("gedit") to launch an instance of the Gedit editor. However my problem is while the Gedit window is open, my C++ program waits for it to exit. How can I call an external program without waiting for it to exit? ...

Subdirectory .htaccess affecting other directories

I'm having a strange .htaccess issue. My web structure is setup like so to have two sites: www/site1/ www/site2/ inside the site1 directory, I have a .htaccess file with rewrite rules in it. Inside the site2 directory, I have a different .htaccess file with different rewrite rules. My problem is that the rules in www/site1/.htacces...

How to configure oracle instantclient for mono?

Mono is really awesome. Some of our applications worked in linux out of the box even without recompiling the binary. However I am having tough time to configure oracle instantclient to use it with mono. I installed instantclient on a CentOS VM(by installing instantclient rpm) but however I did not find TNSNAMES.ORA anywhere. I searche...

How to empty ("truncate") a file on linux that already exists and is protected in someway?

I have a file called error.log on my server that I need to frequently truncate. I have rw permissions for the file. Opening the file in vi > deleting all content > saving works (obviously). But when I try the below cat /dev/null > error.log I get the message File already exists. Obviously there is some kind of configuration done o...

How to write ONE line of command that scp all the sub-directories in a directory to a remote machine

something like: scp -r all_directories_in_current_directory fenix@xxxxx:~/data anyone can give me a clue? ...

Java Swing positioning elements differently in different operating systems.

I have written a Java Desktop Application that runs in Windows, Mac OS X, Ubuntu and Open Suse. I am having issues with is positioning thing differently in Linux. I developed the application with NetBeans using the designer, it looks as I would expect in Windows and Mac OS X, but in the Linux distros certain label controls have shifted ...