linux

How can I re-add a unicode byte order marker in linux?

I have a rather large SQL file which starts with the byte order marker of FFFE. I have split this file using the unicode aware linux split tool into 100,000 line chunks. But when passing these back to windows, it does not like any of the parts other than the first one as only it has the FFFE byte order marker on. How can I add this two ...

Using 'expect' to automatically send in password

I am trying to copy a file from my remote server to my local. Here's my script to run it, by using 'expect' to automaticlally send in password scp user@host:/folder/myFile ./ expect "Password: " send "myPassword" When I run this, it still prompts for "Password", what is wrong? ...

Proper permission for sendmail.cf when apache sends mail on linux

I have a web application (bugzilla) in apache that needs to use sendmail.cf . When it tries to use sendmail I get the error: /etc/mail/sendmail.cf: line 0: cannot open: Permission denied the web application is in group "apache" Permissions for sendmail look like: -rw-r--r-- 1 root root 58624 2008-03-29 05:27 sendmail.cf What do th...

Process on linux ignoring resource limits

I had asked some questions about developing an online judge sometime ago on stackoverflow and I found quite a few good answers to that. I've started working on developing one and I seem to have run into a major flaw in my code. The user submitted source will be compiled on the server. This is done by exec()ing gcc in a forked process. N...

How to split flv file by size using FFmpeg or mencoder or smth else?

I need to split an flv file into chunks of the known size on linux server. For example my original file is 9Mb and the chunk size is 4Mb. So I should get 3 parts - 4Mb, 4Mb and 1 Mb. Seems that FFmpeg can split only by time. Mencoder can start by time (-ss TIME) and finish by size ( -endpos SIZE MB). But if start second of the first ch...

Java JComboBox Custom Renderer and GTK

I have a list of Customer objects that I need to have selectable from a JComboBox. From what I read I need to implement a custom renderer to have the fields I want displayed in the list. I want my JComboBox to have entries formatted as such: +----------------------------------------------+ | Customer Name - Contact - City, State V...

Transparent windows with Linux

I am trying to find a cross linux distribution solution to the problem of making a program have transparent windows. I now there is some methods out there, that take screen shots of the windows underneath and then print them as the background of the image. I would prefer not to uses that method because it likely that i would have video...

How to view/change socket connection timeout on Linux?

When creating a Socket in Java: new Socket(host, port); The Socket constructor will try to connect to host:port before returning. On Windows, this fails almost immediately for unreachable hosts but for Linux it can take up to 5 minutes for the Socket to timeout. I'm aware that if I have control over creating the Sockets, I can do: ...

ASP.Net on Linux

Hi everbody, I want to use ASP.Net on Linux because of license problems and costs. Can you compare its performance? We coded a few asp.net applications and work well on windows server, can we migrate to linux + apache + mono without any changing? Framework version is 2.0. ...

Shell script to extract particular content using find, xargs, and grep

Hi everyone. Well i am new to linux shell and i can't understand any regexp :( Here is my question: I have a directory called /var/visitors and under this directory, i have directories like a, b, c, d. In each of these directories, there is a file called list.xml and here is the content of list.xml belonging to /var/visitors/a directory...

How can I cross compile my Linux application to get a Windows executable in Linux?

I need to cross compile my QT application in Linux. I compiled my application from the QT SDK in Linux and it is working properly. How do I create an .exe for the same application in Linux. I have installed Mingw in Linux and qmake, but I dont know how to proceed with cross compiling. How do I link my QT with a cross compiler like MinGW ...

Create executable application in linux

Hi, I wanna know how to create executable application in linux just like .exe file in windows. most of you have used/seen "Pidgin IM" in linux on click of that it will open the window where you can see your buddies and more similar to gnome-caculator. i want to create the same executable file for my application. ...

how to play .mp3 songs randomly by searching for them recursively in a directory and its sub directories?

Once I am in the directory containing .mp3 files, I can play songs randomly using mpg123 -Z *.mp3 But if I want to recursively search a directory and its subfolders for .mp3 files and play them randomly, i tried following command, but it does not work. mpg123 -Z <(find /media -name *.mp3) (find /media -name *.mp3), when executed give...

How to check if a file has been opened by another application in C++

I know, that there's the is_open() function in C++, but I want one program to check if a file hasn't been opened by another application - is there any way to do it using standard library? EDIT - Clarified in the answers that this is for a Linux application. ...

Automated Testing of Binaries from SVN on HPC

I would like to setup some automated testing of test cases upon Fortran binaries within an SVN Repository, on demand, or with a Cron job. To complicate the issue slightly, the test cases would be run on a computational cluster, so that each test case would need to generate a PBS script. (Linux Environment) There are a lot of web testin...

Register hotkeys in Linux using library for c++

Hi guys, are there any libraries for linux wroted in C++ which could register global hotkeys for my application? Thanks. ...

Net-SNMP varibles using C++

I am having trouble with a few of the variables that the Net-SNMP library provides, specifically the ability to capture in/out Octets. In/OutOctets Issue: I have another check for ASN_INTEGER and I am catching this oid put the output does not seem to be correct. I am using *vars->val.integer and pushing this into a long but I am current...

__libc_lock_lock is segfaulting

I am working on a piece of code which uses regular expressions in c. All of the regex stuff is using the standard regex c library. On line 246 of regexec.c, the line is __libc_lock_lock(dfa->lock); My program is segfaulting here and I cannot figure out why. I was trying to find where __libc_lock_lock was defined and it turns out ...

Returning the terminal cursor to start-of-line with wrapping enabled

I'm writing a filter (in a pipe destined for a terminal output) that sometimes needs to "overwrite" a line that has just occurred. It works by passing stdin to stdout character-by-character until a \n is reached, and then invoking special behaviour. My problem regards how to return to the beginning of the line. The first thing I thoug...

Linux: Possible to extend and Alias?

A simple example: Let's say I have one alias being sourced somewhere as: alias ls 'ls -o' I'd like to have a second alias add on to this: alias ls 'ls -a' So that when I execute it, I'm really getting: ls -o -a Is this possible? Of course in the above example, the second overwrites the first. Why would I want this? The first...