Java SAML2 + simplesamlphp

The use case is as follows: the java application (SP) must use simplesamlphp as an IdP. I tested 2 libraries, these are the required configs. SimpleSAMLphp Please note that the default install from ubuntu (16.04.2) of simplesamlphp (14.0) does not work with the php version installed (php7) because of this bug so I ended installing everything from the tar.gz provided (14.14). Onelogin This is the first library I tested. To install it:...

May 24, 2017 · len

Simple pomodoro script

This is a very basic pomodoro script I am using to avoid getting in a fixed position for hours at a time: <pre lang="shell"> #!/bin/bash UNIT=5 UNIT_CNT=5 PAUSE=6 notify-send -i clock "Starting interval..." for i in $(seq $UNIT_CNT); do sleep ${UNIT}m let c=$i*$UNIT notify-send -i clock "$c minutes" done (for i in $(seq $PAUSE); do let c=$PAUSE-$i+1; echo -n "Pause ${c}m"; echo -e '\f'; sleep 1m; done; echo -e '\f'; echo "Work";) | sm -

December 22, 2016 · len

Simple hdmi activate script

This is a simple script I bound to ‘meta+F7’ to activate a second hdmi display I am using: <pre lang="shell"> INTERNAL=eDP1 EXTERNAL=HDMI2 LOCK=/tmp/${EXTERNAL}.on disper -l | grep $EXTERNAL function on { disper -e -d $INTERNAL,$EXTERNAL -r 1920x1080,1920x1080 touch $LOCK } function off { disper -s -d $INTERNAL -r auto rm -f $LOCK } if [ $? -eq 1 ]; then #there is no EXTERNAL, run single command off elif [ -f $LOCK ]; then off else on fi

December 22, 2016 · len

The dark side of the force

I have been spending a lot of time lately working on a new javascript based interface. As with any js project we ended up with a lot of layers. For instance for a simple numeric input there are: the html input the kendo numerictextbox the aurelia-kendo-bridge wrapper our own wrapper to allow for some level of DRY The fun part is that we needed of course some functionality which did not existed in the kendo component (adding support for financial shortcuts: 10k => 10,000)....

December 22, 2016 · len

A few thoughts about http fetch

Fetch is the “de facto” standard now if building a new javascript code. Even if not yet supported by all browsers it is warmly recommended. There are numerous examples of usage but after reading a lot of them most of them seemed to miss the answer to my questions. These where: how to proper do error handling including having a default error handler which can be overriden how to do http POST?...

December 22, 2016 · len

Dynamic Aurelia

From someone used to developing in a “traditional” way, switching to a javascript framework is like crossing over to a different universe where the laws of physics do not really apply. They might seem similar but they’re not. Take inheritance for instance, the foundation stone of OOP and throw it down the drain. No more inheritance, everything is composition right now. Yet in time you will learn the new laws and adapt....

September 9, 2016 · len

Update NumericTextBox precision on the fly

As currency selection changed you naturally want to change the precision and format of a NumericTextBox which contains an amount in the given currency (damn JPY for not using the same precision as everyone else). At a first glance one might think this can be accomplished using computed properties and something like: <pre lang="javascript"> @bindable precision:number = 2; @computedFrom('precision') get step():number { return Math.pow(10, - this.precision); } @computedFrom('precision') get format():string { return "n" + this....

August 23, 2016 · len

Dispatch change events in custom components

This is the first post about Aurelia and the Kendo-UI-Bridge. It’s a brave new world for me. The goal was to create a custom component (which wraps a ak-combobox) and dispatch a change event in a similar way to the standard components (i.e ak-combobox, ak-datepicker, etc.). <pre lang="html"> <input ak-datepicker="k-value.two-way: model.date" k-on-change.delegate="onChange($event)"></input> For these components, the change event is dispatched after the model changes. In my component code I had initially wrapped the k-on-change from the base component and continued dispatching it....

August 10, 2016 · len

One week in JavaScript Hell

(or how one must lose all assumptions while starting to use JavaScript) For the past 8 years I’ve worked most of my time on a large ERP system. It was a lot of work and it’s a real system, a system used each day by thousands of people. Yet it is quickly becoming un-sell-able. One would think after almost 4k fixed bugs and years of improvements, the system works pretty well, it might be right, yet this argument fails in front of marketing arguments....

August 7, 2016 · len

Parsing network stream into http request/response

The need was to convert the network stream into clear text http request/responses while doing some decoding of the response body. For instance: request uri + queryString => response body Capture the stream – easy using tcpdump Filter the http stream – easy using wireshark with a tcp.port eq 80 filter Export http #1. using wireshark file -> export objects -> http. This works fine only for files. It does not work for POST requests....

June 22, 2016 · len