Skip to content

How to detect if USB keyboard is plugged and unplugged

Is there any daemon/tool which will trigger some signal/event when USB keyboard is plugged and unplugged from pc? I need to know in my program when USB keyboard is plugged and unplugged. Any ideas on how to do this? Answer udev (Linux device manager) is the one that polls hardware. When it detects some change…

XTerm on windows

I have Swing Java application manifesting an error on linux, which I need to fix. The main problem is getting linux environment, and I’m unwilling to install one because I have a remote linux box already. Now, the GUI part, how would I run xterm on windows? I made several shots in the dark: installed XM…

Socket data length questions

I have a couple of questions related to the following code: The questions: Why I read 255 not 256 ? Let’s say I want to send the word: “Cool” from the client to the server. How many bytes should I write “in client” and how many bytes should i read “in the server”? I&#…

PHP passing $_GET in the Linux command prompt

Say we usually it access via How do we execute the same on a Linux command prompt? But what about passing the $_GET variables? Maybe something like php -e index.php –a 1 –b 2 –c 3? I doubt that’ll work. Answer Typically, for passing arguments to a command line script, you will use eith…

I cannot get stdout to update in Qt

I need to call an executable, from my QT application, monitor the output and then display the out put in a text browser. The executable I call from my QT app will run for many hours (~12) and each time the executable spits something out to stdout, I need to parse the output to be able to monitor its progress,

Simple polymorphic engine

I have to program a simple polymorphic engine. I use linux (32-bit) and i can code in assembly and c. I don’t know how to start. Can you give me a schema for constructing such an engine? My idea is to make a program that: read the code section of a file encrypts it in a buffer, make space at