<?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 Gayan Sandaruwan DE Silva on Medium]]></title>
        <description><![CDATA[Stories by Gayan Sandaruwan DE Silva on Medium]]></description>
        <link>https://medium.com/@gayankavirathne?source=rss-4168abb3772f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mP2bl363hB58rlcD.</url>
            <title>Stories by Gayan Sandaruwan DE Silva on Medium</title>
            <link>https://medium.com/@gayankavirathne?source=rss-4168abb3772f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 00:01:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gayankavirathne/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[Updating puppet on Centos 8]]></title>
            <link>https://gayankavirathne.medium.com/updating-puppet-on-centos-8-7bef4f6b87f1?source=rss-4168abb3772f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bef4f6b87f1</guid>
            <category><![CDATA[puppet]]></category>
            <category><![CDATA[centos]]></category>
            <category><![CDATA[puppetserver]]></category>
            <category><![CDATA[gpg-key]]></category>
            <dc:creator><![CDATA[Gayan Sandaruwan DE Silva]]></dc:creator>
            <pubDate>Wed, 10 Feb 2021 12:06:40 GMT</pubDate>
            <atom:updated>2021-02-10T12:06:40.152Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are trying to update the puppet or maybe running dnf update / yum update to update other repositories, might be geeting the following erro</p><pre>STDERR:<br>    warning: /var/cache/dnf/puppet6-61278a3d8cb73bd9/packages/puppet-agent-6.21.0-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 9e61ef26: NOKEY<br>    The GPG keys listed for the &quot;Puppet 6 Repository el 8 - x86_64&quot; repository are already installed but they are not correct for this package.<br>    Check that the correct key URLs are configured for this repository.. Failing package is: puppet-agent-6.21.0-1.el8.x86_64<br>     GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet6-release<br>    Public key for puppet6-release-6.0.0-14.el8.noarch.rpm is not installed. Failing package is: puppet6-release-6.0.0-14.el8.noarch<br>     GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet6-release<br>    Error: GPG check FAILED<br>Failed on c5.ds.cse.uom.lk:<br>  The command failed with exit code 1</pre><p>This error means that, repository manager has updated the gpg key from the original site, but the original site is complaining about the new key.</p><p>Let’s see what has happened. Before move into further run the following command and see whats there.</p><pre>ls /etc/pki/rpm-gpg/</pre><p>For me output looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJFO6EZ8hHuQ5vzqHlQg2g.png" /></figure><p>If you carefully look at the output you will see that there are two <strong>RPM-GPD-KEY-puppet6-release</strong> and <strong>RPM-GPD-KEY-2025–04–06-puppet6-release .</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FfZ7fBCOhfJEoqn424g%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FfZ7fBCOhfJEoqn424g%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FfZ7fBCOhfJEoqn424g%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="262" frameborder="0" scrolling="no"><a href="https://medium.com/media/2578e2318d9f8cab6a33bf5e3459a684/href">https://medium.com/media/2578e2318d9f8cab6a33bf5e3459a684/href</a></iframe><p>Now lets go and see the yum repository.</p><pre>cat /etc/yum.repos.d/puppet6.repo</pre><p>The out put for me looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*e4YnbAnGmKUrt99dqAh3lQ.png" /></figure><p>Check the value of parameter gpgkey, you’ll see that it’s kind of pointed to the old file in the key folder. Yum installs the key to correct place as per the instructions from original site, but when its communicating to get new updates, it’s again sending the old key. Okay. Now we know what has gone wrong here.</p><p>What we have to do is to replace the gpg key file to the correct / new one so that yum knows how to find the correct one.</p><p>But to be on safe side, lets just keep both of the files, then yum will manage to find the correct one.</p><p>All you have to do is append the new file path to gpgkey parameter.</p><pre>[puppet6]<br>name=Puppet 6 Repository el 8 - $basearch<br>baseurl=<a href="http://yum.puppetlabs.com/puppet6/el/8/$basearch">http://yum.puppetlabs.com/puppet6/el/8/$basearch</a><br>gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet6-release<br>       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet6-release<br>enabled=1<br>gpgcheck=1</pre><p>Make it look something like this.</p><p>Now go back and re run the update.</p><pre>sudo dnf update</pre><p>Probably it will ask couple of yes/ no questions and we are done.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FCLLlVrnuuhTq0%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FCLLlVrnuuhTq0%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FCLLlVrnuuhTq0%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="245" frameborder="0" scrolling="no"><a href="https://medium.com/media/6216c2bb81bc38432f421435871861b1/href">https://medium.com/media/6216c2bb81bc38432f421435871861b1/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bef4f6b87f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Installing mysql-5.7 server on Ubuntu 20.04 and connecting outside the docker]]></title>
            <link>https://gayankavirathne.medium.com/docker-installing-mysql-5-7-server-on-ubuntu-20-04-and-connecting-outside-the-docker-5a2007ea5ec1?source=rss-4168abb3772f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a2007ea5ec1</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ubuntu-20-04]]></category>
            <category><![CDATA[mysql-server]]></category>
            <dc:creator><![CDATA[Gayan Sandaruwan DE Silva]]></dc:creator>
            <pubDate>Thu, 06 Aug 2020 12:58:23 GMT</pubDate>
            <atom:updated>2020-10-02T08:04:02.733Z</atom:updated>
            <content:encoded><![CDATA[<p>In previous versions of Ubuntu Installing mysql-server version 5.7 was as easy as executing,</p><pre>apt install mysql-server   # don&#39;t run this command, it will install mysql 5.8 ( which you dont need at this moment)</pre><p>But in ubuntu 20.04 ( focal fossa) the default mysql version is version 8. Given that if you run the usual way it will install version 8. Not only that, if you need to install the older version process is very difficult ( might not be impossible). So the easiest solution is to use a docker.</p><p>First you need to install docker.</p><p>If you have older versions of docker remove them first.</p><pre>sudo apt remove docker docker-engine docker.io containerd runc</pre><p>Now update repository, and install the certificates and some dependencies.</p><pre>sudo apt update</pre><pre>sudo apt install \<br>    apt-transport-https \<br>    ca-certificates \<br>    curl \<br>    gnupg-agent \<br>    software-properties-common</pre><p>Add repository key.</p><pre>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -</pre><p>Now set the stable repository</p><pre>sudo add-apt-repository \<br>   &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu \<br>   $(lsb_release -cs) \<br>   stable&quot;</pre><p>Now install the docker engine</p><pre>sudo apt-get update<br>sudo apt-get install docker-ce docker-ce-cli containerd.io</pre><p>To install a certain version you can list the available versions now</p><pre>apt-cache madison docker-ce</pre><p>Output will look like this,</p><pre>docker-ce | 5:19.03.12~3-0~ubuntu-focal | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> focal/stable amd64 Packages<br> docker-ce | 5:19.03.11~3-0~ubuntu-focal | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> focal/stable amd64 Packages<br> docker-ce | 5:19.03.10~3-0~ubuntu-focal | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> focal/stable amd64 Packages<br> docker-ce | 5:19.03.9~3-0~ubuntu-focal | <a href="https://download.docker.com/linux/ubuntu">https://download.docker.com/linux/ubuntu</a> focal/stable amd64 Packages</pre><p>I’m selecting version ‘5:19.03.12~3–0~ubuntu-focal’ and install it as below.</p><p>Template is like this</p><p>sudo apt-get install docker-ce=&lt;VERSION_STRING&gt; docker-ce-cli=&lt;VERSION_STRING&gt; containerd.io</p><p>In my case,</p><p>sudo apt install docker-ce=5:19.03.12~3-0~ubuntu-focal docker-ce-cli=5:19.03.12~3-0~ubuntu-focal containerd.io</p><p>Now Start the docker daemon with following<br>sudo systemctl start docker</p><p>Then Enable docker to run on start of the OS</p><p>sudo systemctl enable docker</p><p>You can test docker by running the hello-world</p><pre>sudo docker run hello-world</pre><p>then see the created image by,</p><pre>sudo docker images</pre><p>Now remove this docker</p><pre>sudo docker rmi hello-world</pre><p>We need to give the user to run docker to avoid using sudo</p><p>Follow this,</p><pre>sudo usermod -a -G docker $(whoami)</pre><pre>//now check the user is added</pre><pre>grep docker /etc/group<br>// output will be like<br>// docker:x:998:$(whoami)</pre><pre>newgrp docker</pre><p>Now, no need to use sudo for running docker related commands.</p><p>Now lets install mysql server 5.7. First we are pulling the docker image, then create a volume to store the mysql data.</p><pre><strong>docker pull mysql/mysql-server:5.7</strong></pre><pre><strong>docker volume create mysql-volume</strong></pre><p>In following command set the passwd for root for your desired</p><pre><strong>docker run -d --restart unless-stopped --name=mysql -p3306:3306 -v mysql-volume:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql/mysql-server:5.7</strong></pre><p>Now check the created installation</p><pre><strong>docker ps</strong></pre><pre><strong>docker exec -it mysql bash</strong></pre><p>Now create another user (other than root) to use from outside connections.</p><p>First Log into mysql with the password you gave to root early.</p><pre>mysql -uroot -p</pre><pre>// Hit enter and then enter the password</pre><pre>create user &#39;admin&#39;@&#39;%&#39; identified by ‘password’</pre><pre>GRANT ALL PRIVILEGES ON *.* TO &#39;admin&#39;@&#39;%&#39; WITH GRANT OPTION;</pre><p>Now you can install db viewer community or any desired application to browse mysql from outside.</p><p>Keep in mind that docker we just installed is a centos version. So if you need to do any changes in the future google with centos. Most of requirements should be installed by yum inside the docker.</p><p>References</p><ol><li><a href="https://docs.docker.com/engine/install/ubuntu/">https://docs.docker.com/engine/install/ubuntu/</a></li><li><a href="https://stackoverflow.com/questions/47854463/docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socke">https://stackoverflow.com/questions/47854463/docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socke</a></li><li><a href="https://docs.docker.com/config/containers/start-containers-automatically/">https://docs.docker.com/config/containers/start-containers-automatically/</a></li><li><a href="https://towardsdatascience.com/connect-to-mysql-running-in-docker-container-from-a-local-machine-6d996c574e55">https://towardsdatascience.com/connect-to-mysql-running-in-docker-container-from-a-local-machine-6d996c574e55</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a2007ea5ec1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing mysql-server in remote ubuntu server and access from a remote client]]></title>
            <link>https://gayankavirathne.medium.com/installing-mysql-server-in-remote-ubuntu-server-and-access-from-a-remote-client-c5135ac0bf40?source=rss-4168abb3772f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5135ac0bf40</guid>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Gayan Sandaruwan DE Silva]]></dc:creator>
            <pubDate>Tue, 12 Jun 2018 23:17:49 GMT</pubDate>
            <atom:updated>2018-06-12T23:17:49.279Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Installing mysql-server in remote ubuntu server and access from a remote client</strong></p><p>Today I had to spend hours trying to find a way how to do this easily but unfortunately many options were lengthy and most of them didn’t work at all. Finally I figured out to do it in my own way( Maybe there are some security issues, so, use with caution).</p><p>The goal of this is to install and configure mysql server in remote ubuntu server and to access to it with a local client (my case it is <strong>dbeaver </strong>)</p><p>First logged in the remote server through ssh</p><pre><em>user@local:~$ ssh ‘user’@‘remoteserver’</em></pre><p>Install mysql server by</p><pre><em>user@remoteserver:~$ sudo apt install mysql-server</em></pre><p>In newer mysql versions of mysql the user is authenticated via the auth socket plugin, so you can log in to the root user with your system user credential by,</p><pre><em>user@remoteserver:~$ sudo mysql -u root -p</em></pre><p>Here you have to give the <strong>sudo</strong> password. If you need to change this to the old method check <a href="https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost">here</a>.</p><p>Now create a database, user and assign privileges to that user who can connect through a remote connection.</p><pre>mysql&gt; create user ‘user’@‘localhost’ identified by ‘password’;<br>mysql&gt; create database &#39;database&#39;;<br>mysql&gt; grant all privileges on &#39;database&#39;.* to &#39;user&#39;@&#39;localhost&#39;;</pre><p>Now go to the local client you are using. In my case it is <strong>dbeaver.</strong></p><p>Go to the add new connection wizard.</p><ol><li>Fill the <strong>server Host </strong>as <strong>localhost </strong>and for the database and user name as above. Now go to next page.</li><li>From the tabs menu put a tick in the Use SSH Tunnel and then fill the detail</li><li>Test Connection</li></ol><p><strong>Nothing new right </strong>? Yes, but when you google there are many things to do but you don’t have to do those unnecessary things where the solution is much much easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5135ac0bf40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSOC -2018 with MATRIX.org]]></title>
            <link>https://medium.com/series/gsoc-2018-with-matrix-org-29f1fa17c39?source=rss-4168abb3772f------2</link>
            <guid isPermaLink="false">https://medium.com/p/29f1fa17c39</guid>
            <dc:creator><![CDATA[Gayan Sandaruwan DE Silva]]></dc:creator>
            <pubDate>Mon, 26 Mar 2018 14:01:25 GMT</pubDate>
            <atom:updated>2018-03-26T14:01:25.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Willing to participate to GSOC this year with MATRIX.org. They have some cool projects. My expectation is to join to write a bridge for connecting viber.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29f1fa17c39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mars Weather Prediction With Italian Mars Society]]></title>
            <link>https://gayankavirathne.medium.com/mars-weather-prediction-with-italian-mars-society-93e45210509e?source=rss-4168abb3772f------2</link>
            <guid isPermaLink="false">https://medium.com/p/93e45210509e</guid>
            <category><![CDATA[mars]]></category>
            <dc:creator><![CDATA[Gayan Sandaruwan DE Silva]]></dc:creator>
            <pubDate>Mon, 03 Apr 2017 15:48:29 GMT</pubDate>
            <atom:updated>2017-04-03T16:06:32.736Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Mars Weather Prediction With </strong><a href="http://mars-city.org/"><strong>Italian Mars Society</strong></a></p><p>This project is continued with the collaboration of Italian Mars society; an open source organization which working on a virtual Mars Simulation.</p><p>My project is expected to conduct parallel to Google summer Of Code 2017 under Python Organization.</p><p>You can find the project proposal <a href="https://www.dropbox.com/s/cmh58o085sbbaie/Italian%20Mars%20Society%3A%20Space%20Weather%20Monitoring%20for%20A%20Virtual%20Reality%0ASimulation%20of%20a%20Martian%20Settlement.pdf?dl=0">here</a> in Dropbox. Proposal contains the high level architecture of the system that i’m expecting to build.</p><p>Also you can find code <a href="https://github.com/GayanSandaruwan/WhetherMonitor.git">here</a> in GitHub.</p><p>Will Keep you updated with more information. See You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93e45210509e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>