Seeing as SugarCRM is now truly Open Source, I decided to support them buy using SugarCRM as a contact database for a client.
This script extracts contact data from Sugar, and imports it into an LDAP tree, so that Thunderbird clients can use it as an address book.
It’s written for Sugar 5.0, and a suitable LDAP installation with the Mozilla Schema
A suitable VIEW for printing out a contact directory would look like:
CREATE OR REPLACE VIEW sugarab AS
SELECT c.id, c.description, salutation, first_name, last_name, title, department,
do_not_call, phone_home, phone_mobile, phone_work, phone_other, c.phone_fax,
primary_address_street, primary_address_city, primary_address_state,
primary_address_postalcode, primary_address_country, alt_address_street,
alt_address_city, alt_address_state, alt_address_postalcode, alt_address_country,
assistant, assistant_phone, lead_source, birthdate,
a.name AS account_name,
e1.email_address AS primary_email, e2.email_address AS secondary_email
FROM contacts AS c
LEFT OUTER JOIN accounts_contacts AS j ON (c.id = j.contact_id AND j.deleted = 0)
LEFT OUTER JOIN accounts AS a ON (j.account_id = a.id AND a.deleted = 0)
LEFT OUTER JOIN email_addr_bean_rel as eb ON (eb.bean_id = c.id AND eb.deleted = 0)
LEFT OUTER JOIN email_addresses as e1 ON (eb.email_address_id = e1.id AND eb.primary_address = 1 AND e1.deleted = 0)
LEFT OUTER JOIN email_addresses as e2 ON (eb.email_address_id = e2.id AND e1.id != e2.id AND e2.deleted = 0)
WHERE c.deleted = 0;
I’ve written several MediaWiki extensions, mainly for the CLUG Wiki. I don’t think any of them are particularly beautiful or maintained, but they are an essential part of our wiki, and might be useful to somebody out there…
Written for ClugPark, this extension displays all the images in a category together, as a gallery.
Usage: <category-gallery category=”PicturesOfPenguins” resizewidth=”50” width=”60” height=”60”></category-gallery>
Written for the Mailing Lists page, this extension displays mailman subscribe forms.
Usage: <mailman>http://lists.example.com/mailman/subscribe/foobar</mailman>
Written for the Contact a Committee Member page. I use my own simple Javascript that replaces innerHTML and href when you mouse over an e-mail link. I think it’s spambot-proof.
Usage: <email domain=”example.com”>foobar</email>
This is my script for migrating from Wordpress to Drupal. I know that there is already a migration script out there, but I still wrote my own for a few reasons:
So here it is.
Limitations and bugs:
wp-). This is messy, but while Drupal’s multi-database system is a cool and would be perfect, it’s unworkable when you are debugging. Errors seem to be hooked in drupal, and if you have a broken SQL query (for example) the error handling code hooks Drupal themes, which aren’t findable in the alternate-db world you are visiting.I’ve written a simple drupal module for including the Amatomu tracker.
It also supports the “What’s hot in South African blogs” tag-cloud, albeit via ugly javascript. I’m not a fan of all this javascript DHTML nonsense, but maybe they can be talked into providing a better API…
Todo list (Things amatomu does that I don’t care for, and thus haven’t coded):
Bashbot was originally an idea and bash snippet from Jonathan Hitchcock. I took it and bastardised it beyond imagination.
It’s a fully-featured, modular IRC bot.
The modules come in 2 types:
foo if it exists.# ^(.*) is( also)? (.*)$ will be executed if you try and set a factoid with “bot: Spinach is a vegtable”Included modules:
Back in the days of using dial-up, I wrote this firewall & QoS script. All in one and relatively easy to use for my specific use case. However it only really works for single machines or small networks routers with no DMZ and only one router.
Mozilla Address Book exports pretty terrible LDIF. To add these LDIF files to an LDAP directory, you must first run it through this utility. It will turn the LDIF into schematically correct LDIF. If will (hopefully) not maul data that is already in the correct format.
The scripts used to generate the album on my previous web site. The thumbnails are generated with Python (using ImageMagick’s convert) and displayed with a PHP script. This split approach keeps the scripts’ file-size down while not needing PHP to process any images, which keeps the speed up.
It’s very primitive, but can look quite nice, and is easily automated.
This script is for putting in cron on remote servers. It does a df and mails root if a filesystem is over 80% full. (Naturally configurable, too).
Never let a server in your control fill up a file-system slowly over time again.
A collection of scripts, utilities, and other bits and bobs.
Yes yes yes, I’ll put it in a public bzr repository some time soon. At the moment, I’ve got it in a private SVN repo, so you’ll just have to live with tarballs…