linux

Iterating over each line of ls -l output

I want to iterate over each line in the output of ls -l /some/dir/* Right now I'm trying: for x in ls -l $1; do echo $x done, however this iterates over each element in the line seperately, so i get -r--r----- 1 ivanevf eng 1074 Apr 22 13:07 File1 -r--r----- 1 ivanevf eng 1074 Apr 22 ...

Help Installing phpMyAdmin on Linux Server

I constantly get this error when attempting to view index.php in the phpMyAdmin folder I have setup: Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. I am using subversion with three co-workers and I am trying to install this o...

Script to parse emails for attachments

I am looking for a way to monitor a Linux mbox email account, when an email arrives I would like to download an attachment from the email and save the attachment (CSV file) so that it may be used by a PHP script. What would be the best way of going about this? I have looked at PHP's IMAP functions but this does not appear to be the most ...

CUDA SDK compilation error

I am in the process of setting up a CUDA workstation. Platform specs: Intel Core 2 Duo Nvidia GTX 280 Fedora 10 GCC version 4.3.2 I have installed the developer driver, toolkit, and the SDK. When I try to compile the SDK example code I get the following errors: make[1]: * [obj/i386/release/cutil.cpp.o] Error 1 make: * [lib/libcutil....

When assert() fails, what is the program exit code?

When an assert() call fails, what is the exit code used, and where is it documented? ...

Why are functions loaded at aligned addresses in x86 Linux for elf executables?

Hi, I've been looking at Linux elf executables on x86, mostly using IDA but also gdb. One thing I've noticed is functions are always loaded at word aligned addresses? Anybody knows the reason of that? I am not aware of any requirement of x86 instructions to start at aligned addresses. And it cannot be due to page alignment cause the pag...

PHP: testing two double-variables gives different result without changing the variables

Dear All, in my code i have two double values. Lets call them $a and $b. now I want to test which one of them is larger, so I wrote the following: print ($a > $b ? "larger\n" : "smaller\n"); print ($a > $b ? "larger\n" : "smaller\n"); strangely the result is larger smaller does anybody encountered a similar problem before? This pr...

Slow tab switching in Vim with large terminal

My vim is very slow to switch tabs (:tabnext) when i've fullscreened my terminal (1920x1200). Does anyone have a fix for this? Is it a vim issue, or is it my setup? Redrawing a black terminal (gnome-terminal) with a bit of text shouldn't be that hard. ...

how to know service name of an application?

I installed yammer application in my centos(linux) machine.It is starting at the time of starting the machine.How can i know its service name and how can i delete from startup....? ...

call external program in python, watch output for specific text then take action

Hello everyone, i'm looking for a way in python to run an external binary and watch it's output for: "up to date" If "up to date" isn't returned i want to run the original command again, once "up to date" is displayed i would like to be able to run another script. So far I've figured out how to run the binary with options using subproces...

automatic delete mqueue in sendmail

I have setup sendmail in centos 5.4 64bit and i want script to delete mqueues automatically when it crosses to 20 ? Thanks ...

Valgrind 'noise', what does it mean?

When I used valgrind to help debug an app I was working on I notice a huge about of noise which seems to be complaining about standard libraries. As a test I did this; echo 'int main() {return 0;}' | gcc -x c -o test - Then I did this; valgrind ./test ==1096== Use of uninitialised value of size 8 ==1096== at 0x400A202: _dl_new_o...

Can I prevent a Linux user space pthread yielding in critical code?

I am working on an user space app for an embedded Linux project using the 2.6.24.3 kernel. My app passes data between two file nodes by creating 2 pthreads that each sleep until a asynchronous IO operation completes at which point it wakes and runs a completion handler. The completion handlers need to keep track of how many transfers ...

Help with CVS in command line after an already "checked out" module by a GUI app.

I've already checked out a bunch of repositories in my ~/cvs folder, using CrossVC, a graphical CVS client. How can I use CVS in cmd with these already checked out repositories? Which variables should I export? (I have 10 directories, which one with different checked ou repositories) ...

Is there a way/tool to list TCP connections flaged as "thin" under Linux ?

Is there a way/tool to list TCP connections flaged as "thin" under Linux ? ...

sed script to remove file name duplicates

Dear community, I hope the below task will be very easy for sed lovers. I am not sed-guru, but I need to express the following task in sed, as sed is more popular on Linux systems. The input text stream is something which is produced by "make depends" and looks like following: pgm2asc.o: pgm2asc.c ../include/config.h amiga.h list.h pg...

Flash + RTMFP + Stratus: Video Quality on Linux

I'm developing a video chat-like application using Flash RTMFP and Stratus. So far, I'm having good success. I can build from source, tweak settings, and get video and audio in both directions. There's one glaring problem I haven't been able to solve, however -- when using a client on a Linux machine, the video received by the other e...

Shell - How to find directory of some command?

I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH. Even I don't know how to see what dirs are on my PATH variable (and this is another good question that could be answered), what I'd like to know is: I come to shell and write: $ lshw I want to know a ...

add string after each line bash

How do I add a string after each line in a file using bash? Can it be done using the sed command, if so how? ...

FIFOs implementation

Consider the following code: writer.c mkfifo("/tmp/myfifo", 0660); int fd = open("/tmp/myfifo", O_WRONLY); char *foo, *bar; ... write(fd, foo, strlen(foo)*sizeof(char)); write(fd, bar, strlen(bar)*sizeof(char)); reader.c int fd = open("/tmp/myfifo", O_RDONLY); char buf[100]; read(fd, buf, ??); My question is: Since it's not ...