linux

syslog_r for Linux?

Folks, I can't find the re-entrant version of syslog() for Linux...is there one? And if no, what do you? The obvious answer is to move logging facility into separate thread and serialise access to syslog... ...

Linux USB: turning the power on and off?

How can I programmatically enable and disable the power to a particular USB port on Linux? Is such a thing even possible? (no -- see below) Mac answers appreciated as well! I was trying for a BOC (don't pretend you weren't try to get one too!) and ended up with one of these, and would like to get some use out of the thing by hooking it ...

what is a reentrant kernel

What is a reentrant kernel? ...

Are there Unix platforms where Perl is not installed by default?

I am in the process of answering a request for tender on a contract that requires a decent amount of text processing. The main trouble is that the customer wants to be able to run this on any UNIX (HPUX, Solaris, AIX, FreeBSD) or Linux (SLES, RHEL) platform, which may constrain what I use to do it. They don't want to make the installatio...

Gui for KDE and Gnome

I want to write a gui to an application that is now CLI that needs to "look good" in both KDE and Gnome DE's, taking optimal advantage of a users settings for appearance. If I select Qt or GTK+ will I be able to do this? Do they integrate well with both DE's? Or does a KDE user need gnome libs and vice versa to run them? My developme...

How to use gtk_widget_add_accelerator ?

I am trying to build a gtk widget which will exists when Escape key is pressed. Here is my code. gtk_signal_connect (GTK_OBJECT(window), "delete-event", GTK_SIGNAL_FUNC(gtk_main_quit), NULL); /* FIXME */ GtkAccelGroup *accels = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(window), accels); gtk_widget_...

grep -- find this but not that

To make a long story short, I have a line of text that I'm using grep to see if the letter 'd' exists here is an example of what is going on: echo d file='hello world' | grep -c -w d Returns 1, this is correct. echo file='hello world' | grep -c -w d Returns 0, this is correct. echo d file='hello world d' | grep -c -w d Returns 1, this...

How does xterm's -S option (pass pseudo terminal name and descriptor) work in Linux ?

Greetings, while porting old Solaris 2.4 code to CentOS 5.3 I came across an invocation like /usr/bin/xterm -S%s%d ... where %s is a two-character digit sequence XX like 00, 01 and %d is a numeric file descriptor. This was apparently a way to tell xterm to use /dev/ttypXX (a pseudo terminal slave) but the code does not seem to bother ...

linux permission group

I am trying to setup my webserver so that one group will have access to the files. Apache and every user that needs to edit the files will be part of this group. So I've set all the files to have the group psacln. I've added psacln to my groups. But it still won't let me view the files: [tom@166 httpdocs]$ whoami tom [tom@166 httpdocs]...

OpenCV videos across platform

I am writing a video using OpenCV on linux machine. I want to read the same video using OpenCV on a windows machine. I am not able to do this using the standard codecs provided in openCV. Can anybody suggest how I can read/write videos across the two platforms? ...

Different access levels with PAM

Currently I have a graphical application that has two levels of access, operator and administrator. The login and authentication is all homebrewed and I'd like to switch the application to use PAM instead. I'm not sure what the right way to do that is. Correct me if I'm wrong, but it seems that PAM boils down to a "yes" or "no" check--y...

Change Mysql, php and apache2 log file formats

I am sending php errors, all mysql queries, apache2 errors and mod_rewrite debugging to one file, needless to say it's busy in there. Can the format be changed from: [22-Jul-2009 23:00:58] Parameters: GET Array ( ) POST Array ( ) [22-Jul-2009 23:00:58] Finding Associations 237 Query SELECT `table`.* FROM `table...

Guides for implementing a foreign function interface

Right now I'm working on a scripting language that doesn't yet have a FFI. I'd like to know what's the most convenient way to get it in, assuming that I'd like to write it like cool geeks do - I'd like to write the FFI in the scripting language itself. The programming language I need to interface is C. So for basics I know that libdl.so...

What is a good easy to use profiler for C++ on Linux?

I need to profile some code running C++ on Linux. Can you guys recommend some profilers? ...

Alternative Intel drivers for X

I'm having trouble getting X to run with the defaults on my chakra linux live-cd. It is an Arch based distro. I have a thinkpad x40 with Intel 855GME and I get "no valid modes" error from X. I figure I should try a different driver. But I'm not sure how I would do that. Can someone give me a few pointers? ...

How do you execute an INSERT statement using MySQL (in c++)?

Google is failing me (or I am failing Google.) I am simply looking for the function that executes an INSERT statement using the mysql.h library in C++. ...

Using Eclipse C++ CDT in Linux

I want to use Eclipse to develop C++ projects on Linux. Particularly I want to modify stable and widely used open source projects using the Eclipse CDT. One of them is Intel Opencv. There are tutorials to create simple c++ projects like here: http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/ . I have seen plent...

Running shell script in detached screen session. Must kill. How?

I am an Ubuntu Linux user. I am running jobs remotely and started a screen session. During this session I sourced a file containing a long list of command lines arguments to be executed. I was forced off of the connection and now the jobs are still running in this screen and I am unable to kill them. Does anyone know how to kill all ...

how can I use debuginfo-install with a local file ?

hello, im trying to debug a program I wrote but the gdb tells me an error : Missing separate debuginfos, use: debuginfo-istall glibc-2.9-2.i686 when im trying to use that command, it gaves me an error because my fedora is disconnected from the internet. however, I have glibc-2.9-2.i686 in my fedora's cd. how can I use debuginfo-insta...

debuginfo-install using a local file

hello, im trying to debug a program I wrote but the gdb tells me an error : Missing separate debuginfos, use: debuginfo-istall glibc-2.9-2.i686 when im trying to use that command, it gaves me an error because my fedora is disconnected from the internet. however, I have glibc-2.9-2.i686 in my fedora's cd. how can I use debuginfo-insta...