Quickest way to launch camera app on Samsung Galaxy Note 9

Camera is the mostly used app on smart phones, and its frequently required app. Having quick shortcut to launch the camera is always helpful. 
Samsung Galaxy Note 9 offers the always on display mode, where it allows to enable on screen home button.  Always on display also allows to set camera as a app to launch when double tap on home button. 

To enable this go to Setting -> Lock Screen -> Always on Display. On always on display settings choose action for "Double tap Home Button". To use this shortcut you should also select "Home button and clock" under Contents to shown on the same screen.

Enable/Disable always on Display on Samsung Galaxy Note 9

If you like to save your battery more, you can turn off the always on display on your Samsung Galaxy Note 9. 

To do so, go to Settings -> Display. Now on display settings scroll down to the end, you will find the always  on  Display  setting.
Other option is go to Settings. Now using search bar search for "Always on".

Here enable/disable always on display by using the toggle at the top. There are many settings for always on display. One more important is to customize the Always on  display timing. You can choose the time period when you want the always on  display  should be enabled. This is also another great way to save battery and still using  this feature.




Using Connect-standalone in Kafka with Kerberos cluster

Kafka Connect is a tool for scalably and reliably streaming data between Apache Kafka and other systems. It can also be used in secured Kafka environment. In Kerberixed Kafka installation also you can use the Kafka Connect utilities. 
You just have to provide the Java security config and Kerberos config as parameters to connect utils. 
Below command shows how can you specify the security properties to the connect-standalone.sh.
The command assumes that you are in the Kafka installation directory.


bin/connect-standalone.sh connect_standalone.properties source.properties -Djava.security.auth.login.config=kafka-jaas.config -Djava.security.krb5.conf=krb5.conf

Here the kafka-jass.config should specify the file path which contains the KafkaClient properties like below.


  KafkaClient {
 com.sun.security.auth.module.Krb5LoginModule required
 useKeyTab=true
 keyTab=""
 storeKey=true
 useTicketCache=false
 serviceName="kafka"
 principal="";
};

And the krb5.conf should detail about the KDC server property. Sample shown below.
  
        [libdefaults]
 renew_lifetime = 7d
 forwardable = true
 default_realm = example.com
 ticket_lifetime = 24h
 dns_lookup_realm = false
 dns_lookup_kdc = false
 default_ccache_name = /tmp/krb5cc_%{uid}
 #default_tgs_enctypes = aes des3-cbc-sha1 rc4 des-cbc-md5
 #default_tkt_enctypes = aes des3-cbc-sha1 rc4 des-cbc-md5

 [realms]
 example.com = {
 master_kdc = my.master.kdc.com
 admin_server = my.admin.com
 kdc = my.kdc.com
 }
If above command does not work of if Kafka connect is not able to use the kerberos config, then update the Kafka-run-class.sh file to pass these security parameters to exec command at the end "-Djava.security.auth.login.config=kafka-jaas.config -Djava.security.krb5.conf=krb5.conf"

How to avoid host key checking during ansible script execution

During execution of ansible playbook or ansible script on new remote host (which you have not connected via ssh so far) the script might fail with below error

 UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ----}

To avoid this you can set the environment variable (ANSIBLE_HOST_KEY_CHECKING) to disable host check before ssh during ansible script execution.

 export ANSIBLE_HOST_KEY_CHECKING=False

Now you can execute the ansible script.

HMaster not starting up, error "java.io.IOException: Filesystem closed"

HMaster fails to start with below error

util.FSHDFSUtils: attempt=0 on file=hdfs://krbhdfs/apps/hbase/data/MasterProcWALs/state-00000000000000000001.log after 1ms java.io.IOException: Filesystem closed.

There could be multiple causes of the error. 

If you are willing to loose the data, remove manually the logs under "apps/hbase/MasterProcWALs" and  "apps/hbase/WALs" from HDFS. After doing this start the HMaster service.  

Golang: Http POST Request with JSON Body example

Go standard library comes with "net/http" package which has excellent support for HTTP Client and Server.   In order to post JSON ...