linux

Can I automate the finding of -l parameter I use when linking based on header files (gcc)?

Normally when linking against a static library, I have to specify a library directory and the name of a libX.so (or its symbolic link) as -lX flag for linking [and its directory with -L flag]. Can I automate this based on my header files (in c/c++) only? Or maybe it is not a good idea? Is there a software for locating the -L and -l par...

How do you pass a file list to the linux zip command

I'm using Git for version control and unlike SVN I have not come across an inherent means of performing an export of changed files between 2 revisions, branches or tags. As an alternative I want to use the linux zip command and pass it a set of file names, however the file names are the result of another command git diff. Below is an ex...

Modifying text files and executing programs with command line parameters in c# or c++ on Linux

I have a need to create a utility in Suze Linux. The utility will make modifications to some text files, and then use the information in those text files to program a device in the computer using a different executable which accepts command line parameters. I am fluent in c#, but have never worked with Linux. Should I take the time to...

hex dump of file in bash

How do I create a UNMODIFIED hex dump of a binary file in linux with bash? The od and hexdump commands both insert spaces in the dump, I DON'T WANT THIS, I need something that will simply write a long string with all the hex characters without inserting spaces or newlines in the output. How do I do this in bash? ...

How to generate pdf from docbook 5.0.

I've written a docbook 5.0 document with the header: <?xml version="1.0" encoding="UTF-8"?> <book version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:m="http://www.w3.org/1998/Math/Ma...

Unix RPC programming

I needed some help with ONC RPC programming. My task is to create a two-tier client-server architecture wherein one main server (something like a directory) keeps a track of level-two servers and acts as a lookup; the level-two servers expose some trivial functions, and finally, the clients for level-two servers. The clients ask th...

How do I output coloured text to a Linux terminal?

How do I print coloured characters to a Linux terminal that supports it? I'm using C++ for this program, but I think that might be irrelevant. EDIT: And secondly, how do I tell if it supports colour codes? ...

double fork using vfork

HI I am writing a part of a server which should dispatch some other child processes. Because I want to wait on some of the processes, and dispatch others without waiting for completion, I use double fork for the second kind of processes (thus avoiding the zombie processes). Problem is, my server holds a lot of memory, so forking takes a ...

Are there any way to link my program with Wine-compiled part?

I am trying to use windows dll functionality in Linux. My current solution is a compilation of a separate wine application, that uses dll and transfer requests/responses between dll and main application over IPC. This works, but is a real overhead comparing to a simple dll calls. I see that wine-compiled program usually is a bootstrapp...

Alternative to JFileChooser on Linux?

I don't like this ugly FileChooser layout in Linux. This layout is used by any other program and is MUCH more beautiful. Is this layout available in Java? If so, how? ...

mod_wsgi | linux installation error

I'm getting the following error when I try to install mod_wsgi ./configure checking for apxs2... no checking for apxs... /usr/sbin/apxs checking Apache version... 2.2.3 configure: creating ./config.status config.status: creating Makefile make /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG mod_wsgi.c -L/usr/local/lib -L/u...

(Why) does Tomcat/Java perform better on Linux than on Windows?

I just read this (one) study in which Tomcat under Linux outperformed Windows. From your experience, is this generally true? Any deep reason that could explain the performance difference? ...

[sed] Multiline trimming

I have a html file that I want to trim. I want to remove a section from the beginning all the way to a given string, and from another string to the end. How do I do that, preferably using sed? ...

How to install a Linux Rails gem on Windows

I need to upload vendorize a gem which is causing problems at my host - in this case nokogiri. My host is using linux, my development system is windows. The gem contains binaries and so my local gem downloads the win32 binaries. Is there any way I can get gem to download the linux binaries, so I can vendorize and upload them? ...

How the buffering work in socket on linux

How does buffering work with sockets on Linux? i.e. if the server does not read the socket and the client keeps sending data. So what will happen? How big is the socket's buffer? And will the client know so that it will stop sending? ...

Replacing Part of Text Using Sed

I have the following text file Eif2ak1.aSep07 Eif2ak1.aSep07 LOC100042862.aSep07-unspliced NADH5_C.0.aSep07-unspliced LOC100042862.aSep07-unspliced NADH5_C.0.aSep07-unspliced What I want to do is to remove all the text starting from period (.) to the end. But why this command doesn't do it? sed 's/\.*//g' myfile.txt What's the righ...

Replacing multiple bar (special char) with tab using sed

I have a string like this BRADI5G20430|BRADI5G20430.1||1 How can I replace the bar (single and multiple) with tab ("\t")? I tried this but dont' work sed 's/\|+/\t/g' I also want to include this line in bash script. ...

Joining Multiple Fields Using Unix Join

How can I do it? I have a file that looks like this foo 1 scaf 3 bar 2 scaf 3.3 File2 looks like this foo 1 scaf 4.5 foo 1 boo 2.3 bar 2 scaf 1.00 What I want to do is to fine lines that co-occur in file1 and file2 when field 1,2,3 are the same. Is there a way to do it? ...

AWK If/ElseConditional Problem

I have a data that looks like this: foo foo scaffold_7 1 4845 6422 4845 bar bar scaffold_7 -1 14689 16310 16310 What I want to do is to process the above lines where I just want to print column 1,2,3, 7 and one more column after 7th. But with condition when printing column 7 onwards. Below is my awk script: awk ...

sliver light application deploy on Linux

Hi, My requirement is host a silver light web site on Linux O/S on tomcat or web logic server. would appreciate if anyone can explain the possibility and approach for this. Regards, vidya ...