linux

Does changing the order of class private data members breaks ABI

I have a class with number of private data members (some of them static), accessed by virtual and non-virtual member functions. There's no inline functions and no friend classes. class A { int number; string str; static const int static_const_number; bool b; public: A(); virtual ~A(); public: // got virtual a...

Invalid argument in sendfile() with two regular files

I'm trying to test the sendfile() system call under Linux 2.6.32 to zero-copy data between two regular files. As far as I understand, it should work: ever since 2.6.22, sendfile() has been implemented using splice(), and both the input file and the output file can be either regular files or sockets. The following is the content of sendf...

PHPBB3 Automod cant install

Anyone got any experience with this? i tried asking in the automod section on phpbb.com but waited along time to no reply. Basicly i upload the files to the needed directory and go to www.mywebsite.com/install/index.php it then comes up with a screen saying Install etc, and when i click next it returns a 404 error saying page cannot be...

CoreFoundation Lite on Linux and Android

I would like to use Apple's CoreFoundation library on linux and android. The source code is available here, but there is very little documentation on how to build it on Linux. As far as I could figure out, building is done through a script called BuildCFLite. I grepped for DEPLOYMENT_TARGET ./CFUtilities.c:#if DEPLOYMENT_TARGET_MACOSX ...

Connecting to Active Directory From Net::LDAP Perl

How to connect to Active Directory from Perl? I am using the Net::LDAP Module. Could you please give me some examples, that can help me get started. ...

Graphing the DAG generated by make?

My understanding is that when make executes, it generates a DAG internally to represent all the dependencies in the project. Is there a way to get at that DAG and graph it, say using something like graphviz? I'm using gnu make on Ubuntu 8.04. EDIT I just ran across these tools called mamdag and mamdot. They're supposed to work wit...

What is the difference between the various unistd.h under /usr/include in Linux ?

Under the /usr/include directory in Linux i entered the command: find -type f -name unistd.h which gave the following output: ./unistd.h ./linux/unistd.h ./asm-generic/unistd.h ./bits/unistd.h ./asm/unistd.h ./sys/unistd.h my question is, what is the purpose of each unistd.h, since there is only one definiton of that file in the single...

Optimize grep, awk and sed shell stuff

I try to sum the traffic of diffrent ports in the logfiles from "IPCop" so i write and command for my shell, but i think its possible to optimize the command. First a Line from my Logfile: 01/00:03:16 kernel INPUT IN=eth1 OUT= MAC=xxx SRC=xxx DST=xxx LEN=40 TOS=0x00 PREC=0x00 TTL=98 ID=256 PROTO=TCP SPT=47438 DPT=1433 WINDOW=16384 RES=...

Error in unzipping a file from a python script running as daemon

I am getting an error whenever i try to run following unzip command from a python script which is running as a daemon Command : unzip abcd.zip > /dev/null Error End-of-central-directory signature not found$ a zip file, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comm...

UDP sockets in ad hoc network (Ubuntu 9.10)

Hi! I am using BSD sockets in Ubuntu 9.10 to send UDP packets in broadcast with the following code: sock_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP); //sock_fd=socket(AF_INET,SOCK_DGRAM,0); receiver_addr.sin_family = PF_INET; //does not send with broadcast in ad hoc receiver_addr.sin_addr.s_addr ...

how can I kill a Linux process in java with SIGKILL Process.destroy() does SIGTERM

In Linux when I run the destroy function on java.lang.Process object (Which is true typed java.lang.UNIXProcess ) it sends a SIGTERM signal to process, is there a way to kill it with SIGKILL? ...

How to force tracker to re-index a folder?

I'm using the tracker indexing tool to search for and in files on my Ubuntu 10.10 amd64 system. Having recently added some of files into a single folder I wondered how to force tracker to re-index this folder so I would be able to perform search-queries on these files. Any ideas? A terminal command would be completely sufficient. ...

Cross-compiling a Python script on Linux into a Windows executable

I have a Python script that I'd like to compile into a Windows executable. Now, py2exe works fine from Windows, but I'd like to be able to run this from Linux. I do have Windows on my development machine, but Linux is my primary dev platform and I'm getting kind of sick of rebooting into Windows just to create the .exe. Any ideas? PS: I...

MySql UDF using shared library won't load

I am attempting to create a mysql UDF which will match a fingerprint using Digital Persona's free linux SDK library. I have written a trivial UDF as a learning experience which worked fine. However, when I added a dependency to Digital Persona's shared object I can no longer get MySql to load my UDF. I added includes to DP's headers a...

How do I manage a Python based daemon on Linux?

I have a working Python based program that I want to run as a daemon. Currently I'm doing it in a very hackish manner of starting it in with screen-d -m name session and killing it with pkill -9 -f name. Eventually I'm doing to have to move this to the better system we use here (thus I'm not willing to modify the program) but in the int...

Linux: Finer-grain control of INET listen socket binding?

I have interfaces lo, eth0, and eth0:1. progA creates a listen socket, and binds it to port p on INADDR_ANY. Simultaneously, I would like to use ncat to port forward, listening on the same port p, but only on the IP address associated with eth0:1. As expected, ncat is failing with "address already in use". What I would like to b...

When is a program limited by the memory bandwidth?

I want to know if a program that I am using and which requires a lot of memory is limited by the memory bandwidth. When do you expect this to happen? Did it ever happen to you in a real life scenario? I found several articles discussing this issue, including http://www.cs.virginia.edu/~mccalpin/papers/bandwidth/node12.html http://www...

What is the sequence followed by the Linux kernel to configure a device?

As I understood after reading the chapter related to The Linux Device Model in the Linux Device Drivers 3rd Edition, when a new device is configured, the kernel (2.6) follows more or less this sequence: The Device is registered in the driver core (device_register(), what includes device initialization) A kobject is registered in the de...

Bash/shell script - shell output redirection inside a function

function grabSourceFile { cd /tmp/lmpsource wget $1 > $LOG baseName=$(basename $1) tar -xvf $baseName > $LOG cd $baseName } When I call this function The captured output is not going to the log file. The output redirection works fine until I call the function. The $LOG variable is set at the top...

How to properly set URL rewrite rules for a php script to only accept POST

I have a rewrite rule for GET and POST: <LocationMatch "^/my/script/dir/?$"> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$ RewriteRule .* /resources/scripts/storage/admin/list.php Script POST /resources/scripts/storage/admin/create.php </LocationMatch> How would I modify it to only allow POST? ...