linux

shell script not running via crontab, runs fine manually

Hey guys, Before you guys jump on me for asking this question which is asked a million times over and over. Yes I have tried exporting my paths and variables and crontab still will not run my script. I'm sure I am doing something wrong. I have a shell script which runs a jar file. This is not working correctly. After reading around ...

revision control for server side cgi programming

Hi all, A friend of mine and I are developing a web server for system administration in perl, similar to webmin. We have a setup a linux box with the current version of the server working, along with other open source web products like webmail, calendar, inventory management system and more. Currently, the code is not under revision c...

How do I set a ulimit from inside a Perl script that applies to its children?

I have a Perl script that does various installation steps to set up a development box for our company. It runs various shell scripts, some of which crash due to lower than required ulimits (specifically, stack size -s in my case). Therefore, I'd like to set a ulimit that would apply to all scripts (children) started from within my main ...

when I include atomic.h, GCC says No such file, why?

I want to use atomic API, and I include . I don't know how to use it! Thank you! ...

How can I find out a files "mime-type(Content-Type?)"?

Is there a way to find out the MIME-TYPE (or is it called "Content-Type"...) of a file in a linux bash script? The reason I need it is because imageshack appears to need it to upload a file as for some reason it detects the .png file as an "application/octet-stream"… I'v checked the file, and it really is a .png $ cat /1.png ?PNG (wi...

php & filesystem +setUID/permissions ... i just don't get it!

i have to admit, i never really completely got the *nix filesystem permission model. oh, the rwxrwxrwx stuff isn't too complicated, but i get confused easily when programs create new files and how i can handle them. my current problem is the mixture of a (closed source) java-applet that does file uploads over ftp and php (it's on a ded...

Debian send ip address on startup (sheevaplug)

Hi, I'm having a sheevaplug with debian (default) installed on it. I would like to receive a mail with the ip-address of the sheevaplug, everytime it is restarted, AND everytime the ip address changes. I have no idea how to do this... I realize I'm asking multiple things at once, so part of the solution is also ok: how to write som...

ddd debugger enters an infinite loop when the program tries to read console input.

when a C++ program reads from cin, the ddd provides it with "1" instead of letting me type the input in its console. Since the program reads interactive commands, "1" is an invalid command and ddd seems to have an infinite supply of them, the result is an infinite loop of "invalid command" output. Have anybody encountered such behavior ...

Ruby On Rails Development Machine

Hi Folks, I'm starting with Ruby-On-Rails development on Linux machine. I want to know which Linux distribution will be best suited to do ROR development. Also what will be the best (free) IDE for ROR on Linux. ...

Shmat with non-null shmaddr

Could someone provide an example of (reasonably) using the function shmat() with non-null second parameter? The manual says: #include <sys/shm.h> void *shmat(int shmid, const void *shmaddr, int shmflg); The shmat() function attaches the shared memory segment associated with the shared memory identifier shmid to the data se...

Prolog - SWI specifically - where is pl located?

Hello guys, I'm trying to set up an environment with interprolog and SWI prolog, interprolog needs the location of swi's "pl" but i cant find it. All i can find is swipl or plrc and neither work with interprolog. If i type pl into the terminal(this should run swi-prolog) it says bash: pl :command not found but if i type in swipl o...

Linux application profiling

I need some means of recording the performance of an application on a Linux machine. I won't have an IDE. Ideally, I need an app that will attach to a process and log periodic snapshots of: memory usage number of threads CPU usage Any ideas? ...

Interprolog and SWI-Prolog help

Hello guys, I have set up and installed both interprolog and swi prolog on my linux machine following the instructions here :Interprolog with SWI instructions on Linux I have edited the unixVariables.sh to contain the path of java and swi-prolog(pl) executables on my machine and that my unixVariables.sh looks like: # This is a typical ...

Implementing file locks to make a copy a file.

Develop a C program for file-copy where two processes work together to complete the task: Parent process receives source filename and destination filename from command line. It opens the source file in read mode. Use shared lock on the source file in both the processes. Use exclusive lock on the destination file. Do read/write operatio...

How to get the system library path on Unix (Linux, FreeBSD)

I need a more-or-less portable programmatic way for querying the the dynamic library path list. For Linux, I can concatenate the $LD_LIBRARY_PATH and the contents of /etc/ld.so.conf (processing the include directives as needed and possibly filtering by architecture), but that doesn't work e.g. on FreeBSD. Ultimately, I need a Python fun...

Why are string::append operations behaving strangely?

look at the following simple code: #include <iostream> #include <string> using namespace std; int main() { string s("1234567890"); string::iterator i1 = s.begin(); string::iterator i2 = s.begin(); string s1, s2; s1.append(i1, ++i1); s2.append(++i2, s.end()); cout << s1 << endl; cout << s2 << endl; } w...

C programming, unicode and the linux terminal

So what I'm trying to do is write Japanese characters to my terminal screen using C and wide characters. The question is whats wrong with what I'm doing so that I can fix it, what other caveats should I expect while using wide characters and do you have any other comments about what I'm trying to do? The bad code: #include <stdio....

Setup SFTP to use public-key authentication

How do you setup server to server SFTP to use public-key authentication instead of user account and password? ...

* on the linux command line

I am making a little calculator in C, and i want to pass simple arithmetic formulae to my program. But it really does not like me passing character '*' to my program. Why not? And how can I work around this without changing the asterix to something else? Thanks ...

Reason for output 1 bit differences between Linux-gcc compiled C code output and MS-VS2008 compiled output?

Hello, I have a Theora video deocder library and application compiled using VS-2008 on windows(Intel x86 architecture). I use this setup to decode theora bit streams(*.ogg files). The source code for this decoder library is used from FFMPEG v0.5 source package with some modifications to make it compile on windows-VS-2008 combination. ...