linux

How to intercept HTTP requests on Linux desktops?

I really appreciate if someone could give me an idea how to implement this. Also, is it possible to have a common implementation for most of the popular Linux desktop distros, if not all of them. Thanks. What I need to implement is something like a Windows service, which runs automatically every time the OS boots. What it does is to int...

PHP pam_auth and cookies

Long story short, I'm developing an in-house report engine. It is entirely web based (utilising PHP and various AJAX techniques) and interprets data stored in a MySQL database by our production software. It runs on an Ubuntu 8.04 server, and all employees have a linux user account on that machine. I set up a login system using pam_auth t...

AJAX boardgame runs fine in Windows, but not in Linux

I have been playing a web boardgame called Empires at GamesByEmail.com recently. It runs fine under Windows, but is unusably slow on Linux. I asked the developer why. He uses Linux, but he does not know. He suspects there are too many DOM elements, but he does not know what to do about fixing the problem. It's slow both in Firefox and ...

Scripting Python for Linux commands

Hello, I have a question. I have been really trying to learn Python. For a project, I want to make an ncurses GUI for my backup server. My backup server runs rdiff-backup, and I want to have the ncurses take in variable names and plug them into my script. I have been trying to do a lot of reading so I don't ask dumb questions. Here...

linux shell output to html

is there any way to convert bash output to html ? for example if I had some colorized output in bash ( something like htop ), how can I convert it to html tags ... ( something like this: <p style="color: red">some text</p>) ...

Does OS X have an equivalent to /dev/shm?

Does OS X (Snow Leopard in particular) have an equivalent to (some versions of) Linux's /dev/shm , ie something where you can write to and read from a file without necessarily touching the hard drive? ...

Simultaneously write to multiple syslog facilities?

Is it possible to have one application simultaneously write to multiple syslog facilities? I have an application, written in C/C++, that I would like to write some messages to local0 and other messages to local1. I do not want the messages for local0 to appear in local1 or vice versa. ...

Shell variable expansion - indirection problem while calling a utility with env

Hi all, sorry if this is a repeated question but I was trying to figure out env, ( i.e. calling a util with a new environment). Just as an example my environment variable KDEDIRS = /usr in my current environment and lets say I type: env -i KDEDIRS=/home/newkdedir env This outputs KDEDIRS=/home/newkdedir as expected. (i.e calling se...

how to solve errors like ‘struct iphdr’ has no member named ‘daddr’

I ran a program ( the link is - http://www.security-freak.net/raw-sockets/sniffer_eth_ip_tcp.c ) in my fedora core 5. On compilation , i get the following errors : [root@localhost ~]# gcc sniffer_eth_ip_tcp.c In file included from sniffer_eth_ip_tcp.c:12: /usr/include/linux/ip.h:97: error: expected specifier-qualifier-list before ‘u...

If I build and link an OpenGL application using only OpenGL ES 1.x calls, will it still work?

I am writing an OpenGL game which will hopefuflly be for both linux and iphoneOS, I basically want to be able to build using the OpenGL ES 1.5 headers and run it on my linux desktop. Can I do this? IE, I want to only use the subset of API calls common between OpenGL and OpenGL-ES. Doing the above and linking with normal libGL.a from my ...

what is my current desktop environment

how can i get from python that, what is my desktop environment i mean I like the result be gnome or KDE or else ...

How can my threaded image generating app get it's data to the gui?

A slow multiple precision implementation of a mandelbrot generator. Threaded, using POSIX threads. Gtk GUI. I've got a bit lost. This is my first attempt at writing a threaded program. I'm not actually trying to convert the single-threaded version of it yet, just trying to implement the basic framework. A brief description of how it wo...

linux virtual application: is this is possible?

I need some guidance from all the Linux experts out there. I would like to do the following. Please tell me if this possible. If it's not, please tell me why. I would like the user to interact with a touchscreen LCD connected to a Linux thin client PC. I want to use Linux Terminal Server to run a virtual linux application (with user int...

Run php script as daemon process

I need to run a php script as daemon process (wait for instructions and do stuff). cron job will not do it for me because actions need to be taken as soon as instruction arrives. I know PHP is not really the best option for daemon processes due to memory management issues, but due to various reasons I have to use PHP in this case. I came...

semop() returns error EINVAL

Hi, all I'm writing a program with two processes operate on a semaphore in the ping-pong mode. The program first calls semget() to acquire a semaphore of size 2, semaphore #0 is initialized with value 1 while semaphore #1 is initialized with value 0. The code is as following: #include <sys/types.h> #include <unistd.h> #include <stdlib....

static library install under Linux - should it be similar to dynamic library install?

I've spend the morning figuring out how in a makefile to do a shared library install under Linux. So that's fine; I now have my shared object and a pair of soft links to it, one of which was created by ldconfig and one by me. Now, I can also build my library as a static library. When I check /usr/lib, I see the .a files there just bei...

Why time command in linux has different output when I type it in shell than I use it in script?

Hey, The problem is when I use time in shell I get output like that: 1.350u 0.038s 0:01.45 95.1% 0+0k 0+72io 1pf+0w And when Im using it in script I get: real 0m1.253s user 0m1.143s sys 0m0.047s I mean why? And in shell script at the beginning I write: #!/bin/bash ...

Binary files and OS

Hello! I'm currently learning C++ and there are some (basic) things which I don't really know about and where I didn't find anything useful over different search engines. Well as all operating systems have different "binary formats" for their executeables (Windows/Linux/Mac) - what are the differences? I mean all of them are binary bu...

Get node distance (hops) in NUMA sistems

Is there any API/way to get the "distance" (called 'hops' in literature) between two NUMA nodes? I want to implement a memory allocation system that takes advantage of this (reuse memory from the nearest node, because the access is faster). Windows doesn't seem to have such a feature... and libnuma (under Linux) doesn't seem to have it t...

Starting processes at same time is slower than staggering; why?

I'm evaluating the performance of an experimental system setup on an 8-core machine with 16GB RAM. I have two main-memory Java RDBMSs (hsqldb) running, and against each of these I run a TPCC client (derived from jTPCC/BenchmarkSQL). I have scripts to launch things, so e.g. the hsqldb instances are started with: ./hsqld.bash 0 & ./hsqld...