Nginx Access Denied 403

01 Aug

Ran into a 403 error serving up a dynamic PHP script with a non-standard ending. My nginx config correctly passed it to PHP FPM however, the extension needs to be added to security.limit_extensions in the php fpm config.

No Comments

Posted in Nginx


jQuery Tools Tooltip Positioning Fix

22 Jun

I started using jQuery Tool’s Tooltip today and ran into a position problem. When using bottom center the tooltip would position offscreen when the target was too close to the edge of the browser.

The following ticket notes include a proposed patch

To quickly update the minified version with the proposed fix replace



g=="left"&&(f-=i); if(f<0){f=0}if(f+c.width()>$(window).width()){f=$(window).width()-c.width()} return{top:e,left:f}}


Trying to clone an uncloneable object of class stdClass

20 Jun

Ran into the following error recently:

PHP Fatal error: Trying to clone an uncloneable object of class stdClass in /wp-includes/cache.php

Adding the following to the PHP config fixed the error

; Adding for wp-e-commerce plugin
zend.ze1_compatibility_mode = Off

The ze1_compatiblity_mode is removed in PHP 5.3 so in that case I needed to wrap the clone calls with

function clone_it($data)
if(get_class($data) != ‘stdClass’)
return clone $data;
return unserialize(serialize($data));


Upgrading Ec2 Instance

10 Nov

Okay here’s the steps to upgrade an existing Ec2 EBS instance to a larger box

1) Right click on the instance and select Create Image (EBS AMI). This will take a few minutes
2) Go to your snapshots and right click on the new snapshot you just made select Create Volume from Snapshot
3) Create your new EC2 (larger) Instance.
4) Stop your new EC2 instance
5) Go to volumes, right click on your volume from step 2 and attach it to the new EC2 instance (/dev/sda1)
6) Detach the volume auto assigned to the new EC2 Instance
7) Start your new EC2 instance

No Comments

Posted in AWS, EC2


999 Tax Calculator

14 Oct

Okay, had some extra time on my hands and I was curious about the 999 Tax plan, so I wrote a calculator that gives you a good idea of your current tax burden vs a 9% sales tax + 9% income tax.


Posted in RIA


Setting up Blazeds ( Tomcat ) on Amazon Ec2 à la Ubuntu

08 Oct

We’ll throw in some lamp and phpmyadmin in too for good mesure. These are the steps I recently used to setup an Ec2 box for some dev…

Step 1: Java

#See if we have it already
sudo apt-get install sun-java6-jdk
#if no repo add it...
sudo add-apt-repository "deb lucid partner"
sudo apt-get update
# and try again
sudo apt-get install sun-java6-jdk

Step 2: Tomcat

sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples
sudo /etc/init.d/tomcat6 start
#modify user rights so you can use the webadmin gui
sudo pico /etc/tomcat6/tomcat-users.xml
sudo /etc/init.d/tomcat6 restart

#And if we want to autostart tomcat...

sudo pico /etc/init.d/tomcat

Insert the following
# Tomcat auto-start
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
exit 0

Now issue
sudo chmod 755 /etc/init.d/tomcat

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

Step 3: Blazeds

Copy up the blazeds WAR (assuming you’ve already downloaded blazeds on your localmachine)

scp -i ~/pathto/YOURPEM.pem blazeds.war ubuntu@someelasticip
sudo /etc/init.d/tomcat6 restart

Step 4: LAMP

tasksel --list-task
sudo tasksel install lamp-server

Step 5: phpmyadmin

sudo apt-get install phpmyadmin

Add the following line to /etc/apache2/apache2.conf:
Include /etc/phpmyadmin/apache.conf

sudo /etc/init.d/apache2 restart

Extra Credit: Xuggler for kicks

uname -m (verify which version of linux 32/64)

chmod a+x ./
sudo ./

sudo pico /usr/share/tomcat6/bin/
export XUGGLE_HOME=/usr/local/xuggler

No Comments

Posted in RIA


Streaming Thinkorswim’s CNBC video feed on Mac

03 Nov

I was a bit disspointined to find that when I moved to Mac, I lost the video stream within thinkorswim. To stream the video on Mac a few simple steps are required

1) Install VLC
2) Click on the icon to run the video externally (lower right corner)

No Comments

Posted in RIA


Pentaho Kettle Scheduled Task: Windows

08 Jul

To run a Spoon/Kettle job from the command line (convenient for creating a scheduled task) use the following syntax:

kitchen.bat /rep:”REPOSITORY NAME” /job:”JOB NAME” /dir:/LOCATION /user:USER_NAME /pass:PASSWORD /level:Basic

Replace /job: with /file: to run a job from a file if you’re not using a repository.


Posted in RIA


Warehouse Dashboard Architecture

22 Jun

If Flex has a sweet spot, dashboards would be it. The technology provides a richness that makes engaging UIs very easy to implement.

For those evaluating possible solutions, I’m showcasing a simple architecture for a data warehouse / dashboard project. This particular architecture encapsulates the extract / transform so those are the only steps (simple SQL=>CSV) that need to be recreated for each environment (client) that has different source systems.

