linux

Using Unix Tools to Extract String Values

I wrote a small Perl script to extract all the values from a JSON formatted string for a given key name (shown below). So, if I set a command line switch for the Perl script to id, then it would return 1,2, and stringVal from the JSON example below. This script does the job, but I want to see how others would solve this same problem usi...

socket behavior on read

the client writes 5 bytes to the socket after every 1 second. the server continuously reads from the socket. the buffer at the server end is 10 bytes long. so the function looks like this read(fd, buf, 10); the server reads 5 bytes everytime. now the client writes 5 bytes continuously. the server is the same. the server reads 10 byt...

popen & status of a pipe

Let's say I spawn a process PO through popen (READ ONLY) from a process PA. I then pclose() the pipe on PA's side. On PO's side, how do I determine if stdout is still available without executing a write() ? Note that I have tried catching SIGPIPE on PO's side to no avail. UPDATED: I tried using fstat(1, &buf) without success. UPDATED...

EXT3 Error Running Inside VMWare

I'm doing development of an OS based on the 2.4 Linux kernel. Right now I'm porting it to VMWare. When creating the partitions, either on first boot or when the user formats the drive (the user never formats the drive themselves, they use a special command in our OS that takes care of all the system calls for them), it gives the followin...

[ linux, g++, linking]: library is in ldconf cache and Links Manually, but not by default

Hi all, This appears similar to an earlier post: http://stackoverflow.com/questions/335928/linux-gcc-linking-ld-cannot-find-a-library-that-exists But to the best of my knowledge, it's not exactly the same situation. The following command works: $g++ -I../../include/ -lboost_program_options-mt rips-zigzag.cpp However this doesn't: $...

Load multiple copies of a shared library

I am running Linux, and I would like to be able to make parallel function calls into a shared library (.so) which is unfortunately not threadsafe (I am guessing it has global datastructures). For performance reasons, I do not want to simply wrap the function calls in a mutex. What I would like to do is to spawn, say 4 threads, and also...

Is there a way to capture the output of a command, and its return value into variables in a shell script?

So, let's say that I have a command, foo, in a script which has both a return value, and an output string that I'm interested in, and I want to store those into a variable (well at least its output for the variable, and its return value could be used for a conditional). For example: a=$(`foo`) # this stores the output of "foo" if foo...

TeamCity Alternatives

I write a lot of little projects, and I'd like to use something like TeamCity for my build server(s). My problem with just using TeamCity itself is that the Professional version of only seems to allow for, at most, 20 projects. And since these projects are generally not-sellable, the price tag for the Enterprise edition is a bit much. ...

Linode or Slicehost

I'm looking into VPS for LAMP and wanted to see if any of you have an opinion to help me decide between Linode and Slicehost? Pro, Cons and overall opinion will be much appreciated. ...

check internet connection in linux using mono?

is there any way to check internet connection status in linux using mono ...

Get MAC Address in linux using mono

How do I get the MAC address of my computer in a Mono application on Linux? ...

Convert Microsoft Office documents to Text

I'm looking for a library (or command line tool) to turn MS Office documents into either plaintext or HTML (for conversion to text). It must run on Linux (not via Wine!). I found antiword, but the last release was 2005, so it won't read the new Office 2007 formats. I need it to read Word, Excel and Powerpoint documents ...

Create a shared lib using another shared lib

I have a shared library "libwiston.so". I am using this to create another shared library called "libAnimation.so", which will be used by another project. Now, the second library "libAnimation.so" can't be used in test code correctly. So I doubt that the creation of the second lib "libAnimation.so" is right. The gcc command to create this...

.NET application exports data to a remote Linux server.

There is a MySQL database located on my remote Linux server. I have written a .NET Windows application to export data to this MySQL database. I want to know whether there will be any compatibility issues regarding .NET / Linux? ...

Linux inter-process reentrant semaphore

I'm porting a Windows application to Linux and I have a synchronization problem. In Windows I'm using a system-level named mutex to sync access to a shared memory block. How do I emulate that in Linux? I've created a SystemV semaphore, using semget. The problem is that it is not reentrant, if I already hold it it will block, unlike on ...

(*nix) Cloud/Cluster solutions for bulding fast & scalable web-services

I'm going to build a high-performance web service. It should use a database (or any other storage system), some processing language (either scripting or not), and a web-server daemon. The system should be distributed to a large amount of servers so the service runs fast and reliable. It should replicate data to achieve reliability and a...

how linux run different microprocessors

how linux run different processors, linux kernal compiled using corresponing compilers,so it run different micprocessors like intel, Sun sparc,MIPS? ...

Tips for Setting Up Complex CTAGS Search Paths

I want to be able to start up vim in an arbitrary subdirectory in my project and have it search up to the project root for the tags file, and then to search in an unrelated directory outside the project tree. For example let's say I have the following: ~/projects/foo/bar/baz.c ~/projects/foo/tags ~/some/arbitrary/path/tags I want to ...

C++ 64-bit std::ostream support

I am about to make the transition from using standard FILE pointers from some older code to using C++ streams but I need to have LARGEFILE seeking support (the compiler flags that activate this support are: *-D_FILE_OFFSET_BITS=64* et al) which I am able to obtain by using the *off64_t* datatype. My original question was answered regar...

Is there a way to build a libxml2 without text relocations on Linux?

Good afternoon, I am having difficulties with libxml2. I tried to build the Perl module XML-LibXML which is part of our standard runtime environment. However, this time the installation on a RHEL5 box failed, because the build process complained about missing libxml2: $> perl Makefile.PL LIB=/foo/lib/perl PREFIX=/foo INSTALLDIRS=site...