Friday, January 24, 2014

Set svn to ignore auxiliary LaTeX files globally

There are certain intemediary files (.aux, .log, etc.) that are best not put under version control because they change very often. In SVN, to stop svn status complain about them, you can add those patterns to the global-ignores property in your ~/.subversion/config file (or "%APPDATA%\Subversion\config" on Windows).

If you just want to set it for one repository, you can use svn propedit svn:ignore . or svn propset as explained here.

PS: Read Configuration Area Layout in the red bean book or this SO question for more information.

Wednesday, January 8, 2014

tcsh/csh tips for the bash user

The official shell in FreeBSD is tcsh/csh, and in Debian/Ubuntu, it's dash or bash. The back-story is, these fall into two families of shells: Ones derived from the original bourne shell (sh) which include bash, ksh etc. and those derived from the C shell which include csh, tsch, etc. These use slightly different commands for setting environment variables etc.
  • You can check the type of shell you are using by the commands echo $shell or echo $0
    Note: $0 is actually the name of the running process. It will return the name of the shell or shell script according to the context. Read more on that here: http://www.tldp.org/LDP/abs/html/othertypesv.html#CHILDREF2
  • You can get a list of all the shells installed on your system by typing
  • cat /etc/shells 
  • ..and also change the default one to a different shell (if you have the permissions) using the command chsh.
  • If you are moving from bash to tcsh, you will find your .bashrc file (or even .bash_profile, .profile) doesn't work anymore. It's the ~/.cshrc file in tcsh instead. And for setting environment variables, rather than the old command.. PATH= $PATH:$HOME/bin; export PATH you will have to use something like.. 
  • setenv PATH ${PATH}:${HOME}/bin
     Note the missing '='.

More related reading:

Tuesday, September 24, 2013

Region & time zone settings in Linux Mint 15 Cinnamon

For some weird reason, in Linux Mint 15 Cinnamon, Region & city selection boxes have been removed from Cinnamon Settings > Calender. You can set your region during installation, but if you make a mistake during installation or travel between timezones with a laptop then indeed there seems to be no easy way to configure this. This issue has been reported already as an issue. In the meantime, you can change it from the command line.
Display available time zone options:
timedatectl list-timezones
Set the time zone:
timedatectl set-timezone
Or you can just use..
sudo dpkg-reconfigure tzdata

Sunday, June 30, 2013

[Quick Tip] BPEL Correlation, Load tests in soapUI and Groovy

In WS-BPEL, the concept of Correlation is used to maintain references to instantiated business process instances with the help of business-application-specific data (like social security numbers, Order IDs) in the exchanged messages. When you're testing these BPEL processes with asynchronous service invocations you might have come across the problem of maintaining a unique correlation value across the multiple test steps of a BPEL process (because the back-end services this asynchronous service calls made to, are not available in the test environment). Here's a quick tip to achieve this via a Groovy script in soapUI. In the beginning of your test case have a Groovy script test step which does the following: It creates a random integer value and assigns it to a property. So you can make use of this property in the SOAP request where the correlation set is initialized, and all the other SOAP request test steps which uses the same correlation set, as follows:

Thursday, May 9, 2013

Namespaces in E4X

ECMAScript for XML (E4X) extends JavaScript with support for XML-based data manipulation by introducing new XPath-like language features. Apache ODE/WSO2 BPS has an E4X Assign activity to ease Rich Data Manipulation in BPEL using E4X. To use namespaces in E4X queries, follow the syntax namespace::localName in place of a normal element specifier. Eg: To extract the hotelRequestId from the variable submitHotelReviewRequest which has a format similar to the following: You can use a js snippet as follows:
Related Links:
https://developer.mozilla.org/en-US/docs/E4X/Processing_XML_with_E4X
http://www.taval.de/publications/INPROC-2009-25/
http://stackoverflow.com/questions/922668/e4x-grab-nodes-with-namespaces

Friday, May 3, 2013

Few tips to setup a Linux UPnP/DLNA Media Server for iPad

For converting files to the Apple compatible format, I use arista-transcode
..or ffmpeg
In AVI/MKV files, sometimes there are AVI files with 2 audio streams,  the first and default track is not in your preferred language, but the second track is. This causes problems when you view it in a player that does not support multiple audio tracks. Here's how to delete the unwanted audio tracks and making one the default audio, using the MKVtoolnix package.

First, get the audio track info so we know which one to keep.
mkvmerge -i input.mkv

Then copy only selected audio tracks to the new file with --atracks option. Here 2 is the Audio Track ID we need to keep.
mkvmerge -o output.mkv --atracks 3 input.mkv

My preferred Media Server is MediaTomb.
mediatomb -e wlan0
Here I have used the wireless network interface to bind to, so all the other devices on the Home WiFi can connect to this server.
It also supports transcoding to perform format conversion of your content on the fly allowing you to view media that is otherwise not supported by your player. If you like to go ahead with tinkering the configuration, find it here: ~/.mediatomb/config.xml and change 'no' to 'yes' on the '<transcoding enabled="no">' line. But for mediatomb and iOS devices it's hard to find the right configuration for live transcoding. So I'm sticking to the above manual conversion.

Sources:
http://superuser.com/a/77582/52620
http://www.videohelp.com/tools/MKVtoolnix
http://www.techradar.com/news/digital-home/media-servers/build-a-transcoding-upnp-media-server-923345

Wednesday, April 17, 2013

How to use Hibernate as the persistence layer for Apache ODE/WSO2 BPS

Note: In order to run ODE/BPS under Hibernate, you will have to include external dependencies (and accept Hibernate LGPL license).

By default, Apache ODE/WSO2 BPS uses OpenJPA as the persistence layer, but also includes implementation for Hibernate as well. For switching to Hibernate add the following system propety. (For WSO2 BPS you can do it via $CARBON_HOME/bin/wso2server.sh)
-Dode.persistence=hibernate \

Make sure you have copied the required Hibernate jar to $CARBON_HOME/repository/components/lib directory.
If you are getting errors at server start up, check whether the necessary tables have been automatically created by Hibernate. If not, you can use a script to manually create the tables (similar to the following used for MySQL DB)  Note Hibernate has slightly different database schemas and also uses "BPEL_" prefix in table names instead of "ODE_" prefix.
If you are using a DB other than Apache Derby, H2, MySQL or Oracle, and having trouble resolving the DB dialect from the database product name, you can manually set the HIBERNATE_DIALECT in org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl class. For implementation details see dao-hibernate and dao-hibernate-db modules in Apache ODE source.

Related discusson on "Switch to the hibernate DAO layer" mail thread.