linux

Using dlopen, how can I cope with changes to the library file I have loaded?

I have a program written in C++ which uses dlopen to load a dynamic library (Linux, i386, .so). When the library file is subsequently modified, my program tends to crash. This is understandable, since presumably the file is simply mapped into memory. My question is: other than simply creating myself a copy of the file and dlopening th...

Books to read on networking and microcontrollers?

Hi folks, I was recently elected programming team lead for my community college's engineering club. We're going to put a solar panel on a roof. The programming part involves Controlling servos to adjust the orientation of the panel Sending data on the electricity collected by the panel to a server (we haven't decided whether we want...

optimum setup for php server

We have a number of servers running various different LAMP setups. One thing that seems to be different depending on who set the server up is the way PHP is configured. Some are set up to use the Apache DSO module, others are setup to use CGI. Some have suEXEC turned on, other servers its turned off. We are always trying to tweak our app...

Using SDL on Android: can't compile because of missing "GLES_CM"

Hi. I'm trying to use OpenGL on Android using C. I'm following this excellent tutorial, but I've hit a wall. I'm using an ARM compiler (arm-none-linux-gnueabi-ld) on Linux Mint 7 (Ubuntu 9.04 branch). I can copy the compiled binary to the Android emulator just fine, it runs. But when I try to make it myself, I get the following error:...

how to generate an invoice

Hello, I have started freelancing and a client has asked for an invoice. Do you have a favorite tool for generating invoices? I am after something that I can use from Linux (either a desktop tool or web solution) and generates well formatted Pdf's. thanks ...

How do I have my program's core dump saved to a file upon a crash?

I'm using Bash. I used ulimit -c unlimited but the program still doesn't generate a core file. It may be due to the GUI debugger kicking in. I get the option to save the crash info to a file, but I really want a core file. Edit: I just wrote a small non-gui program meant to crash, and it produced a core dump. ...

sed: Find pattern over two lines, not replace after that pattern

Wow, this one has really got me. Gonna need some tricky sed skill here I think. Here is the output value of command text I'm trying to replace: ... fast n : abstaining from food The value I'd like to replace it with, is: ... Noun : abstaining from food This turns out to be tricker that I thought. Because 'fast' is listed a...

Communication between Windows Client and Linux Server

Hi there, I want to provide my colleagues with an interface (using Windows Forms or WPF) to control the states of virtual machines (KVM based) on a linux host. On the command line of this server, I'm using a tool, called libvirt, which provides python bindings to access its functionality. What whould be the best pratice to remotely acce...

perl hangs on exit (after closing a filehandle)

I've got a function that does (in short): my $file = IO::File->new("| some_command >> /dev/null 2>&1") or die "cannot open some_command for writing: $!\n"; ... undef $file; Right now I'm not even writing anything to $file. Currently there are no other operations on $file at all. When I run the program, it doesn't exit properly. I...

How to check for an exploding zip file in bash?

I have a bash shell script that unzips a zip file, and manipulates the resulting files. Because of the process, I expect all the content I am interested to be within a single folder like so: file.zip /file /contentFolder1 /contentFolder2 stuff1.txt stuff2.txt ... I've noticed users on Windows typically don't ...

nautilus extensions: where are the docs??

I've googled and googled and I can't find the docs for writing extensions to Nautilus. ...

ubuntu/fedora: how do I add applications in the menus?

What files and where do I need to drop those in the filsystem hierarchy in order to add an application to Ubuntu or Fedora? I am creating a .deb package and I would like it to appear in the "Other" menu. How do I achieve this? ...

linux: adding hosts programmatically?

Is there a way to programmatically add hosts to the local name resolver under Linux? I would rather avoid fiddling with /etc/hosts dynamically... Example: add the name foo and bind it to the local port 127.1.2.3 Use Case: I have an application installed locally accessible through a web browser. I'd like the application to be accessib...

ArcGIS Server 9.3 SUSE 10 "Failed dependencies"

I'm getting an error when I try to install: wxWidgets-gl-compat-2.8.10.1-1.pm.1.2.i586.rpm in SUSE 10. error: Failed dependencies: libgio-2.0.so.0 is needed by wxWidgets-gl-compat-2.8.10.1-1.pm.1.2.i586 rpmlib(PayloadIsLzma) <= 4.4.2-1 is needed by wxWidgets-gl-compat-2.8.10.1-1.pm.1.2.i586 Any ideas? Thanks! ...

How do I use tr to substitute '--' string

I have an output: -- out1 -- out2 -- out3 I want to get the output: out1 out2 out3 I thought of using: tr '--' '' but it doesn't recognize '--' to be the first string I want to substitute. How do I solve this? ...

How can I use Linux's splice() function to copy a file to another file?

Hello--here's another question about splice(). I'm hoping to use it to copy files, and am trying to use two splice calls joined by a pipe like the example on splice's Wikipedia page. I wrote a simple test case which only tries to read the first 32K bytes from one file and write them to another: #define _GNU_SOURCE #include <fcntl.h> #in...

NetworkManager: where is the specification for its DBus interface?

where is the specification for Network Manager's DBus interface? I've been googling like crazy. ...

Google perftool cannot read file "libprofiler.so.0"

Hi all, I am trying the google performance tool for CPU time profiling. However, I had encountered some problem that I cannot read the shared library file "libprofiler.so.0" I had read the README of google performace tool, there are 3 steps in the manual: Compile my program with -lprofiler. I had done this part without any problem. Ru...

How do I get gdb working with D programs under linux?

I have a patched gdb 6.8, but I can't get any debugging to work. Given this test file: import std.stdio; void main() { float f = 3.0; int i = 1; writeln(f, " ", i); f += cast(float)(i / 10.0); writeln(f, " ", i); i++; f += cast(float)(i / 10.0); writeln(f, " ", i); i += 2; f += cast(float)(i / 5....

How can I split a file into a given number of parts in Perl? (On Unix)

I have several large files, each of which I want to chunk/split it in to predefined number of parts. Is there an efficient way to do it in Unix (e.g. via awk/sed/perl)? Also each file can have varied number of lines. File1.txt 20,300,055 lines File2.txt 10,033,221 lines etc... ...