<?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 Santhosh Kumar on Medium]]></title>
        <description><![CDATA[Stories by Santhosh Kumar on Medium]]></description>
        <link>https://medium.com/@santhoshkmunigala?source=rss-3c7a3ab1af17------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*39KUYg5SGBYeoDMs_dzgAQ.jpeg</url>
            <title>Stories by Santhosh Kumar on Medium</title>
            <link>https://medium.com/@santhoshkmunigala?source=rss-3c7a3ab1af17------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 02:05:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@santhoshkmunigala/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[TOTP Hack (Google Authenticator)]]></title>
            <link>https://santhoshkmunigala.medium.com/totp-hack-google-authenticator-766a526bc93e?source=rss-3c7a3ab1af17------2</link>
            <guid isPermaLink="false">https://medium.com/p/766a526bc93e</guid>
            <category><![CDATA[totp]]></category>
            <category><![CDATA[2fa]]></category>
            <category><![CDATA[google-authenticator]]></category>
            <category><![CDATA[oathtool]]></category>
            <category><![CDATA[2-step-verification]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Sun, 16 May 2021 19:03:30 GMT</pubDate>
            <atom:updated>2021-05-16T19:03:30.309Z</atom:updated>
            <content:encoded><![CDATA[<p>I use a VPN for my work network access. It uses TOTP as 2FA password. In a day I connect and disconnect to VPN at least 10 times and every time I try to connect I need to open my Google Authenticator app on mobile to get OTP. This is not a problem generally but it gets a little boring doing this 10 times a day and for me mobile phone is a productivity blackhole so I try to keep away from it.</p><p>In this article I mentioned a way in which you can generate an TOTP on your machine for easy access. For general purpose its <strong>not secure</strong> to follow this way for generating TOTP so <strong>I do not recommend </strong>doing this for important credential.</p><p>To start with, what is TOTP? It stands for Time-based One-Time Password, it’s an algorithm to generate OTP as a function of current time and a secret string. Essentially when you register for TOTP on google authenticator you basically input the secret to the authenticator app and the app then uses the secret and current time to generate a 6 digit (customisable) OTP. I have mentioned the steps below to achieve the same using your Terminal.</p><p><strong>Step 1</strong>: Decode the QR code you use(d) for registering on Google Authenticator. You can simply do this by scanning (in most phones pointing camera at it should do the job) the QR code on your android or iPhone to get the link text. The decoded string looks something like below</p><pre>otpauth://totp/&lt;label&gt;?secret=&lt;secret&gt;&amp;issuer=&lt;issuer&gt;</pre><p><strong>Step 2</strong>: Install oath-toolkit, I’m on mac and I use <a href="https://brew.sh/">Homebrew</a>, so I used brew to install the same</p><pre>brew install oath-toolkit</pre><p><strong>Step 3</strong>: Run the below command with secret from first step and make sure the printed OTP is same as that on Google Authenticator</p><pre>oathtool — base32 — totp “&lt;secret&gt;”</pre><p><strong>Step 4</strong>: (Optional) You pretty much achieved what you are looking for in step 3, this and the next steps are to make it convenient and secure for regular usage<br>Create a .sh file with the below line, make it executable, update the default opening application to Terminal and keep it in a place that is easily accessible for you, you will get the OTP on your clipboard after opening this file, paste it wherever required</p><pre>oathtool — base32 — totp “&lt;secret&gt;” | tr -d ‘\n’ | pbcopy</pre><p><strong>Step 5</strong>: (Optional) I have a sweet mouse with customisable buttons, so I mapped it to one of the buttons to run this file, then made the file hidden using below command, you can map the same to a key board shortcut or any other accessibility feature that’s at your disposable, in that way you can keep your file with the secret hidden in a safe location</p><pre>chflags hidden &lt;file name&gt;.sh</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=766a526bc93e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 steps to setup OpenGrok on your Computer]]></title>
            <link>https://santhoshkmunigala.medium.com/5-steps-to-setup-opengrok-on-your-computer-a41b43af05d5?source=rss-3c7a3ab1af17------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41b43af05d5</guid>
            <category><![CDATA[indexing]]></category>
            <category><![CDATA[opengrok]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[source-code]]></category>
            <category><![CDATA[grok]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Sun, 16 May 2021 16:05:10 GMT</pubDate>
            <atom:updated>2021-12-01T18:38:45.009Z</atom:updated>
            <content:encoded><![CDATA[<h3>5 Steps to setup OpenGrok on your Computer</h3><p>Have you ever referred to existing projects for correct usages of annotations like @SpringBootTest,@Async,@Cached or have you ever went back to a project that you have worked before to check the way you wrote that ThreadPool, Pom.xml, DockerFile. Everyone does that!</p><p>So how do you do it? Do you load the project on your IntelliJ or PyCharm or any other IDE and search for it? Or do you go to the GitHub UI and look for it? Its just not convenient and we do this so often! If you are working on a Microservice architecture this will be gazillion times harder.</p><p>I use Opengrok. It’s pretty handy, makes my life much easier. I can index all my little projects and search for any thing in any number of repos easily and quickly. Apart from search it comes very handy when you quickly want to check for any file’s Git history. Instead of setting up in local, if its hosted on a server accessible to your coworkers, it will be the easiest way to point to specific line in code in indirect discussions. You can refer to all the stuff it can do and on its <a href="https://github.com/oracle/opengrok">git repo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioZfJ9rtVLlF4lLQc6U_7Q.png" /></figure><p>In this article I shared the steps that I used to easily setup OpenGrok on my Macbook. Opengrok uses Java 11, I didn’t want to install Java 11 on my mac since my company still uses Java 8 and applications doesn’t work with Java 11 (I tried installing both JDks but it just makes everything messy).</p><p>To avoid all this complications I used docker image. It also takes care of updating you repositories and reindexing with latest code as per the defined intervals. Most of what I mentioned here can be found in the official <a href="https://hub.docker.com/r/opengrok/docker/">docker hub page</a>. I just filtered out things that I used and also included some other steps I did.</p><p><strong>Step 1</strong>: Install docker if you haven’t already (You can download <a href="https://www.docker.com/products/docker-desktop">Docker Desktop</a>, its pretty convenient and installs all command line tools too)</p><p><strong>Step 2</strong>: Clone all your repos in one folder, <a href="https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh">use SSH</a> for automatically updating git repos periodically (Avoid using your development workplace since we want to update and reindex all the code regularly)</p><p><strong>Step 3</strong>: Create a docker-compose.yml file and copy the below contents</p><pre>version: &quot;3&quot;</pre><pre># More info at <a href="https://github.com/oracle/opengrok/docker/">https://github.com/oracle/opengrok/docker/</a><br>services:<br>  opengrok:<br>    container_name: opengrok<br>    image: opengrok/docker:latest<br>    ports:<br>      - &quot;9090:8080/tcp&quot;<br>    environment:<br>      SYNC_PERIOD_MINUTES: &#39;60&#39;<br>    # Volumes store your data between container upgrades<br>    volumes:<br>       - &#39;&lt;path to your source code&gt;/:/opengrok/src/&#39;  # source code<br>       - &#39;&lt;path to opengrok dir&gt;/opengrok/etc/:/opengrok/etc/&#39;  # folder contains configuration.xml<br>       - &#39;&lt;path to opengrok dir&gt;/opengrok/data/:/opengrok/data/&#39;  # index and other things for source code<br>       - &#39;&lt;path to your .ssh folder&gt;/.ssh:/root/.ssh&#39; # ssh key for git access</pre><p>Lets go through few key configurations in this file</p><ol><li>The port configuration is 9090:8080/tcp. We are basically mapping your localhost port 9090 to 8080 of the tomcat inside docker. Since I use 8080 port frequently I set it as 9090, you can update it to any valid value as you wish</li><li>SYNC_PERIOD_MINUTES refers to the time intervals in which repos needs to be updated and reindexed, its set to 60 mins here</li><li>&lt;path to your source code&gt; — This is path to your local folder containing all the cloned repos (don’t miss ‘/’ at the end)</li><li>&lt;path to opengrok dir&gt; — Create a folder ‘opengrok’ for storing generated indexes and other stuff locally, inside this folder create two more folders ‘etc’ and ‘data’</li><li>&lt;path to your .ssh folder&gt; — You will need this mapping if you want to automatically pull code from git or any other versioning system using ssh</li></ol><p><strong>Step 5</strong>: Run docker-compose up to bring up opengrok container, this will pull the latest image and index the source code</p><p>Thats it! In 5 steps you have OpenGrok on your machine, you can access it @ localhost:9090</p><p>Although these steps refer to what I followed to setup open grok in my macbook, it should be pretty similar on other setups as well. Do you let me know if you encounter any difficulties.</p><p>Few Tips:</p><ol><li>Add following two lines in .sh file, make it executable, change the default opening application to terminal and add it to your startup/login items. This will keep your open grok ready to use when you start your machine<br>cd &lt;path to docker compose file folder&gt;<br>docker-compose up -d</li><li>Add a custom search engine for the key word grok in your browser to point it to localhost:9090 for easy access</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a41b43af05d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>