linux

How to install mapnik on SLES 11 64 bit?

For a customer I have to install a django webserver on SUSE Linux Enterprise Server 11, 64 bit (short: SLES 11). Our application makes use of mapnik 0.7.0. My development environment is Ubunto 10.44. How do I install mapnik 0.7.0 on my SLES 11 machine? My first difficulty is to compile boost. Maybe it's handy to use SUSE Linux Enterpris...

Can't build sigqueue example with gcc but g++ is ok?

Hi I have a strange build problem. I have a simple test program that sends a sigqueue to another process. This little code example builds and runs when I build it as a c++ program (compiled with g++) but when I compile it as a c program (with gcc) I get a error that he can't find the sigval struct. The short example: #include <std...

How secure is storing sensitive information in a .PHP file on an Apache server?

I am making an easy-to-setup, no-database PHP website which stores its data instead in text files. The setup is a Linux/Apache/PHP server. Up to now the information has been non-sensitive, so I store in: ../data/system.txt Theoretically someone could type (url)/data/system.txt in their browser and see the data file in plain text, which...

Is there a way to know the creation time of a file in ubuntu?

i am using ubuntu and want to know the creation time of a file even when it gets modified or accessed ? ...

Linux: how to detect how a process was started

How can my program detect how it was started: by someone using the command-line or by another process? The program has an optional interactive part that I want to suppress when it was started by another process - running in the background; but when it was started from a terminal I want it to do the interactive bit. [edit] If it is poss...

Simultaneus development in Visual Studio and a Linux IDE

Hi, I am trying to get started with an existing open source project (QuantLib) using Linux operating system. However it seems that most developers use Visual Studio (judging from the project files committed with the source). Which Linux C++ IDE would be most compatible with VS project files? Is there a way to import/export them, so th...

Declaring User Defined Variable in Shell Scripting (csh shell)

I am trying to learn shell scripting and trying to create a user defined variable within the script, first: howdy="Hello $USER !" echo $howdy However, when I execute the script (./first) I get this: howdy=Hello aaron!: Command not found. howdy: Undefined variable. What am I doing wrong? ...

c / c++ disable access to files

Is it possible to disable access of some program to files completely? Because I don't want it to have any kind of access to files on system, is it possible to compile it so it doesn't have access to file stream or to run it someway it cant access files? ...

How long are resources used (file descriptor and memory) for Java temporary files (jar_cache####.tmp)?

I"m running a Java application on a Linux system. I noticed that the application seemed to consume a lot of file handles (I get "Too many open files" after a few days). So when I use the 'lsof' command to dump all the files associated with the Java application, I get something like this: java 2690 root 239u REG 3,2 428057 943...

packet travelling in layers

I want to know how a network packet travels through different layers i.e. from physical layer to presentation layer in Linux systems. I want very detailed article or book on this topic with codes in C. I tried to Google it but unable to find. Any other type of guidance is welcomed. Kindly help. Thanks in advance. ...

What happens to open file handles after an execv call? (C++)

Hi, On Linux, I have some C++ code where I want to execv another application. That program outputs some data to the stderr. I therefore redirect the stderr by calling freopen() with stderr as the stream parameter. The thing is, I want to redirect the stderr for another process that is run. Here is the scenario I am working with. I ...

What do you do with badly behaving 3rd party processes in Linux?

Anytime I have a badly behaving process (pegging CPU, or frozen, or otherwise acting strangely) I generally kill it, restart it and hope it doesn't happen again. If I wanted to explore/understand the problem (i.e. debug someone else's broken program as it's running) what are my options? I know (generally) of things like strace, lsof, d...

readline clash with child printf?

In Linux, readline() in an infinite loop repeatdly reads text\n. However, as soon as child processes start printing to the screen, readline no longer reads new lines. Even if I repeatdly press enter, readline() doesn't return. Anyone know what's wrong? Code sample as requested: char* input; int cpid; while(1) { input = readline("...

Following multiple log files efficiently

I'm intending to create a programme that can permanently follow a large dynamic set of log files to copy their entries over to a database for easier near-realtime statistics. The log files are written by diverse daemons and applications, but the format of them is known so they can be parsed. Some of the daemons write logs into one file p...

gcc switches - what do these do?

I am new with using gcc and so I have a couple of questions. What do the following switches accomplish: gcc -v -lm -lfftw3 code.c I know that lfftw3 is an .h file used with code.c but why is it part of the command? I couldn't find out what -lm does in my search. What does it do? I think I found out -v causes gcc to display program...

Help Using werc

Hello, Can anybody tell me some sources from which I can learn how to use werc framework? (The documention on the site is very poor) Thanks ...

How to convert DATE to UNIX TIMESTAMP in shell script on MacOS

On Linux you can convert a date like "2010-10-02" to a unix timestamp in shell script by date -d "2010-10-02" "+%S" Since Mac OS does not have the equivalent -d for date. How do you go about converting a date to a unix timestamp in a shell script. ...

Building an USB peripherial

I would like to control an RC model via USB from my computer. I don't need a real radio control, so controlling the servos directly through cables is sufficitent (yes, there will be cables between the model and the controlling unit). I thought I would build some microcontroller-based device which would be connected to the computer via US...

Are there any c demos with netfilter?

I want to forward packets by netfilter, so I want to get some c demos to get start, thanks ...

Linux; How do I find logs if a program I'm running uses certain ports?

I am running CentOS 5 with csf firewall. I'm running a program that can't connect to another server (using some port that is blocked by csf I presume). Where is the log file for 'ports'? ...