<?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 Divakar Rajesh on Medium]]></title>
        <description><![CDATA[Stories by Divakar Rajesh on Medium]]></description>
        <link>https://medium.com/@sdivakarrajesh?source=rss-5f6fa8b1881b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XAeiSih3hK34qdLl</url>
            <title>Stories by Divakar Rajesh on Medium</title>
            <link>https://medium.com/@sdivakarrajesh?source=rss-5f6fa8b1881b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:02:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sdivakarrajesh/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[Control your browser with Google Agent Development Kit and MCP]]></title>
            <link>https://sdivakarrajesh.medium.com/control-your-browser-with-google-agent-development-kit-and-mcp-0ac04a0ac9ed?source=rss-5f6fa8b1881b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ac04a0ac9ed</guid>
            <category><![CDATA[web-automation]]></category>
            <category><![CDATA[agent-development-kit]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[adk]]></category>
            <category><![CDATA[adkhackathon]]></category>
            <dc:creator><![CDATA[Divakar Rajesh]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 13:53:31 GMT</pubDate>
            <atom:updated>2025-06-20T13:58:33.287Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s jump right into this AI hype and build some AI Agents using Google’s bleeding edge ADK</p><h3>Google’s — Agent Development Kit</h3><p>Writing your own agents using LangChain/LangGraph or any LLM client libraries makes you write all the chat history logic that keeps the LLMs stay with the flow while understanding the context and using the available tools. Coding all those yourself sounds kinda tedious don’t you think?</p><p>Google just came up with the ADK framework that let’s you build<strong> model agnostic AI Agents</strong> with all those bundles of features packed in like tools, memory, session management, artifacts management, callbacks to have more controls in the LLM responses etc. You don’t need to build the graphs or build the workflow(you can if you want to). Its the agents that you define, that are in-charge here. They take actions using available tools and transfer to sub-agents if they can’t on their own.</p><h3>Model Context Protocol</h3><p>While it kinda looks similar to tool-calling, the MCP is a complimentary protocol that the <strong>service providers can use to expose their functionalities</strong> as simple functions that the agents or your LLMs can call in a standardised way.</p><h3>Just another framework ?— uh🙄</h3><p>Jeez, not me thinking if i should learn another framework. But hey, ADK is pretty concise and can do a lot with very little code. Don’t believe me? Ok let’s build something big in terms of features, but small in terms of lines-of-code. Let’s build an agent that can control your browser to do anything you want.</p><p>Create a python project using your favorite package manager (mine’s uv recently🙋🏻‍♂️)</p><pre>uv init &amp;&amp; uv add google-adk &amp;&amp; source .venv/bin/activate</pre><p>For our use case, let’s use the Playwright MCP server. More details on the available capabilities is on their <a href="https://github.com/microsoft/playwright-mcp">GitHub repo</a>. We don’t need to do anything here as we’ll be using <em>npx </em>to run the playwright-mcp server</p><p>Believe me when I say this, your agent code is only 30 lines even with fancy indentation!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b3e95919c8e5c558076e3982b3d49ff/href">https://medium.com/media/8b3e95919c8e5c558076e3982b3d49ff/href</a></iframe><p>Now let’s use the adk web command to spin up a UI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ys11vKNoHbT02BsR6tQ6Kw.png" /></figure><p>When your server starts, hit up http://localhost:8000 on your browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rwAduDUYT_wUREdw82Lutg.png" /></figure><p>Select your agent from the top-left corner and start prompting! Let’s take it for a spin shall we?</p><blockquote>Let me ask the latest price of Apple stocks using Yahoo</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jW51I7u8SL0Nnk7kVgNYOA.gif" /></figure><p>Woo — fancy-schmancy. It opened up the browser instance, navigated to the required url(https://medium.com/in%20this%20case,%20its%20knows%20from%20the%20training%20data%20knowledge) and analysed the page’s content to provide the answer. With a browser, your possibilities are almost endless on what you can do! May be build a rival to Devin AI that promised AI software engineers?</p><p><a href="https://github.com/sdivakarrajesh/adk-playwright-mcp">Link to the full source code here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*ouB0qpVm5WJYvFs2fQCxfw.jpeg" /></figure><p>This article is dedicated to the software engineers, who are very curious on building AI tools that would replace their own job🤪</p><p>On a personal note — Hey👋 — I’m <strong>Divakar Rajesh</strong> — a clueless Software Engineer re-assessing his career &amp; life choices in this evolving age of AI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ac04a0ac9ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speeding up Strapi development times]]></title>
            <link>https://sdivakarrajesh.medium.com/speeding-up-strapi-development-times-d47895bd21d0?source=rss-5f6fa8b1881b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d47895bd21d0</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[strapi]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Divakar Rajesh]]></dc:creator>
            <pubDate>Sat, 23 Dec 2023 15:01:34 GMT</pubDate>
            <atom:updated>2023-12-23T16:00:35.655Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve used strapi in couple of my exploratory projects. Be it AI or that project which I dearly hope will make me millions in the near future.</p><p>I’ve started using Typescript because whenever I type something, it would give me autocomplete or “Intellisense” in VSCode, so that i don’t have to remember those methods and even help explore new ones that I don’t know yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r-KSz9VbCR_d3HuWBqFgA.png" /></figure><p>But the problem with Typescript is that there is a compilation step involved that needs to happen before your browser or Node.js environments can run them. Projects like create-react-app, Vite starter templates, Next.js starter template would give this to you, out of the box. Strapi did support it too. But it was just slowwwwer. My first thought was,</p><blockquote>“Should I stop using TypeScript?”</blockquote><p>Every time i change a file, it takes me solid 16s+ for the server to restart on an M1 Pro in a MacBook Pro 14 inch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_syNnQFF5-p6Olj_i-q9rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*l8nV0FgtvUZkKSFN9vCIuw.gif" /><figcaption>Apple boasting their chip is the fastest in the market. Meanwhile me noticing that it still takes 16s+ to compile a bunch of .ts files?</figcaption></figure><h3>The Compiler</h3><p>May be it wasn’t my laptop that’s slow(obviously!). I’ve seen create-react-app bootstrapping the whole app in 4–5s. Whenever I change a file and hit save, the changes are already on the site.</p><p>One thing I noticed about Strapi, is that they seem to compile the TypeScript files to a directory and run the JS code from there. So my first suspect was obviously just that, the TypeScript compilation step. By default, it is tsc that is compiling. I just swapped it out, with the more faster swc and the results were clear! For this to work, you need to install the following</p><pre>npm i -D @swc/cli @swc/core</pre><p>I didn’t dare to replace the compilation in the “PRODUCTION” Node.js environment, so bear with me on this. Just replace the node_modules/@strapi/typescript-utils/lib/compile.js with this</p><pre>&#39;use strict&#39;;<br><br>const compilers = require(&#39;./compilers&#39;);<br>const { exec, execSync } = require(&#39;child_process&#39;);<br><br>const getConfigPath = require(&#39;./utils/get-config-path&#39;);<br><br>module.exports = async (srcDir, { configOptions = {} } = {}) =&gt; {<br>  if (process.env.NODE_ENV === &quot;development&quot;) {<br>    let msg = &quot;SWC Typescript compilation&quot;<br>    console.log(srcDir)<br>    console.time(msg)<br>    await Promise.all(<br>      [<br>        exec(&quot;npx swc server.ts  -d dist --config-file .swcrc&quot;),<br>        exec(&quot;npx swc config/  -d dist/config --config-file .swcrc --copy-files&quot;),<br>        exec(&quot;npx swc build/  -d dist/build --config-file .swcrc --copy-files&quot;),<br>        exec(&quot;npx swc src/  -d dist/src --config-file .swcrc --copy-files&quot;),<br>      ]<br>    )<br>    console.timeEnd(msg)<br>  }else{<br>    let msg = &quot;Typescript compilation&quot;<br>    console.time(msg)<br>    const configPath = getConfigPath(srcDir);<br>    console.log(configPath, configOptions)<br>    compilers.basic.run(configPath, configOptions);<br>    console.timeEnd(msg)<br>  }<br>};</pre><p>and create a .swcrcin the root of the project with this.</p><pre>{<br>    &quot;$schema&quot;: &quot;https://json.schemastore.org/swcrc&quot;,<br>    &quot;jsc&quot;: {<br>        &quot;parser&quot;: {<br>            &quot;syntax&quot;: &quot;typescript&quot;,<br>            &quot;tsx&quot;: true<br>        },<br>        &quot;target&quot;: &quot;es2018&quot;<br>    },<br>    &quot;module&quot;: {<br>        &quot;type&quot;: &quot;commonjs&quot;<br>    },<br>    &quot;sourceMaps&quot;: true<br>}</pre><p>Essentially, we’re just asking it to use swc during development. We need the SourceMaps, so that we can debug our app by putting breakpoints and VSCode would know which Typescript code to point back to. And the results are here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*c6x7wu2c7ivrdoF6HfAcrA.png" /><figcaption>Woot Woot!</figcaption></figure><p>That’s a solid 12s saved every time you hit save on your IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*J3ly9hTxaoSc6p4IIP97PA.gif" /></figure><p>So now you can focus on making more apps that brings in revenue rather than waiting for your compiler to compile your code 🙌🏻</p><p>Hey👋 — I’m Divakar Rajesh, a <strong>Product Engineer</strong> at <strong>Sensara </strong>— You’ve probably interacted with our products if you have tried Xiaomi Mi Remote, or used the search experience on Zee5 (the list goes on and on..) as we’ve made our mark in the OTT and Linear TV &amp; media space.</p><p>On a personal note😛, you can find me on <a href="https://twitter.com/sdivakarrajesh">Twitter </a>and other socials as @sdivakarrajesh — Shameless plug 🤦‍♂️ — See ya..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d47895bd21d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Python Script That Clusters Photos Based on the Faces]]></title>
            <link>https://medium.com/swlh/building-a-people-clustering-script-in-python-4b197bceb84e?source=rss-5f6fa8b1881b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b197bceb84e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[face-recognition]]></category>
            <dc:creator><![CDATA[Divakar Rajesh]]></dc:creator>
            <pubDate>Fri, 15 Jan 2021 12:32:53 GMT</pubDate>
            <atom:updated>2021-01-17T22:21:14.929Z</atom:updated>
            <content:encoded><![CDATA[<h4>Used Google photos before? You’ve probably seen this in action.</h4><h3>So, what are we building?</h3><ul><li>We are going to group a bunch of photos based on who’s in the picture</li><li>We’ll be leveraging the <a href="https://pypi.org/project/face-recognition/"><em>face_recognition</em></a><em> </em>python module specifically</li><li>Yo! Juz gimme the code: <a href="https://github.com/sdivakarrajesh/face-clustering">https://github.com/sdivakarrajesh/face-clustering</a></li><li>You can use the requirements.txt to install all the dependencies</li></ul><h3>Let’s get familiar with the module first</h3><p>The face recognition module provides us the functions to load a photo, get the encodings of the faces in the photo and also compare them, saying if the two encodings match or not.</p><p>We’ll use two photos of Kylie(one with black hair and another with blonde hair) and one photo of Khloe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbupNNhRQQIqmQINDBeARQ.jpeg" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94d564832938956948b7b7222b5621c9/href">https://medium.com/media/94d564832938956948b7b7222b5621c9/href</a></iframe><p>Running the program gives this result. Even though Kylie has different hair colors only her face data is used to decide if they are the same person. Nice!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*gwBbuN5OgWrSZKH3OK_G9Q.jpeg" /></figure><h3>Let’s cluster a bunch of images now, shall we?</h3><p>A sample set of 25 images of 3 football players, are in the GitHub repo mentioned above, so you can also follow along!</p><ol><li>Let’s try to get all the photos that we have in the “dataset” directory</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c485d2a85187cf64f1f2280b47052943/href">https://medium.com/media/c485d2a85187cf64f1f2280b47052943/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*vEkbl6erMuE7qv2lbnm94g.jpeg" /></figure><p>2. Now we should process each image, checking if the face in the image matches any cluster we have, if it matches, we add it to the cluster, if it doesn’t we create a new cluster</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d82e875dbc1f9cfaba971ff2d997635/href">https://medium.com/media/8d82e875dbc1f9cfaba971ff2d997635/href</a></iframe><p>3. Putting this all together and running the file should group the images in “results” folder in the current working directory inside their own respective folders representing each cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*JSI9JTIxiOhR_tSuRYu3ug.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*5EarrWSNwXkjFoKzX_S6rQ.jpeg" /></figure><p>(The complete code can be found in the <a href="https://github.com/sdivakarrajesh/face-clustering">GitHub Repo</a>)</p><p>Yay! — we can now cluster images based on who’s in it. But wait a second, this CLI app won’t scale well if you are trying to build let’s say a desktop GUI or Android application around it. Some things that you might want to consider include:</p><ol><li><strong>Representative Image for cluster:</strong> Promoting an image to a represent a cluster. So, every time when we are trying to check if an image belongs to a cluster, we compare it with just that one representative image and not all the images that the cluster has</li><li><strong>Parameter Tuning: </strong>Of course, this out-of-the-box solution by this library will not suit all use cases. We might want to tune parameters such as <em>tolerance</em> to get better results</li><li><strong>Multiple faces:</strong> And if you followed along you might also notice, that we only take the first face that we find on the image and in real photos that might not be the case</li><li><strong>Database and OOMS:</strong> Throw in a SQLite database or whatever and try to persist the data on disk rather than holding all encodings at the same time in memory like the “encodings” dictionary that we have in our script</li><li><strong>Same or Different:</strong> One nice thing that I also like about google photos is that, when it realizes some clusters have somewhat closer resemblance it suggests “Same or different person” — that asks for human input.</li></ol><p>So, that’s it? — Wait we have something interesting to share!</p><h3>Sensara’s Video Reasoning platform</h3><p>We at Sensara have been building something interesting that helps identify what’s in a video. This is especially useful for an OTT platform, where recommendations and user interests can be improvised manifold if we can understand what’s there in the video that the users watch.</p><p><em>Banners</em>, <em>Trailers</em>, <em>Boilerplates</em>, <em>Tunes</em>, <em>Detail pages</em>, we’ve create them all, just out of the given video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAL2rh_KXvhqAkH5iqaB2w.jpeg" /></figure><p>We mine this almost in real-time from linear TV as well.</p><blockquote>Of course that is built with a more sophisticated solution than the above script, duh! <em>🤭</em></blockquote><p>And that is used to power recommendations and detail pages in popular D2H boxes including Airtel. This help us build enriched detail pages of people with movies they are on, link to relevant OTT apps and also future TV shows they appear on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*svPBjCC-ksVwlJIRpCQEAg.jpeg" /></figure><p>You can also try it in action with the “Sensy India TV Guide &amp; Remote” &amp; “Mi Remote controller” Android apps</p><ul><li><a href="https://play.google.com/store/apps/details?id=co.sensara.appsense">Sensy India TV Guide &amp; Remote - Apps on Google Play</a></li><li><a href="https://play.google.com/store/apps/details?id=com.duokan.phone.remotecontroller">Mi Remote controller - for TV, STB, AC and more - Apps on Google Play</a></li></ul><p>Hey👋 — I’m Divakar Rajesh, a <strong>Product Engineer</strong> at <strong>Sensara </strong>— You’ve probably interacted with our products if you have tried Xiaomi Mi Remote. We’re also the default TV Guide/Launcher on some popular smart TVs including the MiTV and we also power recommendations, live TV discovery on all Airtel Smart Set-top boxes.</p><p>On a personal note😛, you can find me on <a href="https://twitter.com/sdivakarrajesh">Twitter </a>and other socials as @sdivakarrajesh — Shameless plug 🤦‍♂️ — See ya..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b197bceb84e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/building-a-people-clustering-script-in-python-4b197bceb84e">Building a Python Script That Clusters Photos Based on the Faces</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating task to run on startup in VSCode]]></title>
            <link>https://sdivakarrajesh.medium.com/automating-task-to-run-on-startup-in-vscode-fe30d7f99454?source=rss-5f6fa8b1881b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe30d7f99454</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Divakar Rajesh]]></dc:creator>
            <pubDate>Wed, 18 Nov 2020 13:03:16 GMT</pubDate>
            <atom:updated>2020-11-21T16:15:29.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Whenever I open up an <em>npm project </em>workspace on VSCode I usually run a few commands on startup. VSCode has been my favorite Text Editor of choice for quite sometime now, primarily due to the available customization options and the wide variety of extensions. And it didn’t fail me here😛.</p><h3>What do I do every time I open a workspace?</h3><ul><li>I open up the integrated terminal with ctrl + `</li><li>Start the development server with npm start</li><li>Open another terminal instance with ctrl + shift + `</li><li>Start the test suite with npm run test</li></ul><blockquote>What do we, developers, do when we realize that we are doing things again and again?<br>Yes, we automate it!🤣</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*gMD9ZdDwdjlz-cG7psWpPA.jpeg" /></figure><h3>Tasks in VSCode</h3><ul><li>We’ll be leveraging VSCode’s Tasks feature for this.</li><li>Complete Documentation here: <a href="https://code.visualstudio.com/docs/editor/tasks">https://code.visualstudio.com/docs/editor/tasks</a></li><li>Similar use case: These tasks can be used to run multiple steps on a build process in compiled languages for example. Or you can setup doing a git pull when on a collaborative project.</li><li>Or even CI / CD ? - wow! let’s not do that here shall we?</li><li>Specifically we’ll be running these tasks on opening a workspace for our use case.</li></ul><h3>Let’s do it then?</h3><p>VSCode has workspace specific settings and configurations in a .vscodedirectory</p><ul><li>Create a tasks.json file inside the .vscode folder</li><li>Setup the task that we want to run</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54eb91c6c0a7eaf73c6eb0ccd73858fe/href">https://medium.com/media/54eb91c6c0a7eaf73c6eb0ccd73858fe/href</a></iframe><ul><li>npm start and npm run test commands are the two tasks that we want to run here.</li><li>We obviously want to see the output of these commands. So <em>presentation reveal</em> is set to <em>always</em> and each of these run on separate terminal instances</li><li><em>folderOpen runOn</em> option inside <em>runOptions</em> makes the task run on opening a workspace</li><li>That’s it</li></ul><h3>Let’s try it out, shall we?</h3><ol><li>Open up the command Palette with ctrl + shift + p</li><li>Try searching for tasks and select “Tasks: Run Task”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*4JAgIN_qB_wABRn9KV692A.png" /></figure><p>3. Now select the “Start App” task and give it a test run and see if it works</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*pYizPnioLghnjBJQqZRU7A.png" /></figure><p>4. You would be presented with this notification 👇, click on “Allow and run”<br>(if you do not see this automatically, try closing the integrated terminal, ctrl + `)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*7J7QCysn346-PVHuBlSClA.jpeg" /></figure><p>5. Reload the workspace and see if the tasks automatically run on startup. Open the command palette with ctrl + shift + p and type “reload”, select “Developer: Reload Window”,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*cgYA0ExUvnX3RcwFVREY0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPZkkT3STWRWpP-IdP51XA.jpeg" /></figure><p>As soon as the workspace is opened, the integrated terminal should open up and you should see the tasks should start running.</p><h3>Bonus:</h3><p>If you didn’t know you can open previously opened workspaces using the ctrl + r shortcut</p><p>Try it out and share what you automated with this VSCode feature!</p><p>Hey👋 — I’m Divakar Rajesh, a <strong>Product Engineer</strong> at <strong>Sensara </strong>— You’ve probably interacted with our products if you have tried Xiaomi Mi Remote. We’re also the default TV Guide/Launcher on some popular smart TVs including the MiTV anddd we also power recommendations and live TV discovery on all Airtel Smart Set-top boxes.</p><p>On a personal note😛, you can find me on <a href="https://twitter.com/sdivakarrajesh">twitter </a>and other socials as @sdivakarrajesh — Shameless plug 🤦‍♂️ — See ya..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe30d7f99454" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You don’t need a VPN to securely access servers in your Office/Datacenter]]></title>
            <link>https://sdivakarrajesh.medium.com/you-dont-need-a-vpn-to-securely-access-servers-in-your-office-datacenter-af7297128590?source=rss-5f6fa8b1881b------2</link>
            <guid isPermaLink="false">https://medium.com/p/af7297128590</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[remote-development]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Divakar Rajesh]]></dc:creator>
            <pubDate>Wed, 09 Sep 2020 12:53:04 GMT</pubDate>
            <atom:updated>2020-09-09T16:51:04.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Especially now during the COVID-19 period😷, when you are forced to work from home🏡, you somehow have to access the servers and databases in your office’s intranet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XQSLpoXG5tKp5f4P" /><figcaption>Photo by <a href="https://unsplash.com/@danny144?utm_source=medium&amp;utm_medium=referral">Dan Nelson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong><em>Why can’t we expose them all?</em></strong></h3><ul><li>Well🤔.. not all applications are built with security in mind.</li><li>For most applications there won’t be even an auth wall that checks the person accessing it, for authorization.</li><li>so let’s just keep them behind the intranet.</li></ul><p>But there must be that one<em>(or more)</em> machine<em>(s)</em> that acts as load balancer setup(the machine exposed to the internet — let’s call it the “proxymachine”), that distributes to external traffic to the servers inside the intranet. We’re gonna make use of that to accomplish the goal.<br>It’s possible that you’ve used SSH(Secure Shell) to access remote servers securely. Right?💭</p><p>According to the <a href="https://www.ssh.com/ssh/">https://www.ssh.com/ssh/</a></p><blockquote>“The SSH protocol uses encryption to secure the connection between a client and a server. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network”</blockquote><p>So SSH can help us here. One slight issue, we’re not gonna have to SSH to the proxymachine and then SSH again from there. Some folks at SSH have already thought this through and let’s us specify an attribute that let’s you make a machine act as a <strong><em>“Proxy”</em></strong></p><h3><strong>Setting up the config File</strong></h3><p>To achieve this we might have to change few lines in your SSH config file. It would reside in ~/.ssh for linux and MacOS and C:\Users\&lt;YOUR_USERNAME&gt;\.ssh for Windows.</p><p>Setting up hosts in the config file is pretty straightforward.</p><pre>Host &lt;any-name&gt;<br> HostName &lt;domain-name-or-ip-of-the-proxy-machine&gt;<br> User &lt;your-username-at-the-proxy-machine&gt;<br> Port &lt;port-for-ssh-at-proxy-machine&gt;</pre><p><strong>Example</strong>:📝</p><pre>Host proxymachine<br> HostName lb.yourorg.com<br> User divakar<br> Port 22</pre><h3>The Proxy</h3><p>The machine we setup as proxy will talk to — or to be precise — tunnel the traffic to the machine behind the intranet wall</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*eAghOeTmK4A6WDXPAxOegw.gif" /><figcaption>Source: <a href="https://giphy.com/gifs/SuccessionHBO-hbo-succession-im-in-charge-QOy97mw7oOEXZyl70O">https://giphy.com/gifs/SuccessionHBO-hbo-succession-im-in-charge-QOy97mw7oOEXZyl70O</a></figcaption></figure><p>Now to access the server in the Proxy machine’s network — AKA our restricted servers, databases etc:</p><pre>Host &lt;any-name&gt;<br> HostName &lt;domain-name-or-ip-address-of-the-machine-in-intranet&gt;<br> User &lt;your-username-in-that-machine&gt;<br> ProxyJump &lt;name-you-gave-for-proxy-machine&gt;</pre><p>For Windows users, instead of the “ProxyJump” use this</p><pre>ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe -q -X -W %h:%p &lt;your-username-in-that-machine&gt;&gt;@&lt;proxy-machine-name&gt;</pre><p><strong>Example</strong>: 📝</p><p>Now, let us suppose you want to access the Database machine in your office intranet and its IP in the “intranet” is 123.11.222.33</p><pre>Host dbmachine<br> HostName 123.11.222.33<br> User divakar<br> ProxyJump proxymachine</pre><p>For Windows, you’d have something like this instead of ProxyJump</p><pre>ProxyCommand C:\Windows\System32\OpenSSH\ssh.exe -q -X -W %h:%p divakar@proxymachine</pre><p>So now you can just,</p><pre>ssh dbmachine</pre><p>and access the resources from the command line.</p><h3>Port Forwarding</h3><p>OK, seems fine and all, but this would give you only the command line interface. How would you use stuff like dashboards and other stuff that run over HTTP on different ports? VPN gives you these for free remember? For that, you’ll have to do one more step.</p><p>Enter “<em>Port Forwarding</em>” 🙌</p><p>You can forward port on a remote machine, to your localhost machine and send traffic to it as though it was running locally. So you can view them on the browser on localhost, send them API requests etc.</p><p>The syntax for it is something like:</p><pre> ssh -nNL localhost:&lt;local-port&gt;:&lt;remote-machine&gt;:&lt;remote-port&gt; &lt;remote-machine&gt;</pre><p><strong>Example</strong>:📝</p><p>So, if you want to tunnel traffic from localhost 8000 to, let’s say, a dashboard running in dbmachine at port 9000, you’d have something like:</p><pre> ssh -nNL localhost:8000:dbmachine:9000 dbmachine</pre><p>Keep in mind that port forwarding would respect the ProxyJump/ProxyCommand we had setup above</p><p>(You can always look at the man pages to see what the args do😛)</p><p>You’d have the keep the terminal open after entering the above command to keep the forwarding alive😑</p><h3>Bonus: Remote Development</h3><p>That’s good and all, but what if you also want to use a GUI editor to develop on that remote machine?</p><p>If its a popular editor, its probable that, there is an extension out there that let’s you write code directly on the remote machine.</p><p>Heard of VSCode? It’s pretty awesome. It has extensions called “Remote Development” &amp; “Remote SSH”. With these you can open up any folder and start developing on that workspace as if you would do it locally. It can also automatically setup port forwarding if you want, as you open up a remote workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*QDY8-x6tkeDHqQR3Rg6tXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m465keFTcYUvhcmwx9y4IQ.png" /><figcaption>Source &amp; More info: <a href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></figcaption></figure><p>That’s it! — Hope you learnt something here. I’m sure I did😅</p><p><em>Credits: Elvis D’Souza(My mentor🤗), Anshul Mittal(That one annoying co-worker)</em></p><p>Hey👋 — I’m Divakar Rajesh, a <strong>Product Engineer</strong> at <strong>Sensara </strong>— Who dat? — whoa, you’ve probably interacted with our products if you have tried Xiaomi Mi Remote. We’re also the default TV Guide/Launcher on some popular smart TVs including the MiTV anddd we also power recommendations and live TV discovery on all Airtel Smart Set-top boxes.</p><p>On a personal note😛, you can find me on <a href="https://twitter.com/sdivakarrajesh">twitter </a>and other socials as @sdivakarrajesh — Shameless plug 🤦‍♂️— See ya..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af7297128590" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>