linux

debug Linux process with suid

I develop an application with requires root privileges. I use Code:Blocks launched with sudo codeblocks command. The problem is that developing in root'ed Code::Blocks results in source files and CB configuration files being created with root owner. I thought I could use setuid on codeblocks executable but it is not allowed with GTK app...

Select EBADF : which FD is bad?

We have a long standing bug in our production code. This is essentially a socket based daemon. It listens to a bunch of filedescriptors using select. Occasionally (once a day or so), select will return with EBADF. I have written code to search for the bad filedescriptor, that loops over each fd and calls select on it. These calls never...

method to authenticate via a php script on my server

I am using a new service to pull xml data from a server. The service provides two methods of logging in, one via a url query: http://&lt;server&gt;/login.asp?username=&lt;User Name>&password=<Password> and the server returns a cookie valid for 7 days. This means instead of logging in for every query (and making my script less effici...

struct ip_mreq dissapears when compiling with -std=c99

On some of our linux boxen compiling with gcc -std=c99 makes struct ip_mreq dissappear (included from netinet/in.h) Is there some other interface we are supposed to use ? ...

what's the difference between foreground and background programme?

I tried to run a programme in background mode and foreground mode, while in background mode,it failed to run, but in foreground mode,it succeeded, so what's the difference between background and foreground mode that might cause this issue? ...

Mixing libraries from different C++ compilers

I am working on redhat 5.2 on a project which spans several disparate organizations. Each organization delivers libraries which have been compiled with various versions of g++. Currently, these versions include 4.1.1, 4.1.2 and 4.3.1. I am trying to link all the libraries together into an executable using 4.1.2. What, if any, problem...

how to investigate what a process is doing?

I know this can be checked from /proc/PID directory, but don't know how to, can any one show me the way? ...

Grep Recursive and Count

Need to search a directories with lots of sub-directories for a string inside files: I'm using: grep -c -r "string here" * How can I total count of finds? How can I output to file only those files with at least one instance? ...

what does these output mean?

especially the last two with '-' and '+' respectively, what does it mean on earth? [1] Done php start.php bots/admin32.bot.php [2] Done php start.php bots/admin36.bot.php [3] Done php start.php bots/admin10.bot.php [4] Done php start.php bots/admin11....

Does Linux's splice(2) work when splicing from a TCP socket?

I've been writing a little program for fun that transfers files over TCP in C on Linux. The program reads a file from a socket and writes it to file (or vice versa). I originally used read/write and the program worked correctly, but then I learned about splice and wanted to give it a try. The code I wrote with splice works perfectly...

Capicom Decryption in Linux.

I have a database that encrypted with windows CAPICOM library with RC4. Following PHP script works fine on windows server. ... $oCapiCapi = new COM("CAPICOM.EncryptedData"); $oCapiCapi -> Algorithm = 1; $oCapiCapi -> Algorithm -> KeyLength = 3; $oCapiCapi -> SetSecret('OURveRYSecretKey'); ... $oCapiCapi -> Decrypt($orsd[1]); $...

Makefile for Shared Libraries?

I've just written a Makefile to build a shared library, similar to the following: libmystuff.so: CFLAGS+=-fPIC -shared libmystuff.so: libmystuff.o otherstuff.o $(CC) $(CFLAGS) -o $@ $^ I like to avoid doing explicit actions when this seems like a common operation, but it seems there's no implicit rule or other built-ins to standar...

Is it possible to allocate, in user space, a non cacheable block of memory on Linux?

I have a bunch of buffers (25 to 30 of them) in my application that are are fairly large (.5mb) and accessed simulataneousley. To make it even worse the data in them is generally only read once, and it is updated frequently (like 30 times per second). Sort of the perfect storm of non optimal cache use. Anyhow, it occurred to me that it ...

How can I randomize the lines in a file using a standard tools on Redhat Linux

How can I randomize the lines in a file using a standard tools on Redhat Linux? I don't have the "shuf" command, so I am looking for something like a perl or awk one liner that accomplishes the same task. ...

Fast, free tool to unarchive any compression format?

I've been using (Ubuntu's) file-roller to compress a range of files, e.g. .gz, .zip, .rar, .tar.gz, etc. It's nice because it provides a simple, uniform interface to de-compressing files in particular folders. However, it's pretty slow, apparently because it pops open a GUI window to tell you its uncompressing the file. So I am wonderin...

problems during linux kernel init

What are the possible culprits for crashes during kernel init? I am running a kernel that has initramfs, the inittab is very basic rcS (as sysinit) and getty (respawn). While booting I don't get any error message, however the init gives me this message: S0 respawning too fast: disabled for 5 minutes, where S0 is actually the respawn::g...

What does the object code file ctr1.o do in the gcc compiler?

What does the obj file ctr1.o does in gcc compilier ?Why does the linker link this obj file whenever an executable is generated? ...

kernel stack for linux process

Is the kernel stack for all process shared or there is a seperate kernel stack for each process? If it is seperate for each process where is this stack pointer stored? In task_struct ? ...

How to run .net application on Linux environment?

Is it possible to run a .net application on Linux environment? If yes then how? Will all the components of .net framework work properly on Linux ? ...

Need some advise to begin programming on ARM (with linux) platform

Hi everybody, I will have (maybe) to work soon on ARM platform hosting a linux distribution (I don't know which distribution ..). I know the project concerns video streaming, but I can't tell you more. Actually I only received the announe, and meet nobody yet. I've never worked on such platform. So the idea for me is to test before the...