Archive for the “General” Category


Sometimes you need to store information and settings that really doesn’t fit into any other SQL table, in these situations it’s nice to have a generic key-value driven preference system.

The preference system consists of multiple stores or trunks, each store is identified by a unique, arbitrary string and each store has multiple key-value pairs. The key-value pairs are dynamically created and flushed to database when the preference object is destroyed or when an explicit flush is requested.
Read the rest of this entry »

Comments 1 Comment »

This is an extensible object oriented wrapper around the MySQL and MSSQL (Microsoft SQL Server) interfaces provided by PHP. I’ve been using them for a while, it’s nothing new and no rocket science but others might find them useful.

Why do this at all? why just not stick with the API provided by PHP? It’s really nothing else than a more convenient way to interact with a SQL server and exposing it’s interface in a vendor natural way. Instead of writing mysql_query everywhere, one simply writes query.

Having a consistent interface will obviously help if you are using multiple types of database servers or someday would like to migrate to another SQL server (of course, weird and vendor specific SQL code could be a problem in this case). Other advantages are things like automatic disconnection on object destruction etc.

The foundation is an abstract class called SQLConnector and provides the basic interface. The class will connect to the database on creation and disconnect when the object is destroyed, it also implements __sleep and __wakeup so that it’s possible to serialize a SQL connection.

Because SQLConnector is abstract one can’t create objects directly from it, we’ll create child classes for each type of SQL-server we want to connect to. These objects will share the same interface and can be used interchangeably.
Read the rest of this entry »

Comments 1 Comment »


I recently had to replace the system disk in a FreeBSD machine (SMART self-tests failed, better be safe than sorry), this is my recipe for an “online” replacement. I did this in multi-user mode with all services shut down.

Read the rest of this entry »

Comments No Comments »


Network Administration with FreeBSD 7“Network Administration with FreeBSD 7″ (paperback, 280 pages) by Babak Farrokhi (farrokhi@) is an excellent walk-through style book that guides the reader to how to perform, both common and uncommon, administration tasks with FreeBSD, ranging from basic system configuration to firewall and network services configurations.

This book is divided into three sections, system configuration, network configuration and network services and together they cover a lot of ground.

Chapter 1 through 4 deals with basic system configuration ranging from partition layout, swap configuration, quotas, software RAID (GEOM framwork) to maintaining and keeping a system updated and secure, not only the FreeBSD system itself but also third party applications.

Read the rest of this entry »

Comments No Comments »

Thanks to the great work of Ganaël LAPLANCHE the hso driver and the hsoctl utility can, as of today, be installed through FreeBSD ports from comms/hso-kmod.

Existing users should note that hsod has been renamed to hsoctl and that the utility now properly updates resolv.conf.

Device IDs for the following devices have been added to the driver. However, this is completely untested, if you have any of these devices, please test and report if it works or not. Thank you.

  • Option GlobeSurfer iCON HSUPA
  • Option iCON 401

Comments No Comments »