« August 2005 | Main | October 2005 »

September 29, 2005

HTML character entity code list

Numeric Code Character Entities

Posted by pj at 09:27 AM

September 28, 2005

Blojsom: A Java based blog system that implements the Atom API

http://wiki.blojsom.com/

Posted by pj at 10:57 AM

September 23, 2005

First crack at finance database LDS

-- phpMyAdmin SQL Dump
-- version 2.6.4-pl1
-- http://www.phpmyadmin.net
-- Host: localhost
-- Generation Time: Sep 23, 2005 at 08:32 PM
-- Server version: 3.23.56
-- PHP Version: 4.4.0
-- Database: `fwl_finance`
-- 
-- Table structure for table `category`
-- 
CREATE TABLE category (
  category_id int(10) NOT NULL auto_increment,
  category_label text NOT NULL,
  category_description text,
  category_is_parent tinyint(1) NOT NULL default '0',
  category_parent_id int(10) NOT NULL default '0',
  PRIMARY KEY  (category_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
-- 
-- Table structure for table `recipient`
-- 
CREATE TABLE recipient (
  recipient_id int(10) NOT NULL auto_increment,
  rec_organization_name text,
  rec_person_title enum('Mr','Mrs','Miss','Ms','Dr','Professor') NOT NULL default 'Dr',
  rec_person_first_name varchar(255) NOT NULL default '',
  rec_person_last_name varchar(255) NOT NULL default '',
  rec_contact_address text NOT NULL,
  rec_email varchar(255) NOT NULL default '',
  PRIMARY KEY  (recipient_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
-- 
-- Table structure for table `transaction`
-- 
CREATE TABLE transaction (
  trans_id int(10) NOT NULL auto_increment,
  trans_record_created_date timestamp(14) NOT NULL,
  trans_record_last_modified datetime NOT NULL default '0000-00-00 00:00:00',
  trans_date datetime NOT NULL default '0000-00-00 00:00:00',
  trans_category_id int(10) NOT NULL default '0',
  trans_amount_in int(10) NOT NULL default '0',
  trans_amount_out int(10) NOT NULL default '0',
  trans_payment_type enum('Invoice','FBA credit card','Cash','Cheque') NOT NULL default 'Invoice',
  trans_date_invoiced datetime default '0000-00-00 00:00:00',
  trans_date_paid datetime default '0000-00-00 00:00:00',
  trans_payment_recipient_id int(10) default '0',
  PRIMARY KEY  (trans_id),
  KEY trans_category_id (trans_category_id,trans_amount_in,trans_amount_out)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
-- 
-- Table structure for table `event`
-- 

CREATE TABLE `event` (
  `event_id` int(10) NOT NULL auto_increment,
  `event_title` text NOT NULL,
  `event_description` text NOT NULL,
  `event_start_date` date NOT NULL default '0000-00-00',
  `event_end_date` date NOT NULL default '0000-00-00',
  `event_record_created_date` timestamp(14) NOT NULL,
  `event_type` enum('meeting','conference','training','item purchase','hospitality') NOT NULL default 'meeting',
  PRIMARY KEY  (`event_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

Posted by pj at 08:33 PM

Broke my GRUB

I ran the Fedora up2date tool on my desktop against kernel packages today and broke GRUB so my machine wouldn't boot.

I used the installation disk to boot from, fired up rescue mode and typed the following:

grub
grub> root (hd0,2)
grub> setup (hd0)
grub> quit

Once I rebooted, this fixed things.

Posted by pj at 01:08 PM

September 14, 2005

Python Library for reading and writing CSV stuff

12.20 csv -- CSV File Reading and Writing

Posted by pj at 02:48 PM

Parsing binary data with Python

4.3 struct -- Interpret strings as packed binary data

Another alternative library is also available:

- http://www.nightmare.com/software.html

Posted by pj at 11:49 AM

September 12, 2005

Starting MySQL with max_allowed_packet size setting

mysqld_safe --max_allowed_packet=1012MB

Sets to a GB. Onyl works in MySQL 4.0 or greater.

Posted by pj at 09:42 AM

September 09, 2005

File partition problems with Fedora Core 4 / Windows XP dual-boot installation

I've been having some difficulty getting Grub to see my Windows NTFS partition after I used partition magic to resize it and then DiskDruid as part of the Fedora install.

Grub wasn't seeing the Windows partition.

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           7       56196    6  FAT16
/dev/sda2               8        9729    78091965    7  HPFS/NTFS
/dev/sda3   *        9730       19388    77585917+  83  Linux
/dev/sda4           19389       19452      514080   82  Linux swap / Solaris

This was because the Windows partition (/dev/sda2) was flagged as hidden.

Grub therefore didn't write this into the grub.conf file on installation

I used parted to switch the hidden setting off:

[root@fba-pc04 dev]# parted /dev/sda
GNU Parted 1.6.22
Copyright (C) 1998 - 2005 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Public License for more details.

Using /dev/sda
(parted) print
Disk geometry for /dev/sda: 0.000-152587.890 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031     54.909  primary   fat16
2         54.910  76316.594  primary   ntfs        hidden
3      76316.594 152084.091  primary   ext3        boot
4     152084.092 152586.123  primary   linux-swap
(parted) set 2 hidden off
(parted) print
Disk geometry for /dev/sda: 0.000-152587.890 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031     54.909  primary   fat16
2         54.910  76316.594  primary   ntfs
3      76316.594 152084.091  primary   ext3        boot
4     152084.092 152586.123  primary   linux-swap
(parted)

I then changed the /boot/grub/grub.conf file as follows and it all now works:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,2)
#          kernel /boot/vmlinuz-version ro root=/dev/sda3
#          initrd /boot/initrd-version.img
#boot=/dev/sda3
default=0
timeout=20
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4smp)
        root (hd0,2)
        kernel /boot/vmlinuz-2.6.11-1.1369_FC4smp ro root=LABEL=LINUX rhgb quiet
        initrd /boot/initrd-2.6.11-1.1369_FC4smp.img
title Fedora Core-up (2.6.11-1.1369_FC4)
        root (hd0,2)
        kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=LINUX rhgb quiet
        initrd /boot/initrd-2.6.11-1.1369_FC4.img
title Windows XP
        map (hd0,0) (hd0,1)
        map (hd0,1) (hd0,0)
        rootnoverify (hd0,1)
        chainloader +1

This was quite useful for explaining the syntax in the grub.conf file:

- http://www.tldp.org/HOWTO/Linux+Win9x+Grub-HOWTO/proc.html#AEN54

Posted by pj at 11:33 AM