Wednesday, November 24, 2010

Oracle SQL to split field

Ok so I needed to split a field in an Oracle DB into two fields in a new view I was creating. This is the SQL I used:

select entitlement_data,
  substr(entitlement_data,0,instr(entitlement_data,':')-1) ENT_NAME,
  substr(entitlement_data,instr(entitlement_data,':')+1,length(entitlement_data)) ENT_VAL
from arm_user_entitlements

Codeigniter - How to invoke Controller from command line

So I was digging around for a way to invoke one of my Codeigniter(CI) controllers from the command line. This was the solution I liked the most.

Create the following file in the root CI folder of your web server e.g. /srv/www/htdocs/

I called mine test.php. Also make the file executable (chmod a+x).

/* make sure this isn't called from a web browser */
if (isset($_SERVER['REMOTE_ADDR'])) die('Permission denied.');

/* set the controller/method path */

/* raise or eliminate limits we would otherwise put on http requests */
ini_set('memory_limit', '256M');

/* call up the framework */

Now just replace _PATH_TO_CONTROLLER_ with the path to the controller:

e.g. /armaudit/update_ad_names_res


Monday, November 22, 2010

XGR Webcam Ubuntu Skype

So a while ago I bought this cheap Webcam. Here's how I got it working with Skype on Ubuntu:

1) sudo aptitude install v4l-conf
2) Run skype with export command:

export LD_PRELOAD=/usr/lib/libv4l/; skype

And that's it! No compiling required.

FYI lsusb output is as follows:

Bus 001 Device 003: ID 0ac8:0321 Z-Star Microelectronics Corp. Vimicro generic vc0321 Camera

This is almost unreal - 10Mb ADSL Line installed

Can't hardly believe my eyes:

Monday, November 8, 2010

Novell RBPM Log Date via ECMAScript

Here how to log the date from a Log event in the workflow:

var myDate = new Date();