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...
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
...
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...
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...
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 (...
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? They both look similar to me.
...
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...
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...
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
...
How can I query if a service (dnsmasq) is running, in C?
...
<?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...
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...
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...
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...
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?
...
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?
...
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...
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...
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?
...