linux

Load HTML - Command line

Hi, I have a PHP script that dynamically creates a HTML file. In command line, I would like to load all elements in the HTML file. So let's say the HTML file has these elements: img src="http://www.test.com/image.php" ... iframe name="xxx" src="https://www.abc.com" ... I would like the Web servers test.com and abc.com to actually rec...

Ubuntu directory for storing files

Hi, I have a server running on Ubuntu which creates lots of data and media files. I would like to know what is the best location to store the files. Requirment : My application running on java server(tomcat) needs to read, write and delete these files. There could be 100s of these files and the files could be huge. I would like to ...

Can anyone recommend a free FTP client for Linux that allows scheduled transfers?

I'm looking to do nightly backups - copy files from a dev server to my local machine. I'm on Ubuntu Lucid, and currently use FileZilla for FTP, but it doesn't support scheduled transfers and based on their discussion forums, it never will. Can anyone recommend a free, GUI ftp client that supports scheduled transfers and runs on Linux? ...

libstdc++.so.5: cannot open shared object file - but library is installed and up-to-date

My client had some developer write a small c++ command-line app to run on their Linux servers. On one of the servers (running Fedora 11), when I execute the app I get the following error: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory Obviously the first thing I did wa...

Capturing user input at arbitrary times in python

Is there a way to send an interrupt to a python module when the user inputs something in the console? For example, if I'm running an infinite while loop, i can surround it with a try/except for KeyboardInterrupt and then do what I need to do in the except block. Is there a way to duplicate this functionality with any arbitrary input? Ei...

Why isn't chroot working?

As an alternately to my real question: does anyone know of a simple command line tool to make a chroot jail? I'm thinking something that will run a command and copy everything it needs to run into a given directory. I saw some directions for a tool but it had config files and seemed to be expecting me to launch it from X and neither of t...

How to compile '97 C codes using Motif?

Hi I'm trying to compile about 30 C sources written in 1997. Based on required header files such as XmAll.h and Xlib.h and the use of "Widget" syntax, I found that these sources depend on the Motif programming tool kits, so it seems they should be compiled in Linux or Unix system. I have no any experience with X Windows Programming and ...

Right click key set over rdesktop?

I have a Macbook and am sshing into a Red Hat machine with the -Y option over VPN. From the Red Hat machine, I do an 'rdesktop' into a windows XP machine, so I get the forwarded X window of the xp desktop on my Mac. After trying many combinations, I cannot figure out what the key set is to right click in the X window of the XP machine. P...

TCP handshake phases corresponding to select() and accept() return points

I have a TCP server that creates a (blocking) socket, waits until it is available for reading using select(), then calls accept() and starts reading the data. Here is an example (not mine) illustrating the concept. The question is, at what points of TCP handshake does select() and accept() calls return? Ubuntu Hardy, if it matters. 2...

Integrating C++ code with any web technology on Linux

hello, i am writing an program in c++ and i need an web interface to control the program and which will be efficient and best programming language ... ...

Why cant' I return bigger values from main function ?

I am trying to return a bigger value like 1000 form my main function, but when I type echo $? it displays 0. If I return a smaller value like 100 it displays the correct value. My Code : int main(void) { return 1000; } Is there any limitation on the values which we can return ? Thanks. ...

Including files issue with relative paths on a linux system

Hi, I have the following directory tree structure: /index.php /code/inc/variables.php /code/inc/config.php index.php is the file that is called. On our development system in: /code/inc/variables.php, when I have the line: require_once("./code/inc/config.php"); it doesnt work and when I have: include_once('config.php'); it does...

file search bash script

i am trying to make a very simple bash script to find files matching the given name in the directory structure of the current directory. So, I used the find function like this ARGS=1 E_BADARGS=65 E_NOFILE=66 if [ $# -ne "$ARGS" ] # Correct number of arguments not passed then echo "Usage: `basename $0` filename" exit $E_BADARGS fi...

"Max open files" for working process

Hello all. Is it possible to increase "Max open files" parameter for working process ? I mean this parameter: cat /proc/<pid>/limits | grep files Thanks for your advices ...

Automatic syntax/headers in vim for c++ files [solved]

I want that whenever i open a new c++ file in vim in linux ( mandriva 2010 ) the following code gets inserted in it automatically : Default code : #include <iostream> using namespace std; int main() { return 0; } Is there any way to get it done. also can i bind .py, .pl, .java files with similar things. Moreover i should be ...

Pear downloading packages instead of installing after php downgrading to 5.2 on ubuntu 10.04

Hello Good poeple! I've downgraded php to 5.2 in ubuntu 10.04 and it seems i can't install new pear packages. the existing packages i had by typing pear list are : Package Version State Archive_Tar 1.3.3 stable Console_Getopt 1.2.3 stable PEAR 1.9.0 stable Structures_Graph 1.0.2 stable X...

filter with grep to print when text is NOT present in another file

I have a linux filter to extract all lines from an xcode project that contain localized strings and produce a sorted list of unique entries. The filter works fine and is shown below. grep NSLocalized *.m | perl -pe 's/.*NSLocalizedString\((.+?)\,.*/$1/' | sort | uniq The result is a list of strings looking like this @"string1" @"st...

Change Default Group in Script

Is it possible to change a user's default group inside a script for the duration of that script's execution? I need to generate files in a script that have the proper user and group but my user's primary group is not who should own the resultant output. $ groups groupa groupb $ ./myscript.sh $ ls -l -rw-r--r-- 1 me groupa 0 Sep 1...

Duration of an amr audio file

Hi to all i want to find the duration of an audio file of type "amr" without converting it to other audio formats with any way? AK ...

How to execute a shell script from C in Linux?

How can I execute a shell script from C in Linux? ...