Archive for the “Linux” Category

Lately I’ve worked with mongoDB which is a great NoSQL database. A tool which can come in handy is mongosniff, which comes with mongodb binaries. Mongosniff is something like tcpdump for TCP/IP.

On my Fedora 16 x86_64 System I’m running mongodb binaries available from mongodb, this allows me to easily run the version I want. But mongosniff didn’t worked right out the box for it. When starting mongosniff I got following error: mongosniff: error while loading shared libraries: cannot open shared object file: No such file or directory.  So this mostly means that libpcap isn’t installed, but this wasn’t the case as you can see in a minute.

My first try was to install libpcap for my system but this didn’t solve the problem. A lookup with ldd showed that indeed was missing for it: =>  (0x00007fffa30d2000) => /lib64/ (0x0000003ef0400000) => /usr/lib64/ (0x0000003655a00000) => not found => /lib64/ (0x0000003ef1000000) => /lib64/ (0x0000003654600000) => /lib64/ (0x0000003ef0000000)
        /lib64/ (0x0000003eefc00000)

A check if any libpcap module was available showed that a too new version was installed and that a symlink as was missing:

ls /usr/lib64/libpcap*
/usr/lib64/        /usr/lib64/
/usr/lib64/         /usr/lib64/
/usr/lib64/     /usr/lib64/

So creating a symlink for solved the startup problem: ln -s /usr/lib64/ /usr/lib64/ If you’re running a 32bit mongodb version you may check your /usr/lib to see if the required libpcap is missing. Don’t know if this problem still exists if you’re running mongodb from the offical repositoy.

Tags: none

Tags: 64bit, fedora 16, libpcap, mongosniff

Comments 1 Comment »

Just worked a bit with crontab to edit some no longer working cron job. But instead of typing crontab -e I had written crontab -r, without any warning or notice my crontab was dropped! What’s the logic behind that behaviour? Isn’t the normal, userfriendly way, that you have to confirm you want to drop something? All Programms I can remember want a confirmation for not saving data or dropping some file, or even for exiting.
I could life with the problem, if it wouldn’t be too likely to do the typo. But the keys are on a normal qwert(y|z) keyboard next to the other one, so a typo isn’t that unlikely. To avoid the problem I need to add the parameter -i to it, to be asked If I’m sure I want drop that crontab. Since when do I need to add additional parameter to have a higher “security” level? Normally you need to add parameters to avoid such behaviour not to initialize it.
But as I just see my crontab version is even the userfriendly one(on Debian 5 amd64), which offers such a parameter -i. The standard BSD(as on Debian 4 x86) one hasn’t this parameter nor does -r ask the user to confirm the operation.
Anyone knows why it behaves that way, I mean a multiliner crontab isn’t too nice to be lost by accident?

Tags: none
Tags: amd64, bsd, crontab, debian, x86

Comments 1 Comment »

Somedays it’s really hard to come along with Linux, it’s apps and tools. Recently I’ve tried to use AuthMySQL for authentication within a certain webfolder. To reach this, many trails and even more errors were needed :( .

The first point was to configure the module correctly, which isn’t that easy, as no post tells which version of AuthMySQL is used nor that there are two of them out, additionally it seems that the module can handle at least partially both directives, but later more.
I’ve searched quickly for some resources about how to configure AuthMySQL, some of the commands worked other didn’t. After several tries with extensive watching the apache error.log I finally managed to get the authentication running, upto the point of the used Encryption. The first try was to use MD5, but sadly the module did not support that value, although somewhere was talked about it (later I encountered it was for the other module). No Problem there’s another MD5 Setting, let’s switch to that one (Crypt_MD5), now AuthMySQL was working, but didn’t accepted the login details. A google search later I discovered that Crypt_MD5 uses a default Salt of 12 signs (or so) to encrypt the passwords, but my password is encrypted with md5, so no way to get it working. After a few searches why md5 isn’t working with my version of the module I found that forum entry which revealed that there are two modules out, which offer Authentication through MySQL.
But as I already supposed Debian doesn’t offer a package for the other module or I didn’t find it, anyway I got to the website of the other module and downloaded it’s source code. A fast lookup on howto compile and install modules for apache showed that I need to run apxs. But for my debian install the application wasn’t installed, you need to get some apache-dev package to install apxs. A few minutes later I’ve got a matching package and installed it. Next problem: while compiling apxs throws an error 65536, but luckily I found soon an patch, in this blog entry a patch is supplied so that the module was successful compiled under my linux installation.
The needed renaming of the module directives was done quickly and finally I got the authentication through MySQL working.
Alltogether it took a few hours to get that simple job working, anyway I’ve increased my knowledge about Apache and Linux, which isn’t that bad :)
Maybe this post will help the one or other to solve his problems quicker, as it contains quite well condensed errors and their solution.
If you want to use AuthMySQL get this version as it supplies in my eyes the best functionality. The easiest way to differ both versions is that one requires underlines within the directives and the other one doesn’t (the one which is linked).

Tags: none
Tags: apache, apxs, authentication, authMySQL, error 65536

Comments 1 Comment »

If you need to extract all mails from a single mbox file to seperate .eml files, take a look at this tool. I had recently the need to do so, and this tool was just perfect for it. It lets you choose which files to extract from mbox to .eml. In order to import a normal GNU/Linux (any *nix?) mbox into the tool, you need to set as file-ending .mbx. The Only restriction is that it can only handle western character sets, but not sure if that’s a big problem, aren’t most Emails still in latin?
To run the tool you need to have installed JavaRuntime 1.2 or higher

Tags: none
Tags: converter, eml, howto, mbox

Comments No Comments »

That’s maybe some common Error you’re receiving, when you’re new to find and the exec parameter. So I encountered the Problem as well.
After a short research within the man page of find the problem was found: ‘;‘ needs to be escaped with a Backslash ‘\‘. The look over to my commandline just showed that this was already the case. Now the internet was asked and most results just reveal the same thing: escape the ; with a Backslash.

Some hits later I found a german page where they told that it’s even required that the ‘\;‘ is separated from the previous commands with a space ‘ \;‘. So it’s not enough to write -exec command ‘{}\;‘ it needs to be -exec command ‘{} \;‘ . Well from my point of view some mistake which can be fast overseen, even more if you suppose that ‘{}\;‘ should work out nicely as it’s something which occurs often or everytime within the exec(at least these groups of signs).

Just something new learnt, and hopefully for a few people less headache.

Tags: none
Tags: -exec, find

Comments 3 Comments »

Bad Behavior has blocked 1250 access attempts in the last 7 days.