linux

Publish and subscribe to dBus events with Eclipse EventAdmin?

D-Bus on Linux and the EventAdmin in Eclipse both offer a publish/subscribe model. I want to link the two, so I can publish an event to the EventAdmin in Eclipse and it publishes that event to D-Bus and vice versa. A module in Eclipse listens to selected D-Bus events and publishes them to the EventAdmin. I'm clear how to publish/subscrib...

What is the Linux equivalent to MAXDWORD?

In Microsoft Visual C++, there is a constant called MAXDWORD defined in winnt.h as follows: #define MAXDWORD 0xffffffff It's useful as a high initial value for a 'double' when one is searching for the lowest value in a collection. Google though I might, I can't find the equivalent in standard headers on Linux, but I'm willing to be...

Using getenv function in Linux

I have this following simple program: int main() { char* v = getenv("TEST_VAR"); cout << "v = " << (v==NULL ? "NULL" : v) << endl; return 0; } These lines are added to .bashrc file: TEST_VAR="2" export TEST_VAR Now, when I run this program from the terminal window (Ubuntu 10.04), it prints v = 2. If I run the program ...

Is there any Java Library to operate on unix config files like http.conf

There are very good Perl libraries (e.g. Apache::Admin::Config) to operate on traditional unix config files like httpd.conf. Anyone know if there is good Java libraries to do the similar task? I know there is a c library called Augeas with Java binding. Has anyone used that before? Thanks! ...

Allocating largest buffer without using swap

In C/C++ under Linux, I need to allocate a large (several gigabyte) block of memory, in order to store real-time data from a sensor connected to the ethernet port and streaming data at about 110MB/s. I'd like to allocate the largest amount of memory possible, to maximise the length of data sequence that I can store. However, I also need ...

Writing atomic function

Hi, I want to implement an atomic function in C language, so that the process or thread will not be preempted while executing the function. ...

Reserving a part of console using assembly language in X86_32 Linux

I'm developing a text editor like VI with assembly and need to take control of console, exactly like Vi, for example changing the position of cursor and inserting and deleting of strings. I googled a lot but didn't find any good suggestion, the code is not my problem, I want to get the idea of how to do it, then i could code it myself I'...

How to print the contents of a doubly-linked list?

How can I print the list values using list.h defined in /include/linux/list.h? ...

Why doesnt SIGINT get caught here?

Whats going on here? I thought SIGINT would be sent to the foreground process group. (I think, maybe, that system() is running a shell which is creating a new process group for the child process? Can anyone confirm this?) % perl local $SIG{INT} = sub { print "caught signal\n"; }; system('sleep', '10'); Then hit ctrl+d then ctrl+c im...

What is the "linux-2.6.3x.x/include/asm-generic/' for?

My os-book says that if you want to add a system call to the Linux kernel, edit the linux-2.x/include/asm-i386/unistd.h. But the linux kernel's source structure seems to change a lot. In the linux-2.6.34.1 version kernel source tree, I only find a linux-2.6.34.1/include/asm-generic/unistd.h and linux-2.6.34.1/arch/x86/include/asm/unistd...

interacting with the terminal in linux for passwords?

I asked this question and doing echo pass | cmd and cmd <<< pass do not work with mysql and another app i tried. One guy comments that passwords are through the terminal and not stdin, that sounds secure. How do i do that? using bash, .NET or C++? ...

Does developing applications for SPARC, IBM power CPU require separate compliers, other than x86, x86-64 targets?

Does developing applications for SPARC, IBM PowerPC require separate compliers, other than x86 and x86-64 targets? If true, how easliy could x86, x64 binaries in Linux be ported to SPARC and PowerPC? Is there a way to simulate these environments using virtualization? ...

Perl, executing linux shell commands that are multi-line, require authentication?

I've been looking around but can't figure this out.. I figured out how to do a perl execution of a shell script, such as: #!/usr/bin/perl $cmd = "nautilus"; system $cmd; However, I want to do a shell script execution from perl that would do something like this on the command line: su $password nautilus So it would become root, then...

building an sk_buff for egress device linux kernel

Long story short, I am trying to build a very bare bones UDP SKB just to get something onto the wire. The scenario is as follows: I have a kernel module loading that (among other things) overrides the memory location of the standard udp_sendmsg function in /net/ipv4/udp.c. From here I would like to construct an skb to the point where ...

Transferring a site - various file issues

I am putting an old website up on a new server and i've noticed various issues. Firstly, if i look at any of the files locally they all have double line spacing - anywhere there is a newline there has also been a blank line inserted. This is the same in netbeans and notepad++. Then, when i SFTP the files to the server and view them in Vi...

Loading a config file from operation system independent place in python

Hi, under Linux I put my configs in "~/.programname". Where should I place it in windows? What would be the recommendated way of opening the config file OS independent in python? Thanks! Nathan ...

After packaging with mkbundle2, the destination machine is complaining about libmono.so. Why?

I thought the purpose of mkbundle2 was to allow a machine without mono installed to run a mono application. But it does not seem to be packaging libmono.so. I am not sure if it is supposed to or not, but the destination machine is complaining that it can't find libmono.so.0 when I run the bundle. Why would it be looking for that file?...

Design choices for high performance file serving

I'm developing an application under linux that will need to support around 250 connections and be transmitting large files over TCP sockets in the 100MB+ size range. The aim is to tune for throughput rather than latency. I want to keep saturated 2x1Gbit ethernet connectons at all times. These will be channel bonded. It's expected tha...

In Linux, where is the default root directory for log4j.appender.R.File?

Hi all, in windows, when I use the following File path, log4j will write the file to C:\eclipse\logs\appLog.log (I am using eclipse as the IDE in windows): log4j.appender.R.File=logs/appLog.log Then when I deploy the jsp to the apache tomcat in a Linux server, where does the log file go? (I try to avoid using absolute path because I w...

Client UDP Socket binding

Hi I am creating UDP socket for a UDP client and sending UDP packets with different port numbers and wait for the reply from the destination for certain amount of time. My doubt is .. Is it possible to re-bind a UDP socket to multiple port numbers(even IP-address) to the same socket FD without closing the socket ?? (I cant use RAW sock...