Thursday, April 11, 2013

Linux VIM : usefull search tips and tricks

  • Search for a word

/search_word

  • Search ignore case

/\csearch_word

  • Incremental search

With incremental search you can view the matches as you type, no need to type the whole word.

:set incsearch

  • Highlight search matching word.

:set hlsearch
  • Smartcase

Search case sensitively if caps letters are in search pattern.
:set ignorecase smartcase

Sunday, March 17, 2013

Create blog post using Linux terminal - GoogleCL (Google CommandLine)

As you know Linux terminal is a very powerful tool which allows the user to perform almost everything on your Linux machine. It is the best tool a developer should get used to. Most developers use Google services such as email, blogger, youtube, docs, calender, picasa and finance. In order to consume these services users have to use a web browser like Firefox or Chrome. But can't we use our best tool, Linux terminal for it.


googlecl allows above services to be accessed via Linux commandline. You can

  • Create blog posts
  • Add calendar events
  • View your google docs
  • Add calendar events
  • Upload images to Picasa
  • Upload videos to Youtube
Step 1 - Install

sudo apt-get install google


The syntax for any command is
google  SERICE TASK
services include blogger, docs, contacts, youtube, picaza and finance

Create a blog post

google blogger post --title "Terminal Blogging" "This post is created via Linux terminal"

List your contacts

google contacts list Udara

List your google docs

google docs list

Upload images to Picasa

google picasa create "Terminal images" ~/photos/*.jpg


Upload videos to Youtube
google youtube post --category my_video.mp4

More examples can be found from the example page.

Friday, March 15, 2013

Debugging and Logging WSO2 ESB SOAP messages

In order to log and see the SOAP messages that comes in to and goes out from WSO2 ESB add the following entries to the log4j.properties file

log4j.logger.org.apache.synapse.transport.passthru.wire=DEBUG log4j.logger.httpclient.wire.content=DEBUG

 You can find some more loging varieties from [1].

 [1] http://hc.apache.org/httpcomponents-client-ga/logging.html

Monday, February 11, 2013

WSO2 Stratos 1.6 - How to intall and Configure

Prerequisites

I. MySQL Server
    Download the setup from http://dev.mysql.com/downloads/mysql/ or
    in Ubuntu
sudo apt-get install mysql-server

2. Stratos assumes the password of MySQL is 'root'. So change mysql root password to root

mysqladmin -u root -p 'oldpassword' password root  


Step 1- Download the local WSO2 Stratos setup version 1.6 from http://wso2.com/cloud/stratos/. Extract the downloaded setup and go inside the folder. We will name this folder as

Step 2- To initialise the setup run ./initialize.sh In initialization, appropriate database tables and database users and required configurations will be created.

 ./initialize.sh 

Step 3- Add following entry to /etc/hosts file. So below links will points to localhost

127.0.0.1 stratos-local.wso2.com
127.0.0.1 management.appserver.stratos-local.wso2.com
127.0.0.1 appserver.stratos-local.wso2.com
127.0.0.1 management.esb.stratos-local.wso2.com
127.0.0.1 esb.stratos-local.wso2.com
127.0.0.1 management.data.stratos-local.wso2.com
127.0.0.1 data.stratos-local.wso2.com
127.0.0.1 monitor.stratos-local.wso2.com
127.0.0.1 management.process.stratos-local.wso2.com
127.0.0.1 process.stratos-local.wso2.com
127.0.0.1 governance.stratos-local.wso2.com
127.0.0.1 identity.stratos-local.wso2.com
127.0.0.1 storage.stratos-local.wso2.com
127.0.0.1 cep.stratos-local.wso2.com
127.0.0.1 task.stratos-local.wso2.com
127.0.0.1 messaging.stratos-local.wso2.com
127.0.0.1 management.rule.stratos-local.wso2.com
127.0.0.1 rule.stratos-local.wso2.com
127.0.0.1 cloudgateway.stratos-local.wso2.com

Step 4- To view the available services you are provided,

./stratos.sh 

To start a services
./stratos.sh start 'service list separated by spaces'

Example: To start ESB Management node and Appserver worker node 
 ./stratos.sh start 'esb_mgt as_worker' 


To start all services
./stratos.sh start all


Please note that you may need super user privileges to start or stop elb as it runs on standard http and https ports. And also please make sure none other services are running on port 443 or 80.(apache, etc)

To stop a services ./stratos.sh stop 'service list separated by spaces'

 Example: To stop ESB Management node and Appserver worker node
 ./stratos.sh stop 'esb_mgt as_worker'

 Note : manager service and elb service should be started first in order to start the Stratos

 ./stratos.sh start manager
sudo ./stratos start elb 

To atop all services
./stratos.sh stop all