linux

C++ weird RAW sockets and iptables issue...

With reference to http://stackoverflow.com/questions/3951043/c-iptables-redirection-forming-separate-packets, I am facing an extremely peculiar problem now. I am trying to redirect all incoming traffic on UDP port 5060 to port 56790, and all outgoing traffic from 5060 to the port 56789. I used these iptables rules: iptables -t nat -I PR...

C++ preprocessor

I'd rewritten a simple C++ program using unix as a variable name. But the program compilation failed. #include <iostream> int main() { int unix = 1; return 0; } After searching a lot on the internet I got to this website which helped me by saying that unix is predefined macro equal to 1. I want to know list of all suc...

Smart answer needed for strange segmentation fault on embedded ARM with posix threads

Hi, The last couple of days I've been working on a strange segmentation fault. The following code works just fine on my PC running Linux. But using the ARM crosscompiler suppplied by the manufactor of our embedded device, it gives a segmentation fault in routine s(). The SIGSEGV occurs at the destruction of a std::string. This also happ...

How create a new launcher with bash shell ?

I want create a new launcher in the Application -> Game menu with bash shell. How can I do that ? ...

Linux Small Text only version

I need a small linux Text only version bootable installed on a partition of my hardrive, How can I customize a Linux version like redhat, debian, puppy etc. Please suggest some suitable distribution? ...

How to specify include directory for configure script.

I have a linux system at my workplace with pretty old packages and no root access. I'm compiling packages that I need from source with --prefix=[somewhere in homedir]. My problem is that I just can't find out how to convince configure to look for header files in a specific directory. The source is cpp. I tried with environment variables ...

rpm installation fails due to depencency /bin/sh not found

Hi,i am trying to install a package using rpm, for which i have created a different database using rpmdb --initdb --dbpath $HOME/myrpmdb and specifying that path in the --dbpath while insatlling. The error i am getting is root@jason:su rpm --dbpath $HOME/myrpmdb -ivh XXX.rpm error: Failed dependencies: /bin/sh is needed by XXX and /...

Multithreading UDP server with epoll?

Hi all, I'd like to develop a multithreaded UDP server in C/Linux. The service is running on a single port x, thus there's only the possibility to bind a single UDP socket to it. In order to work under high loads, I have n threads (statically defined), say 1 thread per CPU. Work could be delivered to the thread using epoll_wait, so thre...

portable mysql for linux

hi Folks... is there a portable version of MySQL for Linux available. Thanks in advance.. Rajan ...

how to display only Permissions and file names using ls command

and how to list all files in a directory including full path, owner, group and permissions for each file ...

How much data can be malloced at a time? what is the limit in modern OS such as Linux?

Hi, How much data can be malloced and how is the limit determined? I am writing an algorithm in C that basically utilizes repeatedly some data stored in arrays. My idea is to have this saved in dynamically allocated arrays but I am not sure if it's possible to have such amounts malloced. I use 200 arrays of size 2046 holding complex dat...

Windows Named Pipe Support in Linux

I'm looking at a project which will require inter-process communication between a legacy Windows application using named pipes, and a new service running on a Linux server. The windows application cannot be changed. Does anyone know if there is a Linux library available that supports Windows named pipes? Or even better, can anyone recomm...

Try...catch causes segmentation fault on embedded ARM with posix threads

Hi, Totday, I posted a problem about a segmentation fault after destruction of a std::string (see this post). I've stripped the code so that I don't use the STL and still have a segmentation fault sometimes. The following code works just fine on my PC running Linux. But using the ARM crosscompiler suppplied by the manufactor of our emb...

how to link to shared lib from shared lib with relative path

Hello. I'm working on a Firefox plugin that uses external libraries to render 3D graphics on the browser. The problem is that i want the plugin to use external libraries packed with it without changing the LD_LIBRARY_PATH variable. The libraries are installed in a position relative to the plugin (a shared library too), while the actual...

Conditional wait overhead

When using boost::conditional_variable, ACE_Conditional or directly pthread_cond_wait, is there any overhead for the waiting itself? These are more specific issues that trouble be: After the waiting thread is unscheduled, will it be scheduled back before the wait expires and then unscheduled again or it will stay unscheduled until sign...

Splitting gzipped logfiles without storing the ungzipped splits on disk.

I have a recurring task of splitting a set of large (about 1-2 GiB each) gzipped Apache logfiles into several parts (say chunks of 500K lines). The final files should be gzipped again to limit the disk usage. On Linux I would normally do: zcat biglogfile.gz | split -l500000 The resulting files files will be named xaa, xab, xac, etc ...

how to change my domain Name to new one in Ubuntu Apache PHP?

Hello guys, I need help. Currently I am using Ubuntu Apache server with PHP. My server name is some rt-arr-php. I want to change it to rtapp.arr.edu Please help me. Thanks, Raj ...

Integrating Google Desktop Search into a website using PHP, hosted in a Linux environment.

Is there a way to make a search call to GDS in PHP and have it return XML containing the search results? The Google Desktop API documentation page specifically states: "This document describes methods for issuing Desktop search queries using HTTP and XML. This XML-based API is supported by both the Windows and Mac OS X versions of ...

checking if a key was pressed

I need to know which interrupt in linux checks if any key was pressed. Thanks. ...

Simulate No Flash in Ubuntu

I've searched this and cannot find it. I've tried different plugins and different browsers (Firefox, Opera, and Chrome). I've tried most of the no flash plugins for each of those as well as disabling Flash plugins/addons in the settings. I also renamed the .so file in /usr/lib/flashplugin-installer/ i found by searching the system. when ...