Usman Saleem Java HelloWorld
Powered By
AWS Cloud Computing
WildFly 1.0.0.Final - 1.2.8.Final
JavaServer(TM) Faces 2.2 API - 2.2.11
PostgreSQL 9.4.1
Uzi's Blog - Main - IT
If you are using MSysGit on Windows and love to use git from command line, try it together with this excellent console emulator ConEmu-Maximus5.
Following are some useful git setup commands.

Set up a global username to be used for all commits.

git config --global [your username]
Set up a global email to be used for all commits. Note that GitHub can associate multiple emails to your account. GitHub can aggregate statistics regarding your commits if you verify your email(s).
git config --global [your email] 
Set all branches to automatically rebase instead of merge. This produces a cleaner commit tree. This doesn't mean you must always rebase; it's just the way to go unless you have a good reason not to.
git config --global branch.autosetuprebase always	
Ensure that all new branches are set up to track its upstream branch.
git config --global branch.autosetupmerge true
Prevents Git from pushing changes in all matching local branches. It will only push changes in the branch you are currently in.
git config --global push.default current
Tell Git to not treat a file as having been modified if the only change is file mode executable bit. Useful for working on FAT/Windows systems.
git config --global core.filemode false
Improves git status performance considerably on Windows 7 x64
git config --global core.preloadindex true

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.


[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


For MSysGit, we need to convert paths using our own script. Create ~/ as

#! /bin/sh                                                                
function wpath {                                                          
    if [ -z "$1" ]; then                                                  
        echo "$@"                                                         
        if [ -f "$1" ]; then                                              
            local dir=$(dirname "$1")                                     
            local fn=$(basename "$1")                                     
            echo "$(cd "$dir"; echo "$(pwd -W)/$fn")" | sed 's|/|\\|g';   
            if [ -d "$1" ]; then                                          
                echo "$(cd "$1"; pwd -W)" | sed 's|/|\\|g';               
                echo "$1" | sed 's|^/\(.\)/|\1:\\|g; s|/|\\|g';           
wpath "$@"                                                                
Then in your ~/.gitconfig

[mergetool "ideamerge"]
cmd = "/c/Program\\ Files\\ \\(x86\\)/JetBrains/IntelliJ\\ IDEA\\ Community\\ Edition\\ 15.0.2/bin/idea.exe" merge `~/ $LOCAL` `~/ $REMOTE` `~/ $BASE` `~/ $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.