Warehouse Dashboard Architecture

No Comments

Posted in RIA


Flex OLAP Take Two

15 Jun

After running some OLAP benchmarks it was obvious that a more scalable OLAP solution was needed.

After some quick searching and downloading, I’ve wired up a scalable Flex OLAP UI.

I downloaded and setup Mondrian from Pentaho for my OLAP server. Mondrian supports XMLA making integration easy.

I found a few Flex projects interfacing to OLAP via XMLA. The most robust appears to be Grebulon by the guys over at Sherlock Informatics

Mondrian setup required a few tweaks, as I’m running Java 6:

Added the following JARs
commons-discovery-0.2.jar (removed commons-logging)

Also set the following parameters in tomcat

Using the FoodMart as a reference, the setup was very straight forward.

I had to download the Grebulon source as the .swcs had hardcoded in a few references (PivotGrid) to the FoodMart datasource.

Commercially, I’d check out FlexMonster too 🙂

1 Comment

Posted in RIA


Flex OLAP Benchmarks

14 Jun

I ran some benchmarks for the OLAP components in Flex. The OLAP components allow you to perform you’re OLAP operations client side out of the box. You *can* utilize the SDK interfaces and move your processing to the backend, should you have too much data for the browser.

That said, the benchmarks below should help define the line for “too much data.”

Record Structure:

Grade:Number (Our measure)

Records / Processing Time (s)

1,000 / 3 sec
5,000 / 12 sec
10,000 / 22 sec
15,000 / 33 sec
20,000 / 43 sec

The processing times listed above are for the *client* side processing time. The data was loaded from the server before starting the benchmark.

I ran the benchmarks at various rollup depths (multiple hierarchies) which the components actually handled very well, the processing time was not significantly affected.

Extending the dataset to 125K+ records caused errors with the script timeouts occurring.

For datasets above 5-10K records, I’d suggest moving the processing to the server and passing the results to the UI. (assuming you’re looking to leverage the OLAP components as provided)


Posted in RIA


BlazeDS Custom Authentication

30 Apr

Here are the steps to roll your own BlazeDS Custom Authentication:

You’ll need to write a Java Class that implements the following class(es):;;

For example:

package com.dl.login;


import com.dl.login.UserVO;

public class LoginProxy implements LoginCommand,LoginCommandExt
public Principal doAuthentication(String username, Object attributes)

String password = (String)attributes;
//At this point you’d typically check against a datastore / LDAP / etc

if(username.equals(“riafan”) && password.equals(“mysecret”))
UserVO vo = new UserVO(username);
return vo;
return null;

public boolean doAuthorization(Principal user, List roles)

UserVO u = (UserVO)user;

if(u == null)
return false;

for(int i=0;i<roles.size();i++)
String role = (String)roles.get(i);
return true;
return false;

