<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ayush Goyal on Medium]]></title>
        <description><![CDATA[Stories by Ayush Goyal on Medium]]></description>
        <link>https://medium.com/@defcon007?source=rss-ffc6d65d7566------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C67r7nd5oHAek6TUdNP0Cw.jpeg</url>
            <title>Stories by Ayush Goyal on Medium</title>
            <link>https://medium.com/@defcon007?source=rss-ffc6d65d7566------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:30:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@defcon007/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sleep — By Kaha Mind]]></title>
            <link>https://defcon007.medium.com/sleep-by-kaha-mind-185ff7f48d45?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/185ff7f48d45</guid>
            <category><![CDATA[sleeping]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Wed, 20 Oct 2021 08:04:56 GMT</pubDate>
            <atom:updated>2021-10-20T08:04:56.162Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sleep — By Kaha Mind</h3><blockquote>Disclaimer: Following views are my own and I am not affiliated with <a href="https://www.kahamind.com/">Kaha Mind</a></blockquote><p>Recently, Kaha mind organized a very awesome session on sleep hygiene. It was very informative, and I jotted down the key learnings I had from the session to easily comback and look again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*mzoDQ4z02qB_5eAPVsLyWA.png" /></figure><p>The session started with quick little trivia busting common myths people have on sleep. Following are some of them:</p><ol><li>A 20 minute power nap during the day will energize you.</li><li>If you have trouble falling asleep at night, it&#39;s helpful to get out of bed and do some “boring” task then just lying in the bed.</li><li>For a better sleep, it&#39;s better to have a cool dark room.</li></ol><h3>Culprits for Improper Sleep</h3><ul><li>Not taking enough breaks during the day</li><li>Having stress &amp; anxiety</li><li>Using screens like laptop or phone late into the night</li></ul><h3>Sleep Hormones and some biology</h3><ol><li><strong>Melatonin: </strong>Its production and release is increased in the dark and it is the main sleep hormone. It is what helps you sleep.</li><li><strong>Melanopsin: </strong>It is a photopigment found in cells which increases awareness and keeps us awake. It is triggered with blue light.</li></ol><p>So, Melatonin helps you sleep and Melanopsin keeps you awake. Also, in these two, Melanopsin over powers Melatonin. i.e. if you do any activity which increases Melanopsin, you are unlikely to get good sleep.</p><h3>Binaural Beats</h3><p>A binaural beat is an illusion created by the brain when you listen to two tones with slightly different frequencies at the same time.<br>Most of the sleep music/lucid dreaming music audios are actually binaural beats.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=185ff7f48d45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Timeline is malleable]]></title>
            <link>https://defcon007.medium.com/timeline-is-malleable-e93da49ecdb9?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/e93da49ecdb9</guid>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 14:19:37 GMT</pubDate>
            <atom:updated>2021-04-13T14:19:37.717Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>From family to nation, every human group is a society of island universes. — Aldous Huxley</blockquote><p>A few days back I was back in Kharagpur for my convocation. There were a lot of places I went to and a lot of old friends I met. After coming back to Bangalore, I was sitting with one Kharagpur friend and he was telling me his convocation experience. We both had a lot of fun and enjoyed to the fullest but his experience was completely different than mine!</p><p>We were discussing a particular night when it rained so hard during convocation that half of the hostels ground floor rooms were flooded. He and I were in different parts of the campus and were doing completely different things. This struck me, as I thought I could also have been doing what he was doing at that time, or vice-versa. But we chose to do what we did.</p><p>According to the wildly popular multiverse theory, there are infinite parallel universes and for every choice you make there exists a parallel universe in which you made the opposite choice. This is a very old theory and helped a number of superhero comic stories, but for now no one is even close to prove it in real life. According to me, it is just a way by which people try to be happy with their wrong choices and think that somewhere out there is a place where they made the right choice.</p><p>Everywhere there are a lot of little universes living their lives and we can only be a part of one of them at a time so it&#39;s on the choices we make which decides the universes we will be part of and that&#39;s what makes all the difference.</p><p>In life also, every moment which we are living is part of a single universe out of infinite universes happening at the same time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e93da49ecdb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Whatever happens, happens for the good]]></title>
            <link>https://defcon007.medium.com/whatever-happens-happens-for-the-good-c1cfdf38903a?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1cfdf38903a</guid>
            <category><![CDATA[philosophy]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 17:32:00 GMT</pubDate>
            <atom:updated>2021-04-04T17:44:16.381Z</atom:updated>
            <content:encoded><![CDATA[<p>At some point or the other in your life you must have heard this phrase that “Whatever happened, happened for a better good” , “Everything will be fine” , “One day you are gonna be thankful that this happened ” etc. Well I am not saying they are wrong, all these phrases are 100% correct but the way they are interpreted is wrong.</p><p>Like if you don’t get a job or meet with an accident or are in some sort of financial crises, then there is nothing good in it. However, if you stand strong at that time, after sometime you will surely succeed. But your failure has nothing to do the current success, you are successful today only because of your will power.</p><p>There is another phrase, “Darker the night, brighter will be the morning”. Now most people think of it as, if you are facing a lot of troubles right now then sooner or later you are going to have a lot of happy moments. Well that depends. Again those yet to come good times have nothing to do with your current bad times. I think that being in the worst situations make your mind so depressed that a small or normal happy moment seems to be big enough.</p><p>Following is a nice real life analogy for this:</p><p>Think of eating something sweet. So, if you eat something sweet just after eating something else sweet, it doesn’t taste sweet enough but eating same sweet after have something something bitter makes it more sweet!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1cfdf38903a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harry potter and the philosopher’s stone — An insight]]></title>
            <link>https://defcon007.medium.com/harry-potter-and-the-philosophers-stone-an-insight-f3571b7dbec6?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3571b7dbec6</guid>
            <category><![CDATA[harry-potter]]></category>
            <category><![CDATA[potterhead]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Sat, 03 Apr 2021 19:08:44 GMT</pubDate>
            <atom:updated>2021-04-03T19:08:44.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>Harry potter and the philosopher’s stone — An insight</h3><p>So I have watched the harry potter series a lot of times. I binge-watched the complete series recently in the summers just before reading the Harry Potter and the Cursed Child. But then some of friends told me that the story in the original novels is quite different and a LOT of details are missed in the movie. So, I took kindle unlimited subscription and started with the very first book Harry Potter and Philosopher’s Stone.</p><p>So the first thing I noticed different was the name. I remembered seeing the name Harry Potter and the Sorcerer’s Stone but well the book was Harry Potter and Philosopher’s stone. After a quick google search, I found that it also recommends the movie as Harry Potter and the Sorcerer’s Stone. Even on amazon prime video the movie is listed as Harry Potter and the Sorcerer’s Stone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*wBqfccnRwQ6oto3X1QPfEQ.png" /></figure><p>So now I started reading the book and trust me it was VERY different from the movie. Now I will list all the changes I found out in the book one by one. I will also add snapshots of the book for you to read !</p><ol><li>In the first scene when Albus Dumbledore, Professor McGonagall and Hagrid are at Privet Drive to leave young Harry at doorsteps of the Dursley’s — The worst muggles imaginable, in the movie it was a simple scene Hagrid bringing Harry and they all leaving him there with a letter to the Dursley’s but in the book there was a dialogue between McGonagall and Dumbledore which caught my attention. You can read it from the below snapshot of the book.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*aMhcfXt2gdQvHlU4AjiZWg.png" /><figcaption>Page 13 of 309 . Location 194 of 3912</figcaption></figure><p>2. In the movie when we have the first glimpse of our most loved and fierce wizard it was quite simple scene, Harry’s Aunt Petunia waking him up and then big fat Dudley going up and down over the stairs which was spilling dust over Potter and then he coming out of the cupboard and cooking breakfast for all and being scolded for non sense things. But in the book this was quite different. The scene starts with Aunt Petunia waking up Harry and it also tells about Harry dreaming of a flying motorbike. And then he was instructed to cook bacon by his Aunt with a warning not burn them but in the movie what to cook for breakfast was not specified. This whole conversation was going on when Harry was still in the cupboard while in movie it was happening when he was inside the kitchen. Also afterwards in the book he looks for his sock and finds spider on them which he pulls off and it was also mentioned that he was used to spiders in cupboard but nothing of this sort was mentioned in the movie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*R3barnWDszdtF6xzdcZGqg.png" /><figcaption>Page 18 of 309 . Location 248 of 3912</figcaption></figure><p>3. After Hagrid delivered the Hogwarts Letter to Harry in the secluded light house they can be seen directly walking in the street next to the Leaking Cauldron and then on their way to Diagon Alley but according to the book when Hagrid arrives at the night after having some “fun” with the Dursleys he sleeps on the sofa and next morning harry wakes up seeing an owl dropping newspaper for Hagrid and then starting to tap its beak on Hagrid’s coat until Hagrid told Harry to pay him five Knuts (the small bronze ones) and then they pack their things and went out and Hagrid told Harry that he came flying but since he now got Harry he cannot use the magic so they uses the boat to cross the sea and then they walked to the station and boarded a train to London. Hagrid sat on the train taking up two seats and knitting something which looked like Canary-yellow circus tent. The Passers-by were staring at Hagrid a lot. And then Hagrid asks to take out the things he needed. Now in the movie Harry tells about only One standard size 2 Pewter Cauldron, and either an Owl, Cat or a Toad but in the book the whole list of essentials for a first year wizard was present which can be seen in the screenshot below.</p><p>You will be amazed to find that one of the text book was Fantastic Beasts and Where to Find Them by Newt Scamander.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JDhu3taZcCMDCE7v5vsHAg.png" /><figcaption>Page 61 of 309. Location 760 of 3912</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcMT6ipE3IeZau7EXUUsMg.png" /><figcaption>Page 64 of 309 . Location 803 of 3912</figcaption></figure><p>4. In the scene when Harry has boarded the Hogwarts Express from the platform 9¾ of the King’s Cross Station and is sitting with Ron having bought a lot of the things from the smiling dimpled woman and eating Chocolate Frogs which contains card of a famous witch or wizard. Harry finds the card of Dumbledore. In the movie the scene is now completed but in the book there is more to the card. Harry turns over the card and starts reading :</p><blockquote>Albus Dumbledore, currently Headmaster of Hogwarts. Considered by many the greatest wizard of modern time, Professor Dumbledore is particularly famous for his defeat of the dark wizard Grindelwald in 1945, for the discovery of the twelve uses of dragon’s blood and his work on alchemy with his partner, Nicolas Flamel. Professor Dumbledore enjoys chamber music and tenpin bowling.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*CRoLTLgmGuNffiwmYOtn4w.png" /><figcaption>Page 100 of 309 . Location 1242 of 3912</figcaption></figure><p>Now many of you guys who have followed the Harry Potter realm properly must know who Grindelwald is. I was astonished to see his reference this early in the series.</p><p>5. In the movie when Harry and Ron were still on Hogwarts Express and Ron was going to change the Scrabber’s colour and Hermoine walks in looking for Neville’s toad. She just slams Ron for his trick not working and then fixes Harry’s spectacles. She then advices them to change as they all will be reaching soon and then just leaves. But in the book after Hermoine got to know about Harry she tells that she had read everything about him and also that he is mentioned in <strong>Modern Magical History </strong>and <strong>The Rise and the Fall of the Dark Arts</strong> and <strong>The Great Wizarding Events of the Twentieth Century</strong>. She also talks a bit about they both knowing which house they will be in and then talking about how she would like to be in Gryffindor but Ravenclaw will also work. And then she leaves advising them to change. After this Harry and Ron talks and Ron tells Harry how everyone from his family was in Gryffindor and Harry enquired about the two of his brothers who completed their school. Now Ron tells Harry that :</p><p>Chalie’s in Romania studying dragons and Bills in Africa doing something to do with Gringotts.</p><p>We all know that the Charlie’s reference will have a comeback in the Goblet of Fire 😜</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*rYIGinncLJUyj8QBMUX-Ag.png" /><figcaption>Page 103 of 309 . Location 1282 of 3912</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*X2BcZjwdkaTPZsYObJWmaQ.png" /><figcaption>Page 107 of 309 . Location 1328 of 3912</figcaption></figure><p>6. There were some differences in the sorting ceremony too. The grand hall was more elaborated in the book. Also in the movie Dumbledore gives the start-of-the-term notices before the sorting ceremony begins but in the book it was done after the ceremony. Also, in the book before the sorting began the sorting hat sing a song, which is as follows :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*mhItoZCnB8wHojfXgZKN1A.png" /><figcaption>Page 117 of 309 . Location 1449 of 3912</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3571b7dbec6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using custom subdomain with GitHub repositories]]></title>
            <link>https://defcon007.medium.com/using-custom-subdomain-with-github-repositories-6fa15dbc39b4?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fa15dbc39b4</guid>
            <category><![CDATA[custom-domain]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-pages]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 10:34:00 GMT</pubDate>
            <atom:updated>2020-03-24T10:34:00.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*C6KqIOLCzoDpottbBxmEZA.png" /></figure><p>GitHub actually allows you to host websites for your projects directly from the repository itself. It will have URL something like https://&lt;username&gt;.github.io , you can add your custom domain to it too. If you haven’t done it, GitHub has pretty good documentation about it. You can read it <a href="https://help.github.com/en/github/working-with-github-pages/about-custom-domains-and-github-pages">here</a>.</p><p>Now, let&#39;s suppose you have already set up a custom domain and your default site is accessible through <a href="https://example.com./">https://example.com</a> . Now, if you create a new repository named project , and enable GitHub pages, it will be accessible through https://example.com/project but sometimes it makes more sense to have a custom sub-domain, like https://project.example.com . To do this, there are some additional configurations required. Just follow the steps below.</p><p>To make the steps more clear, I will use my own, recent project example for which I set up the custom subdomain. My GitHub username is DefCon-007 and my personal website which was available through GitHub pages at <a href="https://defcon-007.github.io/">https://DefCon-007.github.io</a> is served from my custom domain with <a href="https://defcon007.com/">https://defcon007.com</a> and https://www.defcon007.com . I now had a new repository named utilobot-website which contained some HTML and was served at https://defcon007.com/utilobot-website and I wanted it to be served at https://utilobot.defcon007.com</p><h3>Step 1: Configure DNS settings</h3><p>Go to your domain provider’s website and add a new CNAME record with a name as your subdomain and value as your GitHub root URL with a trailing dot(No it is not a typo). In my case the name was utilobot and the value was defcon-007.github.io.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrg1XYCd4qOvWVNhKGqsdA.png" /><figcaption>Cloudflare DNS entry screenshot</figcaption></figure><h3>Step 2: Add CNAME file</h3><p>Now, add a new file named CNAME to your repository with just a single line in it, that is your complete URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3MWxKwmI9uhX6jHinItLA.png" /><figcaption>UtiloBot CNAME file</figcaption></figure><p>You can also go to the repository settings and enter your custom domain in the GitHub Pages section, it will automatically add the CNAME file.</p><p>That’s it, you have a custom domain for your GitHub project now. Try opening it with http first, and it is working fine, you can select Enforce HTTPS option in the repository settings page.</p><h3>Troubleshooting</h3><ol><li>If the custom sub-domain does not work, try after some time, so that the DNS records are propagated, also try removing the trailing period from the URL in step one, it works sometimes.</li><li>If you find that the Enforce HTTPS checkbox is disabled, and your custom domain is working fine with http , try deleting the CNAME file, push the changes, create the same CNAME file with the same content and push again. It should be enabled now.</li></ol><p>Thanks for reading.</p><blockquote>This article was originally published at <a href="http://www.defcon007.com/GitHub-Custom-Domain/">http://www.defcon007.com/GitHub-Custom-Domain/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fa15dbc39b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finances of real life]]></title>
            <link>https://defcon007.medium.com/finances-of-real-life-72480e74c604?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/72480e74c604</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Wed, 04 Dec 2019 04:18:07 GMT</pubDate>
            <atom:updated>2019-12-04T04:18:07.407Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Below are some of my 2 AM thoughts I had while trying to correlate some finance and life, and I just want to share them to see if there is someone else who can relate to this analogy of real life.</em></p><p>Most you have heard about the term ‘Depreciation’ in terms of finance and know the meaning of it, for those of you who don’t, below is the definition form <a href="https://economictimes.indiatimes.com/definition/depreciation">Economic Times</a> website:</p><blockquote>The monetary value of an asset decreases over time due to use, wear and tear or obsolescence. This decrease is measured as depreciation.</blockquote><p>Now, those tangible assets depreciate overtime in the monetary world but have you thought how similar kind of thing happens with you in your real life too with the people you meet or things you like?</p><p>If you think about it, till now you have met countless people in life, and also possessed a number of things which at some point of time meant the world to you. If somehow you can quantify how much value they hold for you at any point in time and plot it against time itself you will notice that the curve will be declining! I am not saying that everything and everyone’s value will surely decrease, there are always outliers in every dataset, and some people and things will always hold a special value in your life but majority will follow this trend.</p><p>On the contrary, in finance, while making an investment the main thing you see is what is the return you will get on it, or in other words, the future value of your current money matters more. But in real life, I feel we tend to do the opposite! We are more focused on the current value and don’t give much thought about future returns, be that investment is in people or things. Like you never buy a new phone because you think it will make you happy in the future or be friends with someone just because you think you will like that person’s company in the future.</p><blockquote>In life, we invest in today but in finance, we invest in tomorrow.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72480e74c604" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using a GPS module(neo-7m) with Raspberry Pi 3]]></title>
            <link>https://defcon007.medium.com/using-a-gps-module-neo-7m-with-raspberry-pi-3-45100bc0bb41?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/45100bc0bb41</guid>
            <category><![CDATA[gps]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 13:03:13 GMT</pubDate>
            <atom:updated>2018-10-10T13:03:13.344Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I got an opportunity to work on an awesome project which included hardware and software development. The project was about <strong>Tractor Telematics</strong>. For starters, we needed to track the location of a tractor in real time. So, we the one and only way for it was to use Raspberry Pi and a GPS module. While trying to make things work, I faced a lot of problems in the configuration and there was no one-stop guide for it. Hence, I decided that I will write a blog about how I did it and what problems I faced along with their solutions.</p><p>NOTE: All of these steps were done on a Raspberry Pi 3 model B and ublox neo-7m GPS module but it should work on other models too.</p><h3>Configuring UART</h3><pre>sudo raspi-config</pre><p>Select -&gt; <strong>Interfacing Options</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*SF8TOpjnbU8QUZeq" /></figure><p>After selecting Interfacing option, select <strong>Serial</strong> option to enable UART</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*ifQx_YP0kb945z_e" /></figure><p>Then it will ask for login shell to be accessible over Serial, select <strong>No </strong>shown as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/0*psssF9nE1Rh_Ex28" /></figure><p>At the end, it will ask for enabling Hardware Serial port, select <strong>Yes</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*RMHpr3hHn3qV2Suo" /></figure><p>Finally, our UART is enabled for Serial Communication on RX and TX pin of Raspberry Pi 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/0*NXc4KntnWq5Ok_3-" /></figure><p>Then, reboot the Raspberry Pi.</p><h3>Hardware connections</h3><p>In the GPS module I have there were total 4 connections to be made as follows:</p><ol><li>VCC — 5v(pin 2)</li><li>GND — Pi’s ground(pin 6)</li><li>RX — Pi’s TX</li><li>TX — Pi’s RX</li></ol><p>Note that Pin 1 is the one facing the memory card slot and Pin2 is just adjacent to it. Refer to following images for better understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*cTdDA8O3GxSY5__1AX2yHQ.jpeg" /><figcaption>GPIO Pins numbering</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbAdyOGN7dXpoFVSszvA6A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMCWExyCudD7A1rrQMV_PQ.jpeg" /></figure><h3>Installing GPS Applications</h3><pre>sudo apt-get install gpsd gpsd-clients</pre><p>Now, run the GPSD client</p><pre>sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock</pre><p>Here, ttyS0 is my serial port where GPS data is received, for other Raspberry Pi models this might be different. So, just replace ‘XXX’ in ttyXXX with appropriate name.</p><p>Now, type the following code to check the connections.</p><pre>cat /dev/ttyS0</pre><p>You should see a continuous stream of data. It is raw GPS data in NMEA format. If you see something like <em>$GPTXT,01,01,01,NMEA unknown msg*58 </em>a lot then check your serial port configuration. If the ‘echo’ option is enabled that will cause this problem. Just do stty -F /dev/ttyS0 -echo to disable echo then cat the gps serial device and those messages should stop.</p><p>Now, after this type cgps and you should see something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbfmLOtYdHdBT9cJcTjYhw.png" /></figure><p>After some time the data will be shown here.</p><p>If the cat command shows data but you get nothing in cgps at all do the following :</p><ol><li>Check if port 2947 is open in firewall.</li><li>Open the file /etc/default/gps in sudo with any text editor and change DEVICES=”” to DEVICES=”/dev/ttyS0&quot; and then type sudo systemctl restart gpsd</li></ol><p>Note : It may take sometime for GPS module to receive data. So it time or anything else is shown in cgps that means configurations are all ok but module is not receiving GPS signals. So, just wait for sometime.</p><h3>Some troubleshooting steps if cgps does not get a fix</h3><p>1. Check GPS data stream</p><pre>cat /dev/ttyS0</pre><p>You should see the NMEA stream</p><p>2. Check GPS data with gpsmon</p><pre>gpsmon /dev/ttyS0</pre><p>It should run properly with the data stream</p><p>Note : It first two steps didn’t work, check you connections and configurations properly.</p><p>3. Run gpsd in debug mode</p><pre>sudo gpsd /dev/ttyS0 -N -D3 -F /var/run/gpsd.sock</pre><p>It should say that it is already running</p><p>4. Now type the following lines.</p><pre>sudo systemctl stop gpsd.socket<br>sudo systemctl disable gpsd.socket</pre><p>5. Now, launch gpsd again</p><pre>sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock</pre><p>Now, cgps should get a fix and no timeout.</p><p>After all the proper configurations, you need to run sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock every time the pi is rebooted. If you are using it as an IOT project you might want to automate everything.</p><h3>Automating</h3><p>Create a file at /etc/rc.local</p><pre>sudo nano /etc/rc.local</pre><p>Add following contents to the file</p><pre>#!/bin/sh -e<br>sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock<br>exit 0</pre><p>This will run our sudo command on every boot.</p><h3>Using python to get Latitude and Longitude</h3><p>I used a simple python script to get latitude and longitude from the gps module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56f206f35366e4671a3fdaa2f957ce00/href">https://medium.com/media/56f206f35366e4671a3fdaa2f957ce00/href</a></iframe><p>Here, I print the Latitude and Longitude but you can actually do whatever you like with them and later on make this script to run every time on boot using cron job.</p><p>To make a cron job first type crontab -e and in the window that appears write the following command.</p><pre>@reboot cd /home/pi/ &amp;&amp; python sendCoordinate.py</pre><p>Change the path and file name accordingly.</p><h3>Small Issue</h3><p>Now, after everything was setup the system was working pretty nice. But after 2–3 trial runs I found that something was crashing and I was not able to get the coordinates on my web server.</p><p>Now, there could be only two problems, either the GPS module is not configuring properly on every startup or my internet connection had some issues on boot. After hours of hit-and-try, and trying several permutations and combinations of different things on the internet I did the following to make it work.</p><p>I made a shell script startup.sh and added the following lines of code to it.</p><pre>sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock<br>stty -F /dev/ttyS0 -echo<br>sudo systemctl stop gpsd.socket<br>sudo systemctl disable gpsd.socket<br>sudo killall gpsd<br>sudo systemctl stop gpsd.socket<br>sudo systemctl disable gpsd.socket<br>sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock<br>sleep 10s<br>nohup python /home/pi/sendCoordinate.py &gt; pylog.test &amp;</pre><p>Then I made it an executable.</p><pre>sudo chmod 755 ./startup.sh</pre><p>After added it as cronjob to be executed on every startup and everything ran without any problems. My crontab file looked like this.</p><pre><a href="http://twitter.com/reboot">@reboot</a> cd /home/pi/ &amp;&amp; sh startup.sh</pre><p>Note : I know some of the lines in startup.sh are redundant and may not be necessary but due to time crunch I was not able to further test it and make it more simpler. If you are reading this and have a more optimal foolproof solution kindly let me know in the comments or at <a href="/service/mailto:ayushgoyal.iitkgp@gmail.com?Subject=Medium%20Python%20GPS%Module">ayushgoyal.iitkgp@gmail.com</a> .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45100bc0bb41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django redirect with custom context]]></title>
            <link>https://defcon007.medium.com/django-redirect-with-custom-context-88d256bb5c98?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/88d256bb5c98</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Sat, 01 Sep 2018 17:42:13 GMT</pubDate>
            <atom:updated>2018-09-01T17:42:13.413Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on a recent Django project, I was stuck when I needed to send custom context in redirect request. I googled a lot and still didn’t find any way to do so. Hence I devised my way to do so.</p><p>This blog is more of a reminder of how I managed to do so.</p><p>Since you are facing this issue, I am assuming you have a basic idea on the working of Django. So, we will not go into details.</p><p>Assuming you following two views in your views file.</p><pre><strong>def</strong> <strong>view1</strong>(request) : <br> ..<br> context = {<br> ..<br> }<br> ..<br> <strong>return</strong> render(request, &quot;../../xyz.html&quot;, context=context)</pre><pre><strong>def</strong> <strong>view2</strong>(request) : <br> ..<br> context = {<br> ..<br> }<br> ..<br> <strong>return</strong> render(request, &quot;../../abc.html&quot;, context=context)</pre><p>Now, if you want to redirect to view1 from view2 along with its context, you can modify your functions like this.</p><pre><strong>def</strong> <strong>view1</strong>(request, newContext={}) : <br> ..<br> ..<br> context = {<br> ..<br> }<br> context.update(newContext)<br> ..<br> <strong>return</strong> render(request, &quot;../../xyz.html&quot;, context=context)<br></pre><pre><strong>def</strong> <strong>view2</strong>(request) : <br> ..<br> context = {<br> ..<br> }<br> ..<br> response = view1(request, context)<br> <strong>return</strong> response</pre><p>So, what happens here is, since in <em>view1 </em>the newContext parameter is already initialised, the normal calling of it in the Django architecture will not be hampered and the context.update(newContext) has no effect and when <em>view2</em> calls <em>view1</em>, a response is returned so it can be directly returned from <em>view2</em>.</p><p>Note that this will not change the URL.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88d256bb5c98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of Things!]]></title>
            <link>https://defcon007.medium.com/importance-of-things-995ae39c33e1?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/995ae39c33e1</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[exam]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Tue, 17 Apr 2018 19:41:10 GMT</pubDate>
            <atom:updated>2018-04-17T19:41:10.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*oNxPGXWULCBYG79b-fIqmg.jpeg" /></figure><p>Today, I was thinking about how quickly and how vastly our priorities, importance of things and people, change over time. Personally, I have seen that one thing which was once very important in my life now is just speck of sand in a desert.</p><p>The reason today I started writing about it was very trivial; my end semester examinations commence from tomorrow.<br> I still remember the exam time from my first semester, I was terrified (of course a lot less from the time I was in my high school) mugging up the formulas, solving the tutorial sheets, looking over the solved examples again and again, etc. But today just one day for the examinations, knowing that I have not attended a single class attentively, not even aware of the syllabus, I am Ok! In fact more better than that.<br> <br>I actually feel that over time our way to perceive “important” things in life changes a lot. One thing which is currently so important to you that you will push yourself more than your limits may be rendered entirely useless in some time. <br>For example, I worked my ass off during the examinations in school, but now when I look back to those grades which I secured in school, they are unquestionably useless, they have zero significance in my life right now. So, the point is should I be worried about anything which is going in my life right now knowing that after some time I will look back and say that it was just waste of time and I could have done something else more productive or enjoyed that time of my life more peacefully?</p><p>Now, the significant thing to closely see is that it’s not like those events never actually had any importance, it’s just over the time I am forgetting or don’t want to acknowledge what their significance was. Retaking the example of exams, during those school times, the marks in those exams were essential. Because, if I didn’t study hard, I would not be able to get a good college and which will lead to a low paying job, and thus I will be making compromises at every facet of my life, and the list goes on and on. But now when I am in a good college, I feel those marks are useless.</p><p>So, it’s not that nothing is worth the efforts, but after achieving the importance of them, we tend to think of those events as useless. For example, most of the people are worried about exams in college because they know if they fuck these up they are not going to beg a proper placement. But since I know these grades are not going to help me in my placements, so I give zero fucks to the exams. Contrary to my first semester where I had no such backup, so I prepared hard for the exams and was worried too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=995ae39c33e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KGP developer’s Meet]]></title>
            <link>https://defcon007.medium.com/kgp-developers-meet-73f2980b0c30?source=rss-ffc6d65d7566------2</link>
            <guid isPermaLink="false">https://medium.com/p/73f2980b0c30</guid>
            <category><![CDATA[meet]]></category>
            <category><![CDATA[kgp]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Ayush Goyal]]></dc:creator>
            <pubDate>Thu, 22 Mar 2018 08:57:48 GMT</pubDate>
            <atom:updated>2018-03-22T08:57:48.129Z</atom:updated>
            <content:encoded><![CDATA[<p>On 18th March 2018, KGP witnessed its first ever developers meet[1]. The initiative was taken up by Ksheera Sagar the UG Representative to the Senate. He got to know about the MetaKGP hack day[2], and he thought of a bigger version of it to bring all the developers in the campus on a single platform and also welcome students who are interested in becoming developers.</p><p>Following were the goals he thought of :</p><p>1. To give a brief idea of works done by MetaKGP and the open source community on campus <br>2. Ongoing key projects and initiatives <br>3. Discussing the potential projects for the upcoming and existing developers <br>4. Explaining the necessity of ERP API <br>5. Presentation of 2–3 student wellness projects by myself and Krushi (G.Sec Students Welfare TSG) which needs developers <br>6. Encouraging women from STEM areas to start with dev <br>7. Requesting the professors (like PPD, PDG, PPC….) to speak on this occasion <br>8. Requesting office/ lab space for developers</p><p>Metakgp[3], Lean In[4], Kharagpur Open Source Society[5], Institute Wellness Group[6] came together to make the event a success.</p><p>The event started with Naresh and Nishant giving an introduction of MetaKGP and its various projects. After that Kshitij gave a presentation about the initiatives of KOSS to promote the opensource culture in the campus. <br>Siddharth took the opportunity to bring to the notice of the administration on how providing some open endpoints to the data in ERP can help developer community build cool projects around the ERP and benefits of enabling an OAuth 2.0 authentication for the ERP to make it more developer friendly.</p><p>One of the most frustrating and time-consuming thing for all the final and pre-final year students in building their CV on ERP. Ksheera Sagar pointed out the problems in the CV module and proposed a solution for the same. <br>We all know how bad the gender ratio is in IITs and it is worst in the tech community of the IITs, Ayushi Mrigen gave an introduction about Lean In and also an insight of the perspective of girls community on why they think this problem exists and what are their steps to improve this situation.</p><p>Prof Sriman Kumar Bhattacharyya, Prof Pallab Dasgupta, Prof Adrijit Goswami shared their views on the open source movement currently prevailing in the campus and about the steps already taken by the administration and their plans of the future to help the developer community.</p><p>Prof Sriman Kumar Bhattacharyya, Deputy Director, IIT Kharagpur briefed the students about the opportunities for the funding of projects and lab spaces from the administration side.</p><p>Professor PDG of Computer Science and Technology Department, an alumnus of the batch of ’90, shared the story from his college time. Since we all know, it was the time of genesis of open source. He shared how they were just shifting to UNIX systems and how Donald Knuth developed Tex and open sourced it, but due to complications, no one was able to use it and later came Latex a more user-friendly version of Tex which was again open sourced. His talk was very insightful and inspired a lot of people sitting there.</p><p>Prof Adrijit Goswami, ERP Chairman, talked about how the ERP functioning is different in Kharagpur than other IITs and the autonomous structure of ERP in our institute. He also told about the current problems faced in ERP and how students can help in overcoming them. Though, he didn’t talk much related to the presentation given by Siddharth on OAuth for ERP which was quite disheartening.</p><p>Thanks to Himanshu, the whole event was video recorded, and the video for the same can be found <a href="https://www.youtube.com/watch?v=fI6FQjFzAco">here</a>.</p><p>All the presentations from the event can be found <a href="https://archive.org/details/kgpdevmeet2018">here</a>.</p><p>[1] <a href="https://www.facebook.com/events/181539055903174/">https://www.facebook.com/events/181539055903174/</a></p><p>[2] <a href="https://www.facebook.com/metakgp/posts/1714405645479506">https://www.facebook.com/metakgp/posts/1714405645479506</a></p><p>[3] <a href="https://www.facebook.com/metakgp/">https://www.facebook.com/metakgp/</a></p><p>[4] <a href="https://www.facebook.com/leaniniitkgp/">https://www.facebook.com/leaniniitkgp/</a></p><p>[5] <a href="https://www.facebook.com/kossiitkgp/">https://www.facebook.com/kossiitkgp/</a></p><p>[6] <a href="https://www.facebook.com/iwg.iitkgp/">https://www.facebook.com/iwg.iitkgp/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73f2980b0c30" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>