Nov
04
2009
0

Using SSHBlack.pl for a smokeless server

When I recently checked my logs for this server I was greeted by an endless list of lines containing:

[sshd] Failed password for illegal user student from 204.11.235.142 port 50208 ssh2
[sshd] Illegal user student from 204.11.235.142
[sshd] Failed password for illegal user student from 204.11.235.142 port 50339 ssh2
[sshd] Illegal user student from 204.11.235.142

Even though my password is of the ‘hard to bruteforce’ variety this still isn’t a situation you want to have happening on a constant basis. It makes the server give up smoke, and when the smoke gets out of the computer, it stops responding.

The solution is SSHBlack which works as a log analyzing daemon that scans for failed login attempts. After a previous set limit of failed attempts it blocks the IP address from connection for a set duration (in my case, forever).

I get about 4 blacklisted ip’s a day now and server activity is much lower.

Written by Robert van der Linde in: random thoughts |
Aug
20
2009
0

A new round of (book related) webservice wrappers

As I continue to try and catalog my book collection I keep hitting some walls. One of these is that ISBNdb.org catalogs mostly English editions of books and their corresponding ISBN’s. Seeing that my library is only 60-70% in english this leaves me with a lot of (dutch) editions that I cannot process using ISBNdb.org.

Luckily for me ISBNdb.org isn’t the only dealer on the block. WorldCat has their xISBN service that performs roughly the same as ISBNdb.org and they have a larger collection of ‘foreign’ editions in their database. If that doesn’t work I can use the ‘ThingISBN’ service from LibraryThing to retrieve a list of other editions for my selected book, get an english edition and then search using that ISBN. To use these in PHP i’ve created wrappers for both Services. I also migrated the documentation for ISBNDBService. Information for all of these services can be found at: http://webservices.linde002.nl/

Written by Robert van der Linde in: code | Tags: , ,
Aug
17
2009
0

Documentation update for ISBNDBService

As I have been getting a lot of questions about the functionality of ISBNDBService recently I’ve decided to upgrade the documentation somewhat. Besides the API documentation I have also compiled a small site that explains the basic behavior of the library and shows some common examples.

Written by Robert van der Linde in: code | Tags: , ,
Jul
12
2009
0

Why “the IT crowd” is… special

As a lot of people outside of IT like to say. We IT people are “different”. As a recent post by Catherine Devlin stated:

Given a choice between spending an hour doing a task manually, or spending three hours writing a program to do it automatically… a geek will write the program, every single time.

Combine this with the “10 Ways IT employees are different from everyone else” by Ericka Chickowki and you get a glimpse into this special group of employees.

(more…)

Written by Robert van der Linde in: random thoughts |
Jun
22
2009
0

Iterating in PHP5

The chatter about PHP’s SPL has been picking up recently which is a good thing. SPL has been available for quite some time and a lot of people still don’t know about the awesome features it brings to the table. The problem I have however is that a lot of examples about the iterator interface don’t show off the power that it brings to the table.

For our example we are going to take a look at a simplified version of my ISBNDB wrapper which uses this technique to transparantly page the results received from the webservice. (more…)

Written by Robert van der Linde in: code | Tags: , ,
Jun
07
2009
4

Isbndb.com PHP wrapper

I was working on indexing my bookcollection this weekend and while looking at the stacks of books I had lying around I decided I wasn’t, under any circumstance, going to enter all the data from those books (ISBN/ISBN13, Author, Title, Summary, Publisher, etc) by hand.

So after googling around a bit I found ISBNDB.com which is, in essence, google for books. They crawl the internet searching for bookrelated data and then indexing it themselves. They really do store alot of information about books and cross index that so you can technically search for the categories an author fits in and then search other authors that fit in those same categories.

The best part is though, that they publish all this information through a free webservice. So I wrote a wrapper for this webservice that exposes all the methods and results used that can be used in PHP. If you are interested you can download it here. Documentation here.

Code after the jump:
(more…)

Written by Robert van der Linde in: code | Tags: , , ,
Jun
03
2009
0

Trees and tribulations

