Monday, May 26, 2014

Dancer & Yeoman scaffolding... what needs changed

So here a quick one for integrating dancer and yeoman angular generation.
$ dancer -a myapp
$ cd myapp
$ yo angular myapp
$ rm public
# This is the main configuration file of your Dancer app
# env-related settings should go to environments/$env.yml
# all the settings in this file will be loaded at Dancer's startup.

# Your application's name
appname: "myapp"

# The default layout to use for your application (located in
# views/layouts/main.tt)
layout: "main"

# when the charset is set to UTF-8 Dancer will handle for you
# all the magic of encoding and decoding. You should not care
# about unicode within your app when this setting is set (recommended).
charset: "UTF-8"

# template engine
# simple: default and very basic template engine
# template_toolkit: 
serializer: JSON

template: "template_toolkit"
engines:
  JSON:
    allow_blessed:   '1'
    canonical:       '1'
    convert_blessed: '1' 
  template_toolkit:
    encoding:  'utf8'
    start_tag: '[%'
    end_tag:   '%]'
    WRAPPER: layouts/main.tt
    EVAL_PERL: '1'
 
public: app
auto_reload : true

# For session support enable the following line and see Dancer::Session
# session: "YAML"
plugins:
  DBIC:
    default:
      schema_class: Schema::PMI
      dsn: 'dbi:Oracle:sid=DDB00334;host=ddb00334.com;port=1526'
      user: 'XXXX'
      password: 'xxxx'
      on_connect_call: 'datetime_setup'

Wednesday, May 21, 2014

Mac OSX : VPN Checkpoint E75.01 - Connectivity lost with VPN Service

I spend several hours on this and found out the following.... it might be helpful... After a power failure I was unable to reconnect in fact the "connectivity with the VPN service is lost" popped up, and my settings under DockIcon->Connect To were not prompting me back anything. Then I took a look at:
$ cd "/Library/Application Support/Checkpoint/Endpoint Connect"
$ ls -lrt Tr*
-rwxr-xr-x 1 root wheel 9454272 Apr 5 04:51 TracSrvWrapper
-rw-r--r-- 1 root wheel 25766 Sep 5 11:10 Trac.config.bak
-rw-r--r-- 1 root wheel 0 Sep 5 13:10 Trac.config
$ 
Why was the active Trac.conf zero length? ... dunno why... so after shutting down the client from the DockIcon and executing
$ cd "/Library/Application Support/Checkpoint/Endpoint Connect"
$ sudo cp Trac.config.bak Trac.config
Restarted the EndPoint Security Client and problem solved! Greetz Bananaman! RESTART the Checkpoint Daemon
$ sudo launchctl start /Library/LaunchDaemons/com.checkpoint.epc.service.plist

Saturday, May 17, 2014

Cienega to JW Signlanguage App upload

Manual uploading all the contents for the JW Signlanguage App. For example I currently have 9 chapters downloaded thru the application, however I have the whole library on disk already.
 $ cd Cienega/Media/Bible/Chapter/
 $ cd 02\ Exodus
 $ ls -1 | perl -ne '@x=split/[\.\s]/; chomp;printf "mkdir -p ~/tmp/bi12_ASL_%s;ln  \"$_\" ~/tmp/bi12_ASL_%s/bi12_%s_%s_ASL_%02d_r240P.m4v\n",$x[0],$x[0],$x[0],$x[2] =~ m/(\w\w).+/,$x[3]; ' > x.sh
 $ . ./x.sh
The output looks like a staging area for the upload
host: 02 Exodus root$ cat x.sh 
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.001 Exodus 1.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_01_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.002 Exodus 2.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_02_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.003 Exodus 3.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_03_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.004 Exodus 4.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_04_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.005 Exodus 5.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_05_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.006 Exodus 6.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_06_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.007 Exodus 7.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_07_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.008 Exodus 8.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_08_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.009 Exodus 9.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_09_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.010 Exodus 10.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_10_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.011 Exodus 11.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_11_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.012 Exodus 12.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_12_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.013 Exodus 13.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_13_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.014 Exodus 14.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_14_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.015 Exodus 15.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_15_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.016 Exodus 16.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_16_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.017 Exodus 17.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_17_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.018 Exodus 18.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_18_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.019 Exodus 19.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_19_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.020 Exodus 20.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_20_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.021 Exodus 21.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_21_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.022 Exodus 22.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_22_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.023 Exodus 23.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_23_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.024 Exodus 24.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_24_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.025 Exodus 25.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_25_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.026 Exodus 26.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_26_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.027 Exodus 27.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_27_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.028 Exodus 28.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_28_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.029 Exodus 29.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_29_r240P.m4v
mkdir -p ~/tmp/bi12_ASL_02;ln  "02.030 Exodus 30.m4v" ~/tmp/bi12_ASL_02/bi12_02_Ex_ASL_30_r240P.m4v
Now use iFunBox to locate the User Application 'Signlanguage' and navigate to the Video's Section...

Next copy the ~/tmp/bi12_ASL_02 "folder" to your device...

After that close the *JW Sign Language App* and restart the app. Click on the book you transferred and all are there now.

Dancer / Template Toolkit : auto include javascript sources

Playing with Dancer and Angular I found out spliting up controllers in separate js files seems a clean thing to do... however I kept on missing js includes... let's automate this in your 'layout/main.tt' insert the following to include the js pieces automagically
....

[% PERL %]
my @files = ();
use File::Find;
File::Find::find({ wanted=>sub {   push @files, $File::Find::name if /^.*\.js\z/s; }}, 'public/javascripts', 'public/partials');
foreach my $js (@files) {
    $js =~ s/public\///g;
    print "\n";
}
[% END %]


...
..
Then make sure you configure the template engine in your 'config.yml' for TT.

template: "template_toolkit"
engines:
  template_toolkit:
    encoding:  'utf8'
    start_tag: '[%'
    end_tag:   '%]'
    WRAPPER: layouts/main.tt
    EVAL_PERL: '1'

Then my source gets generated like this (lines 35-43) :