Usman Saleem Java HelloWorld
Powered By
JBoss Web/7.0.13.Final
JavaServer Faces API - 2.0.1.Final
PostgreSQL 8.4.20
Uzi's Blog - Main - IT

IntelliJ IDEA can be used as a git mergetool. If you have merge conflicts, launching git mergetool will launch IntelliJ IDEA. Following configurations are required in ~/.gitconfig . Update the path to idea.exe accordingly. For non-cygwin environments, use appropriate utility to determine absolute paths to $LOCAL, $REMOTE etc.

[mergetool "ideamerge"]
     cmd = C:/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ 13.1.3/bin/idea.exe merge `cygpath -wa $LOCAL` `cygpath -wa $REMOTE` `cygpath -wa $BASE` `cygpath -wa $MERGED`
     tool = ideamerge

Gruveo is an excellent anonymous Flash/browser based very simple video\audio chat website). Due to some weird bug in Ubuntu 13.10 which doesn't allow to change camera settings on individual website (such as Gruveo) through Flash settings popup, following workaround can be used through Flash's global settings.

Visit Select monitor with the eye tab (5th from the left), scroll down and select required site,, and then click radio button "Always Allow" (see following screenshot). Restart the browser and refresh gruveo again. The video chat is now working.


Recently I switched from Fedora 18 to Ubuntu 13.10 on my personal Acer Aspire V5 laptop (a wrong decision when I bought it - anyways...). There are two annoying issues when using both Fedora and Ubuntu on this laptop

Skype Dark Video Screen issue

Skype works on both Fedora and Ubuntu, however, there is this darn issue of dark video screen. This can be fixed by using guvcview and/or from command line tool uvcdynctrl as discussed by this guy in detail.

To ease up calling uvcdynctrl, you can create a launcher and add it to the dash. Follow this link to create desktop launcher in Ubuntu.

Fn keys Screen Brightness issue

The second issue is that screen brightness doesn't work, neither Fn Brightness (blue Fn - left right keys) nor from System Settings ... Brightness & Lock.

To fix the issue for System Settings, we need to add acpi_backlight=vendor to kernel command line parameter as part of grub config. For Fedora follow similar approach for grub2, following approach works in Ubuntu. Update GRUB_CMDLINE_LINUX in /etc/default/grub then run update-grub and restart.

To make the Fn key work again, try fixing /etc/acpi/ and update KEYS_DIR to KEYS_DIR=/sys/class/backlight/intel_backlight. This will allow Fn scripts to call the correct scripts instead of default values (which doesn't work anymore after using acpi_backlight=vendor). Restart to test it.

P.S. Ubuntu seems to have become more user friendly than Fedora (shh...don't tell my former colleagues back at Red Hat ;-))

Added which also points to (via CNAME) this application hosted on OpenShift, similar to my existing domain,

Updated my blog software to provide blog sections. Ideally these are suppose to be "blog categories" while categories are suppose to be "tags", since I already had used "categories", I named then as "Blog Section". For now, there is Experiments section. In future I am planning to add Urdu only sections etc.

New browsers are capable of showing custom embedded fonts which can be specified by using @font-face css tag. This allows web designers to use custom fonts which users don't need to install on their machine.

With custom font (Hussaini Nastaleeq):

پروگرامنگ کی دنیا میں خوش آمدید . یہ ایک اردو فونٹ ٹیسٹ ہے

Without custom font (System default):

پروگرامنگ کی دنیا میں خوش آمدید . یہ ایک اردو فونٹ ٹیسٹ ہے

If font style is same in all above samples, you are probably not using most recent browser capable of using font-face css style.

The custom font `Hussaini Nastaleeq` is a fork of Nafees Nastaleeq and is available here. The font is quite small in size (~ 300K) and browser should only download them if they are used by the page.

Tested on Linux (Fedora 17) on Chrome Version 22.0.1229.94 and Firefox Version 16.0.1, Opera (Windows) and Chrome (Windows). The best rendering is on Firefox though.

Numerous efforts are made to make this font work on IE 8 (which uses eot), however, still not able to make it work on IE8 unfortunately. The font is converted from ttf to eot on Linux using ttf2eot eot-utilities.

On JBoss side (if using JSF), you probably need to specify correct mime types for the font types. Here are the implementation details:

- web.xml:

- css file:

/* Required first for IE, no format */
  font-family: u; 
  src:  url("#{resource['fonts:nafees_riqa.eot']}");

  font-family: u;
  src: url("#{resource['fonts:nafees_riqa.ttf']}") format('opentype');

#nrfont {
  font-family: u;
  font-size: x-large;
- JSF template:

  <h:outputStylesheet name="uzi.css" library="css" />
- Applying font:

<div id="nrfont"> ... 

Just moved the datasource to use jta. Last time it was not working, looks like it started working now ... strange!
My blog project is now moved to maven build system from old Eclipse project. It is also now directly merged/synchronized with openshift git repository. In addition, I ended up writing my own RSS feed generator. Good stuff. Check out my github profile for the source code of this blog.

Time to jump openshift bandwagon, start using PaaS (platform as a service) and join Cloud. Why do I need it and what is Openshift?

My expertise area is JEE development, and I try to keep myself updated with the latest technologies by "getting my hands dirty" in coding. Some time ago, I implemented my own JEE based blogging implementation and decided to host it on resin and then followed by JBoss AS 7. The next step was to get a good, reliable and cheap JBoss hosting. I manage to get a cheap "VPS" host (around 10$/month), however, I wasn't happy with it. Too unreliable, too slow, much lesser resources. And I have to manage everything by hand, monitor JBoss, monitor my HSQLDB etc. Even though its raw power to control things as you please, but it gets too time consuming pretty soon.

Openshift comes to the rescue.

From offering perspective, at the moment, they provide free of cost developer preview (and I hope this will remain as it is). For a low volume site like mine, this was perfect. It provides me a ground to test with the latest and greatest technologies at no fraction of cost.

From technology perspective, I was able to setup one instance of JBoss AS 7 and PostgreSQL 8.4 within minutes, ready to push my changes via git. The main time spent was converting my blog data from hsqldb to PostgreSQL. Openshift provide hooks and access to manage all it with ease - a developer's dream. Pretty neat.

Now the scalability, assuming that my site becomes very popular, I can add another JBoss instance to scale my load (same goes for PostgreSQL instance), this is the true beauty of "PaaS".

So there you go, get yourself an Openshift account and start experimenting. Stay tuned for my further Openshift experiments :)

Are you looking for some really advanced Java discussions? then subscribe to The Java Specialists News letter manage by Java Champion Dr. Heinz Kabutz.

Of course, my all time favorite topic (which I always refer to my new class of Java students :-)) is Java programmers aren't born.