Posts in 2017
-
JEE Container Managed Transaction
Monday, December 25, 2017 in Java
Categories:
less than a minute
Transaction Attribute Client’s Transaction Business Method’s Transaction Required None T2 T1 T1 RequiresNew None T2 T1 T2 Mandatory None error T1 T1 NotSupported None None T1 None Supports None None T1 T1 Never None None T1 Error Container Manager …
-
Java Time Difference
Sunday, December 24, 2017 in Java
Categories:
2 minute read
Time difference can be calculated by subtracting the milliseconds. And then milliseconds can be converted into different Units using TimeUnit. e.g. TimeUnit.MILLISECONDS.toSeconds(1000) will give 1 because 1 second equivalent to 1000 millisecons. …
-
JAXRS Rest Client
Wednesday, December 20, 2017 in Java
Categories:
less than a minute
Option 1 : Using interface proxy import javax.ws.rs.FormParam; import javax.ws.rs.HeaderParam; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.JAXRSClientFactory; import …
-
Java get hostname and IP address
Tuesday, December 19, 2017 in Java
less than a minute
Use java.net.InetAddress to get hostname or IP Address To get local hostname or IP import java.net.InetAddress; public class LocalIPGetter { public static void main(String[] args) throws Exception { InetAddress inetAddress = …
-
MySQL MariaDB Set utf8mb4 as default charset
Wednesday, November 22, 2017 in MySQL
2 minute read
By default charset is set to to latin1 and utf8. This can be checked by executing the following command MariaDB [(none)]> SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%'; …
-
Install Mariadb in Aws Ec2
Wednesday, November 22, 2017 in MySQL
Categories:
2 minute read
These steps can be used install mariadb on any Ubuntu based Linux system (local desktop, aws ec2, etc.) Install MariaDB Execute the following commands: curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash sudo apt install …
-
Git Squash
Friday, November 10, 2017 in Git
Categories:
less than a minute
Option 1 to squash last two commits git rebase -i HEAD~2 This will open editor where you can choose which commit to keep and which to squash. Also you have option to rewrite messages. Option 2 Reset and commit again: git reset --soft HEAD~2 git …
-
TomEE datasource password encryption
Thursday, November 09, 2017 in Tomcat
Categories:
less than a minute
Execute the following command to get the cipher: cd <<tomcat_home>>/bin tomee.sh cipher <<orginal password>> e.g. tomee.sh cipher Passw0rd This will give the cipher something like below xMH5uM1V9vQzVUv5LG7YLA== Use this cipher …
-
Ubuntu Netbeans.desktop file
Wednesday, November 08, 2017 in Ubuntu
Categories:
less than a minute
File: /usr/share/applications/netbeans.desktop [Desktop Entry] Encoding=UTF-8 Name=NetBeans IDE 8.2 Comment=The Smarter Way to Code Exec=/apps/netbeans-8.2/bin/netbeans Icon=/apps/netbeans-8.2/nb/netbeans.png …
-
Google Sign-in Developer Error
Saturday, May 27, 2017 in Android
less than a minute
Resolving google sign-in error: Status{statusCode=DEVELOPER_ERROR, resolution=null} Follow these steps: Go to play console: https://play.google.com/apps/publish/ Go to “Release Management” -> “App signing” Copy the SHA1 …