linux

Using ALSA's function snd_pcm_writei can I free the sample buffer right away?

Using ALSA to play audio, after calling snd__pcm__writei, can I free the sound sample buffer right away or do I need to wait until the sound is finished playing before I can free the sample buffer? For example: unsigned short *buffer; buffer = malloc(size of sample to play); ...load data into buffer... snd_pcm_writei (playback_handle,...

Should I make Linux Shell Script or Java program?

I need to generate multiple databases to SQL, so I need script/program to automatically generate those to SQL and generate files to jboss server. Our client server is running in Linux, but I develop on Windows machine. Should I make script with as Linux script or write Java program that could make same things? ...

bgi graphics linux

I need to know whether there is any bgi library for graphics in linux.can anyone help??please do not suggest any library other than bgi coz I want to use it using C and I am comfortable with it.Thank you in anticipation ...

How do I select a subset of lines from the history in bash?

Quite often I grep through my bash shell history to find old commands, filepaths, etc. Having identified the history number of interest, I would like to see a few lines of context on either side, i.e. view a subset of history lines. For example: $ history | grep ifconfig 8408 ifconfig eth0 8572 sudo ifconfig eth0 down I would like ...

Linux distribution for a programmer's private server

I'm going to get a low-end old (CHEAP!) computer to run non-stop as a little server for Subversion, Mercurial, Trac and maybe a little other things 99% for myself - performance isn't a concern. It'll probably have a 1 GHz P3/P4/Celeron, 256 MB SDRAM, 30 GB IDE HDD or something like that, any video card so I can hook up a monitor. I could...

ip_len set to very large values

I have a program that sets the network interface to promiscuous mode, creates a socket that receives all incoming packets, and then enters a loop to read a packet into a buffer, set a pointer to the location of the IP header, and then print the value of its ip_len field. The problem is that the printed values are impossibly high. The rea...

Reproducible custom distribution build system for Linux

The Problem I have a big infrastructure consisting of several kinds of servers running Linux. For instance, database servers, load balancers, application-specific servers. There are many instances of every kind of server, and all of them need to be reproducible. Every kind of server is basically a custom distribution. Customisations in...

Send file over serial port with Linux and C

Hi all, i'm developing an application that reads data from a serial port and sends it over a TCP connection, and vice versa. Unfortunately, while reading data from serial port, it never stops. It does not detect EOF mark, nor EOL or some other special character. So, how could i detect an end of file (or "end of connection") over serial ...

Comprehesive information on serial ports and programming?

What are some comprehesive sources on serial programming? Ideally they would cover things like: history of devices current and future uses how serial devices work protocols and, of course, how to program, preferably in C/C++ ...

Sending data on AF_PACKET socket

How do I send data on a SOCK_PACKET socket without specifying which host it's bound for? I've constructed the IP header to show where it should go, but write() won't work. ...

Which USB classes are supported driver-free?

Which USB classes are supported by a standard installation of Windows/Linux/etc, without product-specific drivers? For example, a mass storage device is always supported, no matter what its VID/PID combination. What other classes work like this? ...

How to get Linux distribution name and version?

In Windows I read the registry key SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName to get the full name and version of the OS. But in Linux, the code struct utsname ver; uname(&ver); retVal = ver.sysname; returns the string linux, not Ubuntu 9.04. How can I get the Linux distribution name and version? ...

processEvents And Memory Leak?

Hi all, NOTE: THE CODE PROVIDED JUST GIVES THE IDEA OF THE STRUCTURE OF THE APPLICATION I have a Qt application, interfacing with external hardware. The structure is such that the class for interfacing with the hardware inherits from QObject and is composed with the main GUI thread class. Let's say the class is test.h, here is its samp...

What is the best way for interprocessor communication in Linux?

I have two CPUs on the chip and they have a shared memory. This is not a SMP architecture. Just two CPUs on the chip with shared memory. There is a Unix-like operating system on the first CPU and there is a Linux operating system on the second CPU. The first CPU does some job and the result of this job is some data. After first CPU fin...

Does anyone know of a good manual/overview/reference for Open Firmware Device Trees (PowerPC LInux)?

I am trying to setup a driver for an embedded PowerPC board, and the correct way to do this today is to use the OpenFirmware Device Tree datastructure (the .dtb file, compiled from a .dts file). Creating a tree is pretty easy, but how do I get my device driver to find its node and the data in it? I have not managed to find any good ref...

Image draw issue on Linux using Xlib

I am developing an application, in which I am receiving images from my window host.. the client side is in Linux using C++.. I am sending JPEG format from server side.. the problem I am facing is that when I receive the image on client, I use "XCreateImage" function to create the "XImage" and when I write this image to a file, it appears...

how to read each line from a .dat file in unix?

hi trade.dat is my file which consists of lines of data. i have to concatanate each line of that file with comma (,) help me please ...

Automating Amazon EBS snapshots anyone have a good script or solution for this on linux

I'd expect this to be fairly routine, but cannot find a simple approach for creating an managing EBS snapshots automatically. Was hoping there'd be a shceduler in the AWS console.. alas not yet. Would appreciate any suggestions as to how best to do this on from Ubuntu. Thanks ...

Bash Scripting - How to set the group that new files will be created with?

I'm doing a bash shell script and I want to change the default group that new files are created as. I know you use umask to change the permissions. Is there something for the group? ...

Linux LiveCD for software developers

Hi all, My primary development platform is Windows, however I sometimes need access to Linux for porting and testing my apps. To do so I use a preconfigured general purpose VMware image. However I'm looking for a simpler, more light-weight solution. I'm thinking about a zero-installation LiveCD dedicated to software development, booted ...