rss search

next page next page close

Bamboo Trac Integration Plugin

Just finished version 0.1 of my BambooTracPlugin
It adds items from your Bamboo rss feed into your trac timeline.

It’s basically just a hacked up version of the HudsonTracPlugin but I’m still proud of it :P

Feedback is welcomed, not sure how active I’ll be with development though so if anyone wants to take ownership (or co-ownership) of it just let me know.


next page next page close

mysql schema…. finally

I know this has taken waaay to long to post. But here it is if anyone still wants it.

# CREATE DATABASE voip;
# USE voip;

#
# TABLE STRUCTURE FOR TABLE 'allocation'
#

# DROP TABLE IF EXISTS allocation;
CREATE TABLE `allocation` (
`allocation_id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(11) NOT NULL DEFAULT '0',
`site_id` INT(11) NOT NULL DEFAULT '0',
`extension` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY  (`allocation_id`)
) ENGINE=MyISAM AUTO_INCREMENT=58 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

#
# TABLE STRUCTURE FOR TABLE 'asset'
#

# DROP TABLE IF EXISTS asset;
CREATE TABLE `asset` (
`asset_id` INT(11) NOT NULL AUTO_INCREMENT,
`manufacturer` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`model` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`serial` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`mac` VARCHAR(12) COLLATE latin1_general_ci NOT NULL DEFAULT '000000000000',
`phone_ip` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`purchase_price` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`purchase_date` DATE NOT NULL DEFAULT '0000-00-00',
`purchase_from` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`invoice_number` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY  (`asset_id`)
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

#
# TABLE STRUCTURE FOR TABLE 'phoneline'
#

# DROP TABLE IF EXISTS phoneline;
CREATE TABLE `phoneline` (
`line_id` INT(11) NOT NULL AUTO_INCREMENT,
`phone_number` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY  (`line_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

#
# TABLE STRUCTURE FOR TABLE 'server'
#

# DROP TABLE IF EXISTS server;
CREATE TABLE `server` (
`server_id` INT(11) NOT NULL AUTO_INCREMENT,
`site_id` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`server_ip` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`server_hostname` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY  (`server_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

#
# TABLE STRUCTURE FOR TABLE 'site'
#

# DROP TABLE IF EXISTS site;
CREATE TABLE `site` (
`site_id` INT(11) NOT NULL AUTO_INCREMENT,
`site_name` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`street_number` INT(11) NOT NULL DEFAULT '0',
`street_name` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`city` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`state` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
`country` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY  (`site_id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

#
# TABLE STRUCTURE FOR TABLE 'user'
#

# DROP TABLE IF EXISTS USER;
CREATE TABLE `user` (
`user_id` INT(11) NOT NULL AUTO_INCREMENT,
`samaccountname` VARCHAR(100) COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

next page next page close

A few svn pre-commit hooks

I’ve recently been looking around for some pre-commit hooks for our subversion repositories. I figured that since I have them all up and running now, I might as well share them.
I can’t remember where I got all of these from, so if it’s one of yours, then I apologise. Feel free to contact me and I’ll give you credit for it.

Check for blank/empty commit messages and reject
This goes in hooks/pre-commit

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
SVNLOOKOK=1
$SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null || SVNLOOKOK=0
if [ $SVNLOOKOK = 0 ]; then
echo Empty log messages are not allowed. Please provide a proper log message. 1>&2
exit 1
fi
exit 0

Check that the commit message has a reference to a JIRA issue
This goes in hooks/pre-commit, it also uses ‘check_log_message.sh’ which can be found down further.

REPOS="$1"
TXN="$2"

# Check log message for proper task/bug identification
if [ -x ${REPOS}/hooks/check_log_message.sh ]; then
${REPOS}/hooks/check_log_message.sh "${REPOS}" "${TXN}" 1>&2 || exit 1
fi
exit 0

check_log_message.sh

#!/bin/bash

REPOS="${1}"
TXN="${2}"

SVNLOOK=/usr/bin/svnlook

LOG_MSG_LINE1=`${SVNLOOK} log -t "${TXN}" "${REPOS}" | head -n1`

if (echo "${LOG_MSG_LINE1}" | egrep '^[a-zA-Z]+[-][1-9][0-9]*[:]?[\s]*.*$' > /dev/null;) \
|| (echo "${LOG_MSG_LINE1}" | egrep '^[nN][oO][jJ][iI][rR][aA][:]?[\s]*.*$' > /dev/null;) \
|| (echo "${LOG_MSG_LINE1}" | egrep '^\[maven-release-plugin\][\s]*.*$' > /dev/null;)
then
exit 0
else
echo ""
echo "Your log message does not contain a JIRA Issue identifier (or bad format used)"
echo "The JIRA Issue identifier must be the first item on the first line of the log message."
echo ""
echo "Proper JIRA format:  'AAA-000'"
echo "JIRA regex: '^[a-zA-Z]+[-][1-9][0-9]*[:]?[\s]*.*$'"
exit 1
fi

Check that commit message is more than 5 characters long
This goes in hooks/pre-commit

REPOS="$1"
TXN="$2"

SVNLOOK=/usr/bin/svnlook
LOGMSG=$($SVNLOOK log -t "$TXN" "$REPOS" | grep [a-zA-Z0-9] | wc -c)

if [ "$LOGMSG" -lt 5 ]; then
echo -e "Please provide a meaningful comment when committing changes." 1>&2
exit 1
fi
exit 0

next page next page close

Dates in filenames

I came across this handy little batch file that will let you save a file as today’s date:

@echo off
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
    set dow=%%i
    set month=%%j
    set day=%%k
    set year=%%l
)
set datestr=%year%-%month%-%day%
echo datestr is %datestr%

set BACKUP_FILE=BACKUP_%datestr%
echo backup file name is %BACKUP_FILE%

Bamboo Trac Integration Plugin

Just finished version 0.1 of my BambooTracPluginIt adds items from your Bamboo rss feed...
article post

mysql schema…. finally

I know this has taken waaay to long to post. But here it is if anyone still wants it. #...
article post

A few svn pre-commit hooks

I’ve recently been looking around for some pre-commit hooks for our subversion...
article post

Dates in filenames

I came across this handy little batch file that will let you save a file as...
article post