<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>maxvel&#39;s markups</title>
    <link>https://maxvel.writeas.com/</link>
    <description>My little corner of the internet!</description>
    <pubDate>Tue, 30 Jun 2026 18:17:52 +0000</pubDate>
    <item>
      <title>An Exciting Week. Phew! 💁🏻‍♂️</title>
      <link>https://maxvel.writeas.com/an-exciting-week?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[So last week was very busy, engaging and exciting, since I was finally moving my stuff from Nextcloud to Photoprism and Seafile. And also, I had installed Minetest on my server and many of my friends and relatives came in to join me to build some cool things together. It couldn’t have been any better than this!&#xA;&#xA;!--more--&#xA;&#xA;Seafile and Photoprism&#xA;&#xA;Amidst all the chaos with my file synchronisation and Ecosystematic-Wall with Nextcloud, it was probably the best decision to move to Seafile and Photoprism. I spent the last week testing things and they turned out well and I quite like them!&#xA;&#xA;Seafile and Photoprism are amazing in their respective domains and they have their own issues to solve in their own domains. So arguably that makes the platform better and better with time. I have a lot of hopes on both of these services since they have made my life so much easier with file storage and photos/videos organisation.&#xA;&#xA;However, Photoprism lacks multi account support as of now (its on the roadmap) and I’m hopeful for this release since the service is already very neat and polished!&#xA;&#xA;What Test? MINETEST!!&#xA;&#xA;I just love minetest! I had played the game before, but boy oh boy! when it’s paired with other players who are your friends and relatives in your own server, the fun is almost ten folds than that of single player. I kind-of hate myself for not trying it out during the lockdown since this would have been a fun way to virtually meet my buddies (I hope).&#xA;&#xA;Better late than never! Now I have finally created a world and I have added tons of mods to the server and made it customisable to my needs. Just in case you want to build one for yourself, you can find the mod info here. I will eventually open it to the world once I learn how to moderate the server better. I want my world to be a fun filled place, I just gotta learn to be a good admin :)&#xA;&#xA;And I hope you are having a nice day, or nice night, depending on where you are reading from :)&#xA;&#xA;---&#xA;&#xA;Categorized Under #SelfHostedExperiments&#xA;&#xA;Tags : #Nextcloud #Photoprism #Seafile #Minetest&#xA;&#xA;Timestamp : #June2021]]&gt;</description>
      <content:encoded><![CDATA[<p>So last week was very busy, engaging and exciting, since I was finally moving my stuff from <a href="https://nextcloud.com" rel="nofollow">Nextcloud</a> to <a href="https://photoprism.app/" rel="nofollow">Photoprism</a> and <a href="https://seafile.com" rel="nofollow">Seafile</a>. And also, I had installed Minetest on my server and many of my friends and relatives came in to join me to build some cool things together. It couldn’t have been any better than this!</p>



<h3 id="seafile-and-photoprism" id="seafile-and-photoprism">Seafile and Photoprism</h3>

<p>Amidst all the chaos with my file synchronisation and Ecosystematic-Wall with Nextcloud, it was probably the best decision to move to Seafile and Photoprism. I spent the last week testing things and they turned out well and I quite like them!</p>

<p>Seafile and Photoprism are amazing in their respective domains and they have their own issues to solve in their own domains. So arguably that makes the platform better and better with time. I have a lot of hopes on both of these services since they have made my life so much easier with file storage and photos/videos organisation.</p>

<p>However, Photoprism lacks multi account support as of now (<a href="https://github.com/photoprism/photoprism/issues/98" rel="nofollow">its on the roadmap</a>) and I’m hopeful for this release since the service is already very neat and polished!</p>

<h3 id="what-test-minetest" id="what-test-minetest">What Test? MINETEST!!</h3>

<p>I just love minetest! I had played the game before, but boy oh boy! when it’s paired with other players who are your friends and relatives in your own server, the fun is almost ten folds than that of single player. I kind-of hate myself for not trying it out during the lockdown since this would have been a fun way to virtually meet my buddies (I hope).</p>

<p>Better late than never! Now I have finally created a world and I have added tons of mods to the server and made it customisable to my needs. Just in case you want to build one for yourself, you can find the mod info <a href="https://codeberg.org/maxvel/dotfiles/src/branch/main/minetest" rel="nofollow">here</a>. I will eventually open it to the world once I learn how to moderate the server better. I want my world to be a fun filled place, I just gotta learn to be a good admin :)</p>

<p>And I hope you are having a nice day, or nice night, depending on where you are reading from :)</p>

<hr/>

<p>Categorized Under <a href="https://maxvel.writeas.com/tag:SelfHostedExperiments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SelfHostedExperiments</span></a></p>

<p>Tags : <a href="https://maxvel.writeas.com/tag:Nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nextcloud</span></a> <a href="https://maxvel.writeas.com/tag:Photoprism" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Photoprism</span></a> <a href="https://maxvel.writeas.com/tag:Seafile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Seafile</span></a> <a href="https://maxvel.writeas.com/tag:Minetest" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Minetest</span></a></p>

