linux

Linux HA - how to detect a node is dirty wrt a resource?

Some background: on Linux HA, resources and groups have scores, i.e. score=(preference + stickness - failure stickness*fail counter). When a backup node has score greater than that of the current node, the resource will move to the backup node. I need to check, for a given resource/node, if that score is negative. It is easy to get fai...

Can't write to FIFO file mouted via NFS

I'm trying to write to FIFO file locate on NFS mount and it blocks. What could be the problem? My /etc/export: /tmp/test/ 10.0.0.0/24(rw,no_root_squash,async) ls /tmp/test on NFS server and client is the same prw--w--w- 1 root root 0 2009-06-24 17:28 ui-input and I'm writing as root Thanks. ...

how to know the what is our default audio device ? /dev/audio or /dev/dsp in ubuntu?

I was trying to play random songs command line using mpg123. But did not know what is my default audio device.. or if I need to specify any other audio device with the '-a' option. Both /dev/audio and /dev/dsp are audio devices. How to know which one is default ? ...

Howto debug a (slow) linker on a debian system

Hello, at my company we have a really annoying problem with our linker (ld 2.17). It links very very slow on a relatively fast system (Core Duo, 2GB Ram) and i don't really now how to fix this. It takes about five to ten minutes to compile a relatively big project (which takes about 5 seconds to link on my Gentoo system). Personally i ...

Fix file endcoding when downloading a file from Linux to Windows in php

Ok I have an issue. I have a linix web server (RHEL 4 with apache 2) that is used to house an application. Part of this application is a set of php scripts. I created a script that accepts some form variables and then downloads a file to the user. Here si the code: header('Content-Description: File Transfer'); header('Content-Type: ...

How do I can linux flock command to prevent another root process deleting a file?

Hello there, I would like to prevent one of my root process from deleting a certaing file. So I came across the flock command, it seems to fit my need, but I didnt get its sintax. If I only indicate a shared lock, it doesnt work: flock -s "./file.xml" If I add a timeout parameter, it still doesnt work flock -s -w5 "./file.xml" It ...

Header files in subdirectories (e.g. gtk/gtk.h vs gtk-2.0/gtk/gtk.h)

Hello, I'm trying to build a hello world using GTK, which includes the line: #include <gtk/gtk.h> as you would expect. The Makefile supplied has the line: GTK_INCLUDE = -I/usr/local/include so it would expect to find gtk.h in /usr/local/include/gtk/gtk.h. However on my system, it is located in /usr/local/include/gtk-2.0/gtk/gtk.h...

cakephp simpletest and rewrite rule

I've setup simpletest to work with my cakephp. I did it as prescribed in the book.cakephp.org. Everything seems to work fine - i've made my first test - super. But the visual layout of the testpage does not look right - I'm talking about www.mydomain.com/test.php. It looks like it has no CSS. I've seen this with the cakephp framework,...

Source Code of unix utilities such as sort, uniq etc.

Hi, Could anyone provide me with the pointers to source code for linux commands such as 'sort' , 'uniq' etc. many thanks. ...

How to auto login ssh server and run some command to modify a file.

Here is the limitations: No public key file uploaded to server (since this may be run at different target machine), this is just for an automatic testing program, so security is not a concern. It's automatically program run background, so no user input. I do not want to use "expect" which require user to install. I have know the root u...

best c audio library linux

I was wondering if anyone had an opinion on what they think is the best linux audio library for c. I'm just learning and was experimenting with audio output on libao. edit: right now all I'm trying to do is put out frequency tones. ...

Driver Compilation Redhat

Hi, I'm totally new to compiling drivers for linux and I got some problems ! I'm trying to compile a driver for a usb device. Result: [thayoz@lacalpc13 linux]$ make for i in driver lib qrng ; do cd $i && (make all || exit ) && cd ..; done make[1]: Entering directory /home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver' ...

Write a custom PCIe hotplug Linux 2.6.x driver

I'm writing a PCIe driver/module for a custom device. Since the device is hot pluggable, it can disappear at any time. Here how I setup up the pci_driver structure: struct pci_driver my_pci_driver = { .name = "my_pci_driver", .id_table = ids, .probe = "my_pci_driver_probe", .remove = "my_pci_driver_remove" }; But I don't know...

What's the easiest way to create multipart archives on Unix?

tar|gzip is wonderful, except files can get too big, and transferring them over network gets complicated. DOS era archivers were routinely used to create multipart archives, one per floppy, but gzip doesn't seem to have such option (because of Unix streaming philosophy). So what's the easiest and most robust way of doing this under Linu...

Killing linux socket from shell (gentoo amd64)

Folks, what is the best way to kill an established connection from the shell in linux? Looks like there are 'tcpkill' and 'cutter' tools available, however, on my gentoo amd64 tcpkill is disabled by the 'amd64' keyword and cutter, when used, prints an error "openning /proc/net/ip_conntrack: No such file or directory". Is there any ot...

Installing a prebuilt binary on Android: "not found"

I'm trying to install a prebuilt binary in a custom Android image. For that I have copied it to a new directory in prebuilt/android-arm/ with an Android.mk file similar to this one: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := binary_name LOCAL_MODULE := binary_name LOCAL_MODULE_CLASS := EXECUTABLES include $(B...

How can I fix test failures of Perl module HTML::TreeBuilderX::ASP_NET?

I'm trying to install the HTML::TreeBuilderX::ASP_NET mentioned Perl module on my box with CPAN.pm, but the "make test" part of the installation fails so the module doesn't get installed. Distribution: HTML-TreeBuilderX-ASP_NET-0.08 Perl: "This is perl, v5.10.0 built for i486-linux-gnu-thread-multi" OS: Linux 2.6.28-13-server #44-Ubunt...

Java IOException: No buffer space available while sending UDP packets on Linux

I have a third party component which tries to send too many UDP messages to too many separate addresses in a certain situation. This is a burst which happens when the software is started and the situation is temporary. I'm actually not sure is it the plain amount of the messages or the fact that each of them go to a separate IP address. ...

Write simultaneousely to two streams

Is there a way to to couple two streams (or file descriptors) together so that writing to one stream will also write to the second one? (C, Linux) Thanks. ...

Problems when trying to exectue exec("unix2dos xxx") in PHP/Apache

In a previous post, I was trying to update the encoding for a download file from php. One of the suggestions was to run the unix2dos command before sending the file to the user. This works great when I run the command on the linux box, but when I try and run the command from php I get nothing. Here is what I tried: $cmd = "unix2dos -...