linux

gtkbutton font color change

Hi Experts, I am trying to change the color of text displayed on GtkButton using gtk_widget_modify_fg() but it is not working. I have successfully changed the background of GtkButton using gtk_widget_modify_bg() but foreground one is not working. Please help. Regards -Durgesh O Mishra ...

Always fail to apply SVN patch on remote Linux machine

My typical work process is like: Check out the codes from trunk on to my windows work machine Do some fixes (but no commit the SVN) and create a patch of these modifications using Tortoise SVN's "Create Patch". SSH log into a remote Linux server, and upload the patch. The linux server also has the trunk HEAD checked out. Apply the patc...

How to find time in sh scripting

I'm trying to find a way to get date and time separately. For date I can do: date -u +%d/%m/%Y What should I do to find the time in the following format? hh/mm/ss Thanks ...

Shell script : How to cut part of a string

Hello, I have following string â â³ eGalax Inc. USB TouchController id=9 [slave pointer (2)] â â³ eGalax Inc. USB TouchController id=10 [slave pointer (2)] and would like to get the list of id ? How this can be done using sed or something else ? Regards, Levon ...

How to get the contents of a webpage in a shell variable ?

In Linux how can I fetch an URL and get its contents in a variable in shell script? ...

Interrupt handling and transferring data from and to application code - low latency method theories

I have a Fibre Optic link, with a proprietary Device Driver and message format. The link goes into a PCIe card. Running on a RHEL 5.2 (2.6.18-128~) I have mmap'ed the interface on the card for setup and FIFO access etc, but cannot use this for interrupts as this should be done via the kernel-space interrupt routine (correct me if require...

RegEx in bash-script (for-loop)

I want to parse the arguments given to a shell script by using a for-loop. Now, assuming I have 3 arguments, something like for i in $1 $2 $3 should do the job, but I cannot predict the number of arguments, so I wanted use an RegEx for the range and $# as the number of the last argument. I don't know how to use these RegEx' in a for-loop...

Accessing windows applications controls from Linux

Hello everyone, I'm currently using Linux as my main OS and I run some Windows applications via Wine. Let say I'm running Notepad under Wine for example purposes. Is there a way I can access the text entered in notepad from Linux ? (Java, C, C++, C#/mono). Language doesn't matter Thanks in advance ...

Does google analytics slow down my website?

I am at the final stages of my website, and currently I need to find a suitable statistics application/tool. I have looked into webalizer, but it seems outdated. Also, I have looked into Google analytics, but I am afraid that if I implement it, my website will go slow. It is already pretty heavy with database material being displayed w...

Running VM's on windows

I have a Win7 Home Premium box and I'd like to run a Linux VM on it. I'm looking for a free solution. In particular I need the VM to accept inbound network connections. I've used VirtualPC before but IIRC it doesn't fit my network requirements. I took a look at VMWhere Player but I'm not sure it does either and it was asking a lot more ...

Making Python script accessible system wide

Can someone tell me how to make my script callable in any director? My script simply returns the number of files in a directory. I would like it to work in any directory by invoking it, instead of first being copied there and then typing python myscript.py I am using Mac OS X, but is there a common way to get it installed on Windows and...

Unix command to remove whitespace in the first few lines

I'm using this unix command(in a php file) to remove a certain string and then remove the whitespace left by that string. Unfortunately in many cases, the files get completely erased. Is there a workaround? <?php $dir = "./"; $rmcode = `find $dir -name "*.php" -type f |xargs sed -i 'somestring' 2>&1`; echo "String removed.<br />\n"...

find a subset of numbers that most closely match a sum

I'm looking for a technique or algorithm that will give me a subset of integers from a given set that, when summed, most closely match a given target number. I have a music video and I want video for 248 frames. I have a set of clips of various lengths, all less than 248. I would like a subset of those that are closest to 248 when thei...

libmemcached problem

Hi all, when i run the libmemcached example code on my ubuntu, it gave me the error "undefined reference to `memcached_create'", anyone can help ? thanks #include <libmemcached/memcached.h> int main(int argc, char **argv) { //memcached_servers_parse (char *server_strings); memcached_server_st *servers = NULL; memcached_st *mem...

Setting Commit and Checkout Privileges for a Git Repository

We are having a local repository which is accessible to a large number of people. We have to set up a Git repository there such that only certain users have checkout as well as commit privileges. How can we do that. P.S. : This is a part of our homework assignment in which we have to develop a game and update it using a Git repository. ...

Hook up into another Terminal process?

I've got two terminal instances/processes opened with different PID. Is it possible to from one of them, hook up into the other so when I type something and it outputs something, then the other terminal will see the output too (maybe the input too if possible?). Just like cloning the terminals. I want this because then I can hook up s...

How can I check with which options was program compiled?

Hi, I would like to know options which where passed to program before make, which is currently installed on my Ubuntu (from deb). I would like to compile it manualy with the same options (+ some extra). ...

Running a command line from python and piping arguments from memory

Hi, I was wondering if there was a way to run a command line executable in python, but pass it the argument values from memory, without having to write the memory data into a temporary file on disk. From what I have seen, it seems to that the subprocess.Popen(args) is the preferred way to run programs from inside python scripts. For ex...

Set screen resolution in game programming

I have to make a multiplayer game and give the users(on different) an option to change their screen resolution in order to sustain their hardware requirements.Similar to counterstrike. How can I implement this in c ? how can I give the users sitting on different computers an option to change their screen resolution ? ...

Registering Callback / calling a function when network interface comes up

I want to meassure the time it takes for an interface on a linux system to a) become up and b) become IP capable. This would invoke as a first step to get the linux kernel to tell in some way to call a python function when an 'interface up request' has been sent. Some application (e.g. d-bus) requests: 'iface up' => timer_1.start() ...