linux

Implementing basic file system

As a college project I need to implement a basic file system from within a file. So how do I go about this? What are the things that I would need to know? The requirements include having a daemon process in the background. Also the applications that use this system need to connect to the server using a Unix domain socket The file system...

How to prevent writer starvation in a read write lock in pthreads

Hi, I have some questions regarding read write locks in POSIX Pthreads on a *nix system, say Linux for example. I wish to know what is the default bias for read write lock i.e does it prefer reads over writes or vice versa ? Does it provide some api to change this default behaviour. Does posix pthread provide some api so that we could...

GTKMM on RHEL3 ??

Hi - How can I install GTKMM on a Red Hat enterprise Linux 3? ...

A php-based search facility with ExtJS not working well on Windows Environment

I created a search facility with ExtJS and PHP. The PHP file is the server side script with communicates with the database. On my Linux Environment, its working flawlessly. However, since I need to install this application on a Windows Server, I tried to copy it to my personal Windows XP. I installed Apache, PHP with the necessary exten...

Rsync friendly gzip

I must not be the only one - I'm rsyncing .tar.gz files and notice that every time the full file gets rsynced rather than the differences. Reading into it it seems back in 1999 someone created an algorithm that fixed the issue http://svana.org/kleptog/rgzip.html (only 5% of data needed transferred) Has this gone anywhere since, how do I...

On LINUX O.S., how to get the name of files that has been dropped onto shell script to boot JAR with the name of file as a argument to JAR

I have a shell script file to run jar on Linux O.S which contains #!/bin/sh #MyApplication MyApplication_home='/Desktop/MyApplication' chkpath="$MyApplication_home/jre6/bin/java" if [ -e $chkpath ] then export PATH=$MyApplication_home/jre6/bin:${PATH} export CLASSPATH=$MyApplication_home/MyJar.jar:${CLASSPATH} java -Xmx512M -jar MyJar.j...

getopt_long vs getopt_long_only

Hi guys, to do a proper Linux/unix styled application, what is the best choice (eg. afaik ls uses getopt_long but for example ffmpeg getopt_long_only). Which one do you recommend? Cheers, ...

Software serial port loopback on linux

Hello, all. Currently I need to develop some program that will communicate with cisco devices over serial line. I want to build testing environment on my development linux machine. So, I found dynamips cisco emulator. This emulator can provide interface via serial line with '-U /dev/ttyS0' option. Well, this causes dynamips to open hard...

Set the hardware clock in Python?

How do I set the hardware clock with Python on embedded linux systems? Regards, ...

Error initializing XGCValues

Hi. I was following this tutorial, bit stuck here: This code doesn't compile, and the error message is c:35: error: invalid initializer I'm not sure what's wrong with the line XGCValues valu=CapButt|JoinBevel; infact, I copied it from the said tutorial. Here's the full code I have: #include <stdio.h> #include <X11/Xlib.h> #includ...

Linux development/minimal smtp and pop3 server

I use python based as well as rails applications on ubuntu linux. We have functionalities like register, forgot password, reset password, email alerts etc features based on emails. Since now a days, we go on offline development, we want to run a local smtp & pop3 server to send and receive emails. Emails shall be send via the our web ap...

My busybox does not execute non-applet utility commands

I installed the latest busybox to my new embedded project. It runs OK until I try to put dropbear in my application. The busybox shell complains that dropbear is not found although "which dropbear" command gives me the correct answer "/sbin/dropbear". If I change its mode to RW, it complains that dropbear is not executable. I have tried ...

Error while compiling GTK+ app with g_rename func

I'm trying to use g_rename and compiler gives me strange message "error: called object ‘rename’ is not a function" for line in code "if (g_rename(old_file_name, full_new_file_name) == -1)". I don't understand why. I'm compiling with command "cc -Wall -g pkg-config --cflags --libs gtk+-2.0 app.c -o app". Gcc version = gcc (Ubuntu 4.4....

How can I lock a file from a program started as a cron job on Linux?

I use fcntl in my codes to lock file and unlock to practice like mutex in windows... I start my app in linux manually, i got right result, with the app runs smoothly... but i was asked to make a bash script to start the app daily.... my script is cd myapppaht ./myapp however, i got [Bad file descriptor] when it try to lock a file pos...

DTMF monitoring via multimon, awk and espeak

Hello, the question is: How to listen to the spoken DTMD digit every time the sound card capture one? The objective is radio controlling my pc and interfaces activities dialing dtmf tones via a hand-held transceiver. I used multimon to hear DTMF tones I tried to use awk to filter digits and proceed accordingly. For example, if I key...

Best way to control user interface

What is the best way to control the user interface on linux using C++ program. I need to be able to move the mouse, enter text, and view the screen. ...

The command used to find out space utilized by java in linux?

The command used to find out space utilized by java in linux? ...

What's the best alternative library to gettimeofday() in C++?

Hi, Is there a more Object Oriented alternative to using gettimeofday() in C++ on linux? I like for instance to be able to write code similar to this: DateTime now = new DateTime; DateTime duration = new DateTime(2300, DateTime.MILLISECONDS) DateTime deadline = now + duration; while(now < deadline){ DoSomething(); delete now;...

adding a start up via command line (Ubuntu)

Hey, I'm trying to have a graphical program and I want it to start after I log in. How do I do so? I know there's a GUI program, but I want to use a command line here. GUI tool: http://www.thegeekstuff.com/2009/07/ubuntu-open-applications-automatically-during-system-startup/ now, there is update-rc.d, however, it seems to run before I ...

ofstream - detect if file has been deleted between open and close

I'm wriiting a logger on linux. the logger open a file on init. and write to that file descriptor as the program run. if the log file will be deleted after the file descriptor was created, no exception/error will be detected . i have tried: out.fail() !out.is_open() i have google this and find this post . http://www.daniweb.com/forum...