I tried this: If the folder has one tar, it works. If the folder has many tar, I get an error. How can I do this? I have an idea to run a loop to untar, but I don’t know how to solve this problem Answer
Generate a value to reflect the average brightness of an image
I need to determine if an image is above a certain brightness. Using a scale of 0 – 255 I want to generate a value within this range to reflect the image brightness. i.e. a white image is 255 and a black image is 0. All this needs to take place via a bash script I am building up at
Installing Tomcat 7 on Linux system with Native Library
How do you install native library for Tomcat 7.0 under Linux system such as CentOS? Answer Installer Native package installation tomcat file: env.sh
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 changes about devices, it executes the
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 XMing, and then got totally
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’m really confused. Answer You already have
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 either the argv global variable or getopt:
Git on Windows: What do the crlf settings mean?
I don’t understand the complexities related to CrLf settings in git: core.autocrlf, core.safecrlf I’m developing a cross-platform project in a team and would like both Windows and Linux developers to be able to work together without git marking files as modified just because of line ending style. What do the various settings mean? What would be the consequences of choosing
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