I’ve created a simple C++ Application with the boost framework. The Application is running correct from the command line. After this I’ve created a PHP file with a popen to this binary. After visiting the website I’ve got the following error message from apache2/error_log System is openSuse …
Tag: linux
renaming file using shell script
I have tons of image inside a folder and it also has different file types. I have tried googling for an answer but I can’t seem to find one. I wanted the files to be named 1.jpg, 2.png, 3.gif. . . n.JPEG. Could someone help me out with this? Answer Try the command below: Make note that the command above
Can tar extraction erase brother directory ?
I made several backups on different directories with Backup Manager. Eg: /home/user1 /home/user2… It gives me some tar files. The content of a tar file looks like : I tried to test the restoration with something like : But the command above recreate all the structure inside the choosen directory. That g…
Linux xargs command
A quick question. A command doesn’t require xargs, but the command requires xargs command. Can please someone explain me the concept of xargs more clearly. Thanks. Answer In short, xargs converts stdin (standard input) to arguments for the command you specify. For example seq, as you can see, prints a s…
How to control global OpenMP settings from C/C++?
OpenMP doesn’t provide API to adjust some crucial settings in runtime, e.g. OMP_WAIT_POLICY or GOMP_SPINCOUNT (at least in gcc 4.8.3). Such settings are designed to be changed through environment variables for some reason. Not very convenient. Is there any way I can change such settings in run-time from…
Removing specific string from lines in file using sed
I have a file like so: I want the following output: What I tried is: But this is not what I want… Answer Try this way
How do I find what libraries need to be installed on a client linux machine if I compile a binary with a newer version of gcc?
Say I have a C++ binary that was compiled with a version of gcc say 4.4.x, which is used on a client linux box. If I want to upgrade my compiler to use a newer one, say 4.9.3 (because I want to use C++11): What kind of things would need to be upgraded on the client box to run this
Raspberry PI remote debug GTK error
I’m using NetBeans IDE 8.0.2 on my Win7 machine to develop Raspberry Pi opencv C++ application. I’m building & debugging the application remotely on the Raspberry Pi from my Win7 machine. At run time the application fails with “Gtk-WARNING **: cannot open display:” error when reach…
Why does toolchain name have separate OS and EABI fields.?
For eg. arm-unknown-linux-gnueabi Now, once the OS i.e Linux is fixed, the C Library will be fixed (GLibc) and hence the calling convention and ABI being followed will be fixed. What is the requirement of 4th field i.e. ABI separately? Can a toolchain use a different ABI from the one used by underlying OS and…
Sorting files based on time in Linux
I want to get a list of pathnames of files, divided by one blank space, and the files are sorted based on creation time. I use to sort them, but the problem is, how can to delete all the time before the pathnames? If I use I can get a list of pathnames, but I don’t know how to sort