linux

What is the Perl equivalent of PHP's proc_open(), proc_close(), etc.?

Using PHP's proc_open(), I can start a process, read from STDOUT and STDERR (separately) an arbitrary number of bytes at a time using fread() while the process is running, detect when the process is done using feof() on the STDOUT and STDERR pipes, and then use proc_close() to get the exit code of the process. I've done all of this in PH...

new encryption algorithm for ssh

hi dears I am asked to add a new algorithm to ssh so data is ciphered in new algorithm, any idea how to add new algorithm to ssh ? thanks ...

How to learn xInput and gesture programming in Linux (GTK+)

Ramble: I have been goggling for the past ~week trying to get information on tablet programming for Linux. I am currently a student tasked with making a tablet application (mobile but tablet is the preferred device). I am allowed to program with Linux however the class instruction is based on Microsoft XP tablet input "Inking." I howe...

get the return value of bat file in windows in unix ?

i have the following case :- i write bash file bbb in windows 2003 and but a return value = 3 by exit /b 3 then i execute this bash file from unix by this command :- ssh -l admin host 'cmd /c start c:\bbb' but when i print the return value i get ( 0 ) not ( 3 ) i print this value by `echo $? ' now how i can get a return value "exit cod...

Listening for IPv6 multicasts on Linux

I'm trying to get a simple multicasting example to work on Linux (I've tried both RHEL 4 2.6.9 and Ubuntu 8.04 2.6.24). The general idea is that I would like the server to bind to a unicast address and then add itself to the group ff02::1. I would then like it to receive multicasts sent to ff02::1. The code below works on Mac OS X 10.5 (...

JVM load not shared between processor cores on linux

Hey, how come that JVM always uses only one from four cores ? If I run 2 or 3 Java apps, one core is employed on 100% and the rest is sleeping having nothing to do. Apps like Liferay, eclipse, sonatype nexus etc., multithreaded overlords. There is plenty of free RAM also. ps and top shows what I just said, and entire system gets out ...

What is the difference between DMA and memory-mapped IO?

what is the difference between DMA and memory-mapped IO? They both look similar to me. ...

What is wrong with this use of PIPESTATUS in BASH?

I have a for loop that I pass through ssh to a server that is formatted to look kind of like this... i=0 for cmd in cmd_list; do ${cmd} | sed "s/^/OUTPUT_${i}_: /" & (( i++ )); done; wait The idea is that the for loop will run a list of commands that I give it and pipe each one to sed where sed prepends each line of output with a comm...

Selenium RC, on Linux, is there a way to make all browser instances run in the background?

I've been looking into this, as far as how I can run selenium browser instances in the background. I found some things about using a virtual GUI instance, or something like that, but it was all for Windows. I'm using Ubuntu linux so I'm wondering what the easiest way would be to suppress the actual browser instances showing up for the u...

How to detach screen programmatically in linux?

This question is about the linux utility screen. I'd like to make a script to launch a program in screen then detatch it automatically after it starts. I've got the script starting screen, starting the command in screen, but my question is now how do I detach it? Thanks ...

Query if service is running

How can I query if a service (dnsmasq) is running, in C? ...

Problem with "login.php" in ubuntu for chat program in php

<?php // variables $user = $_POST['user']; $ip = $_SERVER['REMOTE_ADDR']; // escape any malicious characters if (!get_magic_quotes_gpc()) { $user = addslashes($user); } if (empty($user)) { echo "Please enter a username."; } else { # connect to the database include_once('connection.php'); // database...

How to access a data structure from a currently running Python process on Linux?

Hi, I have a long-running Python process that is generating more data than I planned for. My results are stored in a list that will be serialized (pickled) and written to disk when the program completes -- if it gets that far. But at this rate, it's more likely that the list will exhaust all 1+ GB free RAM and the process will crash, lo...

PHP and Unicode: Weirdness between Windows and Linux.

Look at IBM's Unicode for the working PHP programmer, especially listings 3 and 4. On Ubuntu Lucid I get the same output from the code as IBM does, viz: Здравсствуйте Array ( [1] => 65279 [2] => 1047 [3] => 1076 [4] => 1088 [5] => 1072 [6] => 1074 [7] => 1089 [8] => 1089 [9] => 1090 [10] => 1074...

Shell Script for renaming and relocating the files

I am working on something and need to solve the following. I am giving a analogous version of mine problem. Say we have a music directory, in which there are 200 directories corresponding to different movies. In each movie directory there are some music files. Now, say a file music.mp3 is in folder movie.mp3 . I want to make a shell sc...

In Linux, how to tell how much memory processes are using?

I think I may have a memory leak in my LAMP application (memory gets used up, swap starts getting used, etc.). If I could see how much memory the various processes are using, it might help me resolve my problem. Is there a way for me to see this information in *nix? ...

In *nix, what causes "sleeping" in top command?

What causes these sleeping processes that I see in top? If I were to call PHP's sleep() function, would that add to the sleeping count I see in top? Are there any disadvantages to having a high number in sleeping? ...

Add thousands of numbers stored in second 'column' in text files?

I've got a file with 400k+ numbers, each with a filename and its size in separate lines and I need to add them up to get a total. See: http://superuser.com/questions/195493/unix-recursive-directory-listing-with-full-pathname-of-file-and-filesize filename1 size1 filename2 size2 Its not going to be a very large number ... < ~50,000,000...

Directory as a dependency in make rule

Is it possible to specify a directory as a dependency in a Makefile rule? Actually I have a Makefile in a directory and another directory containing all the source files. . . |_ Makefile |_ src |_a.c |_a.h Now I want that whenever I make any change in the src directory i.e. in either of a.c or a.h , a particular rule in my Mak...

How to building a linux executable in CentOS 5 and running it on RedHat 9?

We had just migrated our software to CentOS 5 platform, from RedHat 9. We're now compiling our C programs on CentOS 5 using gcc v4.1.2 and everything works fine on CentOS, but these new binaries will not run on RedHat 9 anymore (kernel 2.4.1). Any suggestions on how we can compile a binary that can run on both of these platforms? ...