If your project consists of several developers working on different features your git log will probably look like this at some point:


You may find the dev branch in there but it requires some thorough reading. In fact, it reminds me of something;


Look ! Someone has made a Guitar Hero challenge of your git repository !

Introducing git rebase

Whilst not appropriate in any situation, git rebase command can greatly improve the readability of the repository.

Instead of merging and keeping the timeline from the earliest commit you branched off rebase fast forwards your changes to HEAD of your branch. This image has the same operations as the first image in this post, the difference is that before merging to dev I have performed a rebase on the dev branch.

Before merging the feature branches I performed a rebase on the dev branch and then merged my changes.


The dev branch (now called dev_with_rebase) is hopefully a bit easier to spot now.

It is important to know that git rebase can only be used on local branches as it rewrites the history of that branch. If parts of the branch has been merged or branched by other developers you will most likely have to apologise to them when you rewrite their history and ruin their changes.

The repository used in this showcase is located at https://github.com/oskaremil/git-ar-hero

With a number of different screen sizes and resolutions you can not rely on static pixel size alone. That is where Android uses dips, or Density Independent Pixels. The combination of screen size and resolution is measured in Dots Per Inch, that is, how many pixels can you fit on one inch ?

Each device falls into one of these categories:

Screen Shot 2015-09-11 at 23.12.50

When you read the Android developer guidelines on images you will see that Google always refers to dp when describing image sizes. To calculate the pixel size based on dpi you can use this conversion table :

Screen Shot 2015-09-11 at 23.15.03

What this means,- the pixel density on a XXXHDPI screen is four times higher than the pixel density on a MDPI device.

If you want to create a 48p sized icon the actual size in pixels is 48 pixels on a MDPI screen and 192 pixels on a XXXHDPI screen.

This might not be that useful to know by itself, but my next blog post will be about 9-patch images and knowing your dip is always a good start.

  1. Insert a USB key in the system.
  2. Open a command prompt.
  3. Use diskpart.exe to format the USB key as a single FAT32 partition spanning the entire key, and set the partition to active, as shown in this example.
    • diskpart
    • list disk (note what disk the USB drive is. In this example it is Disk 2…I)
    • select disk 2
    • clean
    • create partition primary
    • select partition 1
    • active
    • format fs=fat32 quick
    • assign
    • exit
    • Copy files from ISO to the USB key.

For NTFS bootable USB drives there are some additional steps.

  1. Follow the steps above, but when formatting use format fs=ntfs quick.
  2. Remount the USB key if diskpart ejects it.
  3. Insert a Windows Operating System installer ISO image.
  4. Open a command prompt as Administrator and navigate to the boot folder (mine ISO is mounted in J:) J:\boot>
  5. bootsect /nt60 G: (where G: is the drive letter of your USB key). You should see something like this:
    J:\boot>bootsect.exe /nt60 G:
    Target volumes will be updated with BOOTMGR compatible bootcode.

    G: (\\?\Volume{db89f4a5-faa0-11e4-825a-989096b10a0c})

    Successfully updated NTFS filesystem bootcode.

    Bootcode was successfully updated on all targeted volumes.

When creating a custom SSLSocketFactory or modifing the application in any other way is not an option

This example uses a Tomcat server listing for HTTPS connections on port 8443 but should work anywhere.

Retrieve the public key:

$openssl s_client -connect localhost:8443, then create a file localhost.pem that looks like


Import the key:

#keytool -import -alias localhost-selfsigned -keystore $JAVA_HOME/jre/lib/security/cacerts -file localhost.pem

When promted for password, write changeit

Restart JVM / Application server instance.

References: http://stackoverflow.com/questions/859111/how-do-i-accept-a-self-signed-certificate-with-a-java-httpsurlconnection

Ever created a lot of nice group policy items and come back to them a year or two later and think “Well where did I apply that firewall rule?” or “Where do I set up servers as Remote Desktop Session hosts?” ?

Powershell saves the day once again.

On a Domain Controller, import the AD Group Policy module

Import-Module GroupPolicy


Get-GPO -All | ForEach-Object {Get-GPOReport -Guid $_.Id -Path ($_.DisplayName + ".html") -ReportType HTML}

This gives you a nice collection of HTML files in the folder where you executed the script. They will contain the defined elements of your Group Policy item.

This tip is mostly useful in you have large generic GP items like “Windows Server” or “Customer Server”. I have learnt to keep my GP items simple-stupid, like “Firewall Allow TCP 80 Inbound” or “Allow Remote Desktop Connections”

Sometimes you just want a new firewall rule, you know that it doesn’t conflict with anything else and you want it simple.

The solution ? Powershell. Many other pages explain the powershell commands for managing the firewall in detail. For me, that made it harder to memorize what I was actually looking for, so I had to look it up the next time as well. So I decided to write down the simplest of all on this page.

This command will create a new firewall rule allowing incoming TCP connections on port 80 for all profiles:

New-NetFirewallRule -Name allowTcp80 -DisplayName "Allow Inbound Port 80" –LocalPort 80 -Protocol TCP

If you omit -Name a GUID will be assigned as the rule name. When you create a name yourself, it will be easier if you want to do more management from Powershell.