<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kasun Siyambalapitiya on Medium]]></title>
        <description><![CDATA[Stories by Kasun Siyambalapitiya on Medium]]></description>
        <link>https://medium.com/@kasunsiyambalapitiya?source=rss-7c993c792d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MZ2z_Tw7nbvV5JePpjWTww.jpeg</url>
            <title>Stories by Kasun Siyambalapitiya on Medium</title>
            <link>https://medium.com/@kasunsiyambalapitiya?source=rss-7c993c792d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 05:13:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kasunsiyambalapitiya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[WSO2's new update model]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/wso2s-new-update-model-ac26fa4df0d4?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac26fa4df0d4</guid>
            <category><![CDATA[updates]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[middleware]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sat, 07 Nov 2020 06:39:22 GMT</pubDate>
            <atom:updated>2021-06-16T06:04:08.702Z</atom:updated>
            <content:encoded><![CDATA[<h3>WSO2&#39;s new product update model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*RwWPiOJ9ycLXrra9Qx-hZA.png" /><figcaption>Image Source: <a href="https://pixabay.com/illustrations/update-upgrade-renew-improve-1672353/">https://pixabay.com/illustrations/update-upgrade-renew-improve-1672353/</a></figcaption></figure><p>If you have gone through my previous blog post on <a href="https://medium.com/@kasunsiyambalapitiya/wso2-update-channels-ac2f6ab0134e">WSO2 update channels</a> or have used any WSO2 product at past, you surely have used WUM or the in-place update tool at least once for updating your WSO2 product. Since the release of wum in 2016, it became the most popular way of retrieving an up to date WSO2 product distribution among many users all around the globe, as it is quicker and efficient than the legacy approach of applying patches one by one.</p><p>⚠️ Please note that although WSO2 provides security fixes as patches along with security advisory announcements, WSO2 strongly recommends updating your product distributions to the latest version available with either wum or the in-place update tool as updates provide bug-fixes, improvements and new features to your product distribution, in addition to the security updates.</p><p>With the feed-backs we received from our user base all over the world for the past few years, we led our efforts in finding ways to optimizing the current WSO2 product update process. As a result we came up with a new update model which is more efficient and more quicker than previous models ( both wum and in-place) and we calls this new model Updates 2.0. So lets dig further on what’s new in Updates 2.0 and how it differs from previous update tools like wum or the in-place update tool.</p><h4>What’s new ❓</h4><ul><li>Three new platform specific update tools (namely wso2update_linux, wso2update_darwin and wso2update_windows.exe)</li><li>Introduction of update levels instead of timestamps for updated product distributions (ex: wso2am-3.2.0.8 instead of wso2am-3.2.0+1602172186640).</li><li>Version bumping of components (Ex: org.wso2.carbon.cluster.mgt.core_4.5.1.jar -&gt; org.wso2.carbon.cluster.mgt.core_4.5.1.1.jar)</li><li>Updates and hot-fixes.</li><li>Consumes very low bandwidth when compared with both wum and in-place update tools.</li><li>More convenient way of viewing details of updates applied to your product distribution via the new WSO2 Updates Portal.</li><li>Bi-weekly update releases which will help you to schedule update cycles more easily in your environment. ( do not worry, for critical security issues we will release new update levels ASAP and notify all users on them 🔔 )</li></ul><h4>What are updates and hot-fixes ❓</h4><p>Updates are the proactive fixes (containing bug fixes, feature additions and improvements) provided by WSO2 for product distributions. At present both wum or the in-place update tool uses these updates for updating your product distributions. So what are hot-fixes?</p><p>Hot-fixes are user specific, temporary fixes provided to a user for resolving a current production issue at hand. These fixes will be provided in the form zip files via the user specific support-jira account when the user reported a critical bug in their production environment. A hot-fix provided above is meant only to be used, until the proper fix is being shipped via an update in future. Once the fix is released as an update, the user should revert the previously applied hot-fix and update his/her product distribution to the latest update level available as soon as possible</p><h4>Where can I find the new update tool ❓</h4><p>The three platform specific update tools will be available inside the &lt;PRODUCT_HOME&gt;/bin directory of your product distribution as follows,</p><ul><li>wso2update_linux</li><li>wso2update_darwin</li><li>wso2update_windows.exe</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONZv6go2kzYgjoCs1cDsWw.png" /></figure><p>These update tools will be readily available in the latest products that you download from <a href="https://wso2.com/">wso2.com</a> and for other products (previous products), the new update tools will get added to the product distribution once you update your product distribution to the latest timestamp( either using wum or the in-place update tool)</p><h4>Ok ! I have the new tool now, how can I use it ❓</h4><p>It is pretty simple, all you have to do is run the tool without any argument as follows to update your product distribution to the latest update level available,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q9Y8USfBaqKPTJEHTZi7qw.png" /></figure><p>During the execution, it will prompt you for your WSO2 account as shown above, you could enter a valid account if any or you could just press Enter to continue with a free trial subscription. In either case your product distribution will gets updated to its latest update level 😃. In above my product distribution got updated from wso2am-3.1.0.0 to the wso2am-3.1.0.2 which is the latest update level of wso2am-3.1.0.</p><p>As you could observe in above, during the update process a backup of my previous distribution is taken which I can safely use to restore my product distribution (to the state before running the update tool) if required 👍.</p><p>⚠️ Note: If you have used in-place update tool at past for updating your product distribution, the new update tool will prompt you for confirmation on the migration to the new update model as shown above. Please note that if you grant the migration, the old update tool in-place will be deleted permanently and you no longer will be able to receive updates to your product distribution from the old update model again.</p><p>Sometimes when running the new update tool for the first time for migrating to the new update model, you might end up with the message as follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4PhhXg4f_Ll1iv6FpJSJw.png" /></figure><p>The reason for the above is that WSO2 delivers updates on bi-weekly basic in the new updates model, hence if you have recently obtained an updated product distribution either from WUM/in-place, those corresponding updates will be available in the next release cycle of the new update model. So the tool will notify this to you and will automatically exits execution.</p><p>Now lets see common use cases of the update tool :</p><h4>Updating to a define update level</h4><p>If you like, you can update your product distribution to a desired update level instead of to the latest update level available, by running the following command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZE_-FSxq909tsyJTRaU0A.png" /></figure><p>You can also provide the desire update level as a single digit (without the product base version) as follows,</p><pre>./wso2update_linux --level 1</pre><h4>Reverting an update level</h4><p>If your workflow hit with a bug after the update or you might want to stick to the previous product version for what ever reason, you can simply run the following command which will restore your product distribution to the state just before running the update tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7CRQcwx51hHbCuN12HLyQ.png" /></figure><h4>Conflict Resolving</h4><p>Sometimes when updating your product distribution you might end up with a conflict message like follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twcWNavSzELDTWZ6qY0BZA.png" /></figure><p>this happens when files been modified from WSO2 updates, are also modified by yourself. To fix the issue you have to manually review and resolve the conflict files listed and rename the resolved files with .final extension. Once the resolved files are renamed with .final you can resume the update process by running the update tool with --continue flag as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*uXm5Wrs3dCnzfrwDdq2Qyw.png" /></figure><p>For more details conflict resolving please go through the<a href="https://updates.docs.wso2.com/en/latest/updates/resolve-conflics/"> conflict resolving documentation</a></p><h3>Sub commands of the update tool</h3><p>Beside above the update tool also has some additional sub commands that will be useful in the long run.</p><h4>current-state</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*bIufUZN5Vc4Gvskn07VBLw.png" /></figure><p>As you could observe above, running the current-state sub-command will provide you details of your current product distribution. This will show on what update level your product is at and the list of hot-fixes applied if any. Providing the details output from this sub command during opening up a support ticket at Jira is very useful, as the output contains all the initial details which will be helpful in analyzing your issue.</p><p><strong>check</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTdUacXB8AA_aoY3KsddFA.png" /></figure><p>The check sub-command can be used to check for the availability of new update levels for your product distribution. This will also list the number of security fixes been provided on the available new update level.</p><h4>help</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*qhANJkwQ0XzU2vOs6SGJjg.png" /></figure><p>The help sub-command can be used to get the help of any command. There is also a — help argument that can be used with any sub-command to get the help of that sub-command. For example</p><ul><li>To get the help of check sub-command you can run</li></ul><pre>./wso2update_line check --help</pre><ul><li>To get the help of create-docker sub-command you can run</li></ul><pre>./wso2update_linux create-docker --help</pre><p>Please refer the <a href="https://updates.docs.wso2.com/en/latest/updates/update-tool/">official documentation</a> and <a href="https://wso2.com/library/webinars/introducing-wso2-updates2.0-na/">webinar</a> for more details on the Updates 2.0.</p><p>Cheers ❗❗❗</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac26fa4df0d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Linux] Play a warning sound when your laptop battery is low]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/linux-play-a-warning-sound-when-your-laptop-battery-is-low-4aa23d5b279e?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aa23d5b279e</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[battery]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[laptop-battery]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 07:35:29 GMT</pubDate>
            <atom:updated>2021-06-16T06:03:28.750Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*GX2rM2AR98vVD1PUQQ3ePQ.jpeg" /><figcaption>Image Source: <a href="https://www.flickr.com/photos/weishaupt-cycles/8738377068">https://www.flickr.com/photos/weishaupt-cycles/8738377068</a></figcaption></figure><p>When working on a big project or when watching a movie or a TV series in an extended display, all of a sudden you might have ran out of battery and your laptop got shut off or goes to sleep or hibernation. This is very bad for the battery in terms of its lifetime and if your laptop has a mechanical hard drive (not SSD) sudden power off could damage the data in it.</p><p>What if your laptop could give you a warning sound when your battery drops a certain value,continuously ( ex: every 5 minutes) so that you can plug in your laptop at your earliest. Well this is very easy and will take about 5min to configure 😍.</p><ol><li>Download a short warning sound from anywhere on the Internet. (if you like you can even play a whole song 😀 but remember, that could drain your battery even more if you are not near it to plug it back).</li><li>Install the command line music player `mpg123` by running the following commands in your terminal.</li></ol><pre>sudo apt-get update -y<br>sudo apt-get install -y mpg123</pre><p>3. Create a script file to play the downloaded music if your battery percentage is less than 20 (you can customize this value to anything you want 😀 ) and save it in a desired location with executable permission.</p><pre>#!/bin/bash</pre><pre># You need to export this environment variable in order to play sound from cron<br>export XDG_RUNTIME_DIR=&quot;/run/user/1000&quot;</pre><pre>currentBatteryPercentage=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep &quot;percentage&quot; | awk &#39;{print $2}&#39;)</pre><pre>currentBatteryPercentage=${currentBatteryPercentage/\%/}</pre><pre>if [ $currentBatteryPercentage -lt 22 ]</pre><pre>then</pre><pre>mpg123 /home/kasun/Music/apx_battery_low_aler.mp3 -l 2</pre><pre>fi</pre><p>Note:</p><ul><li>If upower is not installed in your system run the following commands for installing upower .</li></ul><pre>sudo apt-get update -y<br>sudo apt-get install -y upower</pre><ul><li>Replace mpg123 ‘s argument with the path to your downloaded music file (mine is located at `/home/kasun/Music/apx_battery_low_aler.mp3`)</li></ul><p>4. Open your crontab file for editing by running the following command in terminal.</p><pre>crontab -e</pre><p>Fill in the following to execute our script for every 5min.</p><pre>*/5 * * * * bash /home/kasun/Documents/Scripts/battery-low.sh</pre><p>Note:</p><ul><li>Provide the path to your script file after the sh command (mine is located at `/home/kasun/Documents/Scripts/battery-low.sh`)</li><li>You can change the scheduled time to anything you want.</li><li>Please refer <a href="https://kb.iu.edu/d/afiz">https://kb.iu.edu/d/afiz</a> for more details on the crontab.</li></ul><p>5. Save the crontab file.</p><p>It’s done 😊</p><p>Cheers !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aa23d5b279e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Move git branch from one repository to another with preserving history]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/move-git-branch-from-one-repository-to-another-with-preserving-history-81ed64de3a02?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/81ed64de3a02</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Wed, 23 Oct 2019 18:34:29 GMT</pubDate>
            <atom:updated>2021-06-16T06:07:26.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sLNEBY6-TbUbJEg-NcXNqw.jpeg" /><figcaption>Image Source: <a href="https://www.geograph.org.uk/photo/4272215">https://www.geograph.org.uk/photo/4272215</a></figcaption></figure><p>There can be times that your company has build a certain product/app with a specific language at past and now you are working on implementing its newer version in a different language due to the unique or specific features being provided by the new language.</p><p>For a example if the initial product/app version was implemented using Java, there is a high chance that its newer version may be implemented using go language . This is because a platform specific JVM needs to be installed on the running instance in order to execute Java programs and for go programs there is no such requirement.</p><p>Regardless of the new language you choose for the implementation, more than 90% of the time you may be using a separate branch in the same repository for this development.</p><p>As time passes by your new implementation becomes steady and stable (with tests and all 😊 ) and you will end up with either of the following two options to choose from</p><ol><li>Make the new implementation the master branch of the repository</li><li>Move the new implementation branch to a different repository with preserving history.</li></ol><p>The first option can easily be done from the Github UI by a user with admin permissions. But what if your company decided to go with the second option and you were chosen as the person to perform it 😲.</p><p>Do not worry, it very simple and straight forward 😌 🤗</p><p>let’s dig in 🤓</p><ol><li>First clone your initial repository to a new location (say <em>~/saveMe/initialRepo</em>).</li></ol><pre>mkdir -p ~/saveMe/initialRepo<br>cd ~/saveMe/initialRepo<br>git clone &lt;initial repository URL&gt;</pre><p>Ex:</p><pre>git clone <a href="https://github.com/kasunsiyambalapitiya/in-place-public.git">https://github.com/kasunsiyambalapitiya/awesome-project.git</a></pre><p>2. Checkout to the new implementation branch by creating a new local branch. (say <em>go-implementation)</em></p><pre>git checkout -b go-implementation origin/go-implementation</pre><p>3. Create the new repository at github, gitbucket or etc.</p><p>4. Clone the new repository to a new location. (say <em>~/saveMe/newRepo)</em></p><pre>mkdir -p ~/saveMe/newRepo<br>cd ~/saveMe/newRepo<br>git clone &lt;new repository URL&gt;</pre><p>Ex:</p><pre>git clone <a href="https://github.com/kasunsiyambalapitiya/in-place-public.git">https://github.com/kasunsiyambalapitiya/super-awesome-project.git</a></pre><p>5. Create a new remote inside the new repository (<em>super-awesome-project</em>) for the initial repository (<em>awesome-project</em>)</p><pre>git remote add initial-repo &lt;path-to-cloned-initial-repository&gt;</pre><p>Ex:</p><pre>git remote add initial-repo ~/saveMe/initialRepo/awesome-project</pre><p>6. Pull all the files and directories from initial repository (<em>awesome-project</em>) <em>go-implementation </em>branch to the <em>m</em>aster branch of the new repository (<em>super-awesome-project</em>) with preserving history.</p><pre>git pull initial-repo go-implementation --allow-unrelated-histories</pre><p>7. Remove the remote added for the initial repository (<em>awesome-project</em>) inside the new repository (<em>super-awesome-project</em>).</p><pre>git remote rm initial-repo</pre><p>8. Add all changes and push to github.</p><pre>git add .<br>git push origin</pre><p>You got saved !!!! 🤓</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81ed64de3a02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Encrypting passwords in config files using a separate keystore (an internal keystore) in WSO2…]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/encrypting-passwords-in-config-files-using-a-separate-keystore-an-internal-keystore-in-wso2-e1823b69d408?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1823b69d408</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cipher]]></category>
            <category><![CDATA[keystore]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[encryption]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 02:52:17 GMT</pubDate>
            <atom:updated>2021-06-16T06:12:52.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>Encrypting passwords in config files using a separate keystore (an internal keystore) in WSO2 servers.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lv6lt123fWFw9b7tQb1BvQ.jpeg" /><figcaption>Image Source: <a href="https://www.flickr.com/photos/30478819@N08/51080621877">https://www.flickr.com/photos/30478819@N08/51080621877</a></figcaption></figure><p>In any software product it is not a wiser decision to leave sensitive information like administrator passwords, database passwords, keystore passwords, private key password and etc. in plain text in relevant configuration files as it posses a sever security vulnerability. So almost all of the software vendors today provide a way to secure the sensitive information used by their software products.</p><p>At <a href="https://wso2.com/">WSO2</a> we do the same and by any chance if you have used any of the <a href="https://wso2.com/platform">WSO2 products</a> in past, you might have already come across the terms like <strong>cipher tool </strong>and <strong>secure vault </strong>which are provided by <a href="https://wso2.com/">WSO2</a> for the above purpose. Since the above two features are available out of the box in all of the WSO2 products based on Carbon Kernel 4.4.0 and higher, encrypting/decrypting sensitive information in configuration files can be easily done without any overhead 😌</p><p>That been said, from the latest releases of WSO2 products (<strong>wso2is-5.7.0</strong>,<strong> wso2is-analytics-5.7.0</strong>,<strong> wso2is-km-5.7.0</strong>,<strong> wso2am-2.6.0</strong>, <strong>wso2am-analytics-2.6.0</strong>,<strong> wso2ei-6.4.0</strong>,<strong> wso2-obam-1.3.0</strong>, <strong>wso2-obbi-1.3.0</strong>, <strong>wso2-obkm-1.3.0 </strong>and etc.) you could define a separate keystore to be used by both the <strong>cipher tool</strong> and <strong>secure vault</strong> used in encrypting/decrypting sensitive information in configuration files, other than the primary keystore that was used by default in previous releases. Here the primary keystore is the keystore which is been configured as the <strong>&lt;Security&gt;/&lt;KeyStore&gt;</strong> element in <strong>&lt;PRODUCT_HOME&gt;/repository/conf/carbon.xml</strong> file in any WSO2 product.</p><p>(By default all WSO2 products uses the preshipped <strong>wso2carbon.jks </strong>located at <strong>&lt;PRODUCT_HOME&gt;/repository/resources/security/ </strong>directory as the primary keystore).</p><p>The above feature gets really useful in a scenario, where you would like to have a separate internal keystore (which will not change at all 😉) for encrypting sensitive information in configuration files and another keystore for signing messages and assertions send for third parties (using the protocols like SAML, OIDC and etc.). This because the keystore certificates used in public communications over the Internet has an expiry time and when the certificate get expires you would need to go through a huge burden of migrating the already encrypted sensitive information at your servers 😟.</p><p>So to live an easy life lets see how to configure the internal keystore in WSO2 products, which will allow you to change the keystore used for signing messages and assertions send for third parties at any point in time 😌.</p><ul><li>For latest products mentioned above.</li></ul><p>For the latest products configuring the internal keystore is pretty simple and straight forward as the above feature is supported out of the box in them 😅 . All you need is to configure the <strong>&lt;Security&gt;/&lt;InternalKeyStore&gt;</strong> element in <strong>&lt;PRODUCT_HOME&gt;/repository/conf/carbon.xml</strong> file to point to the relevant internal keystore as follows,</p><pre>&lt;InternalKeyStore&gt;<br>            &lt;!-- Keystore file location--&gt;<br>            &lt;Location&gt;${carbon.home}/repository/resources/security/internalKeystore.jks&lt;/Location&gt;<br>            &lt;!-- Keystore type (JKS/PKCS12 etc.)--&gt;<br>            &lt;Type&gt;JKS&lt;/Type&gt;<br>            &lt;!-- Keystore password--&gt;<br>            &lt;Password&gt;yourPassword&lt;/Password&gt;<br>            &lt;!-- Private Key alias--&gt;<br>            &lt;KeyAlias&gt;wso2internal&lt;/KeyAlias&gt;<br>            &lt;!-- Private Key password--&gt;<br>            &lt;KeyPassword&gt;yourPassword&lt;/KeyPassword&gt;<br>&lt;/InternalKeyStore&gt;</pre><ul><li>For previous version of WSO2 servers.</li></ul><p>If you are using a previous version of a WSO2 server, you need to get the latest wum updated distribution as the above feature is provided via an update (released on 8th of July 2018) to previous WSO2 products. Please refer <a href="https://medium.com/@kasunsiyambalapitiya/wso2-update-channels-ac2f6ab0134e">WSO2 Update Channels</a> on how to use WUM for updating your WSO2 servers.</p><p>Upon updating your product please follow below instructions in order to enable this feature,</p><ol><li>Enable the Crypto Service by adding the following configuration block to the &lt;PRODUCT_HOME&gt;/repository/conf/carbon.xml file.</li></ol><pre>&lt;CryptoService&gt;</pre><pre>&lt;Enabled&gt;true&lt;/Enabled&gt;</pre><pre>&lt;InternalCryptoProviderClassName&gt;org.wso2.carbon.crypto.provider.KeyStoreBasedInternalCryptoProvider&lt;/InternalCryptoProviderClassName&gt;</pre><pre>&lt;ExternalCryptoProviderClassName&gt;org.wso2.carbon.core.encryption.KeyStoreBasedExternalCryptoProvider&lt;/ExternalCryptoProviderClassName&gt;</pre><pre>&lt;KeyResolvers&gt;</pre><pre>&lt;KeyResolver className=&quot;org.wso2.carbon.crypto.defaultProvider.resolver.ContextIndependentKeyResolver&quot; priority=&quot;-1&quot;/&gt;</pre><pre>&lt;/KeyResolvers&gt;</pre><pre>&lt;/CryptoService&gt;</pre><p>2. Configure the new keystore by adding the following configuration block inside the <strong>&lt;Security&gt;</strong> element in the <strong>&lt;PRODUCT_HOME&gt;/repository/conf/carbon.xml</strong> file.</p><pre>&lt;InternalKeyStore&gt;<br>            &lt;!-- Keystore file location--&gt;<br>            &lt;Location&gt;${carbon.home}/repository/resources/security/internalKeystore.jks&lt;/Location&gt;<br>            &lt;!-- Keystore type (JKS/PKCS12 etc.)--&gt;<br>            &lt;Type&gt;JKS&lt;/Type&gt;<br>            &lt;!-- Keystore password--&gt;<br>            &lt;Password&gt;yourPassword&lt;/Password&gt;<br>            &lt;!-- Private Key alias--&gt;<br>            &lt;KeyAlias&gt;wso2internal&lt;/KeyAlias&gt;<br>            &lt;!-- Private Key password--&gt;<br>            &lt;KeyPassword&gt;yourPassword&lt;/KeyPassword&gt;<br>&lt;/InternalKeyStore&gt;</pre><p>Please visit <strong>cipher tool </strong><a href="https://docs.wso2.com/display/Carbon440/Encrypting+Passwords+with+Cipher+Tool">doc</a> and <strong>secure vault </strong><a href="https://docs.wso2.com/display/ADMIN44x/Carbon+Secure+Vault+Implementation">doc</a> for more information regarding their usage and extensibility.</p><p>Cheers !!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1823b69d408" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 Update Channels]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/wso2-update-channels-ac2f6ab0134e?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac2f6ab0134e</guid>
            <category><![CDATA[wso2-update-manager]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wum]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Thu, 14 Mar 2019 06:09:52 GMT</pubDate>
            <atom:updated>2019-03-14T06:09:52.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*FSZZPfaJSPg5QSx-K4aeAQ.png" /><figcaption><a href="https://www.google.com/search?q=wso2+logo&amp;client=ubuntu&amp;hs=mQM&amp;channel=fs&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwi4w5HV-YDhAhUu7XMBHQwED2sQ_AUIDigB&amp;biw=1920&amp;bih=953#imgrc=o3xaafk63V_ccM">Source: https://www.google.com/search?q=wso2+logo&amp;client=ubuntu&amp;hs=mQM&amp;channel=fs&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwi4w5HV-YDhAhUu7XMBHQwED2sQ_AUIDigB&amp;biw=1920&amp;bih=953#imgrc=o3xaafk63V_ccM</a>:</figcaption></figure><p>If you are in love with Technology and like to read, search and share posts on latest trends in Information Technology, you would probably have heard of <a href="https://wso2.com/resources/analyst-reports/the-forrester-wave-api-management-solutions-q4-2018/">The Forrester Wave™ reports, released on Q4 2018</a>.</p><p>Forrester Research Inc. has named <a href="https://wso2.com/">WSO2 </a>— the only fully open source solution in the report — as a leader in “<a href="https://wso2.com/resources/analyst-reports/the-forrester-wave-api-management-solutions-q4-2018/">The Forrester Wave™: API Management Solutions, Q4 2018</a>”. This is one of the best achievements we (WSO2) received in recent past and the gratitude of this glory goes to each and every one who contributes on crafting WSO2 products.</p><p>That being said now lets looks at how WSO2 provide updates to their products. Since all WSO2 product updates are released under <a href="https://wso2.com/licenses/wso2-update/2.0">EULA2</a> license a user should possess a valid subscription in order to receive and keep already received product updates from WSO2. If you are just evaluating WSO2 products or does not have a WSO2 subscription yet, you can create a <a href="https://wso2.com/subscription/free-trial">15 day free trial subscription</a> right away by signing up at <a href="https://wso2.com/">WSO2</a> and enjoy all the benefits that a WSO2 subscription customer receives for a period of 15 days.</p><p>So once you possess a valid WSO2 subscription you will be able to access <a href="https://wso2.com/updates">WSO2 updates</a> and <a href="https://wso2.com/updates/wum">WSO2 Update Manager(WUM)</a> in order to receive continuous WSO2 product updates.</p><p>From the release of <a href="https://wso2.com/updates/wum">WUM 3.0.0</a>, WSO2 provide product updates based on set of update channels. An ordinary subscription user or a free trial user automatically get entitled to both the <strong>full </strong>and <strong>security </strong>update channels by default and are eligible receive and keep updates received from above channels within their subscription/trail period. The definition of above mentioned <strong>full </strong>and <strong>security </strong>update channels are as follows,</p><ul><li><strong>full :- </strong>contain both regular and security updates delivered for a WSO2 product.</li><li><strong>security :- </strong>contains only security updates delivered for a WSO2 product.</li></ul><p>In above, regular updates contain bug fixes, improvements and new features while the security updates contains only the fixes made for security vulnerabilities.</p><p>It is also important to note that the <strong>security</strong> update channel is only available for the latest released two versions of each product distributions (last two GA versions) at any point in time. For example at the time of writing<strong>, wso2is-5.7.0 </strong>is the latest released GA of WSO2 Identity Server and the <strong>security </strong>update channels were available only for the following two GA versions of the WSO2 Identity Server.</p><ul><li><strong>wso2is-5.7.0</strong></li><li><strong>wso2is-5.6.0</strong></li></ul><p>Other than the above mentioned channels a dedicate channel (custom channel) can also be obtained for a subscription which will deliver content (bug fixes, improvements, new features and fixes for security vulnerabilities) based on the user’s requirement. A custom channel is useful in a scenario like follows,</p><p>Lets assume that <strong>organizationABC</strong> using <a href="https://wso2.com/api-management/">WSO2 API Manager 2.6.0</a> for managing their APIs and they have thoroughly tested all their use cases and scenarios with wso2am-2.6.0(GA or GA + updates up to certain timestamp)in pre-prod (staging) environments and gone production with a stable setup. As their production setup is stable and all their use cases works perfectly fine, there is no requirement for <strong>organizationABC</strong> to update their production environment regularly with updates delivered from <a href="https://wso2.com/updates/wum">WSO2 Update Manager</a>. However, <strong>organizationABC </strong>might needs all the fixes for security vulnerabilities identified when time passes and <strong>organizationABC</strong> might also need selective bug fixes, improvements and new features introduced via the <strong>full </strong>update channel.</p><p>In a scenario like above having a custom channel is best bet for <strong>organizationABC</strong> as dedicated WSO2 updates can be received via the customer specific custom channel according their requirements. In case there is a requirement for your organization as mentioned above please contact the Account Manager assigned for your account in-order to be onboard on a specific custom channel for your organization.</p><p>That being said, lets try out updating <strong>wso2am-2.6.0</strong> using <a href="https://wso2.com/updates/wum">WSO2 Update Manager(WUM)</a> in <strong>full, security </strong>and in a custom update channel step by step. For the sake of continuity of the above example, lets assume a user <em>danieal@organizationABC.com</em> from <em>organizationABC.com</em> tries to receive updates from above update channels and the name of the custom specific channel to be <strong>orginzationABC.</strong></p><ol><li>Download OS specific WUM 3.0.2 client from <a href="https://wso2.com/wum/download">WSO2 Update Manager(WUM)</a>.</li><li>Add extracted <strong>wum </strong>executable to the OS PATH variable (needs only to be perform in Linux OSs).</li><li>Open up a terminal (cmd in Windows) and initialize <strong>wum </strong>by executing the following. Please provide valid credentials for your WSO2 account when prompted.</li></ol><pre>~  wum init<br>You need a WSO2 subscription to start using WUM.<br>Don&#39;t have one yet? Sign up for a free-trial subscription at <a href="https://wso2.com/subscription/free-trial">https://wso2.com/subscription/free-trial</a></pre><pre>Please enter your WSO2 credentials to continue<br>Email: <a href="/service/mailto:danieal@organizationABC.com">danieal@organizationABC.com</a><br>Password for &#39;<a href="/service/mailto:danieal@organizationABC.com">danieal@organizationABC.com</a>&#39;: <br>Authenticating...<br>Done!<br>Setting default channel full...</pre><pre>-- Welcome to WUM 3.0.2 --</pre><pre>* Please contact WSO2 for further information at <a href="https://wso2.com/contact">https://wso2.com/contact</a></pre><pre>What&#39;s next? Have a look at the following list of WUM commands:</pre><pre>Add WSO2 products to your product repository<br>  wum search  Search WSO2 products         <br>  wum add     Add or download WSO2 products</pre><pre>Update WSO2 products available in your product repository<br>  wum check-update Check for new updates                          <br>  wum update       Update your WSO2 products                      <br>  wum diff         Create a diff between two updated distributions</pre><pre>Manage WSO2 products available in your product repository<br>  wum list      List WSO2 products           <br>  wum describe  Show details of WSO2 products<br>  wum delete    Delete WSO2 products</pre><pre>Run &quot;wum [command] --help&quot; for more information about a command.</pre><p>(Note the log of `Setting default channel full…` in above)</p><p>4. Add <strong>wso2am-2.6.0 </strong>by executing the following command.</p><pre>~  wum add wso2am-2.6.0</pre><p>Upon completing above <strong>wso2am-2.6.0</strong> will get added to your wum home (~/.wum3/products) and you will be able to verify it by executing the following command in terminal(cmd in Windows).</p><pre>~  wum list<br>Product                 Updated  Filename                  Channel    <br>wso2am-2.6.0            -        wso2am-2.6.0.zip            -      </pre><pre>What&#39;s next?<br>  run &quot;wum describe [product-pattern]&quot; to get more details of products</pre><p>Now lets update <strong>wso2am-2.6.0 </strong>from different update channels :) .</p><ul><li><strong>full </strong>update channel</li></ul><pre>~  wum update wso2am-2.6.0</pre><p>As the default channel is set to <strong>full </strong>the above will automatically fetch updates from the <strong>full </strong>channel.</p><ul><li><strong>security</strong> update channel</li></ul><pre>~  wum update wso2am-2.6.0 security</pre><ul><li><strong>orginzationABC </strong>custom update channel</li></ul><pre>~  wum update wso2am-2.6.0 orginzationABC</pre><p>Upon performing above execute wum list command to verify <strong>wso2am-2.6.0</strong> distributions updated from different update channels as follows.</p><pre>~  wum list<br>Product         Updated                     Filename                                        Channel     <br>wso2am-2.6.0    2019-03-14T10:51:33+05:30  wso2am-2.6.0+1551808453039.security.zip         security<br>wso2am-2.6.0    2019-03-14T10:46:30+05:30  wso2am-2.6.0+1552411265381.full.zip             full   <br>wso2am-2.6.0    2019-03-14T10:28:48+05:30  wso2am-2.6.0+1541808853040.orginzationABC.zip orginzationABC    <br>wso2am-2.6.0    -                          wso2am-2.6.0.zip                                -       <br><br>What&#39;s next?<br>  run &quot;wum describe [product-pattern]&quot; to get more details of products</pre><p>Updated <strong>wso2am-2.6.0 </strong>distributions will be arranged at wum home (~/.wum3/products) in the following hierarchy</p><pre>~/.wum3/products  tree -L 4<br>.<br>└── wso2am<br>    └── 2.6.0<br>        ├── full<br>        │   └── wso2am-2.6.0+1552411265381.full.zip<br>        ├── security<br>        │   └── wso2am-2.6.0+1551808453039.security.zip<br>        ├── orginzationABC<br>        │   └── wso2am-2.6.0+1541808853040.orginzationABC.zip                     <br>        └── wso2am-2.6.0.zip</pre><p>Please refer <a href="https://docs.wso2.com/display/updates/WUM+Commands+Guide">wum command guide</a> for more details on available wum commands.</p><p>Cheers !!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac2f6ab0134e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add primary keys to an already existing table defined with/without primary keys in WSO2 DAS…]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/how-to-add-primary-keys-to-an-already-existing-table-defined-with-without-primary-keys-in-wso2-das-cfe7cf73872f?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe7cf73872f</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[wso2-carbon]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sun, 30 Dec 2018 18:39:40 GMT</pubDate>
            <atom:updated>2021-06-16T06:26:40.418Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to add primary keys to an already existing table defined with/without primary keys in WSO2 DAS 310</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*3U12T2iDTIglDQEVwIj1ng.jpeg" /><figcaption>Image Source: <a href="https://stocksnap.io/photo/vintage-keys-GRRCFFNXRE">https://stocksnap.io/photo/vintage-keys-GRRCFFNXRE</a></figcaption></figure><p>This was an issue I faced when deploying <em>a certain Capp in </em>one of our DAS setup. While trying to resolve the above, I was able to find a bit internals on how primary keys works on wso2das-3.1.0 and though it might be useful to post it in case if anyone face a similar situation.</p><p>Running spark scripts is the way for performing batch processing analytics when working with WSO2 DAS 3.1.0 [1]. In above approach there may be times that you have defined your tables without proper primary key/keys or you have missed out a field or two (more) that should be within the primary key constraint. According the behaviour of how primary key works in WSO2 DAS 3.1.0 , appending primary keys ( both completely new and left over fields) at a later stage to an existing table could results in duplicate records as explained below.</p><p>When redefining tables with relevant primary keys in any of the above mentioned scenarios(adding a completely new primary key or appending new fields for the existing primary key constraint), the introduced primary key constraint doesn’t check already available records in the existing table when inserting new records. This leads to the insertion of duplicate records (duplicates of records which existed prior to defining of primary key constraints) even though relevant primary keys are defined.</p><p>In simple terms let’s say the that <strong>Table A</strong> is having `NIC` and `Name` as its fields and no primary keys are defined. Let’s assume that the following records also exists in the above table and you have used the following query for inserting data into table <strong>TableA</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*MhVp8zmyR7GDq5HuREUtyg.png" /><figcaption>TableA</figcaption></figure><pre>CREATE TEMPORARY TABLE TableA USING CarbonAnalytics OPTIONS (tableName “TableA”, schema “NIC string -i, Name string -i”, mergeSchema “false”);<br>INSERT INTO TABLE TableA <br>SELECT NIC, Name<br>FROM sampleStream;</pre><p>As per the requirement, the inserting query is redefined as follows with the relevant primary key (NIC ) been appended.</p><pre>CREATE TEMPORARY TABLE TableA USING CarbonAnalytics OPTIONS (tableName &quot;TableA&quot;, schema &quot;NIC string -i, Name string -i&quot;, primaryKeys &quot;NIC&quot;, mergeSchema &quot;false&quot;);<br>INSERT INTO TABLE TableA <br>SELECT NIC, Name<br>FROM sampleStream;</pre><p>Upon executing above, already existing records (98579324V and 98721232V) again get inserted into table without considering the primary key constraint defined and the newly defined constraint gets effective only on the latter insertions of the same record.</p><p>According wso2 analyticsteam the behaviour of wso2das-3.1.0 on primary keys is as follows,</p><p><em>The behaviour of the DAS regarding the primary key is, it contains the primary key of the temporary table as a metadata within the DAS and defining a primary key for the data when inserting it into the database. These primary keys are not defined in the physical database. Because of this behaviour of the DAS, if we changed the schema (adding a primary key) in the middle, it will not consider the already inserted data for the primary key and insert those data again.</em></p><p>So in order to avoid adding duplicates, it required to INSERT OVERWRITE the relevant tables (in this case <strong>TableA</strong>) first with relevant primary keys defined (new/ altered primary key constraints) as follows,</p><pre>CREATE TEMPORARY TABLE TableA USING CarbonAnalytics OPTIONS (tableName &quot;TableA&quot;, schema &quot;NIC string -i, Name string -i&quot;, primaryKeys &quot;NIC&quot;, mergeSchema &quot;false&quot;);<br>INSERT OVERWRITE TABLE TableA <br>SELECT NIC, Name<br>FROM sampleStream;</pre><p>Upon performing the above, <strong>TableA </strong>will be freshly populated with non duplicate data and then replace the INSERT OVERWRITE insert query with INSERT INTOwith the same primary keys defined in order to gain a considerable performance gain as the use of INSERT INTO with relevant primary keys defined is more efficient and faster than using INSERT OVERWRITE which will delete the entire table and repopulate it with given data which affects the overall performance of wso2das-3.1.0 .</p><p>Hope this helps :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfe7cf73872f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the exercise: Slices in “A Tour of Go”]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/implementation-of-the-exercise-slices-in-a-tour-of-go-938daa5205bf?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/938daa5205bf</guid>
            <category><![CDATA[exercise]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 04:16:06 GMT</pubDate>
            <atom:updated>2021-06-20T19:27:34.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRhBXdudPIuxR3CwZryf5Q.jpeg" /><figcaption>Image Source: <a href="https://pixabay.com/photos/pizza-cheese-crust-mozzarella-food-3203417/">https://pixabay.com/photos/pizza-cheese-crust-mozzarella-food-3203417/</a></figcaption></figure><p>When you begin to learn the trending <strong><em>Go</em></strong> lang you may have encounter with the Slice exercise which will ask you to draw an image based on slices. Here is how I implemented it.</p><pre>package main</pre><pre>import (<br> &quot;golang.org/x/tour/pic&quot;<br>)</pre><pre>func Pic(dx, dy int) [][]uint8 {<br> pixel := make([][]uint8, dy)<br> data := make([]uint8, dx)</pre><pre>for i := range pixel {<br>  for j := range data {<br>   data[j] = uint8((i+j)/2)<br>  }<br>  pixel[i] = data<br> }<br> return pixel<br>}</pre><pre>func main() {<br> pic.Show(Pic)<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=938daa5205bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to increase the size of a virtual box VM]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/how-to-increase-the-size-of-a-virtual-box-vm-5205720c65f3?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5205720c65f3</guid>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[virtualbox]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sun, 18 Mar 2018 06:26:55 GMT</pubDate>
            <atom:updated>2021-06-20T19:56:33.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_BF-Yr6F7W2eC8kEx_klQ.png" /><figcaption>Image Source: <a href="https://pixabay.com/illustrations/box-amazon-box-package-amazon-5910208/">https://pixabay.com/illustrations/box-amazon-box-package-amazon-5910208/</a></figcaption></figure><p>There may be times that you have created a VM in Oracle Virtual Box with less space and while setting up the environment to the state needed, you get a requirement to expand the size of hard disk with out losing its content. Most probably at this point in time creating a new VM with space and bringing it upto the current state of the previous is time consuming and tedious.</p><p>But by following below instructions you will be able to expand the size of current VM within seconds without affecting it content.</p><ul><li>First stop the current VM instance</li><li>Then navigate to current VM’s Settings -&gt; Storage section under which you will be seeing the devices allocated for your VM</li><li>Next delete the current storage device by keeping in mind where it is located as given in the Information section at right.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*TKBqp_N87ezcrgnf3hElPQ.png" /></figure><ul><li>For increasing the size of VM please follow the instructions appropriate for your Operating System below.</li></ul><p>For Linux :</p><ul><li>Open up a terminal and run the following command</li></ul><pre>~$vboxmanage modifymedium /location/to/the/storage/file/which/needs/to/be/expanded --resize amount_in_MBs</pre><p>Sample command will be look like below</p><pre>~$vboxmanage modifymedium /home/kasun/VirtualBox\ VMs/Windows\ 7/Windows 7.vdi/ --resize 40000</pre><p>For Windows :</p><ul><li>Navigate to the directory where Oracle Virtual Box is installed via theFile Explorer</li><li>For opening up a terminal from the same location, obtain the context menu by right clicking on the empty space with holding shift key and then select open command window here</li><li>Next run the following command</li></ul><pre>C: \Program File\Oracle\VirtualBox&gt;VBoxManage.exe modifymedium &quot;location\to\the\storage\file\which\needs\to\be\expanded&quot; --resize amount_in_MBs</pre><p>Sample command will be look like the following</p><pre>C: \Program File\Oracle\VirtualBox&gt;VBoxManage.exe modifymedium &quot;location\to\the\storage\file\which\needs\to\be\expanded&quot; --resize 40000</pre><p>Upon running above the size of the disk will be increased. Next for setting up the same storage file ( vdi ) for your VM follow the below instructions</p><ul><li>Next navigate to the Settings -&gt; Storage window of the current VM again and add the expanded storage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*_3bIYA8IL_Adz5IEKrGXOg.png" /></figure><ul><li>Next start the VM. The newly added amount will be available as anUnallocated space in the Storage settings of the operating system which your VM is running.</li><li>Finally expand the disk to append it with the formed Unallocated space.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5205720c65f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a new branch from any commit of a github repository which has a long gone history.]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/creating-a-new-branch-from-any-commit-of-a-github-repository-which-has-a-long-gone-history-53885f9a8e29?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/53885f9a8e29</guid>
            <category><![CDATA[commit]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[branch-metrics]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sat, 03 Mar 2018 18:56:14 GMT</pubDate>
            <atom:updated>2018-03-03T18:56:14.587Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RTgn1s0GY8r0rSPsAzf8NQ.png" /><figcaption>Source: <a href="https://wac-cdn.atlassian.com/dam/jcr:83323200-3c57-4c29-9b7e-e67e98745427/Branch-1.png?cdnVersion=jt">https://wac-cdn.atlassian.com/dam/jcr:83323200-3c57-4c29-9b7e-e67e98745427/Branch-1.png?cdnVersion=jt</a></figcaption></figure><p>There may be times that you need to try something different which is completely off the track of current master (branch). You may want to start a new branch from scratch (from first commit) or diverge from an already existing commit on the same repository. Either way this can be easily achieved by following the simple steps as follows,</p><ul><li>Log into to your github account.</li><li>Get the commit history of the relevant repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSSn_rdDrrbvnLyMGP9gZg.png" /><figcaption>Repository: <a href="https://github.com/kasunsiyambalapitiya/carbon-kernel/commits/master">https://github.com/kasunsiyambalapitiya/carbon-kernel/commits/master</a></figcaption></figure><ul><li>Click the button on Browse the repository at this point in the history on the commit which you like to start your new branch with.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Bvef8cYCsSUi_jZ0GcAbQ.png" /><figcaption>Repository: <a href="https://github.com/kasunsiyambalapitiya/carbon-kernel/commits/master">https://github.com/kasunsiyambalapitiya/carbon-kernel/commits/master</a></figcaption></figure><ul><li>Then on the top left tree dropdown type in the name you wish call your new branch, then you will be prompted for the creation of a new branch at the selected commit :) .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*LS8VEoutTQ1KNkRxwJhgSA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53885f9a8e29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing Java version using alias in Linux]]></title>
            <link>https://kasunsiyambalapitiya.medium.com/changing-java-version-using-alias-in-linux-de52cc4fa3b0?source=rss-7c993c792d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/de52cc4fa3b0</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[terminal]]></category>
            <dc:creator><![CDATA[Kasun Siyambalapitiya]]></dc:creator>
            <pubDate>Sat, 24 Feb 2018 07:58:14 GMT</pubDate>
            <atom:updated>2021-06-20T20:01:33.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZB7dqQQ32HCXNWYS02T8g.jpeg" /><figcaption>Image Source: <a href="https://pixabay.com/illustrations/board-arrow-shield-note-change-978179/">https://pixabay.com/illustrations/board-arrow-shield-note-change-978179/</a></figcaption></figure><p>As a programmer or a user there may be times that you might need to switch between different java versions in order for running some legacy softwares or for testing your own written programs. With Linux this can be done easily and effectively. Please go through the following steps in changing your java version temporary. (please do note that this change is effective only for the terminal that executed the alias)</p><ul><li>First download the relevant JDK (Java Development Kit) you need from <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Oracle Website</a>.</li><li>Then extract the downloaded JDK to a desired location.</li><li>Open .bashrc from your favorite text editor. (in my case it’s Vim)</li></ul><pre>vim ~/.bashsrc </pre><p>then at the bottom of the file add the following lines and save the file.</p><pre>alias java7 = &#39;export JAVA_HOME=&quot;/path/to/your/jdk/location&quot; ; export path=$JAVA_HOME/bin:$path&#39;</pre><ul><li>Finally source the new configurations by running the following</li></ul><pre>source ~/.bashrc</pre><p>All are set :) now you will be able to switch between Java versions just by running the alias word on your terminal.</p><pre>echo $JAVA_HOME<br>/usr/lib/jvm/java-8-oracle<br>java7<br>echo $JAVA_HOME<br>/home/kasun/Downloads/Softwares/Java/Java-7/jdk1.7.0_80/</pre><p>Note: you can have as mush as java versions like above with different aliases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de52cc4fa3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>