John Manko

stuff

Archive for September, 2009

G20 Police Attack Pitt Students

posted by john in Civil Liberties and have No Comments

A Case Against JPA

Here are some numbers for JPA generated queries verses a custom formatted one:

Based on the following query:

em.createQuery(" SELECT object(o) FROM INTERNALIPADDRESSBINDING o WHERE o.internalIpAddress.ipAddress = :ip AND o.macAddress.macAddress = :mac AND o.bindTimestamp = :bind ")

JPA generated query based on Entity classes and foreign keys:

SELECT t0.ID,
       t0.BINDTIMESTAMP,
       t0.MACADDRESS_MACADDRESS,
       t0.internalIpAddress_ipAddress
FROM   INTERNALIPADDRESSBINDING t0,
       MACADDRESS t2,
       INTERNALIPADDRESS t1
WHERE  ((
         ((t1.IPADDRESS ='4.4.4.4') AND (t2.MACADDRESS = 'ZZ:ZZ:ZZ:ZZ:ZZ:ZZ'))
         AND
         (t0.BINDTIMESTAMP = '2009-09-22 15:01:53.0')
        )
        AND
        (
         (t1.IPADDRESS =t0.internalIpAddress_ipAddress)
         AND
         (t2.MACADDRESS = t0.MACADDRESS_MACADDRESS)
        )
       );

 Empty set (20.53 sec)

My query:

SELECT t0.ID,
       t0.BINDTIMESTAMP,
       t0.MACADDRESS_MACADDRESS,
       t0.INTERNALIPADDRESS_IPADDRESS
FROM   INTERNALIPADDRESSBINDING t0
WHERE  t0.INTERNALIPADDRESS_IPADDRESS = '4.4.4.4'
   AND t0.MACADDRESS_MACADDRESS = 'ZZ:ZZ:ZZ:ZZ:ZZ:ZZ'
   AND t0.BINDTIMESTAMP = '2009-09-22 15:01:53.0';

 Empty set (1.35 sec)
posted by john in Java and have No Comments

Scripting SVN Repo Creation in Gentoo

I wrote a script to ease the creation of subversion repositories in Gentoo.  This script assumes the existence of three files:

authz         - Standard svn authorization file,
                located svn root conf directory,
                used for all repos.
passwd        - Standard passwd file, and
                is used for all repos.
svnserve.conf - Template file (points back to
                authz & passwd), copied to each
                newly created repo conf
                directory.

Here is the script:


#! /bin/bash
REPO_ROOT=/var/svn

echo -n "New Repository Name: "
read -e REPO_NAME

if [ "$REPO_NAME" = "" ]; then
 echo "A valid repository name must be entered.  Cannot create repository.";
 exit;
fi

REPO_PATH=$REPO_ROOT/$REPO_NAME

if [ -e $REPO_PATH ]; then
 echo "The file or directory ($REPO_PATH) already exists.  Cannot create repository.";
 exit;
fi

svnadmin create $REPO_PATH
cp $REPO_ROOT/conf/svnserve.conf $REPO_PATH/conf/
rm $REPO_PATH/conf/authz
rm $REPO_PATH/conf/passwd
chown -R svn:svnusers $REPO_PATH
chmod -R g+w $REPO_PATH
chmod -R o-rwx $REPO_PATH
/etc/init.d/svnserve restart

echo $REPO_PATH has been created!
posted by john in Linux and have No Comments

Back in Business

I finally set this site up again.  I hope I can keep the posts going (ie, time).  Look for weekly posting, especially re music and coding.  ;)  enjoy.

btw, I can’t stop sneezing.

posted by john in Thoughts and have No Comments