Technologies

I will mostly write about following

Java, J2EE, GWT(Google Web Toolkit), HTML, Javascript, Linux, MacOS, Queue, Docker, Cloud hosting, Auto Scaling, Web, Ad Serving etc.

GWT youtube player

Created GWT wrapper over YouTube Iframe player api refer Usage Inherit GWT module <inherits name="open.pandurang.gwt.youtube.YouTube" /> Before you start using YouTube iframe library one need to load them first, so as to load the library first you need make call to YouTubePlayer.loadYouTubeIframeApi();. This will ensure library is loaded, you can register to recieve event when library is loaded completely by using ApiReadyEventHandler for more details on the same refer YouTube documentation geting started section. [Read More]

GIMP Add border and shadow to a layer

To Add border to layer follow below steps Select the layer then use menu Layer -> Transparency -> Alpha to Selection. Select -> Border Border Selection window will appear. Enter the size of border you want to show. Layer -> Transparency -> Intersect with selection Edit -> Fill with FG/BG Color You need to select required color from FG/BG color panel. Select -> None With above steps you will be added border to your layer. [Read More]

Call GWT Java Code from JavaScript

It is very easy to call Aavascript from GWT java code by making use of JSNI. But calling GWT java code from external Javascript of JSNI is little tricky and it becomes more complicate when you have to call instance method of a GWT java class. For more detail refer GWT official document (refer) Call static class method from JavaScript GWTCode.java package open.pandurang.client.view; /** * @author Pandurang Patil 18-Mar-2014 * */ public class GWTCode { public static String hello(String name) { return "Hello " + name + "! [Read More]

Check Cron executed or not.

Many a times it happens we schedule some cron job to get executed, we do check as well whether command gets executed properly or not. And even though we tried the command your cron fail to execute. There are two possibilities either cron is not configured properly or some how command is failed. Now in this case how do we check if cron is getting executed or not. Does it gets logged some where when is last cron executed? [Read More]

Setup firewall with UFW on ubuntu

It is very easy to setup firewall using UFW on ubuntu server. First you need to check if you have UFW installed on your machine. If it is installed you can check the status of the same using $ sudo ufw status Status: inactive In case it is installed but not enabled. If it is not installed then it will throw command not found error. If it is active then it will show out put similar like below output. [Read More]

Download Oracle JDK / JRE from console / command prompt

Many a times we have to download JDK/JRE on remote machine through console. In most of the cases we tend to download it on our desktop and then upload it to the remote machine through SCP as the download link from Oracle website are not directly accessible. You need to first accept the agreement so that you get the download link. The link is not usable to download it using wget directly. [Read More]
Java  JDK  wget 

GWT access style defined inside .ui.xml within corresponding .java file

Some times you may want to access styles defined inside your Sample.ui.xml file which you want to access/use from within Sample.java widget class. You can do that by defining an interface which extends from com.google.gwt.resources.client.CssResource and declaring method with name matching exactly that of required style class name that you have declared inside ui.xml. Refer below code. Sample.ui.xml contents <src path>/com/pandurang/client/ui/Sample.ui.xml <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui'> . . . <ui:style type="com.pandurang.client.ui.Sample.MyStyle"> .domain { margin: 0 auto; width: 730px; } . [Read More]

Configure Nginx for SSL

You need to have private key and CA signed certificate (to test you may generate your own Self signed certificate) to configure your nginx to serve request over SSL. Add following lines into your nginx.conf file and make required changes to point ssl_certificate to location of your certificate in this configuration it is server.crt (if you copy your .crt and .key file into <nginx home>/conf folder . In that case you can specify only file name other wise you need to specify absolute path of a file). [Read More]

configure nginx to redirect user from HTTP to HTTPS

When you are going to sever all requests over SSL then in some cases you need to only serve requests over SSL. While doing that you may have to disable port 80 so that all the requests will be only served through SSL. But in that case if user hits your url with http, user will see page not found error. Instead you can enable your port 80 and redirect all requests to https url with following configuration. [Read More]

Generate self signed SSL certificate

Follow below steps to generate self signed certificate: You need to first generate your own private key. $ openssl genrsa -des3 -out server.key 1024 Generating RSA private key, 1024 bit long modulus .......................++++++ .......++++++ e is 65537 (0x10001) Enter pass phrase for server.key: Verifying - Enter pass phrase for server.key: With above command it will generate private key, while doing that it will ask you to enter pass phrase which will make this private key useful who knows this pass phrase. [Read More]