A blog about my daily tech ramblings.

Wednesday, 30 September 2015

Building a C/C++ project on Travis CI

September 30, 2015 Posted by Unknown , , No comments
Let's see how we can use Travis CI for building a C/C++ project on Travis CI. We'll use the consoleRadio C application which is used to stream Shoutcast Radio as an example

The .travis.yml file for the consoleRadio application looks like the following -

Installing a custom version of cmake
We can install a custom version of cmake in Travis CI, using the following script -

Building a library from source
A library/dependency in Travis CI can be build from source and installed on Travis CI env.  -

1. Let's build the mpg123 library from source and install it on Travis CI. In .travis.yml, we'll have the following config -


2. We'll create a bash script (installMPG123.sh) with the following content -

Tuesday, 8 September 2015

Friday, 4 September 2015

Thursday, 20 August 2015

Monday, 29 June 2015

Custom Error page in Gatein - jBoss Portal 6.1

June 29, 2015 Posted by Unknown , , No comments

Steps to add a custom error page in GateIn (jBoss Portal 6.1)


1. Create the error pages and place them in the $JPP_HOME/gatein/gatein.ear/portal.war/error/ directory.

For each error code that shall have its custom error page, add the element to the $JPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/web.xml file. This element specifies what page is displayed when the particular error code is returned. 

The sample code below ensures that the 404.html page is displayed when the 404 error code is returned.


Specify the error page locations as static resources in the controller.xml file. The code sample below demonstrates this configuration for the /404.html path. The file is located at $JBOSS_PORTAL/standalone/configuration/gatein/ folder.


Without this configuration, the portal tries to resolve /404.html as a name of a portal or another resource. It is therefore necessary to configure the error page locations as static resources. 


3. Add the Custom Portlet Request Handler in GateIn. (Ref :https://access.redhat.com/solutions/47434)

Build the project available at - https://github.com/martinweiler/CustomPortalRequestHandler and copy the jar to $JPP_HOME/modules/system/layers/gatein/org/gatein/lib/main

Edit the $JPP_HOME/modules/system/layers/gatein/org/gatein/lib/main/module.xml, and add the following to the end of element:

Edit $JPP_HOME/gatein/gatein.ear/portal.war/WEB-INF/conf/portal/controller-configuration.xml, and apply the following change:

4. Browse to any invalid link in jBoss Portal - http://localhost:8080/portal/invalid-link and see the custom error page. 


Note: To have a custom error page on the root (/) domain. Create a war file with the following web.xml or use the project - https://github.com/sachin-handiekar/jboss-utils/error/

Sunday, 21 June 2015

Friday, 20 March 2015

Saturday, 14 March 2015

Monday, 9 March 2015

Wednesday, 12 November 2014

Masking Sensitive Information using CXF Logging Interceptor

In this article we'll see how to mask/hide sensitive information when using CXF Logging IN/OUT Interceptor.

The solution was built to run on Apache Karaf / Fuse ESB, but a similar approach can be utilised to run the custom logging interceptor on other environments.


Alternative approach by parsing SOAP XML Payload : Source Code

Wednesday, 5 November 2014

Thursday, 23 October 2014

Wednesday, 27 August 2014

Wednesday, 13 August 2014

Wednesday, 5 February 2014

Using jRebel with Apache Karaf / Fuse ESB

February 05, 2014 Posted by Unknown , , No comments
Let's see how to use jRebel in Fuse ESB/Apache Karaf.

1. Download jRebel

2. Unzip/Install jRebel and activate it using the jrebel-activation.jar which can be found at JREBEL_HOME/bin.

 3. Add the javaAgent (rebel.jar) & enable the camel plugin in karaf.sh (Mac/Linux) or karaf.bat (Windows) by adding the following line -
 
%JAVA_OPTS% -javaagent:/path/to/jrebel.jar -Drebel.camel_plugin=true

Note :  -Drebel.camel_plugin=true will enable the jRebel plugin for Apache Camel.

Friday, 9 August 2013