linux

Compiling PHP 5.1.6 from source - php -v and phpinfo() version discrepancy

Hi, I have just bought a VPS running Ubuntu and I need to install the LAMP stack with PHP 5.1.6. The VPS came with no PHP installed (checked this from the shell with php -v) and with Apache/2.2.12 installed. I installed PHP 5.1.6 from source and compiled it with Apache 2.2 (using libapache2-mod-php5), tried a phpinfo() test which worked ...

Why can't I use killall with the new name given to a child process with execvp() on Linux?

Hi, Assume I have an executable called 'exe' which spawns a child process. This child process needs to become a daemon and we need to change its name. Next I want to use killall to send a signal to this process using the new name, but I need to use the old name. The order of events is as follows: start 'exec' fork -> exit if parent d...

C++ IDE for linux (ubuntu 7.1)

Hello, I wanna get a complete C++ IDE for linux, specifically ubuntu 7.1, but I want a kind of link where I could download all the files and packets at once, because I have to install it on a remote pc that is far from one Internet connection. I don't need and strong IDE because it is for teach basics of C++. Could you please help me??? ...

Can you recommend a good debugging malloc library for linux?

Can you recommend a good debugging malloc library for linux? I know there are a lot of options out there, I just need to know which libraries people are actually using to solve real-life problems. Thanks! EDIT: I know about Valgrind, but sometimes the performance is really too low. ...

Limiting the time a program runs in Linux

In Linux I would like to run a program but only for a limited time, like 1 second. If the program exceeds this running time I would like to kill the process and show an error message. ...

Why is gconfd running for daemon user without shell access?

I have a java process that runs as a service via a shell script on a RHEL box. The process runs for a while, then seems to die quietly. The process does have a shutdown hook that fires and in the event of a normal kill it does log stuff and but nothing is logged in the cases where it dies. I checked the system logs and at the same tim...

How to get CRON to call in the correct paths

Hello, I'm trying to get cron to call in the correct path's. When I run a Python script from shell the script run's fine as it uses the path's set in bashrc but when I use cron all the path's are not used from bashrc. Is there a file I can enter the path's into for cron like bashrc or a way to call the path's from bashrc. Sorry I don'...

Any workarounds for getting swfupload.js working in Linux?

Hi, SWFUpload doesn't work on ubuntu, I can see various mentions of it throughout the internets but I'm wondering if anyone here as found any work arounds? I'm developing on Windows, so the code executes fine. But my colleague is running ubuntu, and SWFUpload crashes instantly. Has anyone encountered that and found a work around? I've...

Linux shell command to read/print file chunk by chunk

Hi All, Is there a standard Linux command i can use to read a file chunk by chunk? For example, i have a file whose size is 6kB. I want to read/print the first 1kB, and then the 2nd 1kB ... Seems cat/head/tail wont work in this case. Thanks very much. ...

How do I notice when something gets mounted.

I want my program always know all of the mountpoints. After a quick google I found that getmntent() and friends can tell me what is mounted. I realize I could do this everytime that I needed to know what was mounted, but is there some way to recognise when something gets mounted/unmounted so I don't have to keep reading the file? Is t...

Using Xlib via JNA to move a window

I'm using JNA to manipulate application windows on Linux by sending Xlib messages but can't seem to move a window. My original implementation executed wmctrl on the shell to move the windows and that successfully moved the windows. Unfortunately, there's a noticeable amount of overhead associated with calling shell programs from Java, s...

socket in linux

my Socket.cpp containing // Implementation of the Socket class. #include "Socket.h" #include "string.h" #include <string.h> #include <errno.h> #include <fcntl.h> Socket::Socket() : m_sock ( -1 ) { memset ( &m_addr, 0, sizeof ( m_addr ) ); } Socket::~Socket() { if ( is_valid() ) ::close ( m_sock ); } bool Socke...

socket programming in linux

#include "ServerSocket.h" #include "SocketException.h" #include <string> #include<iostream> int main(int argc, int argv[]) { std::cout << "running....\n"; try { // Create the socket ServerSocket server ( 30000 ); while ( true ) { ServerSocket new_sock; server.accept ( new_sock ); ...

How to detect mouse and keyboard inactivity in linux

I am developing an app on python which will check for user inactivity. Is there a way to check for key press and mouse move events in linux? ...

Setting up Linux to use a certain version of python for compile.

I'm running Ubuntu to compile a set of code which requires python 2.4. How can I setup a terminal launcher so that when I open that launcher all python related commands will use python 2.4 instead of the python 2.6 that is defaulted in Ubuntu? ...

Memory Leaks and Apache

My VPS account has been occasionally running out of memory. It's using Apache on Linux. Support says it's a slow memory leak and has enabled MaxRequestsPerChild to deal with it. I have a few questions about this. When a child process dies, will it cause my scripts to lose session data? Does anyone have advice on how I can track down thi...

What happens when a process is forked?

I've read about fork and from what I understand, the process is cloned but which process? The script itself or the process that launched the script? For example: I'm running rTorrent on my machine and when a torrent completes, I have a script run against it. This script fetches data from the web so it takes a few seconds to complete. D...

Linux kernel - add system call dynamically through module

Is there any way to add a system call dynamic, such as through a module? I have found places where I can override an existing system call with a module by just changing the sys_call_table[] array to get my overridden function instead of the native when my module is installed, but can you do this with a new system call and a module? ...

Get ceiling integer from number in linux (BASH)

How would I do something like: ceiling(N/500) N representing a number. But in a linux bash script ...

Round a divided number in Linux

How would I round the result from two divided numbers, e.g. 3/2 As when I do testOne=$((3/2)) $testOne contains "1" when it should have rounded up to "2" as the answer from 3/2=1.5 ...