I’ve been busy, recent projects

I haven’t been posting lately because I’ve been busy 🙂 I really like to document what I’m working on though and frequently use this blog as a personal KB. Anways, I won’t go in huge detail but these are a few things I’ve been messing with.

Barcode detection from scan\faxed images using the amazing zxing

There is a port to .net so I used it like this



Dim img As New Bitmap(“c:\barcode2.jpg”)

Dim bufimg As

bufimg = New client.j2se.BufferedImageMonochromeBitmapSource(img, False)

Dim myreader As New oned.Code39Reader

Dim res As = myreader.decode(bufimg)

tb1.Text = res.getText()

Catch ex As Exception
End Try

(This was for detecting a 3of9 barcode)

Now that works for detecting one but I wanted to detect all of the barcodes on the page. What I ended up doing was slicing the image into a 1000 or so slices and trying to detect a barcode in each. This isn’t the most elegant solution but I can get nearly 100% barcode detection of even really very hard to read barcodes.

I’ve also been wanting to write for ever on the super awesome OS project openfiler. This project really impresses me!

If you have an ESX box this is a must have. We were always running out of space on our antiquated SAN (we are getting a new one hopefully soon) but in the meantime Slap in an openfiler SAN and you have virtually unlimited capacity. We mainly use it for hosting some of our craplications as well as test\dev systems. But this sucker is rock solid and I am contiunally amazed at it! Oh yeah it handles vmotion awesomely! If I were to install it again I might use one of rpaths installers. I wish I had enough time to mess around and enable replication! I wish it was easier and built in with a GUI! If someone were awesome they would make a disk1 and disk2 install of openfiler that would set up the replication for me! Anyways I can dream.

Also as far as vmware goes, I finally ran into the storage motion plugin! That sucker is great!

Trust me you want it!

Also vwire makes a nice tool for checking your vmotion configuration

Speaking of rpath, I recently installed their excellent version of mediawiki (the wiki that runs wikipedia)

This was I must say an awesome way to install mediawiki. First thing I did was donwload the ESX version

From here

Then, I copied those files over to the opefiler SAN! that thing is so awesome! using WinSCP

Then I added the virtual machine to the inventory by going to the configuration tab, storage, and then selecting my SAN, right clicking on it Browse Datastore, open the folder and then right click on the mediawiki-1.0-x86_64.vmx file.

I had to remove the NIC and then reinstall it in order to allow Vmotion.

Then I followed these instructions to expand the size of the virtual appliance.

I uploaded a new logo and then edited /srv/mediawiki/LocalSettings.php to

inclue$wgLogo = “http://MyWiki/wiki/images/e/e8/MyLogo.png”;

Next I had to get email to work.

I added this to the LocalSettings.php

$wgSMTP = array(
‘host’ => “”,
‘IDHost’ => “mailserver”,
‘port’ => 25,
‘auth’ => false,
‘username’ => “”,
‘password’ => “”

I also ran

pear update-channels
pear install --alldeps Mail

As spoken about in this post

Oh, to thumbnails to work I needed to

conary update ImageMagick –install-label –resolve

as spoken about in this post

Then the really fun part was getting the ldap authentication to work!

Download from

This post

and this post where helpful

but finally after reading the documentaiton I went with

require_once( “$IP/extensions/LdapAuthentication.php” );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( “nffc.local” );
$wgLDAPUseLocal = true;
$wgLDAPServerNames = array(“nffc.local”=>”myserver.nffc.local”);
$wgLDAPEncryptionType = array(“nffc.local”=>”clear”);
$wgLDAPProxyAgent = array(“nffc.local”=>”cn=hp scanner,ou=service accounts,ou=national users,dc=nffc,dc=local”);
$wgLDAPProxyAgentPassword = array(“nffc.local”=>”mypassword”);
$wgLDAPSearchAttributes = array(“nffc.local”=>”samaccountname”);
$wgLDAPBaseDNs = array(“nffc.local”=>”OU=National Users,DC=nffc,DC=local”);
$wgLDAPPreferences = array(‘nffc.local’=>array( “email”=>”mail”,”realname”=>”cn”,”nickname”=>”samccountName”));
$wgLDAPAddLDAPUsers = false;
$wgLDAPUpdateLDAP = false;
$wgLDAPMailPassword = false;
$wgGroupPermissions[‘*’][‘edit’] = false;
$wgShowIPinHeader = false;

Ok, once ldap was working then I started installing extensions.

The FCKeditor is a really nice extension. Get it from

To turn on font coloring make sure to

To enable buttons to change font color in the toolbar, do the following:

  • open fckeditor_config.js file (located inside of extensions/fckeditor directory)
  • uncomment two buttons:
  • save the file, clear your browsers cache
  • done!

A2: If you can’t see the third toolbar (for example with the text color buttons) you have to add this line below of the require_once command in the LocalSettings.php:

 $wgFCKEditorToolbarSet   = "Wiki";

I also installed the ImageMap Extension with


in the LocalSettings.php from

I wanted this so I could create a thumbnail for a PDF and then click on it to load the PDF itself.

This is how to make a thumbnail of a pdf you will need to install ImageMagick and then GhostScript

So now a user can upload the pdf thumbnail and then use the imagemap to link to the pdf.

I don’t know why mediawiki doesn’t have a builtin PDF thumbnail! This would be so nice!

I also added the google maps extension.

So then I wanted to get really fancy. I wanted to setup a bunch of stub articles from our ERP and populate them into our wiki.

So the first trick is using the excellent Altova Mapforce to pull out the data and then format it into flat text files for pywikipedia pagefrom file

The format is like this

Text here

Another text

It was pretty difficult to get the bot to login though. After reading a bunch I managed to get a working family file. The hard part was getting it to work with LDAP.

Here is mine

# -*- coding: utf-8  -*-

import family

# The official ABC Wiki.

class Family(family.Family):

def __init__(self):

family.Family.__init__(self)          = ‘WikiNational’
self.langs         = { ‘en’:         ‘WikiNational’, }
self.namespaces[4] = { ‘_default’:  u’WikiNational’,       }
self.namespaces[5] = { ‘_default’:  u’WikiNational Talk’,  }
self.ldapDomain        = ‘nffc.local’

def version(self, code):
return “1.6.1”

def path(self, code):
return ‘/wiki/index.php’

And my ismylang = ‘en’
family = ‘WikiNational’
usernames[‘WikiNational’][‘en’] = u’runaservice’


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: