linux

For list controls, should find-as-you-type match at the start of an entry, or anywhere in an entry?

I have a list control in GTK+ (a gtk.TreeView with one column), with "find-as-you type" enabled (so typing any text will open a small search field for searching through the list entries). Now, if the user enters some search text like "abc", should I search only for entries starting with "abc", or should I search for entries that contain ...

Handling file paths cross platform

Do any C++ GNU standalone classes exist which handle paths cross platform? My applications build on Windows and LInux. Our configuration files refer to another file in a seperate directory. I'd like to be able to read the path for the other configuration file into a class which would work on both Linux or Windows. Which class would o...

Problem with Bash output redirection

I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty. $cat file.txt |tail -1 > file.txt $cat file.txt Why is it so? ...

Create Word Document using PHP in Linux

Whats the available solutions for PHP to create word document in linux environment? ...

extracting text from MS word files in python

for working with MS word files in python, there is python win32 extensions, which can be used in windows. How do I do the same in linux? Is there any library? ...

Capturing Input in Linux

First, yes I know about this question, but I'm looking for a bit more information that that. I have actually, a fairly similar problem, in that I need to be able to capture input for mouse/keyboard/joystick, and I'd also like to avoid SDL if at all possible. I was more or less wondering if anyone knows where I can get some decent primers...

Command line program to create website screenshots (on Linux)

What is a good command line tool to create screenshots of websites on Linux? I need to automatically generate screenshots of websites without human interaction. The only tool that I found was khtml2png, but I wonder if there are others that aren't based on khtml (i.e. have good JavaScript support, ...). ...

Linux commands from Java

Is it possbile to execute linux commands with java? I am trying to create a web servlet to allow ftp users to change their passwords without ssh login access. I would like to execute the next commands: # adduser -s /sbin/nologin clientA -d /home/mainclient/clientA # passwd clientA # cd /home/mainclient; chgrp -R mainclient clientA # c...

How do you find out which version of the GTK Ubuntu is using?

I need to determine which version of GTK Ubuntu is using. Man does not seem to help ...

Java Threads priority in Linux

I have a multi thread application built on Java and I need to set different priorities to this threads. In windows it works fine, a bigger value (priority) gets more CPU time just like it was supposed. On Linux, I cant find a logical answer to how it is working. Looked online, but can't seem to find a definitive answer on how its worki...

How do I run a command in a loop until I see some string in stdout?

I'm sure there's some trivial one-liner with perl, ruby, bash whatever that would let me run a command in a loop until I observe some string in stdout, then stop. Ideally, I'd like to capture stdout as well, but if it's going to console, that might be enough. The particular environment in question at the moment is RedHat Linux but ne...

Automatically resizing X11 display when connecting an external monitor

I have a laptop running Ubuntu to which I connect an external monitor when I'm at the office. Usually this requires me to run "xrandr --auto" in order for the laptop to resize the display to match the external monitor. It would be nice if this could be done automatically, either triggered when the monitor is connected, but it would be en...

What's the best way to keep multiple Linux servers synced?

I have several different locations in a fairly wide area, each with a Linux server storing company data. This data changes every day in different ways at each different location. I need a way to keep this data up-to-date and synced between all these locations. For example: In one location someone places a set of images on their local s...

How to package a Linux binary for my Open Source application?

I have an Open Source app and I currently only post the binary for the Windows build. At this point Linux users have to get the source and compile it. Is there a standard way for posting a Linux binary? My app is in c / c++ and compiled with gcc, the only external Linux code I use is X Windows and CUPS. ...

Linux-based solution for domain management?

Using any member of the Windows Server family, I can set up an active directory, and have a single pool of users for a large scale of computers; access can be given / removed for any shared resources in the given domain (including access to client computers, etc). What similar (and widespread) solutions exist for managing a multi-user, ...

Which is the best LINUX distribution for an all time Windows user

I want a Linux installation which closely matches with Windows Vista in terms of GPU support and good Desktop experience. I heard that Ubuntu is a good choice here. Anybody have thoughts or experience to share. ...

Linux: How to measure actual memory usage of an application or process?

Hi, How do you measure the memory usage of an application or process in Linux? I've read here that "ps" is not an accurate tool to use for this intent. Thanks, Kenneth ...

Linux/C++ programmer to C#/Windows programmer

I have been coding exclusively for a while now on Linux with C++. In my current job, it's a Windows shop with C# as main language. I've retrained myself to use Visual Studio instead of emacs ( main reason is the integrated debugger in VC, emacs mode in VC helps ), setup Cygwin ( since I cannot live without a shell ) and pickup the ropes ...

Creating a local mailbox for NIS account

What is the way of creating a local mailbox for a user that have a NIS account, but doesn't have any local one? ...

What makes a pthread defunct ?

i'm working with a multi-threaded program (using pthreads) that currently create a background thread (PTHREAD_DETACHED) and then invokes pthread_exit(0). My problem is that the process is then listed as "defunct" and curiously do not seems to "really exists" in /proc (which defeats my debugging strategies) I would like the following req...