linux

"No such file or directory" error when executing a binary

I was installing a binary Linux application on Ubuntu 9.10 x86_64. The app shipped with an old version of gzip (1.2.4), that was compiled for a much older kernel: $ file gzip gzip: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, stripped I wasn't able to execute th...

On Linux, how do I run a GUI app from a terminal shell under a different login?

Here's the deal. I logged into a Linux box (CentOS, but that shouldn't matter) as user A. I had to build a program as user B, so I started up a terminal shell, logged into that shell as B, and built it. When I try to run the app, I get this message: "connect to ":0.0" refused by server" Most likely because the current X Windows session...

changed sudo path, command continues not being found

I added export PATH="/home/deltrem/Pedro - Arquivos/play/ps1/linux/pSX:$PATH" to /root/.bashrc , but sudo pSX echoes command not found. ...

How to make gcc on SUN calculate floating points the same way as in Linux

I have a project where I have to perform some mathematics calculations with double variables. The problem is that I get different results on SUN Solaris 9 and Linux. There are a lot of ways (explained here and other forums) how to make Linux work as Sun, but not the other way around. I cannot touch the Linux code, so it is only SUN I can...

Some examples for common Real Time processes in Linux

What are some of the common SCHED_FIFO and SCHED_RR processes in Linux? Does user input falls under the cantegory of Real Time processes? ...

file.createNewFile() creates files with last-modified time before actual creation time

I'm using JPoller to detect changes to files in a specific directory, but it's missing files because they end up with a timestamp earlier than their actual creation time. Here's how I test: public static void main(String [] files) { for (String file : files) { File f = new File(file); if (f.exists()) { ...

c++ profiler that can attach to a running process?

I have a program written in c++ that I want to profile, and I want to avoid restarting it when I start and stop profiling. Ideally I would be profiling both CPU usage and memory allocation. Is there any tool that will allow me to do this? I'm running on Linux. ...

Allow outgoing connections using 'iptables'

Greeting all, "iptables -L" gives the following output [root@ibmd ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source d...

How to use Linq in Mono?

I can't make System.Linq (aka. Linq-to-objects) work. I am running MonoDevelop 2.2.1 in Ubuntu 10 Lucid Lynx with Mono 2.4.4. They advertise in their site that they implemented Linq, but I can't even find Enumerable.Range or .ToArray(). What's wrong? ...

Check if file exists, including on PATH

Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I've got currently is: if( access( filename, X_OK) != 0 ) { But this wont search the PATH for files and will also match directories (which I don't want). Could anyone please help? Edit: As an alternative, seeing as I'm running e...

Setting up a 'find' command cron/bash script, which emails if there are any results?

I'd like to setup a cron job that checks e.g. every 24 hours to see if a 'find' command like the one below (which checks for malicious shell hacking scripts) has any results: find /home/username/public_html -type f -print0 | xargs -0 egrep '(\/tmp\/cmd(temp)?|SnIpEr_SA|(c99|r57|php)shell|milw0rm)' And if there are any results, then I ...

WaitForSingleObject and WaitForMultipleObjects equivalent in linux

Hi, I am migrating an applciation from windows to linux. I am facing problem w.r.t WaitForSingleObject and WaitForMultipleObjects interfaces In my application I spawn multiple threads where all threads wait for events from parent process or periodically run for every t seconds. How can I implement this in Unix. I have checked pthread...

How to install the program depending on libstdc++ library

My program is written in C++, using GCC on Ubuntu 9.10 64 bit. If depends on /usr/lib64/libstdc++.so.6 which actually points to /usr/lib64/libstdc++.so.6.0.13. Now I copy this program to virgin Ubuntu 7.04 system and try to run it. It doesn't run, as expected. Then I add to the program directory the following files: libstdc++.so.6.0.13...

Open Source UML Tool which generates C++ code

Are there any open source UML tools for Linux which can generate C++ source code? ...

How can you determine installed versions of the glibc (etc.) libraries?

I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls. How do I determine the precise versions of the libraries on the system so that I may rebuild the tool chain? I don't intend to replace the libraries deployed, as I do know they work (including I2C), s...

Percentage value with GNU Diff

What is a good method for using diff to show a percentage difference between two files? Such as if a file has 100 lines and a copy has 15 lines that have been changed the diff-percent would be 15%. ...

Create a Windows (XP) installer on a Linux machine?

I need to create an installer for my software for Windows XP and newer. Is there any mechanism to do that on a Linux machine alone? (I'm running ubuntu, but I'd guess is not a show stopper). ...

Linux service and Source for cron job

Hi, I am new to linux and writing a service in C++ which spawns multiple threads and I am starting the service by calling it from init.d, but how should I send the terminate signal to my application from the script , so that my service terminates all the threads and exits. And also where can I find the source code for any linux servic...

How to debug packet loss ?

I wrote a C++ application (running on Linux) that serves an RTP stream of about 400 kbps. To most destinations this works fine, but some destinations expericence packet loss. The problematic destinations seem to have a slower connection in common, but it should be plenty fast enough for the stream I'm sending. Since these destinations a...

Is there an equivalent to DBus on OSX?

Is there an equivalent to Linux DBus on OSX? I mean, is there a "message bus" available by default on OSX? Disclaimer: OSX newbie here. ...