linux

Domain name resolution not working in Java Applications on Ubuntu64 9.04 machine. All other software resolves DNS correctly.

I have an number of Java applications installed on an Ubuntu64 9.04 PC, and none of them can resolve domain names (there are multiple JRE's too - some of them are IBM products). If I put the domain name in the hosts file with it's associated IP address, then the Java apps work for those domains only. Every other non Java program - like p...

How do you convert audio files (on the fly) to the browser?

I would like to be able to convert audio files to MP3 to the users browser on the fly. The software I am using is: Apache, PHP & FFMPEG on an ubuntu system. Here is the code I have so far: <?php header("Content-Transfer-Encoding: binary"); header("Content-Type: audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3"); pas...

Globally use Google's malloc?

I'd like to experiment with Google's tcmalloc on Linux... I have a huge project here, with hundreds of qmake generated Makefile's... I'd like to find a way to get gcc to globally link against tcmalloc (like it does with libc)... Is this possible? Or will I have to edit every Makefile? (I'd prefer not to edit all the pro files as there a...

Kill the process using its name inside linux (Python)

Hello, this works, but it kills every Python process. pkill python However, I cannot do: pkill myscript.py I have also tried killall, but with no luck either. Do I have to user regular expressions? By the way, I want to do this in a python script with import os. ...

A universal mod-rewrite htaccess file for my script

I'm writing a script that (I hope) will be widely distributed and I want make sure that it will work on as many servers as possible out of the box. This script will require an .htaccess file but I've learned some htaccess files are not very portable. The htaccess needs to do a simple redirect, like so: http://example.com/dir/string R...

Remove empty new lines in a text file via grep

FILE: hello world foo bar How can when remove all the empty new lines in this FILE? Output of command: FILE: hello world foo bar ...

Building 64bit libraries

Hi All, I want to build 64bit libraries for some of my C++ components. Is it required to compile/link the libraries in OS running on physical machine directly? Or can i use a OS running as virtual machine in ESX server to build the libraries? Would i need to take care of anything if i am building in a virtual machine? Please advice I w...

On a 20 gig disk, I have a mysql folder of 17gig, but I have 16 gig free?

Hello, I am wondering how this is possible. At my host, I have a Mysql folder that is 17 Gig big, however I have only 20Gig, but DF and the admin panel say's I still have 16Gig Free. How is this possible? Does anyone know? Thank you ...

Screen capture on Linux

Hi, I need to port a screen capture utility to Linux. I'm not familiar with Linux. On Windows, you can get the handle of a specific window or desktop and using BitBlt in Win32 API, you can copy the image and save it to a BMP file or even convert it to Jpeg format. On Linux, as far as I know there are different desktop environments lik...

Automated builds and STDIN

I am writing an automated build system to do nightly builds of our code. Under normal conditions every thing works fine, but some of the processes in the build can require user input, if a developer commits a change that opens up one of these the automated builds grind to a halt. Does any one know of a way of causing reads from STDIN ...

Remove odd lines in a text file

File: /home/USER/DIR/a http://www.here.is.a.hyper.link.net/ /home/USER/DIR/b http://www.here.is.another.hyper.link.net/ Need to remove all the odd lines in this file (PUBLIC-DIRECTORY-LIST)? Its for my batch script which can be found below (dropbox batch puburl creator): for PATH in `cat LIST` do echo $PATH dropbox puburl $PATH done ...

Executing external program via system() does not run properly

I try to call a program (ncbi blast, for those who need to know) from my code, via calling the command in a system() call. If I execute the string directly in the shell, it works as intended, but if I try the same string via system(), the program returns much faster, without the intended results. The output file is created, but the file...

How can I use FIND to recursively backup multiple subversion repositories

At the moment our backup script explicitly runs svnadmin hotcopy on each of our repositories every night. Our repos are all stored under a parent directory (/usr/local/svn/repos) Our backup script has a line for each of the repos under that directory along the lines of: svnadmin hotcopy /usr/local/svn/repos/myrepo1 /usr/local/backup/myre...

Embedded console tools functionality in application

I'm currently developing an application that happens to require some file preprocessing before actually reading the data. Doing it externally was not a possibility so I came up with a fork & execve of "cut options filename | sort | uniq -c" etc... and I execute it like that. However I thought that maybe there was already another option...

Linux - serial port read returning EAGAIN...

Hello all! I am having some trouble reading some data from a serial port I opened the following way. I've used this instance of code plenty of times and all worked fine, but now, for some reason that I cant figure out, I am completely unable to read anything from the serial port. I am able to write and all is correctly received on the...

Multi grep to 1 grep? Should i change it and how do i?

This is my final script find -regex "^\..*[^(~$|\.o$|\.exe)]" | grep -v "\.svn" | grep -v ".tab." | grep -v ".yy." | xargs svn add 2>/dev/null For testing i dont want to add it to svn so i use find -regex "^\..*[^(~$|\.o$|\.exe)]" | grep -v "\.svn" | grep -v ".tab." | grep -v ".yy." NOTE: I wanted to ignore files that started wit...

svn log missing revisions

I appear to be missing revisions. I wrote > svn commit -m "blah. go back" Sending report/report2.pl Transmitting file data . Committed revision 6. > svn info Path: . URL: file:///home/MYNAME/svn_repository Repository Root: file:///home/MYNAME/svn_repository Repository UUID: 05a62b19-7276-0410-ba54-59ad643a30b7 Revision: 3 Node K...

Does the RPM Epoch header have any limitations?

RPM supports an Epoch header to provide version ordering in cases where its version comparison isn't sufficient, for example with 2.0a3 > 2.0. A package without Epoch specified is considered to have an Epoch of either 0 or -1, depending on some obscure factors. The documentation suggests that Epoch start at 1 and be incremented with ea...

Disable TCP Delayed ACKs

I have an application that receives relatively sparse traffic over TCP with no application-level responses. I believe the TCP stack is sending delayed ACKs (based on glancing at a network packet capture). What is the recommended way to disable delayed-ACK in the network stack for a single socket? I've looked at TCP_QUICKACK, but it se...

Can Ruby tell when a USB memory stick is plugged into a USB port on Linux?

First time caller, long time listener... I'm working on a utility that will scan USB ports and mount any Mass Storage devices it finds. I can poll for changes ( with a patched version of Ruby-USB ) but would much rather get a notification, or subscribe to some event. Is there a way for Ruby to be tickled when a USB stick is inserted? ...