linux

How to display a windows/X window system window in 3d space on texture?

Hello, I'm wondering, how can I catch a window and display it on texture in 3D space. And how can I redirect mouse and keyboard input from 3D application to application running in background? I mean full 3D desktop. ...

Am I allowed to host an ASP.NET MVC website using Mono and mod_mono?

I heard somewhere that the MVC license prevents you from using it on non-microsoft technologies, which would prevent me from developing in mono and hosting in Linux. Is this true? Has anyone used it with mono? Can anyone point me in the direction of the license? ...

Capturing password changes in Linux

How can I capture (or access if there is a log file somewhere) when a user changes their password or another user's password? ...

Best way to monitor disk mounts in Linux using C++?

I am currently constructing a Carputer front end and one function that it needs is to be able to recognize when external media is inserted, such as USB/SD memory sticks or iPods. Upon their insertion, I will then scan the device for music/video/images and add them to the media library. Alternately, I need to know when these devices are r...

What do I need to compile the kernel on Ubuntu Eee?

I'm trying follow a tutorial to create a custom USB driver in Linux and I hope to develop this thing on my Eee PC with Ubuntu Eee using g++. Unfortunately to follow the tutorial I need the linux/module.h header file. From what I understand I will need to compile the kernel to get this to work. I never compiled a kernel before and all ...

Linux cross-compilation for ARM architecture

I am interested in cross-compile a Linux kernel for an ARM target on a x86 host. There are some good practices you recommend? Which is the best cross-compile suite in your opinion? Have you setted up a custom cross-compile environment? If yes, what advices you have? Is it a good idea? Thanks, Myrrdyn ...

How can the Linux kernel compile itself?

I don't quite understand the compiling process of the Linux kernel when I install a Linux system on my machine. Here are some things that confused me: The kernel is written in C, however how did the kernel get compiled without a compiler installed? If the C compiler is installed on my machine before the kernel is compiled, how can th...

Fake X11 display?

I have a Java program using AWT which I would like to run on a headless system. The display for the program does nothing other than display stats. When the program finishes, it exits. There is no user interaction on the display. The program creates an output file which I use in my build system. Is there a way to get the Java program to ...

How do I reconcile 'top' and 'free -m''s memory usage reporting in linux?

From free -m i can see that there is 377MB of memory used and 1649MB free on the machine(Of which 1567 is cached by ubuntu). See below for the actual output: caz@riskvm:~$ free -m total used free shared buffers cached Mem: 2026 1975 51 0 30 1567 -/+ buffer...

Linking symbols to fixed addresses on Linux

How would one go about linking (some) symbols to specific fixed addresses using GNU ld so that the binary could still be executed as normal in Linux (x86)? There will not be any accesses to those symbols, but their addresses are important. For example, I'd have the following structure: struct FooBar { Register32 field_1; Regist...

How do I have emacs load a font from a file?

In the interest of making my emacs setup more portable, I'd like to be able to set the current font by specifying a file rather than a font name, i.e. "Load ~/config/myfont.ttf and use size 12". Is there a way to do that in my .emacs? All the instructions I've found assume the font is already installed on the system. I'm using the XFT su...

C++ Dynamic Shared Library on Linux

This is a follow-up to this question. I'm trying to create a shared class library in C++ on Linux. I'm able to get the library to compile, and I can call some of the (non-class) functions using the tutorials that I found here and here. My problems start when I try to use the classes that are defined in the library. The second tutoria...

Can a shell script set environment variables of the calling shell?

I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell. setenv FOO foo in csh/tcsh, or export FOO=foo in sh/bash only set it during the script's execution. I already know that source myscript will run the commands of the script rather than launching a new...

monitor which process modified a file under FreeBSD/Linux

From time to time, a file that I'm interested in is modified by some process. I need to find out which process is modifying this file. Using lsof will not work, nor does kqueue. Is this possible under FreeBSD and Linux? ...

Visual Studio: Intellisense Problems and Linux Compatibility

Two somewhat unrelated questions: Sometimes when I am working on a C++ project in Visual Studio 2008 Express, intellisense just does not want to "work" even though it really should. Auto completion box does not show and status bar says something along the lines of: "Intellisense: No further information is available". Sometimes it can b...

Pass arguments into C program from command line.

So I'm in Linux and I want to have a program accept arguments when you execute it from the command line. For example, ./myprogram 42 -b -s So then the program would store that number 42 as an int and execute certain parts of code depending on what arguments it gets like -b or -s. ...

create a my_printf that sends data to both a sprintf and the normal printf?

Hi I am playing with the printf and the idea to write a my_printf(...) that calls the normal printf and a sprintf that sends the result to a special function. (I was thinking about sprintf since that behaves just like printf on most platforms). My idea was to write a small macro that did this: #define my_printf(X, Y...) do{ printf...

How is the system call in Linux implemented?

When I invoke a system call in user mode,how did the call get processed in OS? Does it invoke some some executable binary or some standard library? If yes,what kind of thing it needs to complete the call? ...

On Linux, is the command-line program mktemp less safe than the C-function mkstemp?

Both operations create an empty file and return the filename but mkstemp leaves the file open in exclusive mode and gives you the handle. Is there a safety benefit to the C-function? Does this imply that there is a safety hole in the command-line version? As an aside, it is interesting that there are several related functions in the C...

Problem redirecting a C program output in bash

I've coded a program in C that sends messages to the stdout using printf and I'm having trouble redirecting the output to a file (running from bash). I've tried: ./program argument >> program.out ./program argument > program.out ./program >> program.out argument ./program > program.out argument In each case, the file program.out is...