AWG Blogs

Wednesday, March 10, 2010

New myedb.com Domain for Framework

My first post to describe my MyEDB (My Entity Database) framework/CMS was placed on a holding site at netfirms:

This is my stand-in site to promote my concept of an "Entity Database" which is more than a relational database -- it gives the DB designer more flexibility in setting up and tearing down entities. I call it and the supporting code framework MyEDB for My Entity DB.



It does away with the traditional notion of entity relationships, and just focuses on pure entities, no relationships and the headaches they cause Database designers. The purpose for relationships has evolved from an ingenuous desire to model entities and their relationships into being merely an optimization device. My framework gets rid of the pretense. All optimization is stored natively through the use of single type tables.

One added benefit of this static architecture is that of being essentially a low level database per se, but one that is accessible to database designers.

Combine this with an elegant PHP-based RESTful MVC framework, and all that's left is defining inputs and outputs and coding them. And the effort of coding the input/output wire-ups simply scales to the level of your requirements -- i.e. pay per requirement.
Requirements can be defined as any of the following:
- Create a form for Inserting, updating, or deleting an entity (e.g. a customer record)
- Create a new view of the entity, purely for display (e.g. a product, or any entity. Examine one of your Excel spreadsheets rows for examples of "entities")
- Build search functionality for all your entities or only a subset



Copyright 2010

Wednesday, February 24, 2010

Connecting to Web Service with .NET

I needed to connect to a remote Java WSRF Web Service having access only to the WSDL and login credentials. At first I tried using Visual Studio 2008, but found it doesn't support old style WSE so well, so had to revert to Visual Studio 2005, over which I installed Microsoft WSE 3.0.msi.

I then pointed wsdl.exe at the https://url?wsdl to generate the proxy class, which I put in the App_Code folder of a test web project. wsdl.exe caused the Service class to inherit from System.Web.Services.Protocols.SoapHttpClientProtocol. I had to replace this with Microsoft.Web.Services3.WebServicesClientProtocol to get the proper authentication interface.

I then had to manually add a wse3policyCache.conf file to get the policy setting intialized (see https://www-secure.symantec.com/connect/forums/newbie-help-adding-security-header-request-object#comment-3625021).

Then, following guidance in http://bytes.com/topic/net/answers/560786-how-add-soap-header-soap-message, I added a SoapHeader class as well as an attribute to the target proxy class method.

The SoapDocumentMethodAttribute Action attribute was set to a blank string so I had to set that to the fully qualified url of the method from the WSDL, i.e. .../PortType/TheMethod.

In the client code, I then just had to call myproxy.SetClientCredential(..), then I could use the proxy class without problems.

Sunday, December 6, 2009

Resize Root Filesystem (/) with LVM

I made the mistake of accepting the default LVM options during a Debian Lenny installation, only to find out that the root / had filled up quite quickly, having started out with only around 300mb.

I wanted to transfer some free space from /home to /; so did as follows:

Select filesystem (e.g. /dev/mapper/debian-home ... 2.5G) to shrink from Filesystem column in df -h
I chose /home, so must be ssh'd as root; use 'who' command to verify no other users are logged in and have the home dir open.

Resize /home:
#umount /dev/mapper/debian-home
#e2fsck -f /dev/mapper/debian-home
#resize2fs /dev/mapper/debian-home 1G
select the corresponding volume to shrink from lvdisplay, i.e., the LV Name field (e.g. /dev/debian/home)
#lvreduce -L -1.3G /dev/debian/home

Extend root volume (/):
verify there is Free PE in vgdisplay. Check this value against the following lvextend command size option
To extend root volume (/), find it's coresponding name by looking up [LV Name] (e.g.
/dev/debian/root) containing 'root' in lvdisplay
then:
#lvextend -L +1G /dev/debian/root
resize the root file system. Find out the Filesystem name for the / mount by checking df
# resize2fs /dev/mapper/debian-root
check df to verify / is resized.
remount home:
#mount /dev/mapper/debian-home

Warning! This procedure is very risky. A full backup of the system immediately before resizing volumes is strongly advised on production systems. After the volumes are resized, run fsck to fix any errors.


refs:
ref for shrinking: http://www.linuxquestions.org/questions/linux-enterprise-47/shrink-lvm-without-dataloss-557746/
ref for extending /: http://www.linuxquestions.org/questions/linux-general-1/lvm-resizing-the-root-partition-361663/

Friday, November 27, 2009

Vertical List Oriented Columns with XSLT

The general idea is snake your list of items a set number of times down each column. So for a list of 7 items (XML siblings) and "n-rows" being set to 3, the resulting columns will look like this:



item 1item 4item 7
item 2item 5
item 3item 6

The XSLT code:
<xsl:variable name="n-rows" select="3"/>

<xsl:template name="recurse-rows">

<xsl:param name="index" select="1"/>

<xsl:param name="modrow" select="1" />

<tr>

<xsl:for-each select="/root/item[position() mod $n-rows = $modrow]">

<td>

<xsl:value-of select="value" />

</td>

</xsl:for-each>

</tr>

<xsl:if test="$index &lt; $n-rows">

<xsl:call-template name="recurse-rows">

<xsl:with-param name="index" select="$index + 1"/>

<xsl:with-param name="modrow" select="($index + 1) mod $n-rows"/>

</xsl:call-template>

</xsl:if>

</xsl:template>


sources for ideas:
http://www.stylusstudio.com/xsllist/200407/post30810.html
http://www.perlmonks.org/?node_id=518095

Sunday, November 15, 2009

Tips for when Setting up WordPress

Platform: Ubuntu 9.04/Apache 2

To set up WordPress as a virtual directory under a VirtualHost, add an alias to the host file in /etc/apache2/sites-available:

e.g.:
<VirtualHost 172.16.134.5:80>

Alias /blog/ "/usr/share/wordpress/"

ServerAdmin webmaster@localhost
DocumentRoot /home/wordpress/public_html
DirectoryIndex index.php

<Directory "/usr/share/wordpress/">

Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny

Allow from all

</Directory>

...

</VirtualHost>
The guide I used was https://help.ubuntu.com/community/WordPress.

Note: where you run the command "sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost" you MUST change localhost to the IP or DNS name if you are setting up the site on a remote server. The reason, as I found out the hard way (I use "localhost" at first) is that the script creates a file under /etc/wordpress called config-<hostname>.php. Then when you go to run the web installation routine, the application can't find the config file, unless you set <hostname> in the above command to match exactly the domain used in the URL. This is because the config file is constructed in /etc/wordpress/wp-config.php using $_SERVER['HTTP_HOST'].

Sunday, November 1, 2009

Dell Memory Errors with BIOS USB Support

My 2550 Dell Server was displaying memory errors. It would split the amount of memory available and errors would be produced in the Windows Memory Diagnostic utility starting with the MATS+ test. It also mentioned something about an invalid NVRAM configuration in the startup messages. Dell Diagnostic utility was not helpful. I started disabling all options in the Integrated devices section of the BIOS. I found that by disabling BIOS USB support, the memory errors went away. Go figure!

Saturday, October 17, 2009

Change Directory with String Replacement

Found out through experimentation how to change directories in the bash shell using sed string replacement. I need a quick way to switch from production to staging sites which have the same path but for the user home directory.

First I tried:

echo `pwd` | echo `sed -e 's/production/staging/' ` | cd


That didn't work.

Then I tried:

cd $(echo `pwd` | echo `sed -e 's/production/staging/' ` )


That worked. Go figure...