<p>Timestamp : <a href="https://maxvel.writeas.com/tag:June2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">June2021</span></a></p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/an-exciting-week</guid>
      <pubDate>Wed, 30 Jun 2021 08:09:26 +0000</pubDate>
    </item>
    <item>
      <title>Too much Minetest-ing ⛏</title>
      <link>https://maxvel.writeas.com/too-much-minetest-ing?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I was revisiting my self hosted setup off-late and decided to have some fun because it has been a long and gloomy day. So what could be better than installing a game in the server and letting everybody else connect to it and play? So, that’s when I came across minetest and installed it in my server. I had been playing for a week now and I don’t think I’ll ever get tired of it&#xA;&#xA;!--more--&#xA;&#xA;So, Minetest!&#xA;&#xA;I had been playing a lot, like a loooot lately. The best thing about minetest is that it is open source. So you get a ton of community attention over the game and the community makes the game better by sending PR’s and patches that make the game better altogether. I also added tons of mods that were community contributed (trust me, that took a while to setup) But that just means you can mod the game any way you want to. Sky is the limit here!&#xA;&#xA;So out of excitement I uploaded this screenshot of a beautiful morning on fediverse!&#xA;&#xA;Minetest ♥️&#xA;&#xA;---&#xA;&#xA;Categorized under #SelfHostedExperiments&#xA;&#xA;Tags : #Minetest #Game&#xA;&#xA;Timestamp : #June2021]]&gt;</description>
      <content:encoded><![CDATA[<p>I was revisiting my self hosted setup off-late and decided to have some fun because it has been a long and gloomy day. So what could be better than installing a game in the server and letting everybody else connect to it and play? So, that’s when I came across minetest and installed it in my server. I had been playing for a week now and I don’t think I’ll ever get tired of it</p>



<h3 id="so-minetest" id="so-minetest">So, Minetest!</h3>

<p>I had been playing a lot, like a <em>loooot</em> lately. The best thing about minetest is that it is open source. So you get a ton of community attention over the game and the community makes the game better by sending PR’s and patches that make the game better altogether. I also added tons of mods that were community contributed (trust me, that took a while to setup) But that just means you can mod the game any way you want to. Sky is the limit here!</p>

<p>So out of excitement I uploaded <a href="https://pixey.org/p/maxvel/314429362122395648" rel="nofollow">this screenshot</a> of a beautiful morning on fediverse!</p>

<p>Minetest ♥️</p>

<hr/>

<p>Categorized under <a href="https://maxvel.writeas.com/tag:SelfHostedExperiments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SelfHostedExperiments</span></a></p>

<p>Tags : <a href="https://maxvel.writeas.com/tag:Minetest" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Minetest</span></a> <a href="https://maxvel.writeas.com/tag:Game" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Game</span></a></p>

<p>Timestamp : <a href="https://maxvel.writeas.com/tag:June2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">June2021</span></a></p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/too-much-minetest-ing</guid>
      <pubDate>Tue, 22 Jun 2021 04:46:43 +0000</pubDate>
    </item>
    <item>
      <title>A Terrifying Morning.. 🤦🏻‍♂️</title>
      <link>https://maxvel.writeas.com/a-terrifying-morning?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Well, this morning, I woke up to a shock because, my archive of photos and videos amounting to 15GB’s had been mysteriously disappeared. This happened while I was testing Photoprism and Seafile on my self hosted setup after this post. I was migrating my photos and videos from Nextcloud to Photoprism from WebDav. It caught me off-guard and this is just a note I want to make so that I can look back and laugh at my stupidity!&#xA;&#xA;!--more--&#xA;&#xA;So, What Happened?&#xA;&#xA;I was trying to move photos from Nextcloud to Photoprism (Docker). Photoprism has a feature where I can add a WebDav folder and it will sync the photos automatically. That’s great! Because I don’t need to download the photos manually and then upload it to Photoprism. I was seriously liking the whole process and it made my life a bit simpler while setting up these services. After the sync, I deleted the WebDav folder from Nextcloud (of which the photos were synced) like a good boy since the photos were already copied and started organising the photos in Photoprism.&#xA;&#xA;It was genuinely a good productive day. Things had gone as per the plan and it couldn’t have been any better. And I called it a day and had a very sound sleep.&#xA;&#xA;The next day, to my surprise, the photos that I carefully collected over the years were lost (Mysteriously). There was nothing more terrifying at that moment when I saw my gallery folder empty!!&#xA;&#xA;Yeah, But How?&#xA;&#xA;Apparently, Photoprism and Nextcloud folder was on sync. That means, whenever the folder in Nextcloud changes, Photoprism also does that change in its folder and its consequent database.&#xA;&#xA;  After the sync, Like I deleted the WebDav folder from Nextcloud (of which the photos were synced) like a good boy and started organising the photos in Photoprism.&#xA;&#xA;This is where I did a blunder and everything was gone! Since Photoprism saw no photos in the Nextcloud folder, it went ahead and deleted everything from its folder. Simple!&#xA;&#xA;And, How did you recover them?&#xA;&#xA;So, Nextcloud has a built in trash feature which I had enabled while I had installed Nextcloud in my server. After the migration, I had deleted the Nextcloud folder in the Nextcloud web interface which will move the folder from files to filestrash.&#xA;&#xA;It took me a while to get there since webui in Nextcloud was unresponsive and amidst all this confusion, I forgot that there was even a files_trash folder in the Nextcloud setup. I should have removed the Nextcloud - Photoprism sync first before deleting one of the folders.&#xA;&#xA;Then a quick copy and import recovered all the photos and videos. However then I carefully deleted my Nextcloud without affecting any other components in the setup. Phew! it was a really long morning. A Lesson for Life.&#xA;&#xA;Categorized under #Note&#xA;&#xA;Tags : #Lessons4Life #Nextcloud #PhotoPrism #Seafile #Photos #Videos&#xA;&#xA;Timestamp : #June2021]]&gt;</description>
      <content:encoded><![CDATA[<p>Well, this morning, I woke up to a shock because, my archive of photos and videos amounting to 15GB’s had been mysteriously disappeared. This happened while I was testing <a href="https://photoprism.app/" rel="nofollow">Photoprism</a> and <a href="https://www.seafile.com/" rel="nofollow">Seafile</a> on my self hosted setup after this <a href="https://maxvel.sh/moving-out-of-nextcloud" rel="nofollow">post</a>. I was migrating my photos and videos from Nextcloud to Photoprism from <a href="https://en.wikipedia.org/wiki/WebDAV" rel="nofollow">WebDav</a>. It caught me off-guard and this is just a note I want to make so that I can look back and laugh at my stupidity!</p>



<h3 id="so-what-happened" id="so-what-happened">So, What Happened?</h3>

<p>I was trying to move photos from <a href="https://nextcloud.com" rel="nofollow">Nextcloud</a> to Photoprism (<a href="https://www.docker.com/" rel="nofollow">Docker</a>). Photoprism has a feature where I can add a WebDav folder and it will sync the photos automatically. That’s great! Because I don’t need to download the photos manually and then upload it to Photoprism. I was seriously liking the whole process and it made my life a bit simpler while setting up these services. After the sync, I deleted the WebDav folder from Nextcloud (of which the photos were synced) <em>like a good boy</em> since the photos were already copied and started organising the photos in Photoprism.</p>

<p>It was genuinely a good productive day. Things had gone as per the plan and it couldn’t have been any better. And I called it a day and had a very sound sleep.</p>

<p>The next day, to my surprise, the photos that I carefully collected over the years were lost (Mysteriously). There was nothing more terrifying at that moment when I saw my <em>gallery</em> folder empty!!</p>

<h3 id="yeah-but-how" id="yeah-but-how">Yeah, But How?</h3>

<p>Apparently, Photoprism and Nextcloud folder was on sync. That means, whenever the folder in Nextcloud changes, Photoprism also does that change in its folder and its consequent database.</p>

<blockquote><p>After the sync, Like I deleted the WebDav folder from Nextcloud (of which the photos were synced) like a good boy and started organising the photos in Photoprism.</p></blockquote>

<p>This is where I did a blunder and everything was gone! Since Photoprism saw no photos in the Nextcloud folder, it went ahead and deleted everything from its folder. Simple!</p>

<h3 id="and-how-did-you-recover-them" id="and-how-did-you-recover-them">And, How did you recover them?</h3>

<p>So, Nextcloud has a built in trash feature which I had enabled while I had installed Nextcloud in my server. After the migration, I had deleted the Nextcloud folder in the Nextcloud web interface which will move the folder from <em>files</em> to <em>files_trash</em>.</p>

<p>It took me a while to get there since <em>web_ui</em> in Nextcloud was unresponsive and amidst all this confusion, I forgot that there was even a <em>files_trash</em> folder in the Nextcloud setup. <em>I should have removed the Nextcloud &lt;–&gt; Photoprism sync first before deleting one of the folders.</em></p>

<p>Then a quick copy and import recovered all the photos and videos. However then I carefully deleted my Nextcloud without affecting any other components in the setup. Phew! it was a really long morning. A Lesson for Life.</p>

<p>Categorized under <a href="https://maxvel.writeas.com/tag:Note" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Note</span></a></p>

<p>Tags : <a href="https://maxvel.writeas.com/tag:Lessons4Life" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Lessons4Life</span></a> <a href="https://maxvel.writeas.com/tag:Nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nextcloud</span></a> <a href="https://maxvel.writeas.com/tag:PhotoPrism" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">PhotoPrism</span></a> <a href="https://maxvel.writeas.com/tag:Seafile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Seafile</span></a> <a href="https://maxvel.writeas.com/tag:Photos" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Photos</span></a> <a href="https://maxvel.writeas.com/tag:Videos" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Videos</span></a></p>

<p>Timestamp : <a href="https://maxvel.writeas.com/tag:June2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">June2021</span></a></p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/a-terrifying-morning</guid>
      <pubDate>Thu, 17 Jun 2021 12:33:19 +0000</pubDate>
    </item>
    <item>
      <title>Moving out of Nextcloud ⛅️</title>
      <link>https://maxvel.writeas.com/moving-out-of-nextcloud?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I loved Nextcloud. Still do.. But there are certain things that concerns me being somebody who likes to self-host almost every service under my own nest. This month I was thinking seriously about usability and convenience, asking myself questions like,&#xA;&#xA;  “The efforts that I’m putting into self hosting and maintaining xyz service on my RaspberryPi really worth it? Or should I move to some other service or create an account in somebody else’s self hosted setup?”&#xA;&#xA;After this self-introspection, it occurred to me that there are a few changes I had to make in my self hosted setup, and this is a result of a lot of brainstorming related to it.&#xA;&#xA;!--more--&#xA;&#xA;Why not Nextcloud?&#xA;&#xA;Yes exactly, Why not Nextcloud? It’s amazing. It has a lot of add ons, plugins, custom css and many more. Just make sure you install it properly and you don’t need to worry about installing another service for news/podcasts/calendar/contacts and much more.&#xA;&#xA;Yes, I get that. That’s what anyone would tell. But the flipside of the coin is that, you are using one service to be a base for every other type of service you use. So even when one of the service starts being janky, you are deemed to stay with it. Since I use a RaspberryPi to self host most of my services, Nextcloud would take up almost all the memory not to leave any space for any other service I would like to deploy.&#xA;&#xA;I used nextcloud as a drop-in replacement for Google drive and Google photos all in one. Eventually I started to make it as my ecosystem keeping my calendar and contacts in sync with it. It’s a really good service but not good enough to be self hosted on a raspberry pi and low-memory chips.&#xA;&#xA;What next?&#xA;&#xA;I’m planning to move to a diversified ecosystem than putting all my eggs in one basket. I’ll focus on services that does one thing and does it well. (I briefly spoke about it in this toot) And have different services to host files (?seafile) and host photos/videos (?photoprism). So that when they become unusable for my use-case, they can be easily replaced. Hopefully when I upgrade my setup to use machines with better memory, maybe I’ll come back to Nextcloud. Until then, Bye Nextcloud :(&#xA;&#xA;Categorized Under #MyTechXperiments&#xA;&#xA;Tags : #nextcloud #ecosystem #files #photos #selfhosted&#xA;&#xA;Timestamp : #June2021]]&gt;</description>
      <content:encoded><![CDATA[<p>I loved <a href="https://nextcloud.com/" title="Nextcloud" rel="nofollow">Nextcloud</a>. Still do.. But there are certain things that concerns me being somebody who likes to self-host almost every service under my own nest. This month I was thinking seriously about usability and convenience, asking myself questions like,</p>

<blockquote><p>“The efforts that I’m putting into self hosting and maintaining xyz service on my RaspberryPi really worth it? Or should I move to some other service or create an account in somebody else’s self hosted setup?”</p></blockquote>

<p>After this self-introspection, it occurred to me that there are a few changes I had to make in my self hosted setup, and this is a result of a lot of brainstorming related to it.</p>



<h3 id="why-not-nextcloud" id="why-not-nextcloud">Why not Nextcloud?</h3>

<p>Yes exactly, Why not Nextcloud? It’s amazing. It has a lot of add ons, plugins, custom css and many more. Just make sure you install it properly and you don’t need to worry about installing another service for news/podcasts/calendar/contacts and much more.</p>

<p>Yes, I get that. That’s what anyone would tell. But the flipside of the coin is that, you are using one service to be a base for every other type of service you use. So even when one of the service starts being janky, you are deemed to stay with it. Since I use a <a href="https://www.raspberrypi.org/" title="RaspberryPi" rel="nofollow">RaspberryPi</a> to self host most of my services, Nextcloud would take up almost all the memory not to leave any space for any other service I would like to deploy.</p>

<p>I used nextcloud as a drop-in replacement for <em>Google drive</em> and <em>Google photos</em> all in one. Eventually I started to make it as my ecosystem keeping my calendar and contacts in sync with it. It’s a really good service but not good enough to be self hosted on a raspberry pi and low-memory chips.</p>

<h3 id="what-next" id="what-next">What next?</h3>

<p>I’m planning to move to a diversified ecosystem than putting all my eggs in one basket. I’ll focus on services that does one thing and does it well. (<a href="https://fosstodon.org/@maxvel/106412920887235350" title="Toot" rel="nofollow">I briefly spoke about it in this toot</a>) And have different services to host files (?<a href="https://www.seafile.com/en/home/" title="Seafile" rel="nofollow">seafile</a>) and host photos/videos (?<a href="https://photoprism.app/" title="Photoprism" rel="nofollow">photoprism</a>). So that when they become unusable for my use-case, they can be easily replaced. Hopefully when I upgrade my setup to use machines with better memory, maybe I’ll come back to Nextcloud. Until then, <em>Bye Nextcloud :(</em></p>

<p>Categorized Under <a href="https://maxvel.writeas.com/tag:MyTechXperiments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">MyTechXperiments</span></a></p>

<p>Tags : <a href="https://maxvel.writeas.com/tag:nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">nextcloud</span></a> <a href="https://maxvel.writeas.com/tag:ecosystem" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ecosystem</span></a> <a href="https://maxvel.writeas.com/tag:files" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">files</span></a> <a href="https://maxvel.writeas.com/tag:photos" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">photos</span></a> <a href="https://maxvel.writeas.com/tag:selfhosted" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">selfhosted</span></a></p>

<p>Timestamp : <a href="https://maxvel.writeas.com/tag:June2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">June2021</span></a></p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/moving-out-of-nextcloud</guid>
      <pubDate>Tue, 15 Jun 2021 08:59:44 +0000</pubDate>
    </item>
    <item>
      <title>Moving from Hugo to Write.as ✍🏻</title>
      <link>https://maxvel.writeas.com/moving-from-hugo-to-write-as-p8d4?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I never initially thought that I would do this. Maintaining a static generated website using Hugo seemed so customisable and simple then, I didn’t even care to look for other options. But now that I have built my website in write.as, I really hate myself for not trying it sooner.&#xA;&#xA;!--more--&#xA;&#xA;What went wrong with hugo?&#xA;&#xA;Don’t get me wrong, I really like Hugo. I really love the way it is customisable to its core. You can create new pages from the existing template, or write a new layout altogether. And boy oh boy! there are tons of themes available. All you gotta do is just run a command and the theme is live. I loved this idea so much that I had made my own Theme for Hugo which then was used to theme my own website.&#xA;&#xA;However, that’s about where the advantages end. Eventually things started to crumble down when I started putting more efforts in setting up the layout and theme for my website when I should be spending more time writing my articles. In the end of the day I would spend so much time just fixing the layout, I would have no more patience to write an article on top of that. As exciting as building a brand new statically generated fully customisable website sounds, it sure comes with its qualms.&#xA;&#xA;…And, Write.as?&#xA;&#xA;Yes. So I decided to move to write.as since I believe it offers me a proper balance between customisability and usability. It lacks some features that I enjoyed having in Hugo (separate tags and categories to organize my content well). But I think I’ll find my way around it as I go. Write.as has theming support that lets you add Custom CSS and JS to your site. So yeah! I don’t regret moving to write.as for my personal website and blog.&#xA;&#xA;I’ve really missed how I can just jump in, write my mind and publish! ✌🏻&#xA;&#xA;Categorized Under #MyTechXperiments&#xA;&#xA;Tags : #Hugo #WriteAs #PersonalWebsite #Blog&#xA;&#xA;Timestamp : #June2021]]&gt;</description>
      <content:encoded><![CDATA[<p>I never initially thought that I would do this. Maintaining a static generated website using Hugo seemed so customisable and simple then, I didn’t even care to look for other options. But now that I have built my website in write.as, I really hate myself for not trying it sooner.</p>



<h3 id="what-went-wrong-with-hugo" id="what-went-wrong-with-hugo">What went wrong with hugo?</h3>

<p>Don’t get me wrong, I really like <a href="https://gohugo.io/" title="Hugo" rel="nofollow">Hugo</a>. I really love the way it is customisable to its core. You can create new pages from the existing template, or write a new layout altogether. And boy oh boy! there are tons of <a href="https://themes.gohugo.io/" title="Hugo Themes" rel="nofollow">themes</a> available. All you gotta do is just run a command and the theme is live. I loved this idea so much that I had made my own <a href="https://codeberg.org/maxvel/itsybitsy-hugo-theme" title="ItsyBitsy" rel="nofollow">Theme for Hugo</a> which then was used to theme my own website.</p>

<p>However, that’s about where the advantages end. Eventually things started to crumble down when I started putting more efforts in setting up the layout and theme for my website when I should be spending more time writing my articles. In the end of the day I would spend so much time just fixing the layout, I would have no more patience to write an article on top of that. As exciting as building a brand new statically generated fully customisable website sounds, it sure comes with its qualms.</p>

<h3 id="and-write-as" id="and-write-as">…And, Write.as?</h3>

<p>Yes. So I decided to move to write.as since I believe it offers me a proper balance between customisability and usability. It lacks some features that I enjoyed having in Hugo <em>(separate tags and categories to organize my content well)</em>. But I think I’ll find my way around it as I go. Write.as has theming support that lets you add Custom CSS and JS to your site. So yeah! I don’t regret moving to write.as for my personal website and blog.</p>

<p>I’ve really missed how I can just jump in, write my mind and publish! ✌🏻</p>

<p><em>Categorized Under <a href="https://maxvel.writeas.com/tag:MyTechXperiments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">MyTechXperiments</span></a></em></p>

<p>Tags : <a href="https://maxvel.writeas.com/tag:Hugo" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Hugo</span></a> <a href="https://maxvel.writeas.com/tag:WriteAs" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">WriteAs</span></a> <a href="https://maxvel.writeas.com/tag:PersonalWebsite" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">PersonalWebsite</span></a> <a href="https://maxvel.writeas.com/tag:Blog" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Blog</span></a></p>

<p>Timestamp : <a href="https://maxvel.writeas.com/tag:June2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">June2021</span></a></p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/moving-from-hugo-to-write-as-p8d4</guid>
      <pubDate>Sun, 13 Jun 2021 12:27:54 +0000</pubDate>
    </item>
    <item>
      <title>New Beginning</title>
      <link>https://maxvel.writeas.com/new-beginning?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[  Originally Posted on Apr 2, 2021&#xA;&#xA;Categorised under #MyTechXperiments&#xA;&#xA;I had always been interested in writing about the things that were of interest to me. Especially, when I started coding with technologies that were unknown to me, everyday was a new beginning and everything was something that I can tweak around with and come up with something entirely new to me. The whole process was so exhilarating that I wanted to document it in it’s entirety and write about things that pick my interest.&#xA;&#xA;!--more--&#xA;&#xA;Therefore I took the path that was obvious to anybody who would want to write articles on the internet, Medium. To be very honest, I don’t have a problem with Medium. Nor that I had any in the past. But, I always wanted to post my articles in my own domain where I have more control over my infrastructure and my content. Where I TRULY own my content. It was not possible in the past since I wasn’t so technically sound to build an infrastructure for web hosting, and renting one was a far cry.&#xA;&#xA;8 months ago, I bought my first raspberrypi microcontroller to learn networking and self hosting. And I was also fascinated by the infinite possibilities of building things with this credit-card sized computer. Hosting my own website was definitely not a priority to me then. I just wanted to acquire knowledge, so much that, I don’t panic when things go wrong with my setup (which happens all the time). And it definitely took me a lot of making-and-breaking to get things setup properly and finally to be able to host my own website and post my articles in my domain. (Of which this is a first one)&#xA;&#xA;Currently I self host Nextcloud (A self hosted cloud), Jellyfin (A self hosted media center) and Gitea (A self hosted git service) On my raspberrypi microcontroller and access these services outside of my home network. And I’m amazed by how modular and convenient the setup could be when combined with docker to manage the containers running on top of the host. Self hosting has given me a new dimension to think about the tools that I could use to make my digital life more convenient and more user friendly. It has also been an amazing place for me to learn things that I have never thought I would ever come across. I have learned more about things that would not work than things that would. All in all it was a fun journey. And cheers to many more to come. :)]]&gt;</description>
      <content:encoded><![CDATA[<blockquote><p>Originally Posted on <strong>Apr 2, 2021</strong></p></blockquote>

<p>Categorised under <a href="https://maxvel.writeas.com/tag:MyTechXperiments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">MyTechXperiments</span></a></p>

<p>I had always been interested in writing about the things that were of interest to me. Especially, when I started coding with technologies that were unknown to me, everyday was a new beginning and everything was something that I can tweak around with and come up with something entirely new to me. The whole process was so exhilarating that I wanted to document it in it’s entirety and write about things that pick my interest.</p>



<p>Therefore I took the path that was obvious to anybody who would want to write articles on the internet, <a href="https://medium.com/" rel="nofollow">Medium.</a> To be very honest, I don’t have a problem with Medium. Nor that I had any in the past. But, I always wanted to post my articles in my own domain where I have more control over my infrastructure and my content. Where I TRULY own my content. It was not possible in the past since I wasn’t so technically sound to build an infrastructure for web hosting, and renting one was a far cry.</p>

<p>8 months ago, I bought my first <a href="https://www.raspberrypi.org/" rel="nofollow">raspberrypi</a> microcontroller to learn networking and self hosting. And I was also fascinated by the infinite possibilities of building things with this credit-card sized computer. Hosting my own website was definitely not a priority to me then. I just wanted to acquire knowledge, so much that, I don’t panic when things go wrong with my setup (which happens all the time). And it definitely took me a lot of making-and-breaking to get things setup properly and finally to be able to host my own website and post my articles in my domain. (Of which this is a first one)</p>

<p>Currently I self host <a href="https://nextcloud.com/" rel="nofollow">Nextcloud</a> (A self hosted cloud), <a href="https://jellyfin.org/" rel="nofollow">Jellyfin</a> (A self hosted media center) and <a href="https://gitea.io/en-us/" rel="nofollow">Gitea</a> (A self hosted git service) On my raspberrypi microcontroller and access these services outside of my home network. And I’m amazed by how modular and convenient the setup could be when combined with docker to manage the containers running on top of the host. Self hosting has given me a new dimension to think about the tools that I could use to make my digital life more convenient and more user friendly. It has also been an amazing place for me to learn things that I have never thought I would ever come across. I have learned more about things that would not work than things that would. All in all it was a fun journey. And cheers to many more to come. :)</p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/new-beginning</guid>
      <pubDate>Sat, 12 Jun 2021 11:36:31 +0000</pubDate>
    </item>
    <item>
      <title>Ecosystematic Walls of Incarceration</title>
      <link>https://maxvel.writeas.com/ecosystematic-walls-of-incarceration?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[  Originally Posted on Feb 5, 2018&#xA;&#xA;Categorised under #Opinions&#xA;&#xA;“Leave this ecosystem? No way! Why should I leave it when they are providing everything for free and it’s so convenient when everything is just there when you want it!” Yep! This is me approximately one year ago when I was heavily tied into the Google Ecosystem and I had been totally involved in all aspects inside this Ecosystem for five to six years straight. And it took me couple of months to actually explore the internet and discover why it was a bad idea. It’s very easy to say that any service on the internet is convenient because it makes your life so easier. However, every convenience comes with a cost. In here, your freedom of choice and your privacy is at stake!&#xA;&#xA;!--more--&#xA;&#xA;The Problem&#xA;&#xA;I didn’t find the idea of moving out of my ecosystem was considerable because my Ecosystem seemed like my ‘Eden Garden’ where everything I wanted to do was in my hand’s reach. Want to store and retrieve photos easily? Use Google Photos. Want to store your documents? Use Google Drive. Want to edit those documents? Use Google docs. Want to add your photos to those documents? Google photos is integrated with Google docs. It’s as if the your Ecosystem knows what you want to do even before you even think of doing it. This nature of an Ecosystem poses us with two big problems.&#xA;&#xA;Privacy : Your Ecosystem knows a lot about you already to understand what you would possibly want to do (Only if it’s collecting your data which is what most of the ecosystems do).\&#xA;Restriction : Your Ecosystem confines you inside its walls restricting you from even thinking about migrating from your services because if you do, you may have to give up some of that convenience. And it’s gonna take a lot of time to unhook the hooks the ecosystem puts on you.&#xA;&#xA;Privacy in an Ecosystem is a bigger discussion in itself. I want to specifically talk about the second one where it confines you inside its walls, which had happened to me. Convenience is like a drug (to put it bluntly). And even if I had known that my ecosystem tracks me 24⁄7, I was reluctant to give away my convenience. When you are heavily tied into an Ecosystem, you stop looking for other services which are clearly better because whatever your Ecosystem provides is the one that would work best for you in the current state and even if it’s something crappy and something you didn’t like, you would have to live with it. This is how the Ecosystem suppresses your freedom of choice by making you enslaved for what you are being provided, not for what you have demanded. That is basically monopolistic nature put into digital media.&#xA;&#xA;The Realization&#xA;&#xA;Last year, I chose to read ‘Permanent record’ by Edward Snowden). It really changed my outlook and it made me question my online presence. It was really implicative when I looked back at my “Ecosystematical” lifestyle and how much I was missing out on the true essence of what makes the internet special. And, I decided I would migrate my data to those services that are clearly better and explore the wide world out there. And the journey was painfully slow because I had an archive of 50+ GB’s of photos in Google Photos and most of my documents were backed up in Google Drive.&#xA;&#xA;The Takeout Process&#xA;&#xA;Google has a takeout program where you can select all of your data and then request for a copy. Google then aggregates your data and then compresses them down to a zip file. You’ll get an email in your gmail inbox. Then you can download your data through the link. Easy right? No!!&#xA;&#xA;What Google does, is it lets you choose how big of a data chunk you want to download. Say you have an archive of 20GB, you can download it in two chunks of 10GB each or 10 chunks of 2GB each. And those downloads will fail if your internet connection drops down certain threshold. Then you need to retry. If it fails more than 3 times, you need to request for the data again. Most of the people would give up here and choose to spend some more time in this ecosystem until they try again and the cycle repeats.&#xA;&#xA;I had to request for my data thrice and I still couldn’t download all my data. And the only inconvinient process around the whole ecosystem was the takeout process. I don’t know if it was done deliberately, but I had to let go of my 50GB+ of archive which had very important documents and photos. My Eden Garden was punishing me when I decided to move away from it.&#xA;&#xA;The Solution&#xA;&#xA;The solution is to move towards open source projects or towards the services that focus on your privacy. When any service focuses on your privacy, it just means they value you as an end user. Internet means Freedom. So, you should be the one who own your free will to navigate around and call yourself at home. It sure takes a lot of trial and errors to make yourself comfortable by finding a balance between convenicence and digital privacy. But it’s gonna be worth it. The more private you go, less convinient your experience will be. However, there are so many alternatives on the world wide web which is enough for you to build your own convenient ecosystem.&#xA;&#xA;You might want to look at NextCloud Project which is a self hosted cloud solution which has plugins for any use case that you might have.&#xA;&#xA;If you want to start self hosting cheap and best, you might want to look at Raspberry Pi Project which is a credit card sized computer which can be used to host your self hosted setup which can be scaled further in future. The possibilities are endless.&#xA;&#xA;So, Instead of living in someone else’s Eden Garden where you live in their terms, why don’t you make your own Garden and live by your terms. Isn’t that what freedom tastes like?]]&gt;</description>
      <content:encoded><![CDATA[<blockquote><p>Originally Posted on <strong>Feb 5, 2018</strong></p></blockquote>

<p>Categorised under <a href="https://maxvel.writeas.com/tag:Opinions" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Opinions</span></a></p>

<p>“Leave this ecosystem? No way! Why should I leave it when they are providing everything for free and it’s so convenient when everything is just there when you want it!” Yep! This is me approximately one year ago when I was heavily tied into the Google Ecosystem and I had been totally involved in all aspects inside this Ecosystem for five to six years straight. And it took me couple of months to actually explore the internet and discover why it was a bad idea. It’s very easy to say that any service on the internet is convenient because it makes your life so easier. However, every convenience comes with a cost. In here, your freedom of choice and your privacy is at stake!</p>



<h2 id="the-problem" id="the-problem">The Problem</h2>

<p>I didn’t find the idea of moving out of my ecosystem was considerable because my Ecosystem seemed like my ‘Eden Garden’ where everything I wanted to do was in my hand’s reach. Want to store and retrieve photos easily? Use Google Photos. Want to store your documents? Use Google Drive. Want to edit those documents? Use Google docs. Want to add your photos to those documents? Google photos is integrated with Google docs. It’s as if the your Ecosystem knows what you want to do even before you even think of doing it. This nature of an Ecosystem poses us with two big problems.</p>
<ul><li><strong>Privacy :</strong> Your Ecosystem knows a lot about you already to understand what you would possibly want to do (Only if it’s collecting your data which is what most of the ecosystems do).\</li>
<li><strong>Restriction :</strong> Your Ecosystem confines you inside its walls restricting you from even thinking about migrating from your services because if you do, you may have to give up some of that convenience. And it’s gonna take a lot of time to unhook the hooks the ecosystem puts on you.</li></ul>

<p>Privacy in an Ecosystem is a bigger discussion in itself. I want to specifically talk about the second one where it confines you inside its walls, which had happened to me. Convenience is like a drug (to put it bluntly). And even if I had known that my ecosystem tracks me 24⁄7, I was reluctant to give away my convenience. When you are heavily tied into an Ecosystem, you stop looking for other services which are clearly better because whatever your Ecosystem provides is the one that would work best for you in the current state and even if it’s something crappy and something you didn’t like, you would have to live with it. This is how the Ecosystem suppresses your freedom of choice by making you enslaved for what you are being provided, not for what you have demanded. That is basically monopolistic nature put into digital media.</p>

<h2 id="the-realization" id="the-realization">The Realization</h2>

<p>Last year, I chose to read <a href="https://en.wikipedia.org/wiki/Permanent_Record_(autobiography)" rel="nofollow">‘Permanent record’ by Edward Snowden</a>. It really changed my outlook and it made me question my online presence. It was really implicative when I looked back at my “Ecosystematical” lifestyle and how much I was missing out on the true essence of what makes the internet special. And, I decided I would migrate my data to those services that are clearly better and explore the wide world out there. And the journey was painfully slow because I had an archive of 50+ GB’s of photos in Google Photos and most of my documents were backed up in Google Drive.</p>

<h4 id="the-takeout-process" id="the-takeout-process">The Takeout Process</h4>

<p>Google has a takeout program where you can select all of your data and then request for a copy. Google then aggregates your data and then compresses them down to a zip file. You’ll get an email in your gmail inbox. Then you can download your data through the link. Easy right? No!!</p>

<p>What Google does, is it lets you choose how big of a data chunk you want to download. Say you have an archive of 20GB, you can download it in two chunks of 10GB each or 10 chunks of 2GB each. And those downloads will fail if your internet connection drops down certain threshold. Then you need to retry. If it fails more than 3 times, you need to request for the data again. Most of the people would give up here and choose to spend some more time in this ecosystem until they try again and the cycle repeats.</p>

<p>I had to request for my data thrice and I still couldn’t download all my data. And the only inconvinient process around the whole ecosystem was the takeout process. I don’t know if it was done deliberately, but I had to let go of my 50GB+ of archive which had very important documents and photos. My <em>Eden Garden</em> was punishing me when I decided to move away from it.</p>

<h2 id="the-solution" id="the-solution">The Solution</h2>

<p>The solution is to move towards open source projects or towards the services that focus on your privacy. When any service focuses on your privacy, it just means they value you as an end user. Internet means Freedom. So, you should be the one who own your free will to navigate around and call yourself at home. It sure takes a lot of trial and errors to make yourself comfortable by finding a balance between convenicence and digital privacy. But it’s gonna be worth it. The more private you go, less convinient your experience will be. However, there are so many alternatives on the world wide web which is enough for you to build your own convenient ecosystem.</p>

<p>You might want to look at <a href="https://nextcloud.com/" rel="nofollow">NextCloud Project</a> which is a self hosted cloud solution which has plugins for any use case that you might have.</p>

<p>If you want to start self hosting cheap and best, you might want to look at <a href="https://www.raspberrypi.org/" rel="nofollow">Raspberry Pi Project</a> which is a credit card sized computer which can be used to host your self hosted setup which can be scaled further in future. The possibilities are endless.</p>

<p>So, Instead of living in someone else’s Eden Garden where you live in their terms, why don’t you make your own Garden and live by your terms. Isn’t that what freedom tastes like?</p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/ecosystematic-walls-of-incarceration</guid>
      <pubDate>Sat, 12 Jun 2021 11:34:42 +0000</pubDate>
    </item>
    <item>
      <title>Simple file upload in Node.js</title>
      <link>https://maxvel.writeas.com/simple-file-upload-in-node-js?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[  Originally Posted on Jan 20, 2018&#xA;&#xA;Categorised under #HowTo&#xA;&#xA;I have been using Koa.js for a while now and it turns out to be great. I’m having a lot of fun playing around with it since its simple and configurable. And I was searching for a ground up way to execute file uploads so that I can tweak its functionality however I want to. And it turns out, It’s not as difficult as I thought. Before going forward, I’m assuming you have a basic knowledge of how to setup basic Koa.js server with routers since it’s being covered in so many articles. So I’ll be skipping the server setup with routers. Click here if you want to go through an article that covers the same. So, Lets get coding. &#xA;&#xA;!--more--&#xA;&#xA;Server Page : app.js&#xA;&#xA;// app.js&#xA;const Koa = require(&#34;koa&#34;);&#xA;const koaBody = require(&#34;koa-body&#34;);&#xA;const logger = require(&#34;koa-logger&#34;);&#xA;&#xA;const router = require(&#34;./router&#34;);&#xA;&#xA;const app = new Koa();&#xA;&#xA;app.use(koaBody(&#xA;    { multipart: true }&#xA;));&#xA;&#xA;app.use(logger());&#xA;&#xA;app.use(router.routes()).use(router.allowedMethods());&#xA;&#xA;app.listen(3000, () =  {&#xA;    console.log(&#34;Listening at 3000&#34;);&#xA;});&#xA;&#xA;The above app.js file starts up the server and starts listening in port 3000 for requests. Simple stuff, nothing fancy. But things to be noted are the koa-body module and { multipart : true } option. This part is really important, since koa-body parses the request body and populates Koa ctx object based on the form data being sent. When a file is being sent from the front-end, koa-body parses the request and the uploaded file attributes will be available under ctx.request.files which we can then access across Koa server to implement file upload functionality&#xA;&#xA;Router and Upload Logic : Router.js&#xA;&#xA;Well, Its not a good practice to add the server logic under router.js file since router is only used for routing the requests. You will have a controller file to take care of the logic when the request is being routed from router. But for the course of this tutorial, I have written the logic in the router itself.&#xA;&#xA;In this part, you will need a package called promisepipe which I’ll explain in a second. For now, install the package by running the following command. And create a folder named uploads in the root of the project which will hold uploaded images.&#xA;&#xA;npm install promisepipe&#xA;&#xA;// router.js&#xA;const Koa = require(&#34;koa&#34;);&#xA;const Router = require(&#34;koa-router&#34;);&#xA;const promisePipe = require(&#34;promisepipe&#34;);&#xA;const fs = require(&#34;fs&#34;);&#xA;const path = require(&#34;path&#34;);&#xA;&#xA;const router = new Router();&#xA;&#xA;router.get(&#34;/&#34;, (context, next) =  {&#xA;    context.body = &#34;Hey&#34;;&#xA;});&#xA;&#xA;router.post(&#34;/upload&#34;, async (context, next) {&#xA;    try {&#xA;        const uploadfile = context.request.files.file;&#xA;        const savefile = ${Date.now()}#${uploadfile.name};&#xA;        const readStream = fs.createReadStream(uploadfile.path);&#xA;        const writeStream = fs.createWriteStream(path.join(&#34;uploads&#34;, savefile));&#xA;        await promisePipe(&#xA;            readStream.on(&#34;error&#34;, () =  {&#xA;                throw new Error({&#xA;                    errors: &#34;File Read Error&#34;&#xA;                });&#xA;            }),&#xA;            writeStream.on(&#34;error&#34;, () =  {&#xA;                throw new Error({&#xA;                    errors: &#34;Write Error&#34;&#xA;                });&#xA;            })&#xA;        );&#xA;        context.body = {&#xA;            message: &#34;File Uploaded&#34;&#xA;        };&#xA;    } catch (err) {&#xA;        console.log(err);&#xA;        context.body = {&#xA;            message: &#34;There was an error&#34;,&#xA;            errors: err&#xA;        };&#xA;    }&#xA;});&#xA;&#xA;module.exports = router;&#xA;&#xA;The Upload Logic&#xA;&#xA;Anything that is written in the bold letters in router.js is important and I’ll be explaining the mode of execution one by one.&#xA;&#xA;/upload : This is the POST route handler that contains the logic of what needs to be done when the front-end makes an upload request with a file attached to its body. When the URL is hit, the function gets executed.\&#xA;uploadfile : File attributes from parsed context.request.files.file in uploadfile stored in this variable so that its easier to access it later on in the code. In simple words, uploadfile contains the reference to the file to be uploaded to the server.\&#xA;savefile : The file name to be stored in the folder has to be unique since the same name will be stored in the database to trace down the files from the folder later. So we use {Date.now()}#${uploadfile.nameto create unique name \(where uploadfile.name is the name of the file to be uploaded)\. Which will give us a string of 1560234246152#anyfile.txt for example. Since we add the timstamp, filename stays unique and it will be stored in savefile variable.\&#xA;readStream/writestream : Stream is nothing but a flow of bits from one end to another end. In here, we create a read stream from user’s local computer and write stream to server’s uploads directory. We pass uploadfile.path which contains user’s local file’s path and uploads folder to write stream. That sets up the stream needed for the upload.\&#xA;promisePipe : promisePipe is a package that takes in two streams ( read / write ) and starts reading from read file to the write file. In here, bits from the user’s local computer file will be written in streams to the uploads directory on the server with the name mentioned in the variable savefile . The best thing about promisepipe is it returns a promise. It returns a resolved response when the uploading is done or returns the rejected response when there is an error. So we can await untill the uploading is done and continue executing code thereafter, or we can use try/catch block to catch any errors while uploading and handle it.&#xA;&#xA;By the end of execution, file will be saved in uploads folder and its name will be stored in savefile variable which can be added to the database for tracking down the files when they are requested. And if there is an error while reading or writing, it will be caught by the catch block and valid response to the front-end will be sent.&#xA;&#xA;Summing it all up&#xA;&#xA;Koa.js is an amazing lightweight configurable framework for Node.js. And arguably, There could be tons of better ways to achieve the same results but this turned out to be the best one for me where i can configure the functionality from the ground up. So if you know of any way to make this code better with added functionalities, I’d look forward to hear it from you. Happy coding. Have a nice day.]]&gt;</description>
      <content:encoded><![CDATA[<blockquote><p>Originally Posted on Jan 20, 2018</p></blockquote>

<p>Categorised under <a href="https://maxvel.writeas.com/tag:HowTo" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">HowTo</span></a></p>

<p>I have been using Koa.js for a while now and it turns out to be great. I’m having a lot of fun playing around with it since its simple and configurable. And I was searching for a <em>ground up</em> way to execute file uploads so that I can tweak its functionality however I want to. And it turns out, It’s not as difficult as I thought. Before going forward, I’m assuming you have a basic knowledge of how to setup basic Koa.js server with routers since it’s being covered in so many articles. So I’ll be skipping the server setup with routers. <a href="https://medium.com/@adam_bickford/creating-a-basic-site-with-koa-pt-1-f3e1711f7a9" rel="nofollow">Click here</a> if you want to go through an article that covers the same. So, Lets get coding.</p>



<h3 id="server-page-app-js" id="server-page-app-js">Server Page : app.js</h3>

<pre><code>// app.js
const Koa = require(&#34;koa&#34;);
const koaBody = require(&#34;koa-body&#34;);
const logger = require(&#34;koa-logger&#34;);

const router = require(&#34;./router&#34;);

const app = new Koa();

app.use(koaBody(
    { multipart: true }
));

app.use(logger());

app.use(router.routes()).use(router.allowedMethods());

app.listen(3000, () =&gt; {
    console.log(&#34;Listening at 3000&#34;);
});
</code></pre>

<p>The above app.js file starts up the server and starts listening in port 3000 for requests. Simple stuff, nothing fancy. But things to be noted are the koa-body module and <code>{ multipart : true }</code> option. This part is really important, since koa-body parses the request body and populates Koa <code>ctx</code> object based on the form data being sent. When a file is being sent from the front-end, koa-body parses the request and the uploaded file attributes will be available under <code>ctx.request.files</code> which we can then access across Koa server to implement file upload functionality</p>

<h3 id="router-and-upload-logic-router-js" id="router-and-upload-logic-router-js">Router and Upload Logic : Router.js</h3>

<p><em>Well, Its not a good practice to add the server logic under router.js file since router is only used for routing the requests. You will have a controller file to take care of the logic when the request is being routed from router. But for the course of this tutorial, I have written the logic in the router itself.</em></p>

<p>In this part, you will need a package called promisepipe which I’ll explain in a second. For now, install the package by running the following command. And create a folder named uploads in the root of the project which will hold uploaded images.</p>

<pre><code>npm install promisepipe
</code></pre>

<pre><code>// router.js
const Koa = require(&#34;koa&#34;);
const Router = require(&#34;koa-router&#34;);
const promisePipe = require(&#34;promisepipe&#34;);
const fs = require(&#34;fs&#34;);
const path = require(&#34;path&#34;);

const router = new Router();

router.get(&#34;/&#34;, (context, next) =&gt; {
    context.body = &#34;Hey&#34;;
});

router.post(&#34;/upload&#34;, async (context, next) {
    try {
        const uploadfile = context.request.files.file;
        const savefile = `${Date.now()}#${uploadfile.name}`;
        const readStream = fs.createReadStream(uploadfile.path);
        const writeStream = fs.createWriteStream(path.join(&#34;uploads&#34;, savefile));
        await promisePipe(
            readStream.on(&#34;error&#34;, () =&gt; {
                throw new Error({
                    errors: &#34;File Read Error&#34;
                });
            }),
            writeStream.on(&#34;error&#34;, () =&gt; {
                throw new Error({
                    errors: &#34;Write Error&#34;
                });
            })
        );
        context.body = {
            message: &#34;File Uploaded&#34;
        };
    } catch (err) {
        console.log(err);
        context.body = {
            message: &#34;There was an error&#34;,
            errors: err
        };
    }
});

module.exports = router;
</code></pre>

<h3 id="the-upload-logic" id="the-upload-logic">The Upload Logic</h3>

<p>Anything that is written in the bold letters in router.js is important and I’ll be explaining the mode of execution one by one.</p>
<ul><li><strong>/upload :</strong> This is the POST route handler that contains the logic of what needs to be done when the front-end makes an upload request with a file attached to its body. When the URL is hit, the function gets executed.\</li>
<li><strong>uploadfile</strong> : File attributes from parsed context.request.files.file in uploadfile stored in this variable so that its easier to access it later on in the code. In simple words, uploadfile contains the reference to the file to be uploaded to the server.\</li>
<li><strong>savefile</strong> : The file name to be stored in the folder has to be unique since the same name will be stored in the database to trace down the files from the folder later. So we use <code>{Date.now()}#${uploadfile.name</code>to create unique name *(where <em>uploadfile.name</em> is the name of the file to be uploaded)*. Which will give us a string of 1560234246152<a href="https://maxvel.writeas.com/tag:anyfile" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">anyfile</span></a>.txt for example. Since we add the timstamp, filename stays unique and it will be stored in savefile variable.\</li>
<li><strong>readStream/writestream</strong> : Stream is nothing but a flow of bits from one end to another end. In here, we create a read stream from user’s local computer and write stream to server’s uploads directory. We pass uploadfile.path which contains user’s local file’s path and uploads folder to write stream. That sets up the stream needed for the upload.\</li>
<li><strong>promisePipe</strong> : promisePipe is a package that takes in two streams ( read / write ) and starts reading from read file to the write file. In here, bits from the user’s local computer file will be written in streams to the uploads directory on the server with the name mentioned in the variable savefile . The best thing about promisepipe is it returns a promise. It returns a resolved response when the uploading is done or returns the rejected response when there is an error. So we can await untill the uploading is done and continue executing code thereafter, or we can use try/catch block to catch any errors while uploading and handle it.</li></ul>

<p>By the end of execution, file will be saved in uploads folder and its name will be stored in savefile variable which can be added to the database for tracking down the files when they are requested. And if there is an error while reading or writing, it will be caught by the catch block and valid response to the front-end will be sent.</p>

<h3 id="summing-it-all-up" id="summing-it-all-up">Summing it all up</h3>

<p>Koa.js is an amazing lightweight configurable framework for Node.js. And arguably, There could be tons of better ways to achieve the same results but this turned out to be the best one for me where i can configure the functionality from the ground up. So if you know of any way to make this code better with added functionalities, I’d look forward to hear it from you. Happy coding. Have a nice day.</p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/simple-file-upload-in-node-js</guid>
      <pubDate>Sat, 12 Jun 2021 11:30:00 +0000</pubDate>
    </item>
    <item>
      <title>Docker, a replacement of Virtualenv for Python developement</title>
      <link>https://maxvel.writeas.com/docker-a-replacement-of-virtualenv-for-python-developement?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[  Originally Posted on Jan 10, 2018&#xA;&#xA;Categorised under #HowTo&#xA;&#xA;Docker! Sounds fancy and simple but trust me it has revolutionized how the tech industry builds, ships and deploys the applications lately. Docker is basically a mini-operating system where you build and run your applications which is totally isolated from the native operating system in your computer, and the same container can be deployed in the hosting platforms. If you are new to docker and want to learn more about its intricacies, i highly encourage you to go through the links given in the end of this article to learn more about it. So let’s get right in :)&#xA;&#xA;!--more--&#xA;&#xA;Creating a Dockerfile&#xA;&#xA;Dockerfile is the recipe of an image. Dockerfile specifies how your image should look like. However, we are not creating an image from the scratch. We will take the existing image and add our dependencies on top of that to create a customized image based on our requirements. You can setup the Dockerfile to either take the existing requirements.txt file and install dependencies from pip or install dependencies manually without requirements.txt. This is how the Dockerfile will look like in either of the situations.&#xA;&#xA;    FROM python:3&#xA;&#xA;    RUN mkdir /usr/src/app&#xA;    WORKDIR /usr/src/app&#xA;&#xA;    # Below two steps are valid only if you have&#xA;    # requirements.txt in the project folder&#xA;    COPY requirements.txt .&#xA;    RUN pip install -r requirements.txt&#xA;&#xA;    # If there is no requirements.txt,&#xA;    # You can install individual packages as follows&#xA;    # RUN pip install package-1 package-2...package-n&#xA;&#xA;FROM: The image that we are building has to be built in such a way that we take an existing image and add our own functionalities to it. So we are choosing an image with python 3.x since we are dealing with Python developement. However, You can choose any image or any version you want.\&#xA;RUN: This will run a command inside the image. Since our image is a mini linux OS (usually debian distribution) we can run linux commands inside it. Here we run mkdir /usr/src/app which creates a working directory for our application to run. Which is not absolutely necessary since its automatically created in the next step. This step was a demonstration of how to run commands inside an image.\&#xA;WORKDIR: This specifies the working directory of our image. After setting the WORKDIR, Any RUN, CMD, ENTRYPOINT, COPY and ADD commands we execute, will be executed inside the WORKDIR . In our case, its /usr/src/app .\&#xA;COPY: This command will copy any file specified on the left before the space to the directory specified on the right of the space. In our case, we are copying requirements.txt from our project folder on the host to our WORKDIR /usr/src/app in the image And running pip install -r requirements.txt on /usr/src/app which will install and save all the pip dependencies inside the image.&#xA;&#xA;If there is no requirements.txt, you can skip the COPY step and install pip dependencies by specifying the pip install command in the RUN section one after the other. And save the Dockerfile with the name Dockerfile&#xA;&#xA;We successfully created a recipe of how our image should look like, now the next step is to build the image based on this recipe.&#xA;&#xA;Building from the Dockerfile&#xA;&#xA;Now since we are done with creating our recipe, we need to build our own image from the recipe. To build the image, the command is as follows&#xA;&#xA;docker build -t python/pack .&#xA;&#xA;docker build is the command that tells docker that we need to build our own image. -t python/pack is where we add our own name for the new docker image. we can also add tags to the image using -t python/pack:latest where latest is the tag for the image. (although latest is a default tag for any new image) . tells the docker to use the current directory in lookout for Dockerfile . If the Dockerfile lies in different directory, you can specify the path from where you would want to build the Dockerfile . Once the build is finished, you will have a Customized docker image based on your recipe, and you can check it by running docker images command in the shell. You should see an image called python/pack&#xA;&#xA;Creating a Container&#xA;&#xA;Containers are the place where we execute our programs by mounting our local volumes to the container volumes. From where you can access the packages and dependencies installed in the container meanwhile, persisting the data to the host system. Run the following command in bash&#xA;&#xA;docker run --rm -it &#xA;-u $(id -u):$(id -g) &#xA;-v /etc/passwd:/etc/passwd &#xA;-v $(pwd):/usr/src/app &#xA;python/pack &#xA;bash&#xA;&#xA;This creates a container based on the image python/pack where you can accesss your project files from the directory /usr/src/app and then you can execute the code as you would do in your host machine. Lets break this command down line-by-line:&#xA;&#xA;docker run –rm -it : docker run tells the docker daemon that we want to create a new container, -it is where we run this container in the interactive mode. -i basically keeps the STDIN open and -t allocates a pseudo TTY. In simple words, -it is essential to open a bashshell inside the container, later. You can also use -d instead of -it which starts the container in detached mode, which starts the container in the background.\&#xA;-u $(id -u):$(id -g) : It is not recommended to start a container as a root user. So we specify -u flag and then user ID $(id -u) and group ID $(id -g) to start a container as a regular user. Now we will have previliges over only that directory which is mounted to the container and not the entire container. This is the cleaner way of creating a container.\&#xA;-v /etc/passwd:/etc/passwd: This -v argument mounts /etc/passwd of the host to /etc/passwd of the container. Otherwise the docker container can’t access the usernames and display I have no name! in the bash prompt. Mounting /etc/passwd solves this problem.\&#xA;-v \\$(pwd):/usr/src/app: This -v argument mounts your project directory to /usr/src/app by doing which you can access your code in the project directory inside the docker container and the changes made inside the docker container will be available in the project directory (pwd prints the present working directory). So in simple words, this creates a shared space between the container and the host machine from where the host machine can access the packages and dependencies installed in the docker image.\&#xA;python/pack: This is pretty straight-forward. This is where we mention, which image is the container will be based on. The resulting container will contain the architecture of the mentioned image.\&#xA;bash: This is where we mention the command to be executed soon after the container is created. Since we want the bash prompt, we specify the command bash which opens a bash shell soon after the container is created.&#xA;&#xA;By the end of this process, we will have a container which is built with the dependencies we need, sharing a same space as our project directory, totally isolated from out host machine. This is really useful since the dependencies are not installed in the host machine. The host machine only contains the project folder but it runs inside the customized container. Clean stuf !!&#xA;&#xA;Extras/Troubleshooting&#xA;&#xA;Editing a Docker Image : Let’s say you have created a Docker image with 3 packages and now you want to install a new package to the already built image. You can do it by editing the imageDockerfile and running the same command docker build -t python/pack . and docker will make changes to the existing image from where the content of the Dockerfile has changed. To make these changes, it is important to note that Dockerfile is in the same folder as it was initially built. Because Docker daemon uses current Dockerfile folder as a build context and when changes to the Dockerfile is made, build context will be checked and from there the Image will be built.\&#xA;Port Forwarding : Port forwarding is such a useful functionality inside docker container. Let’s say you are using Jupyter notebook inside your docker container and it exposes a port 8888. But it will be on the context of the container, and not on the host machine. So if you go to localhost:8888 in the host machine, it won’t work. So you map the host’s 8888 port to container’s 8888 port when creating the container and then you can access jupyter notebook by going to localhost:8888 on the host machine. You can map a port by adding -p 8888:8888 when creating the container where left side of the : is the port on the host and the right side is the port on the container.&#xA;&#xA;Conclusion&#xA;&#xA;Docker is a revolutionary tech, there is no doubt about that. Once the developement is over, the developed project can be containerized and the container can be deployed in hosting platforms like Digital Ocean. Containers can be made to talk to each other and each container can be used as a microservice. The possibilities are endless. It depends on you how would use this tech to the fullest. Happy coding :)&#xA;&#xA;Essential Docker Commands&#xA;&#xA;Pull Image from Dockerhub : docker pull image name\&#xA;Build a Docker Image : docker build -t image name path\&#xA;Create Docker Container : docker run [-it/-d] --rm -u user id:group id -v host directory:container directory -p host port:container port image name initial command\&#xA;List Running Container : docker ps\&#xA;List All Containers : docker ps -a\&#xA;List All Container ID’s : docker ps -aq\&#xA;Delete Single Container : docker rm container id\&#xA;Delete All Docker Containers : docker rm $(docker ps -aq)\&#xA;List all Images : docker images\&#xA;List all Image ID’s : docker images -aq\&#xA;Delete single image : docker rmi image id\&#xA;Delete all images : docker rmi $(docker images -aq)\&#xA;Start Interactive session with a container started in detached mode (-d) : docker exec -it container_name bash&#xA;&#xA;Important Links&#xA;&#xA;Installing Docker\&#xA;Post Installation Steps\&#xA;Dockerfile, full reference\&#xA;Compose file reference]]&gt;</description>
      <content:encoded><![CDATA[<blockquote><p>Originally Posted on <strong>Jan 10, 2018</strong></p></blockquote>

<p>Categorised under <a href="https://maxvel.writeas.com/tag:HowTo" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">HowTo</span></a></p>

<p>Docker! Sounds fancy and simple but trust me it has revolutionized how the tech industry builds, ships and deploys the applications lately. <strong>Docker</strong> is basically a mini-operating system where you build and run your applications which is totally isolated from the native operating system in your computer, and the same container can be deployed in the hosting platforms. If you are new to docker and want to learn more about its intricacies, i highly encourage you to go through the links given in the end of this article to learn more about it. So let’s get right in :)</p>



<h3 id="creating-a-dockerfile" id="creating-a-dockerfile">Creating a Dockerfile</h3>

<p>Dockerfile is the recipe of an image. Dockerfile specifies how your image should look like. However, we are not creating an image from the scratch. We will take the existing image and add our dependencies on top of that to create a customized image based on our requirements. You can setup the Dockerfile to either take the existing requirements.txt file and install dependencies from pip or install dependencies manually without requirements.txt. This is how the Dockerfile will look like in either of the situations.</p>

<pre><code>    FROM python:3

    RUN mkdir /usr/src/app
    WORKDIR /usr/src/app

    # Below two steps are valid only if you have
    # requirements.txt in the project folder
    COPY requirements.txt .
    RUN pip install -r requirements.txt

    # If there is no requirements.txt,
    # You can install individual packages as follows
    # RUN pip install &lt;package-1&gt; &lt;package-2&gt;...&lt;package-n&gt;
</code></pre>
<ul><li>FROM: The image that we are building has to be built in such a way that we take an existing image and add our own functionalities to it. So we are choosing an image with python 3.x since we are dealing with Python developement. However, You can choose any image or any version you want.\</li>
<li>RUN: This will run a command inside the image. Since our image is a mini linux OS (usually debian distribution) we can run linux commands inside it. Here we run mkdir /usr/src/app which creates a working directory for our application to run. Which is not absolutely necessary since its automatically created in the next step. This step was a demonstration of how to run commands inside an image.\</li>
<li>WORKDIR: This specifies the working directory of our image. After setting the WORKDIR, Any RUN, CMD, ENTRYPOINT, COPY and ADD commands we execute, will be executed inside the WORKDIR . In our case, its /usr/src/app .\</li>
<li>COPY: This command will copy any file specified on the left before the space to the directory specified on the right of the space. In our case, we are copying requirements.txt from our project folder on the host to our WORKDIR /usr/src/app in the image And running pip install -r requirements.txt on /usr/src/app which will install and save all the pip dependencies inside the image.</li></ul>

<p>If there is no requirements.txt, you can skip the COPY step and install pip dependencies by specifying the pip install command in the RUN section one after the other. And save the Dockerfile with the name Dockerfile</p>

<p>We successfully created a recipe of how our image should look like, now the next step is to build the image based on this recipe.</p>

<h3 id="building-from-the-dockerfile" id="building-from-the-dockerfile">Building from the Dockerfile</h3>

<p>Now since we are done with creating our recipe, we need to build our own image from the recipe. To build the image, the command is as follows</p>

<pre><code>docker build -t python/pack .
</code></pre>

<p><strong>docker build</strong> is the command that tells docker that we need to build our own image. <strong>-t python/pack</strong> is where we add our own name for the new docker image. we can also add tags to the image using -t python/pack:latest where latest is the tag for the image. (although latest is a default tag for any new image) <strong>.</strong> tells the docker to use the current directory in lookout for Dockerfile . If the Dockerfile lies in different directory, you can specify the path from where you would want to build the Dockerfile . Once the build is finished, you will have a Customized docker image based on your recipe, and you can check it by running docker images command in the shell. You should see an image called python/pack</p>

<h3 id="creating-a-container" id="creating-a-container">Creating a Container</h3>

<p>Containers are the place where we execute our programs by mounting our local volumes to the container volumes. From where you can access the packages and dependencies installed in the container meanwhile, persisting the data to the host system. Run the following command in bash</p>

<pre><code>docker run --rm -it 
-u $(id -u):$(id -g) 
-v /etc/passwd:/etc/passwd 
-v $(pwd):/usr/src/app 
python/pack 
bash
</code></pre>

<p>This creates a container based on the image python/pack where you can accesss your project files from the directory /usr/src/app and then you can execute the code as you would do in your host machine. Lets break this command down line-by-line:</p>
<ul><li>docker run –rm -it : docker run tells the docker daemon that we want to create a new container, -it is where we run this container in the interactive mode. -i basically keeps the STDIN open and -t allocates a pseudo TTY. In simple words, -it is essential to open a bashshell inside the container, later. You can also use <strong>-d</strong> instead of <strong>-it</strong> which starts the container in detached mode, which starts the container in the background.\</li>
<li>-u $(id -u):$(id -g) : It is not recommended to start a container as a root user. So we specify -u flag and then user ID $(id -u) and group ID $(id -g) to start a container as a regular user. Now we will have previliges over only that directory which is mounted to the container and not the entire container. This is the cleaner way of creating a container.\</li>
<li>-v /etc/passwd:/etc/passwd: This -v argument mounts /etc/passwd of the host to /etc/passwd of the container. Otherwise the docker container can’t access the usernames and display I have no name! in the bash prompt. Mounting /etc/passwd solves this problem.\</li>
<li>-v \$(pwd):/usr/src/app: This -v argument mounts your project directory to /usr/src/app by doing which you can access your code in the project directory inside the docker container and the changes made inside the docker container will be available in the project directory (pwd prints the present working directory). So in simple words, this creates a shared space between the container and the host machine from where the host machine can access the packages and dependencies installed in the docker image.\</li>
<li>python/pack: This is pretty straight-forward. This is where we mention, which image is the container will be based on. The resulting container will contain the architecture of the mentioned image.\</li>
<li>bash: This is where we mention the command to be executed soon after the container is created. Since we want the bash prompt, we specify the command bash which opens a bash shell soon after the container is created.</li></ul>

<p>By the end of this process, we will have a container which is built with the dependencies we need, sharing a same space as our project directory, totally isolated from out host machine. This is really useful since the dependencies are not installed in the host machine. The host machine only contains the project folder but it runs inside the customized container. Clean stuf !!</p>

<h3 id="extras-troubleshooting" id="extras-troubleshooting">Extras/Troubleshooting</h3>
<ul><li><strong>Editing a Docker Image :</strong> Let’s say you have created a Docker image with 3 packages and now you want to install a new package to the already built image. You can do it by editing the imageDockerfile and running the same command docker build -t python/pack . and docker will make changes to the existing image from where the content of the Dockerfile has changed. To make these changes, it is important to note that Dockerfile is in the same folder as it was initially built. Because Docker daemon uses current Dockerfile folder as a build context and when changes to the Dockerfile is made, build context will be checked and from there the Image will be built.\</li>
<li><strong>Port Forwarding :</strong> Port forwarding is such a useful functionality inside docker container. Let’s say you are using Jupyter notebook inside your docker container and it exposes a port 8888. But it will be on the context of the container, and not on the host machine. So if you go to localhost:8888 in the host machine, it won’t work. So you map the host’s 8888 port to container’s 8888 port when creating the container and then you can access jupyter notebook by going to localhost:8888 on the host machine. You can map a port by adding -p 8888:8888 when creating the container where left side of the : is the port on the host and the right side is the port on the container.</li></ul>

<h3 id="conclusion" id="conclusion">Conclusion</h3>

<p>Docker is a revolutionary tech, there is no doubt about that. Once the developement is over, the developed project can be containerized and the container can be deployed in hosting platforms like Digital Ocean. Containers can be made to talk to each other and each container can be used as a microservice. The possibilities are endless. It depends on you how would use this tech to the fullest. Happy coding :)</p>

<h3 id="essential-docker-commands" id="essential-docker-commands">Essential Docker Commands</h3>
<ul><li>Pull Image from Dockerhub : <code>docker pull &lt;image name&gt;</code>\</li>
<li>Build a Docker Image : <code>docker build -t &lt;image name&gt; &lt;path&gt;</code>\</li>
<li>Create Docker Container : <code>docker run [-it/-d] --rm -u &lt;user id&gt;:&lt;group id&gt; -v &lt;host directory&gt;:&lt;container directory&gt; -p &lt;host port&gt;:&lt;container port&gt; &lt;image name&gt; &lt;initial command&gt;</code>\</li>
<li>List Running Container : <code>docker ps</code>\</li>
<li>List All Containers : <code>docker ps -a</code>\</li>
<li>List All Container ID’s : <code>docker ps -aq</code>\</li>
<li>Delete Single Container : <code>docker rm &lt;container id&gt;</code>\</li>
<li>Delete All Docker Containers : <code>docker rm $(docker ps -aq)</code>\</li>
<li>List all Images : <code>docker images</code>\</li>
<li>List all Image ID’s : <code>docker images -aq</code>\</li>
<li>Delete single image : <code>docker rmi &lt;image id&gt;</code>\</li>
<li>Delete all images : <code>docker rmi $(docker images -aq)</code>\</li>
<li>Start Interactive session with a container started in detached mode (-d) : <code>docker exec -it &lt;container_name&gt; bash</code></li></ul>

<h3 id="important-links" id="important-links">Important Links</h3>
<ul><li><a href="https://docs.docker.com/install/" rel="nofollow">Installing Docker</a>\</li>
<li><a href="https://docs.docker.com/install/linux/linux-postinstall/" rel="nofollow">Post Installation Steps</a>\</li>
<li><a href="https://docs.docker.com/engine/reference/builder/" rel="nofollow">Dockerfile, full reference</a>\</li>
<li><a href="https://docs.docker.com/compose/compose-file/" rel="nofollow">Compose file reference</a></li></ul>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/docker-a-replacement-of-virtualenv-for-python-developement</guid>
      <pubDate>Sat, 12 Jun 2021 11:18:16 +0000</pubDate>
    </item>
    <item>
      <title>Lego Coding</title>
      <link>https://maxvel.writeas.com/lego-coding?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[  Originally Posted on Jan 5, 2018&#xA;&#xA;Categorised under #SliceOfLife&#xA;&#xA;Sounds Ridiculous! isn’t it ? Me comparing the Megabytes or Terabytes of senseless one’s and zero’s of code to something that is built with Lego bricks. Lego is supposed to be a fun process, right? But coding seems like spending too much time in front of the computer finding which semi-colon did you miss and where! And bang your head to the wall until you get it right. They’re nowhere close to a match. How is that even possible?&#xA;&#xA;!--more--&#xA;&#xA;Yeah! you might say that rather sarcastically, or had that notion in your mind all along. But trust me, this is a perfect analogy that I can put forth when it comes to the creative process of coding in its entirety. I call it Lego Coding. And it is something that you are already familiar with, but never acknowledged it for how amazing it really is.&#xA;&#xA;When I was 11 years old, I got my first real personal computer as my Birthday gift (The best birthday gift ever). Being a tech-geek, and being obsessed with pressing random keys in the keyboard for a mere fascination of seeing something on the monitor, coding was not my first intent. Moreover, I didn’t even know a process called ‘coding to makes wonderful things’ existed back then. I, the kid, who was building castles with Lego bricks and breaking it to build new one’s, came across coding C and C++, few years later. And it caught my attention right away. So I did what most of the budding computer geeks and beginners to the art of coding do, you guessed it,&#xA;&#xA;printf(‘Hello My Computer, It’s your boi, Velan’)&#xA;&#xA;(I might have missed the semi colon in my first few attempts, but you get the point) When I saw the output in the black screen, I was freaking out. Running around the house, shouting “My Computer knows my name”. It sounded ridiculous, yet amazing, that you can teach your computer to do things, and it just obeys you without arguing! That is how I was introduced into the art of coding. And it didn’t seem like something that is a tedious process of finding missing semi-colons, (Sometimes I do feel like banging my head against the wall, Sometimes) But It seemed more like building things that I love, with Lego bricks that I was obsessed with, prior to coding. It made me feel curious and expressive. It made me feel like, I can do anything and everything using my creative intent and my computer. And that kept me going to build things with code.&#xA;&#xA;Growing up, I took an academic path where there is a lot of coding and computer science involved, because that is what I was interested in. It was a place of ecstasy to me, where i’m officially experimenting with things that i love doing. But, to my surprise, I was astonished to see not everyone was engrossed into the process of coding as much as I was. And when my fellow student said “I don’t like coding!”, My obvious reply was, “Are you freaking kidding me? How can you even not love playing Lego with code?”. Gradually I realised that, not everyone was introduced to coding like I had been. Not everyone coded because they loved the process, or I could say, They were never enchanted by the thought of playing Lego with code. While I saw C, C++ and other tools as Lego bricks that I can build my castles with, few others saw it as an ‘Academic-Getaway-Pass’ That can get them into introductory interviews, by showcasing good marks. And it was a let down to see an Art getting wasted, By people turning into primary job seekers than turning into primary artists who can build things they love.&#xA;&#xA;Now i’m 21 years old and, I have been coding ever since. Playing Lego with code never gets old to me. And I can’t think of any other analogy that explains the process any better. I‘m never frightened by errors popping up in my code (Trust me, I get so many of them), besides I get frightened when I don’t get one. And coding has kept my childlike creativity and imagination going, and it has given me a new dimension to think about things that I would never have thought otherwise. I don’t code to save someone’s time or save this world from apocalypse or get people on mars, perhaps. I code because i’m enchanted by the mere process of coding as building something that I love, by keeping lines of code one on top of the other and create a system that is as beautiful as my Lego castle was. If my code goes on to save someone’s life or time, I’m glad it did. But my primary intent always remains to code because I love to do it. Nothing complicated. And I&#39;ve never been tired of it, Nor will I ever be.&#xA;&#xA;If you are someone who doesn’t like coding or someone who doesn’t know where to start coding from or if coding is not interesting to you anymore, Here’s my advice to you (I’m not a professional though. so, you have a total liberty to disagree with me) Coding neither has a how-to-guide, nor a shortcut to be a coding sensei. Starting with coding is as simple as starting with it. It is an art. And art doesn’t come with guides. It is a process of learning through trial and error. If you’re coding, it is highly unlikely that you’ll get things right on the first attempt, YOU DON’T! Most of the people quit here saying, “I’m tired, Let me eat something”. But if you keep the process going, make errors, and learn from them to know where you went wrong, you will have a whole new appreciation for the process of coding as of how it shapes your logic and makes you think in a different light. And few years down the line you will probably sit in front of the computer just like me and write an article on how coding shaped your life, made you a better person, filled your life with creativity. Just in case you do, I’ll be so happy to read through your story someday.&#xA;&#xA;So unleash the art of coding as how you build things with Lego bricks. Write code, Make mistakes, understand the errors and solve them. When you were a kid, it’s highly unlikely that you build a beautiful castle in the first attempt. Similarly it’s highly unlikely that you’ll build a world class software in your first attempt. You will gradually get better with time and practice. And it’s gonna involve a lot of error solving and experimenting. And believe me, when you make something built with code, that you can call your own, You will have a whole new appreciation for the efforts that you’ve put to get there. And that‘s what LEGO CODING does to you. It makes you be proud of yourself for the castle-like structure you have built with your Lego bricks of code. So, have fun writing code, have fun exploring fun new challenges in this world full of possibilities. Have a good day.]]&gt;</description>
      <content:encoded><![CDATA[<blockquote><p>Originally Posted on <strong>Jan 5, 2018</strong></p></blockquote>

<p>Categorised under <a href="https://maxvel.writeas.com/tag:SliceOfLife" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">SliceOfLife</span></a></p>

<p>Sounds Ridiculous! isn’t it ? Me comparing the Megabytes or Terabytes of senseless one’s and zero’s of code to something that is built with Lego bricks. Lego is supposed to be a fun process, right? But coding seems like spending too much time in front of the computer finding which semi-colon did you miss and where! And bang your head to the wall until you get it right. They’re nowhere close to a match. How is that even possible?</p>



<p>Yeah! you might say that rather sarcastically, or had that notion in your mind all along. But trust me, this is a perfect analogy that I can put forth when it comes to the creative process of coding in its entirety. I call it Lego Coding. And it is something that you are already familiar with, but never acknowledged it for how amazing it really is.</p>

<p>When I was 11 years old, I got my first real personal computer as my Birthday gift (The best birthday gift ever). Being a tech-geek, and being obsessed with pressing random keys in the keyboard for a mere fascination of seeing something on the monitor, coding was not my first intent. Moreover, I didn’t even know a process called ‘coding to makes wonderful things’ existed back then. I, the kid, who was building castles with Lego bricks and breaking it to build new one’s, came across coding C and C++, few years later. And it caught my attention right away. So I did what most of the budding computer geeks and beginners to the art of coding do, you guessed it,</p>

<pre><code>printf(‘Hello My Computer, It’s your boi, Velan’)
</code></pre>

<p>(I might have missed the semi colon in my first few attempts, but you get the point) When I saw the output in the black screen, I was freaking out. Running around the house, shouting “My Computer knows my name”. It sounded ridiculous, yet amazing, that you can teach your computer to do things, and it just obeys you without arguing! That is how I was introduced into the art of coding. And it didn’t seem like something that is a tedious process of finding missing semi-colons, (Sometimes I do feel like banging my head against the wall, Sometimes) But It seemed more like building things that I love, with Lego bricks that I was obsessed with, prior to coding. It made me feel curious and expressive. It made me feel like, I can do anything and everything using my creative intent and my computer. And that kept me going to build things with code.</p>

<p>Growing up, I took an academic path where there is a lot of coding and computer science involved, because that is what I was interested in. It was a place of ecstasy to me, where i’m officially experimenting with things that i love doing. But, to my surprise, I was astonished to see not everyone was engrossed into the process of coding as much as I was. And when my fellow student said “I don’t like coding!”, My obvious reply was, “Are you freaking kidding me? How can you even not love playing Lego with code?”. Gradually I realised that, not everyone was introduced to coding like I had been. Not everyone coded because they loved the process, or I could say, They were never enchanted by the thought of playing Lego with code. While I saw C, C++ and other tools as Lego bricks that I can build my castles with, few others saw it as an ‘Academic-Getaway-Pass’ That can get them into introductory interviews, by showcasing good marks. And it was a let down to see an Art getting wasted, By people turning into primary job seekers than turning into primary artists who can build things they love.</p>

<p>Now i’m 21 years old and, I have been coding ever since. Playing Lego with code never gets old to me. And I can’t think of any other analogy that explains the process any better. I‘m never frightened by errors popping up in my code (Trust me, I get so many of them), besides I get frightened when I don’t get one. And coding has kept my childlike creativity and imagination going, and it has given me a new dimension to think about things that I would never have thought otherwise. I don’t code to save someone’s time or save this world from apocalypse or get people on mars, perhaps. I code because i’m enchanted by the mere process of coding as building something that I love, by keeping lines of code one on top of the other and create a system that is as beautiful as my Lego castle was. If my code goes on to save someone’s life or time, I’m glad it did. But my primary intent always remains to code because I love to do it. Nothing complicated. And I&#39;ve never been tired of it, Nor will I ever be.</p>

<p>If you are someone who doesn’t like coding or someone who doesn’t know where to start coding from or if coding is not interesting to you anymore, Here’s my advice to you (I’m not a professional though. so, you have a total liberty to disagree with me) Coding neither has a how-to-guide, nor a shortcut to be a coding sensei. Starting with coding is as simple as starting with it. It is an art. And art doesn’t come with guides. It is a process of learning through trial and error. If you’re coding, it is highly unlikely that you’ll get things right on the first attempt, YOU DON’T! Most of the people quit here saying, “I’m tired, Let me eat something”. But if you keep the process going, make errors, and learn from them to know where you went wrong, you will have a whole new appreciation for the process of coding as of how it shapes your logic and makes you think in a different light. And few years down the line you will probably sit in front of the computer just like me and write an article on how coding shaped your life, made you a better person, filled your life with creativity. Just in case you do, I’ll be so happy to read through your story someday.</p>

<p>So unleash the art of coding as how you build things with Lego bricks. Write code, Make mistakes, understand the errors and solve them. When you were a kid, it’s highly unlikely that you build a beautiful castle in the first attempt. Similarly it’s highly unlikely that you’ll build a world class software in your first attempt. You will gradually get better with time and practice. And it’s gonna involve a lot of error solving and experimenting. And believe me, when you make something built with code, that you can call your own, You will have a whole new appreciation for the efforts that you’ve put to get there. And that‘s what <strong>LEGO CODING</strong> does to you. It makes you be proud of yourself for the castle-like structure you have built with your Lego bricks of code. So, have fun writing code, have fun exploring fun new challenges in this world full of possibilities. Have a good day.</p>
]]></content:encoded>
      <guid>https://maxvel.writeas.com/lego-coding</guid>
      <pubDate>Sat, 12 Jun 2021 10:42:00 +0000</pubDate>
    </item>
  </channel>
</rss>