linux

Can I share cuda GPU device memory between host processes?

Is it possible to have two or more linux host processes that can access the same device memory? I have two processes streaming high data rate between them and I don't want to bring the data back out of the GPU to the host in process A just to pass it to process B who will memcpy h2d back into the GPU. Combining the multiple processes in...

How to check for EOF when using pipe file descriptors in Python?

I have 2 threads, Thread A and Thread B. Thread A takes data from either sys.stdin or from the read end of a pipe (using os.pipe()). Whatever data gets read (from either sys.stdin or from the read end of the pipe) gets sent out on a TCP socket. Thread A uses select.select() to determine whether it should read from sys.stdin or from th...

C++ and CTime & System clock changing

Hello. I want to write simple application in C++ using ctime library. I'm getting the actual time and do some calculation in the loop. Very important for me is the fact that user can modify OS clock during calculations. Is there any way to get to know inside my app if the user has changed OS clock? Thnx for help in advance. PS. This ap...

Anjuta IDE - Simple Python Question

I'm new to Linux, Python and the Anjuta IDE. I have created a new file called hello.py. This is the contents of that file: #!/usr/bin/env python print "Hello World!" All I want to do is run this in the terminal. I go to Run > Execute but I get the following error message: Program 'home/joe/Programming/Python//hello.py' does not h...

automating ssh login: tcl expect interact comand behaves weird

I wanted to automate ssh logins. After some research, it seemed like tcl/expect was the route to go. However, my issue is that when interact takes over my terminal, stuff doesn't work as expected (pun not intended). For example, if I resize the terminal, it does not "take". Also, sometimes the interact is not responsive, and sometimes...

Bash commands work on cmd line but not in script

Hey folks, I have a set of piped commands that work on the command line, but do not produce output when run within a script. The command is: STRNG=$( ip mroute show | tr -d "()," | awk ' {print "/usr/sbin/smcroute -a eth3", $1, $2, "vtun0 vtun1"}' ); echo "$STRNG"` And the output is: /usr/sbin/smcroute -a eth3 192.0.1.19 224.1.1.1 ...

Nginx proxy module and socket descriptor passing

I'm implementing a server passing socket descriptors to worker processes for handling. It send them via UNIX sockets using the sendmsg system call. Server itself can listen on a UNIX socket or an INET socket. I have a problem putting it behind nginx. When my server runs on a INET socket, everything is OK. But proxing doesn't work through...

How to Sort Output from several Log Files by date

Hi, I have got output from several different log files: logfile3 2010/07/21 15:28:52 INFO xxx 2010/07/21 15:31:25 INFO xxx 2010/07/21 15:31:25 DEBUG xxx logfile1 2010/07/21 19:28:52 INFO xxx 2010/07/21 19:31:25 INFO xxx 2010/07/21 19:31:25 DEBUG xxx logfile2 2010/07/21 13:28:52 INFO xxx 2010/07/21 13:31:25 INFO xxx 2010/07/21 13:31:2...

Trying to compile x64 app on linux with mono gives PE32Plus error?

the full error is Error CS8088: Your .NET Runtime does not support `PE32Plus'. Please use the latest Mono runtime instead. (CS8088) (test) this is on a x86_64 linux system with mono and monodevelop installed as x86_64. This happens with any application I try to compile as x64 including an empty test program. I have mono 2....

What's the "fastest" way to take a screenshot of a specific window under Linux programatically ?

Language doesn't matter, libraries either, I just need the fastest way specifying the window (title or handle). Thanks in advance Mike ...

Stack multiple libnotify popups

Does anybody know how i can get multiple popups sent via notify-send to appear on screen at once. With: $ notify-send 'Message One' 'Body One' & notify-send 'Message Two' 'Body Two' & notify-send 'Message Three' 'Body Three' Each one waits for the previous popup in the queue to expire before being shown, i'm trying to get all three t...

How to modify memory contents using GDB?

I know that we can use several commands to access and read memory: for example, print, p, x... But how can I change the contents of memory at any specific location (while debugging in GDB)? Thanks for any info. ...

Using fwrite on file descriptor / Convert file descriptor to file pointer

Lately, I've been working on some small data serialization demos. However, I was wondering how to transfer binary data from a structure into a file descriptor. I am aware that the only (simple) way to do this is through fwrite (if write does this, then please say so), so is there either: A) An fwrite call to use on file descriptors? o...

How do 32-bit applications make system calls on 64-bit Linux?

Some (many? all?) 64-bit1 Linux distros allow running 32-bit applications by shipping parallel collections of 32-bit and 64-bit libraries (including libc). So a 32-bit application can link against 32-bit libs and be run by a 64-bit kernel. I'd like to know the mechanics of how 32-bit applications make system calls on a 64-bit kernel. I ...

Linux C++: Does a return from main() cause a multithreaded app to terminate?

This question seems like it's probably a duplicate, but I was unable to find one. If I missed a previous question, apologies. In Java, where I have most of my experience, if your main() forks a thread and immediately returns the process continues to run until all (non-daemon) threads in the process have stopped. In C++, this appears no...

Sync over user profile and site profile to Urchin

I have been assign to do research and implement Urchin in a cdn project. We need urchin to show statistic of each node being hit. We already have a number of users. So I have to find how to sync user profile (including authentication - to make sure user don't have to keep so many password or even better don't have to login to urchin aft...

How I can get ports assosiated to aplication that oppened them?

Hello all I need to get a list of all opened ports on my machine and what application opened them . I need to get this information programmatically. Thanks. ...

pasting text to xterm in GNOME using gtk clipboard

I am developing a GTK based application which has to support clipboard. For that I am exporting selection data using gtk_clipboard_set_with_data with the target formats: UTF8_STRING, STRING, TEXT, COMPOUND_TEXT, text/plain, text/plain;charset=utf-8, text/rtf, text/html and text/url. Using this I am able to copy-paste text from my aplicat...

Poll is causing crash

Hi, I am getting a crash with following values :- Poll is the system call in use giving "errno" as 24 (EMFILE) and struct pollfd has values "fd = 1022, events = 1, revents = 32" Here we are woking on "fd = 1022" then why it is showing "errno" as 24 (EMFILE /Too many files open/) I have multiple threads which works in an Infinite loop...

Remote development tools/skripts for Linux?

Hi folks, I do some RTAI development. I have a Server which has a modified Linux-Kernel with RTAI. I'am not the only developer on this server. Are there some tools/scripts which support copying sources to the server and compile/run them? (using SSH/SCP maybe) I'am developing with a simple editor and scripts - so a solution which supp...