linux

How to compile an old version of gcc, say 2.95.2?

My ubuntu installed with gcc 4.3.2. But I need gcc 2.95.2 to compile some of my code. I have downloaded the source of 2.95.2. But when I tried to compile it with 4.3.2, i failed. How could I get the 2.95.2 compiled? Many thanks... Update Please take a look at this thread: http://stackoverflow.com/questions/3693632/how-to-build-old-sou...

csh scripting for password authorisation of user

I'm trying to write a professional program to accept and process input via a Menu based system. The program should have no command line arguments. it will be writen in csh script called TaskMenu. This shell script will: 1) ask for a password from the user. If the password is not correct, the system will exit with an appropriate...

Setlocale returns false

Hi, I have installed the dutch local (nl_NL utf8) on my webserver (when I execute locale -a I see nl_NL utf8 so this is allright). However, the dates on my webpage are in english (I have put setlocale(LC_ALL, 'nl_NL'); in the top of my pages). I have read when you install a locale package after compiling php, I have to recompile php. ...

fail2ban: ban incorrect plesk login-attempts (brute force)

How can i ban incorrect login-attempts to the plesk webinterface by using fail2ban to prevent brute-force attacks ? . ...

Speed Up linking speed / Fast linking on linux.

Hi, I am building webkit ( 2 Million lines ) after every ten minutes to see the output of my change in it, and linking of webkit on my Machine requires to process 600-700 MB of object files which are there on my hard-disk. That takes around 1.5 minutes. I want to speedup this linking process. Is there any chance that, I can tell os to ...

Binding multiple times to the same port

Hi, is there a way to bind multiple listening TCP sockets on the same {IP, port}? I know I can just open a socket, bind, fork and then listen in each of the processes. But I'd like to do the same with separate processes that cannot fork after binding. Is there some way to allow this and not get the "Address already in use" error? The on...

Linux Shutdown with dbus-send

Hey, I am writing a Java app to shutdown my Linux box remotely. The desktop app sits and waits for a command to be sent to it. I have tried using "shutdown -h" but this requires sudo privileges and is not an option. I then found a way to shutdown without sudo using the following dbus-send solution: dbus-send --print-reply --system -...

With sendfile(), is it possible to tell when in_fd is at EOF?

Reading through the man page of the Linux system call sendfile, I am wondering whether it is possible for the calling program to know when in_fd is at EOF. Presumably, this could be signaled by a return value of 0, but this leads to the question of what a return value of 0 actually means. If sendfile is like write, then a return value of...

Separate servers handling WSDL file differently

Hi, Within a project I've been writing for the past two years I have a WSDL file which works nicely for use with my SOAP calls however we are now moving all of our code over to a new server and it seems to handle this differently. On the old server if I type in the file path for the WSDL file I can simply read it as if it's a text doc,...

How to list linux running process from C#.net client ?

I want to read all the running process in linux server from my C#.net client ? Can you please show me the way or possibility for achieving this ? We are in same domain.. I guess no firewall issue and but I cannot write or install anything on server. (I am trying this to get hold of the process id running on linux box and when that pr...

Difference between aio_write() and O_NONBLOCK write()

What is the difference between aio_write() and O_NONBLOCK write()? Also, I use write() to a text file using file descriptor using the O_NONBLOCK function and compare the performance with the aio_write() by putting a timer before and after the function. It seems that the write() function would take longer time to write to file when the...

Where to get iostream.h

I'm trying to make something in Linux, but it complains that it can't find iostream.h. What do I need to install to get this file? ...

Image process & recognition implementation on Linux. How to?

Hi guys. Usually I develop image process or recognition program on windows. But I got a custom who requires me to implement one on Linux platform. Because his platform is embedded system, I can not know for sure that OpenCV would be available. Could anyone give me some clue to get started? ...

Some questions about pthread_mutex_lock and pthread_mutex_unlock

When a thread has acquired the lock and execute the following code, Could the thread will unlock the lock it has acquired just with the return statement? some code like this. static pthread_mutex_t mutex; int foo() { pthread_mutex_lock(mutex); ......... execute some code here and some errors happen ...

How to use an older version of gcc in Linux

In Linux I am trying to compile something that uses the -fwritable-strings option. Apparently this is a gcc option that doesn't work in newer version of gcc. I installed gcc-3.4 on my system, but I think the newer version is still being used because I'm still get the error that says it can't recognize the command line option -fwritable-s...

Retrieving netmask for interfaces with multiple IP addresses using Python?

I need to list the available network interfaces and their IP addresses and corresponding netmasks using Python in a Linux environment. I can get the interfaces and the IP addresses of each interface using ioctl and SIOCGIFCONF as outlined here, but I'm at loss when it comes to determining the netmask when there are multiple IP address o...

OS reload on a remote linux machine

If we need to do OS reload on a remote machine, how can the network boot be enabled on the client machine without making any changes in the BIOS ?? I am in a try to develop a control panel, in which this feature is included. i.e., fully automated OS reload and thinking of using the pxe boot. But enabling and disabling boot from network ...

Printing lines from a file where a specific field is matched

Hi, I have many lines of form: A:B:C I want to print those lines(complete) where the 3rd field (fields separated by :) contain a certain pattern. Example: new/old:california/new york:/ms/dist/fx/PROJ/fx/startScript new/old:startScript/new york:/ms/dist/fx/PROJ/fx/stopScript When searching for pattern startScript, the 1st line shoul...

What is the official way to call a function (C/C++) in ab. every 1/100 sec on Linux?

I have an asynchronous dataflow system written in C++. In dataflow architecture, the application is a set of component instances, which are initialized at startup, then they communicate each other with pre-defined messages. There is a component type called Pulsar, which provides "clock signal message" to other components which connect to...

__LINE__ equivalent for Linux shell

Hello, I am writing a considerably huge shell script. Is there any way to print the line number of the script from that script? Basically I want to have something similar to gcc LINE macro. This will help me to debug my script. Thanks in advance, Souvik ...