linux

How to make scons work properly

I'm trying to compile the SndObj library from the source. Supposedly it's as easy as just running 'scons' from the top of the SndObj directory. I get this: nhnifong@ubuntu-nate:~/SndObj-2.6.6$ scons scons: Reading SConscript files ... scons: warning: The Options class is deprecated; use the Variables class instead. File "/home/nhnifong...

How to determine storage type (SSD drive or HHD .mechanical drive), using C language

How can I, programmaticaly, read the hardware information of my drives? ...

compiling on Windows and Linux

Hello, I am just looking for some guidelines, as this might seem like a very open question. I have a project that has been compiled using Visual Studio 2008 sp1. I have to compile so it will run linux using gcc 4.4.1 C99. It is a demo application that I didn't write myself. The source code is written so it can be cross-platform (linu...

Can someone fix this python problem for me? (cannot find a module...)

I installed Yahoo BOSS (it's a python installation that allows you to use their search features). I followed everything perfectly. However, when I run the example, to confirm that it works, I got this: $python ex3.py Traceback (most recent call last): File "ex3.py", line 16, in ? from yos.yql import db File "/usr/lib/python2.4...

What are some of the major pro/con of FreeBSD vs GNU Linux vs OpenSolaris?

What are some of the major pro/con of FreeBSD vs GNU Linux vs OpenSolaris? Which is the best operating system to program/develop against? ...

What if one of my programs runs in python 2.4, but IMPORTS something that requires python 2.5?

Then how do I import that? I run everything in python 2.4, but one of my scripts import xml.etree.ElementTree...which is only Python 2.5 ...

linux bash command separate by space

so I'm trying to display only columns at a time first ls -l gives me this drwxr-xr-x 11 stuff stuff 4096 2009-08-22 06:45 lyx-1.6.4 -rw-r--r-- 1 stuff stuff 14403778 2009-10-26 02:37 lyx.tar.gz I'm using this: ls -l |cut -d " " -f 1 to get this drwxr-xr-x -rw-r--r-- and it displays my first column just fine. Then I wa...

Tools for C code refactoring

What tools are there that supports refactoring C code (renaming variables, extracting methods, finding method references, ...) Preferably for a Linux environment, but Windows tools are ok too. If there's something available for emacs, even better! ...

video file + fragment shader under Linux

coming from Windows (MSVC++ 2005): What SDK or alike do you recommend to port an C++ application (DirectShow+Direct3D) to Linux playing video file + using fragment shaders? Tom ...

Get files from TFS under Linux

Hi, is there a free (command line) tool for linux which with I can get all files from a TFS-Repository (no Check in / Check out required - only get actual version)? greets CFI ...

Function to read files one by one in a directory

I am implementing an SMTP-sender in C which is supposed to read a file from a directory whenever it is created, process data and delete the file. How can I implement this polling function which should keep doing this automatically? ...

The best way to ensure only 1 copy of bash script is running?

What is the simplest/best way to ensure only 1 copy of given script is running - assuming it's bash on linux? At the moment I'm doing: ps -C script.name.sh > /dev/null 2>&1 || ./script.name.sh but it has several issues: it puts the check outside of script it doesn't let me run the same script from separate accounts - which I would ...

Bash script always true

Is there any reason this script always give me running ? In both cases, when my process is started and when my process is stopped. if ps ax | grep -v grep | grep "processName" > /dev/null then echo $"running" else echo $"not running" fi Thank you very much UPDATE : I add a full exemple of my script, maybe smothing wrong somewhe...

How to pass "--external-locking" for mysqld in Ubuntu

Hi, I would like to start my mysql server with the --external-locking option. As mysqld is run by the /etc/init.d/mysql script ubuntu (karmic), I guess that's where I should set this "--external-locking" thing, just can't figure out where to put it(am far from expertise in shell scripting:). Could anyone please help me with that? Sett...

TPM/TSS Linux API alternatives

I would like to find (mature) API alternatives to use TPM (Trusted Platform Module) funcionality on Linux (and maybe other *nix). I'm interested in trusted encrypt/decrypt functions for authentication (probably integrating with Kerberos). I found jTSS (for Java) and TrouSerS, but I would like to know about other alternatives, if any. "G...

ALSA dmix plugin and sample rate problems.

I'm using the ALSA dmix plugin on an embedded project, and mixing mp3 files by playing them with mpg321-alsa. In my asound.conf I've set my dmix sample rate to 44100Hz. If I try to play any mp3 file sampled at a rate other than 44100Hz (or a rate that divides evenly into 44100Hz) then either the audio quality is degraded or even worse t...

scanf() causing infinite loop

I've a small C-program which just reads numbers from stdin, one at each loop cycle. If the user inputs some NaN, an error should be printed to the console and the input prompt should return again. On input of "0", the loop should end and the number of given positive/negative values should be printed to the console. Here's the program: #...

Writing a System Calls for linux

i try to write a system call. I followed these steps: linux/arch/x86/kernel/syscall_table_32.S ----> . long sys mycall linux/include/linux/syscalls.h --------> asmlinkage int sys mycall (int i , int j ); linux/arch/x86/include/asm/unistd_32.h ----> #define NR mycall 333 I changed linux/Makefile to core-y += kernel/ mm/ f...

Why does printf not flush after the call unless a newline is in the format string? (in C)

Why does printf not flush after the call unless a newline is in the format string? (in C) Is this POSIX behavior? How might I have printf immediately flush every time? Thanks, Chenz ...

get the default email from the user on a Linux box

Is there any way to programmatically get the current user's email address? I know the email is usually user@hostname but is there any I can get the email? I know how to get the username and the hostname so I can build it myself, but I want to be sure that I get the email address even when the email is not user@hostname. Code in C is ap...