NoshBar's Dumping Ground

While that's not strictly true, I am overly paranoid about a bunch of things, opening a port on my firewall being one of them.
Not because I think SSH might have flaws, or the firmware on my modem, but because I'm a complete dufus with no self-esteem who doesn't trust himself, and I really don't feel like setting up my PC again, post internet-abuse.

Sooo, introducing (Helper)MonkeyBot, a little instant messenger bot that sits and worships and listens to your commands.
You also get a single-page PHP file to view the stored messages more purdy like.
MonkeyBot is open source and released under the ZLib licence, and is thus compatible with its dependencies, SQLite and Gloox (which uses GnuTLS).

It's a little program that logs into an XMPP account and listens for commands from another specified XMPP account (with a secret handshake phrase), and basically stores whatever you type to it (with a category), with the option of recalling/viewing/deleting/searching the data via IM, as well as downloading files for you so that they are ready by the time you get home.

An example dialog would be:
nashbor@gmail: Hey Asshat. What do you want? todo: Make Drumpster less poo. Stored. (MessageID: 1) download: Stored. (MessageID: 2)
...<time passes so slowly, slowly...> Download finished successfully: search:Drump* ID1: Make Drumpster less poo. Search finished.

MonkeyBot is super easy to compile on Ubuntu.
apt-get install gcc g++ libgloox-dev
change to the folder with the 7 or so MonkeyBot source files
compile sqlite with FTS4 support
g++ *.o *.cpp -lgloox -lpthread -ldl

On any other platform though... I came across some PITA's:

Not every version of Linux has a package manager, especially when trying to use embedded systems, so you're stuck compiling things for yourself.
I spent much too long trying to get libnettle to compile (WHY? Why can't you see the libnettle include files? The paths are PERFECT you piece of gangrenous armpit slug!), which GnuTLS needs, which Gloox needs.

For Windows however, you can get a precompiled GnuTLS DLL and DEF off the gnu website, which you can create a LIB file from, and link against in Visual Studio.
I thought it would be:
Compile Gloox, linking to GnuTLS. (of course, you have to remove some files from the solution and make a typedef before it will compile)
Compile MonkeyBot, linking to Gloox.
Make sure all the GnuTLS and Gloox DLL's are in the MonkeyBot.EXE folder.

But nooo, that gave me weird connection issues in Debug mode, or a crash in Release mode.
However, deleting all the GnuTLS DLL's from the .EXE folder made the Debug build connect just fine all of a sudden.
My random-unproved-and-probably-shitty theory is that the Debug Gloox.DLL includes the GnuTLS stuff, at least it should, given its size.
As for the Release mode crash... some std::string thing that I couldn't be bothered trying to find out about.

I'm considering rewriting the ChatEngine class so that it can use either Gloox or the XMPPFramework for OSX/iOS... with plans to run MonkeyBot and Apache and PHP and the viewing program on a poor abused jailbroken iPhone I got handed down to me by someone rich because I'm so 3rd world.

Anyway, it works for me for now, I discovered a crash when creating custom actions JUST as I was uploading the files to my site... so I guess v0.2 will be coming soon... annnd that you should probably take the time to learn about cron and watchdog scripts...
Lots to still be done on MonkeyBot, like remote shell, not sucking, reminders that do something actively...

Use it, don't use it, I don't care.
Rock on.

( 348 views ) permalink print article