linux

How to get p4v -merge to diff multiple files

In this question: http://stackoverflow.com/questions/42980/how-to-use-p4merge-as-the-merge-diff-tool-for-mercurial, Adam Rosenfield suggested to use launchp4merge to diff multiple files in OSX such that there is only a single copy of p4v running. Is there an equivalent for linux? I ran p4v -merge -h and saw that it does not accept more ...

How do I get all instances of VLC on dbus quickly?

basically the problem is, that the only way to get all instances of VLC is to search all non-named instances for the org.freedesktop.MediaPlayer identity function and call it. (alternatively I could use the introspection API, but this wouldn't seem to solve my problem) Unfortunately many programs upon having sent a dbus call, simply do ...

Watermark a video programmatically

So I am looking for a way to watermark videos uploaded to my site programmatically. I have looked at ffmpeg-php however this will not work as I am using shared linux hosting. I'm wondering if anyone knows of a way that I can programmatically add a watermark to mp4 videos kind of how you do with the GD lib in php. Has anyone successful...

Boost C++ Libraries: Unit Test Assertion on % Processor Usage

I'm writing a unit test with Boost.Unit, and the code I'm testing must not exceed 50% of a single CPU during a portion of the unit test. How could I make this assertion from within the source code? ...

Sending keyboard input to a program from command-line

How do you send keyboard input to a program? That is, under a Linux GUI, is there a good manual (programmable) way, or tool, of simulating keyboard input on a running program on Linux, so that I can send from the command-line, e.g., "Control-T" to a Firefox process and "echo 'hello'\n" to a Gnome-Terminal process without actually focusi...

php scripts will not execute in browser

I'm trying to install wordpress...The install script will not run in firefox or chrome. I'm on ubuntu. I only get an option for downloading the file in both browsers. Any thoughts? EDIT: Do I need to install libapache2-mod-php5? ...

Inner-workings of Keyboard Event Handling under Linux

When I press a keyboard's key on some GTK application under Linux, what happens exactly? How does a key get received (from which device), interpreted, passed to the program, and then handled? ...

Colors with unix command "watch"?

Some commands that I use display colors, but when I use them with watch the colors disappears: watch -n 1 node file.js Is it possible to have the colors back on somehow? ...

How to get complete linking command instead of just CCLD / How to disable silent rules in make file

I am currently building an app and getting error in linking, here is a command, CCLD Programs/GtkBonker Now I want see the Complete linking Command, Any help is appreciated. PS. I am using GNU Build System with c++ programming language, with Ubuntu 10.04. ...

An IDE for shell-scripting in windows environment.

I have learned shell-scripting in linux environment. Now I am unable to install Linux on my PC. I need to practice shell-scripting. Currently, I have Windows XP installed on my PC. Is there any known IDE which can help me practice shell-scripting programs in windows environment? Thanks in advance. ...

Use of shell variable inside command

Hi, my server is using CentOS 5.5 (which is almost Red Hat Linux). I want to backup a set of pictures into time-stamped files. This code would work: z_cmd1=$(tar cvzf /home/user1/public_ftp/misc/pics_20100925_142230.tar.gz /home/user1/public_html/misc/_pics_var/F???????.jpg) echo "tar output =[${z_cmd1}]" but of course I want the...

toolchain arm glibc 2.12.1 error

I try to create cross toolchian for arm but have this error: In file included from dl-lookup.c:28:0: ../glibc-ports-2.11/sysdeps/arm/dl-machine.h:29:0: warning: "VALID_ELF_ABIVERSION" redefined In file included from dynamic-link.h:88:0, from dl-load.c:34: ../glibc-ports-2.11/sysdeps/arm/dl-machine.h:29:0: warning: "VALI...

Linux socket programming testing

I am new to socket programming and I have written a code for the server using the epoll. Basically it would wait to accept for any client connection and it would send data to the clients if the data is available from other sources. I need to test on how is the performance of the server when there are multiple requests for the connectio...

delete the first 5 chars on any line of a textfile in Linux

Hello, i need a 1liner to remove the first 5 chars on any line of a text file, but i dont know sed, could anyone help me please? Thanks in advance Chris ...

Automatically adjusting process priorities under Linux

Hello Everyone! I'm trying to write a program that automatically sets process priorities based on a configuration file (basically path - priority pairs). I thought the best solution would be a kernel module that replaces the execve() system call. Too bad, the system call table isn't exported in kernel versions > 2.6.0, so it's not poss...

why does this give a segmentation fault? it should just exit

Hi, I am trying to learn low-level development. By putting 0 in ebx and 1 in eax (for exit() syscall) and calling int 0x80, it should exit the program. I have a simple c program that runs fine, but when I paste this in, instead of exiting as expected, I get a segmantation fault. Why does this happen? THANK YOU! __asm__ ("xor %ebx, ...

Changing tmp directory used by Haystack and/or Whoosh

I'm running Haystack + Whoosh under a Debian vserver setup with only 128MB for the /tmp directory and am running out of space in it during indexing (the individual Whoosh tmp files are 25MB+). I'd love to increase the tmp folder size, but that's out of my control. Is there a way to instruct Haystack or Whoosh to use an alternate tmp dir...

How can I proxy mmap reads and writes across a network?

I'm working on software to control a mmap'd device on an embedded ARM system, but have run into a few situations where the debugging and development tools available haven't been sufficient. i.e. Instrumentation tools like valgrind and higher end thread profilers are unavailable. What I'd like to do is compile my code on an x86 machine, ...

how to use "system call" to determine ethernet status on linux?

usually I use ping to determine ethernet status, like: ping -c 1 -w 1 <ip_addr> how could we use system call to determine ethernet status? and how could we embedded this method in java codes? ...

Linux, timezone and dst

Hi all, I'm using RHEL 5.3 (linux 2.6.18) I have a legacy code that relies on timezone and dst returned by ftime(3). Now from ftime(3) man pages I see that timezone and dstflag are not supported. Also in gettimeofday(3) those fields are not supported. How I can retrieve timezone and dst? Thanks ...