I was working on a small webapp a couple of months ago that would help my girlfriend manage her research data on horses. Amongst her wishes was that she would be able to view the selected horse’s family tree.

Now this is a specific wish that contains two generic problems.

  • Retrieving hierarchical data from flat dataset
  • Representing hierarchial / genealogical data in a browser

More info after the jump:
(more…)

Written by Robert van der Linde in: code, random thoughts | Tags: , , ,
Jun
02
2009
1

All work, no play?

So I recently started another assignment for my employer which entails a big webapp for the government (queue black helicopters). As you would expect for government work the office is based in The Hague, which means another x weeks of hotels. Luckily for me, instead of a industrial/commercial area without a lot going on like my last assignment this is in a big city. And even luckier, The Hague is near the sea. So after a long day of cursing at technology idiosyncrasies I left promptly at 4P.M to work on my tan.

After the jump you can see the life in IT isn’t always that bad.

(more…)

Written by Robert van der Linde in: random thoughts | Tags:
May
25
2009
2

PHP and the IMAP idiosyncrasy

So recently i’ve started working as a senior software engineer on a PHP project that, amongst a load of other things, shows the content of an IMAP mailbox. As this is a generally easy technology to work with, you’d think it would be coded sooner than you can spell idiosyncrasy (which is still a long time, if you’re me).

Problems arose on the horizon when I started noticing that PHP’s imap functions would dump any E_NOTICE’s they stumbled upon directly to STDOUT, in this case, the table that I use to display the email messages. Another fun fact is that searching and sorting using nested and/or criteria doesn’t work in one go. My colleague created a workaround by searching for each nested criteria, storing the resulting msg_id’s and then performing some filtering magic on the results.This, however, is not wat you want on a high-traphic website, each query to a database, or an imap mailbox, is one too many.

So a solution must be found.

I was made painfully aware after a day of searching that alternative IMAP libraries/components/widgets/whatchamacallits are very rare and rarely of sufficient quality, this problem is increased because of the number libraries that are (PHP4-styled) OO wrappers around the existing imap_ functions.

The solution we arrived on was using PEAR’s Net_Imap module, it is a very usable module based on Net_Socket that uses PHP’s socket functions to access the imap server. It gives you a lot of control of the communications you do with the server while keeping it high-level enough so you don’t have to type each command yourself. Sorting and searching is made pretty easy and using UID instead of Message ID is supported as well.

It does however have a couple of downsides:

  • Under the hood, it uses the PEAR::isError mechanism to check for errors and handle appropriatly, we needed it to throw Exceptions to make sure it fit within the existing architecture.
  • It’s for PHP4
  • It doesn’t support ‘Peeking’, which makes highlighting messages as unread a distinct displeasure
  • It’s for PHP4
  • The response parser that handles the raw response from the server has a bug that adds [int][int]} to the start of the body content, we noticed this when we wanted to display attachments and the base64_decode kept failing
  • It’s for PHP4
  • UID instead of MID isn’t supported in all functions
  • It’s for PHP4

After a nice couple of days of rewriting I got it to work without E_STRICT or E_NOTICES but it really needs a good update. I’m working on it in my free time but it would be nice if a developer or two with some more spare time would look at it.

And for frak sakes… Port it to PHP5 already, it’s been a while sinds they released it. Oh and if you’re at it anyways, go poke the PHP dev’s to give their old C libaries and update as well, functions just outputting notices is quite a bad practice.

Written by Robert van der Linde in: code | Tags: ,
Dec
04
2008
0

Lightning talks – The higlights

At the end of each day there is an hour of lightning talks, 5 minutes per person and you can ramble on about whatever strikes you.

The highlights for me were the geek-my-ride talk and the SQL magic talk.

Geek my ride consists of a Mazda R8 (or something sporty like that) that has an inbuilt computer, 3G data uplink and some usb ports that connect to the engine management system. The cool thing was that he SSH’ed into his car while giving the talk. He could read out Voltages, Air intake, speeed, etc.

The second cool thing was the guy who used bizarre SQL to create fractals as a resultset and solved the travelling salesmen problem using pure SQL.

Written by Robert van der Linde in: random thoughts |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes