linux

Is there any modern review of solutions to the 10000 client/sec problem

(Commonly called the C10K problem) Is there a more contemporary review of solutions to the c10k problem (Last updated: 2 Sept 2006), specifically focused on Linux (epoll, signalfd, eventfd, timerfd..) and libraries like libev or libevent? Something that discusses all the solved and still unsolved issues on a modern Linux server? ...

Bash script -e not detecting filename in a variable

In a BASH script, I'm trying to detect whether a file exists. The filename is in a variable but the -e command seems to be unable to detect the file. The following code always outputs "~/misc/tasks/drupal_backup.sh does not exist" filename="~/misc/tasks/drupal_backup.sh" if [ -e "$filename" ]; then echo "$filename exists" else ech...

Setting and getting the values from configuration file.

Hi, I am using C language and Linux as my programming platform. In my sample application. I want to get and set the value of a custom configuration file. Below is the structure of my config file. idlevalue=5 sleeping=1 Now my problem is I am getting a hard time thinking how to implement the set functionality in my application. I am...

tcpdump: localhost to localhost

Hi, I write a program that send TCP packets from localhost to localhost. And I want to use tcpdump to capture the packets. But nothing is captured. My command in Ubuntu: sudo tcpdump What argument shall I add? Thanks! ...

GTK window motion animation?

I want to move my GTK_WINDOW across the screen automatically. Currently I have it in a draw/move loop, but that's terribly choppy. I'm very new to GTK programming (and gui programming in general). What am I missing? ...

Linux implementation of Solaris doors

I am porting some Solaris code to Linux. This code uses the Solaris-specific door functions. Is there a Linux equivalent? I found a couple of examples but they dont't appear to have been updated for many years. http://www.rampant.org/doors http://sourceforge.net/projects/ldoor Thanks for any help. NickB ...

How long does Glibc take to compile?

I've been compiling it in a virtual machine for over 8 hours now and it still hasn't finished. The terminal is still printing things so I know it's still compiling. The host system is a 2.10Ghz Intel Core2Duo with 4GB RAM and the guest is Linux on a PowerPC virtual machine (QEMU) one with 1GB RAM. I know the dynamic instruction transl...

Code segment sharing between two processes

Suppose we run two processes back to back say :- $ grep abc abc.txt ==> pid 100 $ grep def def.txt ==> pid 101 I read in the book "Beginning Linux programming" chapter# 11 that the code section of the processes would be shared, as it is read only. Is it so? I think if grep is compiled as shared library only then the code section would...

Convert 1000 to 1024 bytes

Im trying to convert a size, lets say 244410368 bytes to xxxxxx mebibyte (MiB) but I have no idea how. All this 1000 and 1024 bytes/bits are rather confusing. ...

How do I remove newlines from a text file?

Hey there everyone ... I have the following data, and I need to put it all into one line... I have this: 22791 ; 14336 ; 22821 ; 34653 ; 21491 ; 25522 ; 33238 ; I need this: 22791;14336;22821;34653;21491;25522;33238; If anyone could help me it would be a great !! Thanks in advance! --------- EDIT No of these commands...

epoll: Distinguishing "listener" FDs

How can I distinguish between "listener" file descriptors and "client" file descriptors? Here's what I saw in the manpage example: if(events[n].data.fd == listener) { ... } else { ... } 'But what if I don't have access to listener? Sorry if this is a vague question. I'm not quite sure how to word it. ...

How do I make this change in my VIM config?

Control + Right = end Control + Left = home Control + down = page down COntrol + up = page up I want these to work, regardless of what mode (insert or not) I'm in. What do I put into my .vimrc? ...

How to take out some of the new lines of a document

Hey there!! Firstly, I'm really new on this and I'm having difficulties... I have this data: [05/Apr/2010:09:59:34 -0300] /~bcc/topo-zero.html 200 238 2 [05/Apr/2010:10:01:19 -0300] /~bsi/materiais/ed/u6.html 200 286960 3 [05/Apr/2010:10:04:56 -0300] /~firedo/AISG/AISGroupContributions.html 200 33193 2 ...

Linux acting as USB device

I am working on an embedded Linux platform and I have need to transfer data between the platform and a PC. The embedded Linux has a usb device port (like a printer), so this is the means by which transfers would take place. I envision the easiest way to integrate Linux with the software already on the PC is to have the Linux device appea...

How to count lines on a document ?

Hey there ... I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00 0.00 4.00 0.00 0.00 0.00 0.00 91.00 09:16:41 AM all 0.00 0.00 4.00 0.00 0.00 0.00 ...

Disable RARP packets from linux

Hi all, I am doing a script in which I change MAC address of interface in linux machine. But when I change the MAC address of the interface it generates an RARP packet (to get an IP address for the new MAC which is assigned). But this is not desirable in my scheme of things. I do not want the RARP to be generated. Can you guys suggest m...

Sun Directory Server can't connect ldap server

I'am installing ArcGisServer for the Java plataform on Centos 5.5 x86_64, this is not a supported platform but I have overcome almost every problem preventing the success of the installation. It uses exhaustively Sun Directory Server. The last error i receive was: ldap_simple_bind: Can't connect to the ldap server - No route to host It...

address space Library or Process

Hi, I have one basic doubt. I have a process which uses a shared library. If I am allocating some memory in the library then which address space it is. (Library or Process) In my opinion it is the process address space because once the library is attached it is all in process address space. Please correct me if I am wrong. Thanks Arpi...

issues when Heartbeat starts in linux

I am using heartbeat3.0.3. when i am starting a heartbeat i am getting like this Starting High-Availability services: *** glibc detected *** heartbeat: free(): invalid pointer: 0x0810e428 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6[0xb7da7b25] /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7dab590] heartbeat[0x805af61] h...

In Linux, how do I log a user out after idle period, even when they are still in a program

Hi all, I am trying to enforce a policy that logs an idle user out of a bash shell session, even when they are in an active process like a script-based menu, or vi session. I have tried using "export TMOUT=x" where x is the number of seconds, but this only logs a user out if they are idle at the bash shell prompt. Is there a bash scri...