Skip to main content

Posts

Showing posts from May, 2013

How to read a patch (or diff) file generated from diff tool

I am writing this blog to share my experience when i was asked to apply a patch which was written by some other person. When we applying patches, sometimes we may get some errors in the patch command. This blog post will help you to understand the format of the patch file and from that you can identify the reasons which caused your patch to fail and enable you to apply patch manually if required. Patch or diff files are just text files, so you can look at them with less or a text editor. If you prefer to use a terminal, colordiff (in the colordiff package) provides syntax highlighting. If the patch is long, you may want to use less to look at it. You need the -R option for less, or else the colors won’t show. I also always use -S, which will enable horizontal scrolling in less instead of wrapping long lines. The whole command to view a patch with syntax highlighting through less in a terminal is: ~$ cat file.patch | colordiff | less -RS Patch formats Each patch file comes in

Send email with attachment in WSO2 ESB

WSO2 ESB comes with a comprehensive set of transports supported. Mail transport is one of the mostly used transports with the WSO2 ESB. This post will guide you to send an email with an attachment by using the WSO2 ESB. 1. First you need to download the WSO2 ESB from the official WSO2 web site. http://wso2.com/products/enterprise-service-bus/ Extract the downloaded archive file in to a folder inside your computer. This extracted folder will be referred as ESB_HOME in the next part of the post. 2. Enable the mail transport from the axis2 configuration file which is located in the ESB_HOME\repository\conf\axis2\axis2.xml Uncomment the lines which are related to mail transport <transportSender name=”mailto”> <parameter name=”mail.smtp.host”>smtp.gmail.com</parameter> <parameter name=”mail.smtp.port”>587</parameter> <parameter name=”mail.smtp.starttls.enable”>true</parameter> <parameter name=”mail.smtp.auth”>true</par