Skip to main content

Posts

WSO2 Siddhi Advance Example

I would like to present you today how to write an advance siddhi query for wso2 das. I would skip basic steps hoping you are already familiar with siddhi event processing language and DAS server. Siddhi - Is an event processing language created by WSO2. this language has a very similar behavior to SQL query language, except siddhi query triggered by a receiving event. siddhi syntaxes bit upside down when compared to traditional SQL. DAS - DAS is the data analytic server introduced by WSO2. Introduction What my example doing is when DAS server is receiving an event it flows through my siddhi example. DAS is connected to an external system and DAS receives events. this event has json body where event-type is hidden. based on the event type we will be pricing the event and pushing updated stream data to a new stream. so to make a result we will have to process the event using siddhi java extension. Before explaining the siddhi query, let me explain you various functions ...

Printing your json on a web page

printing a json on wasnt easy. it looked messy and made your web page very bad looking. theres a simple solution to overcome this. stringify your json and then put inside a html <pre> tag. you will be amazed of the outcome. jsonBody    in the below example is the json object you wanna print.   <pre> ' + JSON . stringify ( JSON . parse ( jsonBody ) , null , '\t' ) + ' </pre>

Change Ubuntu user password

go to linux recovery mode pressing esc button till boot option menu appears. then select advance options then select recovery mode option. then you should see following ui. select update grub boot-loader option to get the read write access to the system. then select drop to root shell prompt option. then press enter to go to root terminal. now you can change the password easily root@ubuntu:~# passwd nuwans Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully root@ubuntu:~#   you are done.   troubleshooting   you might see a error like key string is not matching once you logged in to the system. you can delete  the key-string file to create a new file.   rm ~/.local/share/keyrings/login.keyring    

Did you delete your fstab file in ubuntu 16.04 ?

  P ossible result would be hang your booting at a black screen.   F ix would be restoring the fstab file. Unfortuanatly if you don’t have a back up file have to recreate the file manually.   Y ou should be able to go to recovery mode by pressing esc button till boot option menu appears.  Then select advance options and then select recovery mode.   T hen should see a white ui window.  Select Update g rub bootloader to to get read write access to file system. Then select drop to root shell prompt. N ow sudo blkid file get partition info   sudo blkid   /dev/sda1: UUID="78985254-78ae-45b3-923d-804c7d56a7dc" TYPE="ext4" PARTUUID="ab55e511-01" /dev/sda2: UUID="a30e14b5-0203-4ef3-a135-2dad9c26c309" TYPE="swap" PARTUUID="ab55e511-02" /dev/sda3: UUID="377ce2fa-29c3-46d2-87da-88ff55502d66" TYPE="ext4" PARTUUID="ab55e511-03" Since ...

Ubunutu Help

setting up sts shortcut & installation copy extracted folder to /opt/sts-3.7.0 go to cd /usr/share/applications create a file sts.desktop with [Desktop Entry] Name=Eclipse Type=Application Exec=/opt/sts-3.7.0/STS Terminal=false Icon=/opt/sts-3.7.0/icon.xpm Comment=Integrated Development Environment NoDisplay=false Categories=Development;IDE Name[en]=Spring Tool Suite Access to shared host folder get access to shared host folder                 sudo adduser [username] vboxsf Installing firefox on ubunutu Down load the latest installation wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/30.0/linux-x86_64/en-US/firefox-30.0.tar.bz2 tar -xjvf firefox-30.0.tar.bz2 sudo rm -rf /opt/firefox* sudo mv firefox /opt/firefox30.0 sudo ln -sf /opt/firefox30.0/firefox /usr/bin/firefox Add a bookmark to folder structure open e...

Linux Send Email

Send email 1………………………………………………………………………………………….. [root@tecadmin ~]# vi /tmp/email.txt Subject: Terminal Email Send Email Content line 1 Email Content line 2 [root@tecadmin ~]# sendmail user@example.com   < /tmp/email.txt       2………………………………………………………………………………………………… # - user inputs   # telnet localhost smtp   Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 fbreveal.com ESMTP Sendmail 8.13.8/8.13.8; Tue, 22 Oct 2013 05:05:59 -0400 # HELO yahoo.com 250 tecadmin.net Hello tecadmin.net [127.0.0.1], pleased to meet you # mail from: sender@tecadmin.net 250 2.1.0 sender@tecadmin.net... Sender ok # rcpt to: myemail@ymail.com 250 2.1.5 myemail@ymail.com... Recipient ok # data 354 Enter mail, end with "." on a line by itself # Hey This is test email only Thanks #. 250 2.0.0 r9M95xgc014513 Message accepted for delivery # quit 221 2.0.0 fbreveal.com closing connecti...