linux

Shipping Closed-Source Application for Linux

What are some methods I can use to ship a closed-source application for linux? At the moment the application links against a few libraries (WxWidgets, GraphcisMagic, Crypto++, etc). Statically link everything to a single executable? Include the Libraries in a package? Ship the Dynamically Linked executable (and have the user get t...

Format of parameter to display call graph for templated method with gprof?

What is the command line format to display function call graph for a method in templated class with gprof? For simple C method you would specify it like: gprof -f foo myprogram > gprof.output How do you specify method parse from the following: template <typename T> class A { public: template <typename X> bool parse(X& x,...

Application Autostart Locations/methods for Windows (XP, Vista, 7) and Linux (GTK, KDE, ...)

I am developing a cross platform application that needs to auto start upon user login (not system start). What are the common locations/methods in invoking auto start for Windows/Linux. For example, are the Windows registry locations for auto start compatible across all versions of windows (XP, Vista, Windows 7, etc). And what about ...

Any hand-on exercise to understand how a program is loaded into memory and get executed

Hi, I am curious about the things happend before main() is called , such like load the executable into memory , dynamic load of shared library. Do you have any suggestions how to understand these things by a hand-on exercise? The tools amd things I know of ,and using now, includes: strace disassemble readelf /proc/pid/map NOTES: ...

best way to write a linux daemon

For work i need to write a tcp daemon to respond to our client software and was wondering if any one had any tips on the best way to go about this. Should i fork for every new connection as normally i would use threads? ...

How can I manage use of a shared resource used by several Perl programs?

I am looking for a good way to manage the access to an external FTP server from various programs on a single server. Currently I am working with a lock file, so that only one process can use the ftp server at a time. What would be a good way to allow 2-3 parallel processes to access the ftp server simultaneously. Unfortunately the provi...

seteuid() not working. Reason?

Hi, I'm completely new to C and I use it very rarely. This time i need it for a university project. I have to write a small c app that tests some modifications we made on the Linux kernel (on the scheduler). Inside the script I'd like to switch to another user to see the distribution of CPU times among the different users. So I start m...

mmap to overlay VME bus into user space memory over a PCI?

I'm trying to map a VME address space through a PCI bus into user space so I can perform regular read/writes on the memory. I have done this with another PCI device like this :- unsigned long *mapArea(unsigned int barAddr, unsigned int mapSize, int *fd) { unsigned long *mem; *fd = open("/dev/mem", O_RDWR); if ( *fd<0 ) { ...

On Linux - set maximum open files to unlimited. Possible?

Is it possible to set the maximum number of open files to some "infinite" value or must it be a number? I had a requirement to set the descriptor limit for a daemon user to be "unlimited" and I'm trying to determine if that's possible or how to do it. I've seen some mailing lists refer to a "max" value that can be used (as in: "myuser h...

Is it possible to utilize a python module that isnt installed into the python directories in linux?

I have a python application that depends on the uuid module, but on the server where I need to run it, uuid is not installed. I do not have root on the server so I cannot place the uuid .pys in the /usr/lib/python2.4/site-packages folder... is there a way that I can utilize the .py's from elsewhere? like my ~ ? ...

Linux redhat kernel-headers

I'm trying to compile a c programming package (thc-ipv6-0.7) on Linux Redhat 2.6.9-42.ELsmp and it's complaining that it can't find "linux/string.h". From google, I learned that this is part of the "kernel-headers" package. If I do "rpm -qa | grep kernel" It shows that "kernel-devel" is installed (which I think I need), but not "ker...

articles about fonts in linux or fonts in general

I have heard some terms about linux fonts,such as XFT, fontconfig etc.I just cann't figure out these mumble jumbo.Is there any good tutorial/article about fonts in linux?or fonts in general in the computer science.Thanks. ...

Python subprocess.Popen erroring with OSError: [Errno 12] Cannot allocate memory after period of time

Note: This question has been re-asked with a summary of all debugging attempts here. I have a Python script that is running as a background process executing every 60 seconds. Part of that is a call to subprocess.Popen to get the output of ps. ps = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE).communicate()[0] After runn...

IO.popen - how to wait for process to finish?

I'm using IO.popen in Ruby to run a series of command line commands in a loop. I then need to run another command outside of the loop. The command outside of the loop cannot run until all of the commands in the loop have terminated. How do I make the program wait for this to happen, because at the moment the final command is running too ...

Compiling C++ program with POSIX AIO lib on Linux

I'm having difficulty with the linker when it comes to compiling a sample program that uses the POSIX aio library (e.g. aio_read(), aio_write(), etc) on Linux. I'm running Ubuntu with a 2.6 kernel, and have used the apt-get utility to install libaio. But even though I'm linking with the aio library, the compiler still gives me linker er...

Rotating a spaceship model for a space simulator/game

I been working on a space sim for sometime now. At first I was using my own 3d engine with software rasterizer. But I gave up when the time for implementing textures was due. Now I started again after sometime and now I'm using Opengl (with SDL) instead to render the 3d models. But now I hit another brick wall. I can't figure out how ...

Best C++ Debugger For Linux

I'm learning C++ and I want to know what is the best C++ debugger for Linux, because there are some things, that is better to use a debugger to get here in Stack Overflow and ask very very simple questions that can be easily solved by a debugger. Also, there is any book to learn how to use this debugger? ...

Where are include files stored - Ubuntu Linux, GCC

So, when we do the following: #include <stdio.h> versus #include "myFile.h" the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive. It just utilizes the files with no interaction from me. I think that on my Ubuntu Linux machine the files are stored at /usr/include/. How does...

Postgresql restore Error at or near "`"

Hi, I have 800mb backup postgresql db, i even had hardtime to open the file because not enough memory. I tried to restore the file, but i receive this error while restoring, does any one know how to fix I run this command: psql -U root -d mydatabase -f dbfile.sql i receive message: ERROR: syntax error at or near "" LINE 1: INSERT I...

Use of \c in shell scripting

I am editing someone else scripts and I see s/he has used this \c very often like echo "bla bla \c" which when used simply prints bla bla \c in screen. So, I was wondering why use it or may be I am missing something, because it is doing nothing at all ? I checked escape characters and I didn't find any such thing as well. Is there...