Thursday, December 5, 2019

Data Analytics With Google

Google provides it's own data analytic APIs that can trace web site activities. Every web site must include

1. Create dashboards which provide you transaction reports
2. Traffic monitoring / Page visists on each pages
3. Analysis on different customer segments
4. Trace key word searches
5. Many more...


You can use bellow steps to integrate your Gmail account and Google Analytics with your web site.

Step 1. Login to your Gmail account

Step 2. Then browse Google Analytics page. Ex : https://analytics.google.com/analytics/web/




Step 3. Mention your analytic name











 Step 4. Select your traffic source. For me it is a web site. So i selected web












Step 5. Link you web site. Now you will be getting your web site tracking ID















Step 6. Accept Terms and Conditions











Step 7. Find your script segment. You have to embed this script on the top of your header page.












<!DOCTYPE html> <html> <title> <head> <meta charset="UTF-8"> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-154006826-1"></script> <script>   window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());   gtag('config', 'UA-154006826-1'); </script> <script> function sendData(){     var paged_products_array = [];     var name="iphone-x";     var amount="100.00";     var id="105031";     var brand="apple";     var category="mobile";     var varient="x";     var qty="1"; var obj = {       name : name ,       id : id,       price : amount,       brand: brand,       category: category,       variant : varient,       quantity : qty }; paged_products_array.push(obj); var ecomOb = { products : paged_products_array }    var impressions = JSON.stringify(ecomOb); console.log("Analytics Remove Parameters-->"+impressions);             dataLayer.push({ 'event': "productDetail",        'ecommerce': {        'detail': JSON.parse(impressions)      }  }); } </script> </head> </title> <body> <input type="button" value="send-analytics" onclick="sendData()"/> </body> </html>



Testing Email Services

This Linux terminal command set can be used to test email services

Step 1 : Connect to correct network. This will allow you to connect the service

Step 2 : Open Linux terminal and run bellow command. Then press enter key
             telnet email-service-host 25
             email-service-host is the IP address or hostname of email service


Step 3 : Type bellow content. Then press enter key
              EHLO MAIL

Step 4 : Type 'from' address. Every email service will configure with relevant from mail address. Then press enter key.
              mail from:noreply@abc.com

Step 5 : Type 'to' address. Type your email address. From and To email address should be in same domain. Then press enter key
              rcpt to:test@abc.com            

Step 6 : Type 'data' and enter to enter email content. Then press enter key
              data

Step 7 : Type the email content. Then press enter key
              This is a test mail.

Step 8: Press enter key

Step 9: Type '.' to send the mail.

Step 10: Check your mail



Sample Output


dev64@dev64 ~ $ telnet mailhost.yourdomail.lk 25
Trying 192.168.4.35...
Connected to mailhost.yourdomail.lk.
Escape character is '^]'.
220 yourdomail.lk ESMTP Smtpd; Fri, 6 Dec 2019 09:51:46 +0530
EHLO MAIL
250-yourdomail.lk Hello , pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 209715200
250-DSN
250-STARTTLS
250-DELIVERBY
250 HELP
mail from:noreply@yourdomail.lk
250 2.1.0 noreply@yourdomail.lk... Sender ok
rcpt to:saminda.konkaduwa@yourdomail.lk
250 2.1.5 saminda.konkaduwa@yourdomail.lk... Recipient ok
data
354 Enter mail, end with "." on a line by itself
Test mail content
.
250 2.0.0 xB64Lkmg026459-xB64Lkmh026459 Message accepted for delivery
 

Sample Output


dev64@dev64 ~ $ telnet mailhost.yourdomail.lk 25
Trying 192.168.4.35...
Connected to mailhost.yourdomail.lk.
Escape character is '^]'.
220 yourdomail.lk ESMTP Smtpd; Fri, 6 Dec 2019 09:51:46 +0530
EHLO MAIL
250-yourdomail.lk Hello , pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 209715200
250-DSN
250-STARTTLS
250-DELIVERBY
250 HELP
mail from:noreply@yourdomail.lk
250 2.1.0 noreply@yourdomail.lk... Sender ok
rcpt to:saminda.konkaduwa@yourdomail.lk
250 2.1.5 saminda.konkaduwa@yourdomail.lk... Recipient ok
data
354 Enter mail, end with "." on a line by itself
This is a Test Content
.
250 2.0.0 xB64Lkmg026459-xB64Lkmh026459 Message accepted for delivery



Friday, November 8, 2019

JBoss AS/WildFly HTTPS configuration - standalone mode

Step 1 : Go to the location : JBOSS-HOME/standalone/configuration
Step 2 : Find the relevant xml file. ( default standalone.xml )
Step 3 : Find the xml block : security-realms
Step 4 : Add bellow content inside the block called security-realms


  <security-realm name="ApplicationSSLRealm">
                <server-identities>
                    <ssl>
                        <keystore path="foo.keystore" relative-to="jboss.server.config.dir" keystore-password="mypassword" alias="mykeystore" key-password="mypassword"/>
                    </ssl>
                </server-identities>
                <authentication>
                    <truststore path="mytrust.keystore" relative-to="jboss.server.config.dir" keystore-password="secret"/>
                    <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
                    <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
                </authentication>
                <authorization>
                    <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
                </authorization>
            </security-realm>

 
               
                   
                       
                   
               
               
                   
                   
                   
               
               
                   
               
           

Wednesday, October 30, 2019

JDBC Scan URL configurations

Scan URL can be resolved to multiple ip addresses. in a networked environment, You have to obtain access rules to those ip address and ports.



Properties file configuration with values

myapp.jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
myapp.jdbc.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(FAILOVER=on)(ADDRESS =(PROTOCOL=TCP)(HOST=myapp.test.db.com)(PORT = 1521 ))(CONNECT_DATA=(SERVICE_NAME= myappdbservicename)))
myapp.jdbc.username=
myapp.jdbc.password=
myapp.jdbc.initialSize=2
myapp.jdbc.maxActive=2

JBOSS deployment error - org.infinispan.commons.CacheException: ISPN000279

Reason : Corrupted cache contents
Solution : Remove / rename data folder located in JBOSS_HOME/standalone/data