public boolean logout(Principal arg0) {
// TODO Auto-generated method stub
return false;

public void start(ServletConfig arg0) {
// TODO Auto-generated method stub


public void stop() {
// TODO Auto-generated method stub


public String getPrincipalNameFromCredentials(String arg0, Object arg1) {
// TODO Auto-generated method stub
return null;

In this example UserVO must implement

package com.dl.login;


public class UserVO implements Principal

public String [] groups;
public String username;

public UserVO(String username)
this.username = username;
// Make sure we apply the array groups (roles) this user belongs to at some point 🙂

public String getName() {

return this.username;

public boolean hasRole(String role)
for(int i=0;i<groups.length;i++)
return true;
return false;


Okay, now we just need to point the services-config.xml to our class

<login-command class=”com.dl.login.LoginProxy” server=”all”>
<!– a.k.a. true = per ‘tab’ authentication –>
<!– when set to true a browser refresh will also reset auth –>

<security-constraint id=”trusted”>


That’s it.

To actually secure a destination, use the remoting-config.xml

<destination id=”AlertProxy” >

<security-constraint ref=”trusted”/>


No Comments

Posted in Java


jQuery, Objective C

23 Apr

I’ve been diving into both as I’m looking to land some more iPhone projects. I’m really excited with the breath of fresh air the platform provides.

The big question this year….

WWDC 2010 or MAX 2010

MAX has been great, I’ve met some really great members of the community. For those of us who are Flex veterans, the conference seems a bit light, at least that’s the impression I’ve had the past two years.

Looking over the 2009 sessions of WWDC, I’m impressed, looks like a lot of great sessions.


No Comments

Posted in RIA


Debugging Apache

23 Apr

Problem: Apache quit working

Solution: Debug via gdb httpd2

Apache quit working after some network changes. The error log contained numerous

child pid 20038 exit signal Segmentation fault (11) lines.

Running gdb httpd2 along with a backtrace (bt) revealed the function / line of code throwing the error. The problem was quickly tracked down to the LDAP config (ldap.conf).

No Comments

Posted in Suse


BlazeDS Context.xml

23 Apr

While deploying a BlazeDS project, I ran into a small problem that the META-INF/context.xml was not being loaded by tomcat.

The context.xml has a simple JNDI datasource defined

Reading up on the tomcat docs it became obvious that tomcat was loading the Adobe BlazeDZ tomcat/conf/context.xml.

No Comments

Posted in Java


Java Soap Client

19 Nov

I ran into a short problem writing a Java SOAP client. I was using the Axis[2] wsdl2java class to generate my Java classes. The latest version of wsdl2java has omitted the -T parameter that’s used to specify the SOAP version for the generate classes. The client’s soap endpoint only accepts SOAP 1.1 (not 1.2) so this proved to be a problem. I downloaded an older version of Axis [1.4] so I could specify the -T 1.1 and build against SOAP 1.1.
Download hip hop songs mp3
Buy Levitra Vardenafil
This time around the generated Java classes are missing the soap envelope headers needed by the service. I found a great article covering this exact problem.

The only change needed from there was in the service stub…

The org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS needed to be changed to org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS. I was a bit surpised to see those constants after building w/the wsdl2java -T 1.1 argument.

Disclaimer: I’m not a SOAP *expert* so feel free to provide feedback 🙂

No Comments

Posted in Java


Glassfish LCDS Flex Up Next

19 Nov

It’s been a busy year getting a J2EE and Data Warehousing education. I’m wrapping up the ETL portion of a large Data Warehousing project. The next phase of the project is building a Flex front-end for the warehouse. I’m looking forward to using the Spark Architecture in Flex 4 for the UI, we should be able to generate some amazing UIs.


No Comments

Posted in RIA


Debug Server/Client LCDS Java Helloworld in Flex Builder

02 Sep


Install Flex Builder
Install LCDS Data Services
Install WTP in Flex Builder

Here’s a simple project that shows you how to create a simple Hello World for Flex + Java via LCDS. I’ll also show you how to debug the server [java] code as we move along.

File->New->Flex Project

  • For application server type select J2EE
  • User remote object access
  • LiveCycle Data Services
  • Create combined Java/Flex project using WTP
  • 01 Setup

    Select the target runtime. You will need to click ‘New’ to create one if none are available.

    02 Server

    Create a new target runtime if needed.

    03 Tomcat

    04 Tomcat

    05 Server

    Be sure to change your Output URL to match the LCDS [tomcat] config (defaults to 8400)
    06 Setup


    Again, make sure the URLs are using the correct port

    07 Debug Server

    Project->Properties->Flex Server

    08 URL Context

    Okay, are setup is complete now we’re ready to code.

    Here’s the MXML

    <mx:Application xmlns:mx="" layout="absolute">

    import mx.controls.Alert;

    private function sayHello():void

    private function onFault(event:FaultEvent):void

    private function onSayHelloToResult(event:ResultEvent):void
    { as String);


    <mx:RemoteObject id="testService" fault="onFault(event)" destination="helloDest">
    <mx:method name="sayHelloTo" result="onSayHelloToResult(event)"/>

    <mx:TextInput id="txtName" x="10" y="10"/>
    <mx:Button click="sayHello()" x="178" y="10" label="Go"/>

    Note the destination=”helloDest” line, we’ll have to configure a LCDS destination with this name in a few steps…

    Create a simple java class to test against:

    public class HelloWorld {
    	public String sayHelloTo(String name)
    		return "Hello " + name;

    And finally, we need to setup the destination

    To do so, edit \WebContent\WEB-INF\flex\remoting-config.xml, adding the following

    <destination id="helloDest">

    That’s it, now we are ready to test.

    Set a breakpoint on the on ‘return “Hello ” + name;‘ line in you’re java code.

    Launch the server in debug mode

    09 Server

    Now, launch the flex app [in debug mode if you want to debug the front end as well].

    Type your name in the input box and click ‘Go.’

    You’ll see your breakpoint being caught, both server [java] side and client side 🙂

    Flex Project Archive

    No Comments

    Posted in RIA


    Install WTP in Flex Builder

    02 Sep

    A quick walkthrough on installing the Web Tools Platform (WTP) in Flex Builder.

    Help->Software Updates->Find and Install

    Help Software Update

    Search for new features to install

    Search for New

    Select the [Europa] discovery site


    Select ‘Web and JEE development’

    You may need to click ‘Select Required’



    Posted in RIA


    AMFPHP Support for JSON POSTs

    24 Jul

    I found myself wanting to use JSON POSTs (not just GETs) with AMFPHP. Here’s the addition.

    Open up core\json\app\Gateway.php.


    $rawArgs = explode('/', $args);

    add the following

    if(isset($_POST) && count($_POST) > 0)
    $len = count($rawArgs);
    // Check for and remove [last] empty arg from URL '/' explosion
    if($len && trim($rawArgs[$len-1]) == "")

    // Append the POST variables

    The format of the post variables would be argNo=value
    Backend Function

    public function ResetPassword($username,$password,$oldpassword)
    // Code HERE

    Javascript POST parameters for the latter

    request.send("0=" + escape(username) + "&1=" + escape(oldpassword) + "&2=" + escape(newpassword));

    Hoping to jump into ZendAMF soon 🙂

    No Comments

    Posted in JSON