linux

Developing on both Windows & Linux machines simultaneously

Sorry for the bad title (couldn't think of a better way to describe it) I have a windows machine which I do development on. However, I have a new project which needs to interact with a linux system (executing linux commands etc.). So, obviously I can't do development on my windows machine..and I don't wish to code on the dev machine, s...

Building both devel and normal version of a RPM package

Hi, I have a library from which I'd like to create two RPM packages. While I found several links on how to create a basic RPM package, I can't find how to create a devel package (see this question if you wonder what a devel package is). What do I have to do to generate both devel and non-devel versions of my RPM package ? Thanks. ...

P.Package kernel-package has no installation candidate

Hi, I want to install kernel package by this command sudo apt-get install kernel-package but it gives me the error : Package kernel-package has no installation candidate How can I solve this??? P.S: I am use ubuntu 2.6 ...

How much different is windows and linux in network programming?

I'm reading <<Understanding Linux Network internals>>,but not sure how much of it will also apply to windows? ...

Library for parsing arguments GNU-style?

I've noticed the basic 'style' of most GNU core applications whereby arguments are: --longoption --longoption=value or --longoption value -abcdefg (multiple options) -iuwww-data (option i, u = www-data) They follow the above style. I want to avoid writing an argument parser if there's a library that does this using the above style. I...

Monitoring pthread context switching

I would like to monitor the the context switching behavior in a multi-threaded pthread application. In other RTOSes(Micro C OS) I have been able to register a context switch callback for each thread in the application, and then log (or toggle a gpio) and watch the thread context switching in real time. This was a valuable tool for deb...

Setup SVN/LAMP/Test Server/ on linux, where to start?

I have a ubuntu machine I have setup. I installed apache2 and php5 on it. I can access the web server from other machines on the network via http://linux-server. I have subversion installed on it. I also have vsftpd installed on it so I can ftp to it from another computer on the network. Myself and other users currently use dreamweaver ...

postscript to text

I am working on a project to convert OCR'd PDf to png using ImageMagick and ghostscript and display in the browser so that i can select words in the image by letting a user query for the word . Imagemagick works fine along with ghostscript . I have a problem with the ps2text utility where it does not work reliably with pdf's . could any...

C code in Linux to C code in Windows

I'm having a code written in C that works on Linux. I want this program to work in windows, Are there any differences that I have to make in the code ? It is a code for Server/Client communication using sockets taken from here : http://www.linuxhowtos.org/C_C++/socket.htm ...

pthread_rwlock_init() causing a segmentation fault

I suspect I am doing something dumb here but I am getting seg faults on an embedded Linux platform (GCC compiler) when I try to run pthread_rwlock_init() on a rwlock embedded in a structure. struct rwlock_flag { int flag; // Flag pthread_rwlock_t * rwlock; // Reader/writer lock for flag }; The following causes a seg...

Simple rvm gui manager application

Hi all, i'm trying to write a simple gui application to manage ruby version manager. i started with some stuff like testing how ruby's %x[ ] works.. i made this function def do ( command ) %x[#{command}] end if i try to use this function with one of the rvm commands like "rvm list" or rvm -v i get a command not found: error. the s...

Command key to Meta in Emacs

I'm using a Mac keyboard on Ubuntu at work. What do I add to my .emacs file to turn the command key to Meta? I tried (setq mac-command-key-is-meta t) and (setq mac-command-key 'meta) and neither works. ...

How to encorporate encyption to FlexPaper

Is it possible to configure the FlexPaper reader to un-encrypt password-protected pdfs or swfs? Here is the use-case: User uploads a pdf My server would then convert the pdf to swf via pdf2swf Then somehow encrypt the swf with a password (not sure best way to do this) Then the FlexPaper would be able to un-encrypt the swf and display ...

Best practice for C++ audio capture API under Linux?

I need to create a C++ application with a simple audio recording from microphone functionality. I can't say that there aren't enough audio APIs to do this! Pulse, ALSA, /dev/dsp, OpenAL, etc. My question is what is the current "Best practice" API? Pulse seems supported by most modern distros, but seems almost devoid of documentation....

Forwarding email to distribution list

I recently had to move servers. On the old server, I had a Mailman listserv distribution list, but since Mailman was not supported on the new server, I wrote up a PHP script to read messages from IMAP and resend via SMTP. The script is brittle (my fault) and complex (not my fault): I'm having to parse each message, find the bits that I c...

How to implement a timeout in read function call?

Hi, I want to use serial com port for communication and I want to implement a timeout every time I call the read function call. int filedesc = open( "dev/ttyS0", O_RDWR ); read( filedesc, buff, len ); Thanks EDIT: I'm using Linux OS. How to implement using select function call? ...

How to maipulate the shell output in php

I am trying to write php script which does some shell functions like reporting. So i am starting with diskusage report I want in following format drive path ------------total-size --------free-space Nothing else My script is $output = shell_exec('df -h -T'); echo "<pre>$output</pre>"; and its ouput is like below Filesystem T...

Measuring daemon CPU utilization over a portion of its wall clock run time

I am dealing with a network-related daemon: it takes data in, processes it, and spits it out. I would like to increase the performance of this daemon by profiling it and reducing it's CPU utilization. I can do this easily on Linux with gprof. However, I would also like to use something like "time" to measure it's total CPU utilization...

Easy understanding of UNIX and UNIX shell scripting!!

Hi All, I am beginner to UNIX,UNIX Shell Scripting. Can you please guide me through any excellent sites for unix(which are easy to understand),some study materials(tutorials),video tutorials. Please help!! Thanks! ...

execute command hard coded in script not work when its in a variable

this works: nc shldvgfas005 6155 < temp.6153 this hangs: cmd="nc shldvgfas005 6153 < temp.6153"; $cmd this gives an error: cmd="nc shldvgfas005 6153 < temp.6153"; "$cmd" -bash: nc shldvgfas005 6153 < temp.6153: command not found HELP! ...