<?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 Manish Trivedi on Medium]]></title>
        <description><![CDATA[Stories by Manish Trivedi on Medium]]></description>
        <link>https://medium.com/@manishtrivedi?source=rss-306ebf5389a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pdpPx6N6MLWcVVx7.jpg</url>
            <title>Stories by Manish Trivedi on Medium</title>
            <link>https://medium.com/@manishtrivedi?source=rss-306ebf5389a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:47:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manishtrivedi/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[Losing Hours on YouTube Without Realizing It. So I Built a Chrome Extension to Fix It.]]></title>
            <link>https://medium.com/@manishtrivedi/losing-hours-on-youtube-without-realizing-it-so-i-built-a-chrome-extension-to-fix-it-f5be6567d02b?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5be6567d02b</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[digital-wellbeing]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Sat, 18 Apr 2026 14:49:49 GMT</pubDate>
            <atom:updated>2026-04-18T14:49:49.728Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhT49M1zEmfwOJHcXrooEA.png" /></figure><p>Last month, I sat down to learn Kubernetes. I had a deployment to fix at work, and I needed to understand pod networking better. I searched “Kubernetes networking explained,” clicked a video, and started watching. Twenty minutes in, a thumbnail in the sidebar caught my eye — “10 Tools Every Developer Needs in 2026.” I clicked it. Then another. Then another.</p><p>Two hours later, I had watched six videos. None of them were about Kubernetes. My deployment was still broken.</p><p>And the worst part? I didn’t even notice it happening.</p><h3>The slow bleed of time</h3><p>This wasn’t a one-time thing. It had become a pattern. One day I’m trying to learn Terraform for a new project — I end up watching someone’s home lab setup tour. Another day I open YouTube to check plantation tips for my balcony garden — 40 minutes later I’m watching a guy build an entire farmhouse. I’d open YouTube to learn something specific and somehow end up watching videos I never planned to watch. Not because I was lazy. But because YouTube is really, really good at keeping you watching.</p><p>The homepage is full of recommendations. The sidebar is full of “Up next” videos. Shorts pop up everywhere. And every thumbnail is designed to grab your attention.</p><p>I started noticing something uncomfortable. I was spending 2–3 hours a day on YouTube, but I could barely remember what I watched. It felt like my time was leaking away, slowly, one click at a time. And I wasn’t learning anything meaningful.</p><p>That feeling — where you close the browser and realize you wasted your evening — I think a lot of people know it. You feel frustrated, a little guilty, and you tell yourself “tomorrow I’ll be more disciplined.” But tomorrow, the same thumbnails are waiting for you.</p><h3>I tried everything</h3><p>I tried willpower. Didn’t work — you can’t fight a billion-dollar recommendation algorithm with motivation.</p><p>I tried blocking YouTube entirely. That didn’t work either — I actually need YouTube for learning. There are genuinely great tutorials and talks there. I didn’t want to quit YouTube. I wanted to use it <em>intentionally</em>.</p><p>I tried a few existing extensions. Some were too aggressive — they’d block everything. Some were too complicated with dozens of settings. None of them did exactly what I needed.</p><p>So one weekend, I thought — what if I just build something simple myself?</p><h3>What I built</h3><p>I created a Chrome extension called <strong>YouTube Mindful</strong>. It doesn’t block YouTube. It just removes the parts that distract you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*Sf_E0FY-oQYARJJMt3hn3A.png" /></figure><p>Here’s what it does:</p><p><strong>Grey out thumbnails</strong> — All video thumbnails are replaced with plain grey boxes. You can still see the title, channel name, and duration. You just don’t see the clickbait image that pulls you in. If you actually want to see a thumbnail, just click the grey box and it reveals itself. This alone changed my browsing completely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GwhKDTsR7LBZeFcmPLcpg.png" /></figure><p><strong>Hide Shorts</strong> — Shorts are the worst for killing time. The extension removes the Shorts shelf from the homepage, the Shorts tab from the sidebar, and Shorts from search results. Gone.</p><p><strong>Hide homepage feed</strong> — Instead of a wall of recommended videos, you see a simple message: “What do you want to learn today? Use the search bar.” This forces you to come to YouTube with a purpose instead of just scrolling.</p><p><strong>Hide sidebar suggestions</strong> — Those “Up next” videos on the right side while you’re watching? Hidden. Now you can watch your video and leave without falling into a rabbit hole.</p><p>Each of these is a separate toggle. You can turn on what works for you and leave the rest off.</p><h3>The difference it made</h3><p>The first week felt weird. YouTube looked so… empty. My brain kept looking for something to click. That’s when I realized how deep the habit had gone.</p><p>But after a few days, something shifted. I started opening YouTube only when I had a specific video or topic in mind. I’d search, watch, and close the tab. No wandering. No rabbit holes.</p><p>My screen time on YouTube dropped from 2–3 hours to about 30–40 minutes. And those 30–40 minutes were actually useful — tutorials I needed, talks I wanted to watch.</p><p>The grey thumbnails were the biggest game changer for me. I didn’t realize how much the thumbnails controlled my clicks until they were gone. When all you see is the title, you make much more conscious choices about what’s worth your time.</p><h3>It’s not about hating YouTube</h3><p>I want to be clear — this isn’t an anti-YouTube tool. YouTube is amazing. Some of the best learning content in the world is there, for free. I’ve learned more from YouTube than from most courses I’ve paid for.</p><p>But YouTube’s job is to keep you watching. Your job is to learn what you came for and get back to work. These two goals are in conflict. YouTube Mindful just tips the balance back in your favour.</p><h3>Try it out</h3><p>I built this over a weekend and I’ve been using it daily for a few weeks now. It has no tracking or ads — just a simple tool that does one job.</p><p>If you’re someone who:</p><ul><li>Opens YouTube to learn but ends up binge-watching</li><li>Feels guilty after spending hours on recommendations</li><li>Wants to use YouTube without the distractions</li><li>Has tried “being more disciplined” and it didn’t stick</li></ul><p>Give it a try: <a href="https://chromewebstore.google.com/detail/youtube-mindful/kkbdghndpjogeifadffhmbnmcojlddjc?utm_source=item-share-cb">YouTube Mindful on Chrome Web Store</a></p><p>I’d genuinely love your feedback. What works? What doesn’t? What features would help you? Drop a comment here or use the feedback link in the extension.</p><p>This started as a fix for my own problem. If it helps even a few more people take back their time, that would make my weekend well spent.</p><p><em>Built with frustration, a weekend, and too many hours lost to YouTube’s sidebar.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5be6567d02b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Had 113 Dead Git Branches. Here’s How I Clean Them Up in Seconds Now.]]></title>
            <link>https://medium.com/@manishtrivedi/i-had-113-dead-git-branches-heres-how-i-clean-them-up-in-seconds-now-7bafd3305b1b?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bafd3305b1b</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 06:36:24 GMT</pubDate>
            <atom:updated>2026-04-10T06:36:24.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFSgNJ_Jd9-5ur-cZOJqNA.png" /><figcaption>Source: Generated by Gemini AI</figcaption></figure><p>If you’ve been working on a project for a while — especially with a team — you know how it goes. You create a feature branch, merge the PR, move on. Then another. And another. Nobody goes back to delete the old ones.</p><p>Last week I ran git branch on our monorepo and scrolled. And scrolled. And scrolled.</p><p><strong>113 merged branches</strong> sitting there doing nothing. 69 of mine, 20 from a teammate, 4 from another dev, and 20 random ones from months ago. Some of those branches were even still hanging around on the remote.</p><p>I could’ve written a bash one-liner. I’ve done that before. But I wanted something I could reuse without thinking — something that wouldn’t accidentally nuke main or a release branch at 11pm on a Friday.</p><p>So I built a <strong>Claude Code</strong> slash command for it.</p><h3>What It Does</h3><p>One command. That’s it.</p><pre>/git-merge-cleanup</pre><p>It finds all locally merged branches, shows you the list, asks for confirmation, and deletes them. Done.</p><p>It <strong>always protects</strong> these branches:</p><ul><li>main</li><li>master</li><li>release* (any branch starting with release)</li><li>Whatever branch you’re currently on</li></ul><p>No surprises. No force deletes. It uses git branch -d (safe delete) — so if something isn&#39;t actually merged, it just skips it and tells you.</p><h3>The Options That Actually Matter</h3><h3>Filter by developer</h3><p>Working with a team? Clean up just your branches:</p><pre>/git-merge-cleanup manish*</pre><p>This matched all 69 of my branches — things like manish/feat-promo-improvements, manish/fix-klaviyo, manish/hot-fix-06April. Gone in one shot.</p><p>Then I ran it for each teammate:</p><pre>/git-merge-cleanup lorenzo*<br>/git-merge-cleanup prabhat*</pre><p>20 and 4 branches respectively. Clean.</p><h3>Clean remote branches too</h3><p>The --remote flag also removes branches from origin — but only if they&#39;re actually merged AND exist on the remote. It checks first.</p><pre>/git-merge-cleanup manish* --remote</pre><p>This found 4 of my branches still on the remote (out of 69 local), deleted them, and left 4 others alone because they weren’t merged yet. Exactly what I wanted.</p><h3>Clean everything at once</h3><p>No pattern? It grabs all merged branches (still protecting the important ones):</p><pre>/git-merge-cleanup --remote</pre><p>This was my last pass — caught 20 remaining branches like claude/jovial-mendeleev, feat/sentry, hotfix/prod-674b007. Also cleaned 2 stale remote branches.</p><h3>What a Typical Run Looks Like</h3><pre>&gt; /git-merge-cleanup manish* --remote</pre><pre>Local deletion: 69 merged branches<br>Remote deletion: 4 branches (merged + exist on remote)<br>Skipped (unmerged remote): 4 — not touched</pre><pre>Proceed? yes</pre><pre>✓ 69 local branches deleted<br>✓ 4 remote branches deleted</pre><p>It always shows you what’s about to happen before doing anything. You say yes, it runs. You say no, nothing happens.</p><h3>The End Result</h3><p>RunPatternLocal DeletedRemote</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yp-RO2zl9pBNNyvugBhKDQ.png" /></figure><p>Four commands. Maybe 2 minutes total. Repo feels lighter already.</p><h3>How to Get It</h3><p>This is a Claude Code custom slash command. You can find it in my repo:</p><p><strong>GitHub</strong>: <a href="https://github.com/mManishTrivedi/claude-commands">https://github.com/mManishTrivedi/claude-commands</a></p><p>Drop the command file into your .claude/commands/ directory and you&#39;re good to go. Works with any git repo.</p><h3>What’s Next</h3><p>I’m currently working on another slash command for <strong>AWS CloudWatch log analysis</strong> — pulling production logs, extracting errors, and generating summaries without leaving the terminal. Dealing with log groups, pagination, time ranges, error pattern extraction — all the stuff that usually means jumping between the AWS console and five terminal tabs.</p><p>Will write about that one soon. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bafd3305b1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hotfixing Production Safely with Git (Without Touching Main)]]></title>
            <link>https://medium.com/@manishtrivedi/hotfixing-production-safely-with-git-without-touching-main-fc00d706120f?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc00d706120f</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 13:50:50 GMT</pubDate>
            <atom:updated>2026-03-17T13:50:50.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-HYXQohjE-MUE-JfhL_Vg.png" /></figure><p>Shipping fast is great. Fixing production safely is better.</p><p>When a specific commit is already running in production, the safest way to patch it is to branch from that exact commit, not from the latest main. This avoids pulling in unrelated changes and keeps your hotfix focused.</p><h3>Why this works</h3><ul><li>Your fix is based on the same code currently in production.</li><li>You reduce risk from new, untested changes.</li><li>Rollout and rollback are easier to reason about.</li></ul><h3>The exact workflow</h3><pre># Check your current branch state<br>git status --short --branch<br><br># Verify the production commit<br>git show -s --oneline &lt;Commit-id&gt;<br><br># Create and switch to a hotfix branch from that commit<br>git switch -c hotfix/prod-&lt;DATE-or-ticket-number&gt; &lt;Commit-id&gt;<br><br># Confirm you&#39;re on the new branch<br>git status --short --branch</pre><p>Now you can add only the required fix, test, commit, and deploy with confidence.</p><h3>Pro tip</h3><p>Use clear branch names like:</p><ul><li>hotfix/prod-&lt;short-sha&gt;</li><li>hotfix/&lt;issue-id&gt;-&lt;short-desc&gt;</li></ul><p>This makes on-call and release conversations much easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc00d706120f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native + Firebase Crashlytics: What Happens Behind the Scenes]]></title>
            <link>https://medium.com/@manishtrivedi/react-native-firebase-crashlytics-what-happens-behind-the-scenes-841cd83db954?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/841cd83db954</guid>
            <category><![CDATA[reactnative-app]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 13:23:19 GMT</pubDate>
            <atom:updated>2026-02-17T13:23:19.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BQYtflWFL4OYRqqL0przQ.png" /></figure><p>Today I spent some time testing <strong>Firebase Crashlytics</strong> in a React Native app.<br>I thought crashes appear instantly in the Firebase console… but actually the system works a bit differently.<br>Here is the simple explanation for devs 👇</p><h3>1. Types of errors Crashlytics handles</h3><h3>🔴 Fatal Crash</h3><p>Test with this code crashlytics().crash()</p><p>This immediately kills the app.</p><blockquote><strong>Important point:</strong> <em>The app cannot send data after it dies.</em></blockquote><p>So what happens?</p><ol><li>Crash data is saved locally on the device</li><li>Nothing is sent at that moment</li><li>When user opens the app again → Crashlytics starts</li><li>Then it uploads the crash report</li></ol><p>So you <strong>must reopen the app</strong> to see the crash in Firebase.</p><blockquote><strong>Flow:</strong><br>User action → App crashes → Data stored on device → User reopens app → Report uploaded → Appears in console (~5 min)</blockquote><h3>🟠 Non-Fatal Error</h3><p>crashlytics().recordError(error)</p><p>The app does NOT crash.</p><p>Instead:</p><ul><li>Error is queued in memory</li><li>Sent in batch while app is running</li><li>Usually within a few minutes</li><li>Faster if debug mode enabled</li></ul><p>No relaunch required 👍</p><h3>🟡 Unhandled JS Exception</h3><p>React Native JS errors automatically captured.</p><p>Works same as non-fatal:</p><ul><li>queued</li><li>batched</li><li>auto uploaded</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2JJCS1AVnZiqxj4aHuLgw.png" /></figure><h3>How I tested using simulator/emulator</h3><h3>Test Fatal Crash</h3><ol><li>Add button in app</li><li>Call crashlytics().crash()</li><li>App closes</li><li>Reopen app</li><li>Wait ~2–5 minutes → crash visible in Firebase</li></ol><p>⚠️ If you don’t reopen → you will never see the crash</p><h3>Test Non-Fatal</h3><p>Call: crashlytics().recordError(new Error(&quot;Test error&quot;))</p><p>Keep app running → error appears automatically</p><blockquote><strong>Debug Tip: </strong>Enable debug mode so reports send faster</blockquote><h3>What I understood</h3><p>Crashlytics is not real-time crash reporting.<br>It is <strong>session-based reporting</strong>.</p><p>Fatal crash = next session upload<br>Non-fatal = live session upload</p><p>That’s why many devs think Crashlytics is not working…<br>but actually the app just needs to relaunch 😄</p><p>Small learning but very useful while debugging production issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=841cd83db954" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden AWS ECR Cost Most Teams Forget]]></title>
            <link>https://medium.com/@manishtrivedi/the-hidden-aws-ecr-cost-most-teams-forget-47d185cdd636?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/47d185cdd636</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ecr]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 07:40:18 GMT</pubDate>
            <atom:updated>2026-02-02T07:40:18.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kF2XzYOYmAQdWWupgyHFFA.png" /></figure><p>When we started building our <strong>B2B and B2C solutions</strong>, things were simple.</p><p>We created a few ECR repositories in AWS for our Docker images.Each service had its own repo. CI/CD was pushing images smoothly.Everything was working. No one complained.</p><p>So we moved on.</p><h3>Then Time Happened…</h3><p>New features.<br>New services (Various WebApp/Backend Serevies/Admin Portal/CronJobs).<br>New environments.(Prod/Staging/Dev/client-specific white-labeled things)<br>More developers.<br>More deployments.</p><p>And with every deployment, a new Docker image was pushed to ECR.</p><p>We never deleted anything.Because…</p><blockquote><em>“Storage is cheap, right?”</em></blockquote><p>Wrong. 🧐😑</p><h3>The Day We Opened the AWS Billing Section</h3><p>One day while reviewing the AWS bill, something looked odd.</p><p>ECR storage cost was slowly but continuously increasing.</p><p>Not a spike.<br>Not an alert.<br>Just a silent, steady growth.</p><p>That’s the dangerous kind. 😳</p><p>We opened ECR and checked one repository.</p><ul><li>Hundreds of images</li><li>Most of them unused</li><li>Old builds from months ago</li><li>Untagged images</li><li>Repeated latest pushes</li></ul><p>And then it hit us:</p><blockquote><em>We never configured </em><strong><em>Lifecycle Policies</em></strong><em>. 🙈🙈😒😒😣😣</em></blockquote><h3>The Mistake We Made (That Many Teams Make)</h3><p>When we created repositories initially, we were focused on:</p><ul><li>CI/CD working</li><li>Deployment working</li><li>Services running</li></ul><p>We did not think about:</p><ul><li>Image retention</li><li>Storage cleanup</li><li>Long-term maintenance</li></ul><p>Because at the beginning, it <strong>doesn’t hurt</strong>. But over time, it quietly becomes a cost and management problem.</p><h3>Discovering ECR Lifecycle Policies (Again)</h3><p>We had heard about lifecycle policies before.</p><p>But like many “good practices,” it was one of those things you read, understand, and forget…</p><p>Until you face the real problem. This time, we had a real use case.</p><p>We needed:</p><ul><li>Keep only the <strong>last 10 images</strong></li><li>Never delete important tags like:prod:latest, staging:latest</li></ul><p>And most importantly:</p><blockquote><em>Apply this to </em><strong><em>all repositories</em></strong><em>, not one by one from the console.</em></blockquote><h3>The Console Trap</h3><p>ECR lifecycle policy is <strong>per repository</strong>.And AWS Console has <strong>no bulk option</strong>. We had dozens of repositories. Clicking manually was not an option.</p><p>That’s when we moved to the CLI.</p><h3>The Script That Saved Us Hours</h3><p>We created one lifecycle JSON policy and wrote a small bash script to apply it across all repositories in a region.</p><h4>Step 1 — ECR Lifecycle Policy JSON</h4><p>Create a file named: ecr-lifecycle.json</p><pre>{<br>  &quot;rules&quot;: [<br>    {<br>      &quot;rulePriority&quot;: 1,<br>      &quot;description&quot;: &quot;Protect prod and staging images from deletion&quot;,<br>      &quot;selection&quot;: {<br>        &quot;tagStatus&quot;: &quot;tagged&quot;,<br>        &quot;tagPrefixList&quot;: [&quot;prod&quot;, &quot;staging&quot;],<br>        &quot;countType&quot;: &quot;imageCountMoreThan&quot;,<br>        &quot;countNumber&quot;: 999999<br>      },<br>      &quot;action&quot;: {<br>        &quot;type&quot;: &quot;expire&quot;<br>      }<br>    },<br>    {<br>      &quot;rulePriority&quot;: 2,<br>      &quot;description&quot;: &quot;Keep only the last 10 images for all other tags&quot;,<br>      &quot;selection&quot;: {<br>        &quot;tagStatus&quot;: &quot;any&quot;,<br>        &quot;countType&quot;: &quot;imageCountMoreThan&quot;,<br>        &quot;countNumber&quot;: 10<br>      },<br>      &quot;action&quot;: {<br>        &quot;type&quot;: &quot;expire&quot;<br>      }<br>    }<br>  ]<br>}</pre><h4>What this does</h4><ul><li>Never deletes images tagged with prod or staging</li><li>Keeps only the <strong>latest 10 images</strong> for everything else</li><li>Automatically cleans old unused images</li></ul><h4>Step 2 — Bash Script to Apply Policy to All Repositories</h4><p>Create a file:apply-ecr-lifecycle.sh</p><pre>#!/bin/bash<br><br># Usage: ./apply-ecr-lifecycle.sh &lt;aws-region&gt; [aws-profile]<br><br>if [ -z &quot;$1&quot; ]; then<br>  echo &quot;Usage: $0 &lt;aws-region&gt; [aws-profile]&quot;<br>  exit 1<br>fi<br><br>AWS_REGION=&quot;$1&quot;<br>AWS_PROFILE=&quot;$2&quot;<br><br>echo &quot;Using region: $AWS_REGION&quot;<br>[ -n &quot;$AWS_PROFILE&quot; ] &amp;&amp; echo &quot;Using profile: $AWS_PROFILE&quot;<br><br>AWS_ARGS=&quot;--region $AWS_REGION&quot;<br>[ -n &quot;$AWS_PROFILE&quot; ] &amp;&amp; AWS_ARGS=&quot;$AWS_ARGS --profile $AWS_PROFILE&quot;<br><br># Fetch all repositories and apply lifecycle policy<br>for repo in $(aws ecr describe-repositories $AWS_ARGS \<br>  --query &#39;repositories[*].repositoryName&#39; \<br>  --output text); do<br><br>  echo &quot;Applying lifecycle policy to: $repo&quot;<br><br>  aws ecr put-lifecycle-policy $AWS_ARGS \<br>    --repository-name &quot;$repo&quot; \<br>    --lifecycle-policy-text file://ecr-lifecycle.json<br><br>done<br><br>echo &quot;Lifecycle policy applied to all repositories.&quot;</pre><h4>Step 3 — Make Script Executable</h4><pre>chmod +x apply-ecr-lifecycle.sh</pre><h4>Step 4 — Run the Script</h4><pre>./apply-ecr-lifecycle.sh ap-south-1</pre><p>In less than a minute, every repository had the same cleanup rule.</p><p>No clicking. No manual work.</p><h4>Another Surprise: You Can’t “Run” Lifecycle Policy</h4><p>We thought we could test it instantly. Nope. 🙂‍↔️😢🥺🥺</p><p>ECR runs lifecycle evaluation roughly <strong>once every 24 hours</strong>. But AWS gives a <strong>Preview</strong> option — which is the only way to test what will be deleted.</p><p>Another small learning we didn’t know earlier.</p><h4>The Real Learning (The Important Part)</h4><p>We didn’t really <em>learn</em> lifecycle policies when we first read about them months ago.</p><p>We learned them now. Because now we had:</p><ul><li>Real repositories</li><li>Real image sprawl</li><li>Real billing impact</li><li>Real need for automation</li></ul><p>That’s when the concept sticks.</p><blockquote><em>Early learning is often forgotten — until real problems force you to apply it.</em></blockquote><h3>What We Do Differently Now</h3><p>Now, whenever we create a new ECR repository:</p><ul><li>Lifecycle policy is part of the setup</li><li>Not an afterthought</li><li>Not a future task</li><li>Not “we’ll do it later”</li></ul><p>Because later becomes expensive. 🥸</p><h3>If You Are Starting Today, Don’t Repeat Our Mistake</h3><p>If you have ECR repositories and CI/CD pushing images daily, check this right now:</p><ul><li>Do you have lifecycle policies?</li><li>How many images are stored in each repo?</li><li>Are you paying for images you will never use again?</li></ul><p>You might be surprised.</p><h3>Final Thought</h3><p>DevOps is not just about making things work. It’s about making things work <strong>sustainably over time</strong>.</p><p>And sometimes, the AWS billing page is the best teacher.🤓🤓🤓🤓</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47d185cdd636" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Repo Transfer Breaks Git Pull/Push — Why SSH Saves the Day]]></title>
            <link>https://medium.com/@manishtrivedi/when-repo-transfer-breaks-git-pull-push-why-ssh-saves-the-day-33c9b778bb4d?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/33c9b778bb4d</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 07:27:54 GMT</pubDate>
            <atom:updated>2026-01-21T07:27:54.344Z</atom:updated>
            <content:encoded><![CDATA[<h3>When Repo Transfer Breaks Git Pull/Push — Why SSH Saves the Day</h3><p>Iknow most of us are already aware of this, but sometimes we miss small Git commands and end up wasting time on issues we’ve solved many times before.</p><p>So I’m writing this blog just to <strong>log the situation</strong>, and so I can reuse it again when this happens next time.</p><h4>The situation</h4><p>Everything was working fine.<br> Then the repository got <strong>transferred to a new workspace / team</strong>, and the <strong>repo URL changed</strong>.</p><p>After that:</p><ul><li>git pull started asking for a password</li><li>Bitbucket API token didn’t work</li><li>Authentication failed again and again</li><li>Even after updating the remote URL, Git still complained</li></ul><p>At first, it looks like a permission issue.<br>But most of the time, it’s actually a <strong>credential + URL mismatch</strong>.</p><h4>What usually goes wrong</h4><p>When a repo is transferred:</p><ul><li>Old HTTPS credentials stay cached in the system</li><li>Git keeps using the old authentication silently</li><li>Even if you paste the correct token, it still fails</li></ul><p>On macOS, Keychain makes this worse because it happily remembers old Bitbucket credentials.</p><p>You can spend time deleting credentials, regenerating tokens, checking permissions…<br>or you can just move on to a better solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ltfBNcHIi7POmQyEhBA37Q.png" /></figure><h4>The simple and clean solution: SSH</h4><p>Switching to <strong>SSH</strong> solves all of this in one shot.</p><p>No more:</p><ul><li>Password prompts</li><li>Expired tokens</li><li>Cached credential issues</li></ul><p>Once SSH is set:</p><ul><li>Git just works</li><li>Repo transfer doesn’t break your flow</li><li>Push and pull feel boring again (which is good)</li></ul><h4>The steps (quick reminder)</h4><p>Generate SSH key (if not already):</p><pre>ssh-keygen -t ed25519 -C &quot;your-email@example.com&quot;</pre><h4>Add Key in Bitbucket</h4><p>Add the key to Bitbucket → Personal Settings → SSH Keys.</p><p><strong>Test</strong>:</p><pre>ssh -T git@bitbucket.org</pre><p>Update repo URL:</p><pre>git remote set-url origin git@bitbucket.org:workspace/repo.git</pre><p>Done! :)</p><h4>Final thought</h4><p>Yes, we all know this already.<br>But when things break suddenly, we forget the obvious fixes.</p><p>So this post is not teaching anything new — it’s just a <strong>bookmark for future me</strong> (and maybe for you too).</p><p>Next time a repo transfer breaks your Git setup, don’t fight HTTPS for too long.<br><strong>Just switch to SSH and move on.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33c9b778bb4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI vs ML vs Deep Learning vs Generative AI — Explained Like You’re 10]]></title>
            <link>https://medium.com/@manishtrivedi/ai-vs-ml-vs-deep-learning-vs-generative-ai-explained-like-youre-10-ceb2a1b3ba76?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceb2a1b3ba76</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Thu, 25 Dec 2025 07:38:21 GMT</pubDate>
            <atom:updated>2025-12-25T07:38:21.519Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI vs ML vs Deep Learning vs Generative AI — Explained Like You’re 10</h3><p>If you’ve ever felt confused by buzzwords like AI, machine learning, deep learning, and generative AI, you’re not alone. These terms often appear together, but they are not the same thing — <em>they are more like layers of a cake.</em></p><p>In this post, let’s strip away the jargon and explain everything in plain language, with simple examples you can relate to from everyday life.</p><h3>AI: The big umbrella</h3><p>Think of Artificial Intelligence (AI) as the overall idea of making computers behave in a way that looks “smart.”​</p><p>Any time a computer:</p><ul><li>Makes decisions.</li><li>Plays a game against you.</li><li>Follows rules that feel “intelligent.”<br>…it can be called AI.</li></ul><p>Classic examples:</p><ul><li>A chess app that decides the next move.</li><li>A rule-based chatbot that answers FAQs with fixed responses.</li><li>A thermostat that keeps your room at a set temperature.</li></ul><p>Notice something important: AI doesn’t have to learn. It can just follow human-written rules and still be called AI.</p><h3>Machine Learning: Learning from experience</h3><p>Now zoom in.</p><p>Machine Learning (ML) is a subset of AI where the system learns from data, not just from rules you code by hand.​</p><p>Instead of telling the computer, “Here is exactly how to detect spam,” you show it thousands of emails labeled “spam” and “not spam,” and it learns patterns by itself.​</p><p>Everyday ML examples:</p><ul><li>Email spam filter that improves the more you use it.</li><li>Netflix / YouTube recommendations.</li><li>Credit scoring or fraud detection in banking.</li></ul><p>Conceptually, ML is like training a junior employee:</p><ul><li>Show many examples.</li><li>Give feedback (right/wrong).</li><li>Over time, they get better.</li></ul><h3>Deep Learning: Supercharged pattern recognition</h3><p>Deep Learning (DL) is a special kind of machine learning that uses multi-layered neural networks. These are math models loosely inspired by how the human brain works.​</p><p>Why “deep”? Because there are many layers of neurons stacked together. Each layer transforms the data a bit, and deeper layers understand more abstract patterns.​</p><p>Deep learning shines when:</p><ul><li>Data is big.</li><li>Data is messy (images, audio, text).</li><li>Patterns are complex.</li></ul><p>You meet deep learning every day:</p><ul><li>Face ID unlocking your phone.</li><li>Voice assistants understanding what you say.</li><li>Self-driving cars detecting lanes, people, and traffic lights.</li></ul><p>Traditional ML often needs manual feature engineering while Deep learning can often learn those features automatically from raw data.</p><h3>Generative AI: When AI starts creating</h3><p>Generative AI (GenAI) is where things start to feel magical.</p><p>Instead of just predicting or classifying, generative AI creates new content: text, images, code, music, videos, and more.​</p><p>Famous examples:</p><ul><li>ChatGPT-like tools that write emails, blogs, and code.</li><li>DALL·E / Midjourney that generate images from text prompts.</li><li>Music generators that compose new tunes.</li></ul><p>Under the hood, most modern GenAI uses deep learning models (transformers, diffusion models, GANs) trained on huge datasets. They learn the patterns of existing data and then produce new samples that follow those patterns.</p><blockquote>- All generative AI is AI, but not all AI is generative.<br>- Most modern generative AI is also deep learning.<br>- Machine learning and deep learning often focus on recognizing or predicting, while generative AI focuses on creating</blockquote><h3>One-paragraph takeaway</h3><ul><li>AI is the broad goal: machines doing smart things.​</li><li>Machine Learning is a way to reach that goal by learning from data.​</li><li>Deep Learning is a powerful flavor of ML using deep neural networks for complex data like images and speech.​</li><li>Generative AI is a type of deep-learning-powered AI that doesn’t just understand data, but creates new content like text, images, and music.​</li></ul><p>If you remember only one picture, remember this nesting:</p><blockquote>AI ⊃ Machine Learning ⊃ Deep Learning ⊃ Generative AI</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9JIpuS8SiYbUR8lr4tvhw.png" /><figcaption>Artificial Intelligence: A hierarchy of subsets</figcaption></figure><p>Further Reading:<br><strong>freeCodeCamp</strong> — Machine Learning vs Deep Learning vs Generative AI<br><a href="https://www.freecodecamp.org/news/machine-learning-vs-deep-learning-vs-generative-ai/">https://www.freecodecamp.org/news/machine-learning-vs-deep-learning-vs-generative-ai/</a></p><p><strong>IBM Technology</strong> : <a href="https://www.youtube.com/watch?v=rBlCOLfMYfw">https://www.youtube.com/watch?v=rBlCOLfMYfw</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceb2a1b3ba76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Clean Up Merged Git Branches]]></title>
            <link>https://medium.com/@manishtrivedi/clean-up-merged-git-branches-3a81060321e0?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a81060321e0</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Wed, 07 May 2025 09:55:07 GMT</pubDate>
            <atom:updated>2025-05-07T09:55:07.217Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Keep your Git repo tidy and your team sane</em></p><blockquote><em>Ever opened </em><em>git branch and seen a scroll of old, merged branches? Time to clean house.</em></blockquote><h4>🚀 Why You Should Clean Merged Branches</h4><ul><li>Prevent clutter and confusion.</li><li>Avoid accidentally working on stale branches.</li><li>Improve project hygiene for the whole team.</li></ul><h3>🔥 One-Liner to Delete Merged Branches Locally</h3><pre>git branch - merged | egrep -v &#39;^\*|main|master|release/staging&#39; | xargs -n 1 git branch -d</pre><p>🛡️ This skips the current branch (*) and branches like main, master, and release/staging.</p><h3>☁️ Cleaning Up Remote Branches (Carefully)</h3><p>To delete remote branches that are already merged:</p><pre>git push origin --delete branch-name</pre><p>💡 <em>Pro tip:</em> Use your Git hosting UI (GitHub, GitLab, Bitbucket) to confirm merge status before deletion.</p><h3>🧠 Final Tip</h3><p>Clean up regularly. Make it a habit at the end of each sprint or feature merge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a81060321e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Fixing Zsh History on macOS: Why Only a Few Commands Show Up]]></title>
            <link>https://medium.com/@manishtrivedi/fixing-zsh-history-on-macos-why-only-a-few-commands-show-up-24bf589263e8?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/24bf589263e8</guid>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[productivity-hacks]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[terminal-tips]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 14:21:42 GMT</pubDate>
            <atom:updated>2025-04-25T14:21:42.261Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever opened a new terminal on your Mac and wondered <em>“Why does my Zsh history only show 2–3 commands?”</em> — you’re not alone. Zsh, the default shell in macOS, doesn’t always share command history across sessions by default.</p><h3>🤔 The Problem</h3><p>By default, Zsh saves command history only when a session ends. If you have multiple terminal windows or tabs open, commands typed in one don’t show in the others. And if the terminal closes abruptly, that session’s history might not be saved at all.</p><h3>✅ The Fix</h3><p>To make Zsh remember more history and sync it between sessions, add the following to your ~/.zshrc:</p><pre># Store lots of history<br>export HISTSIZE=100000.  <br>export HISTFILESIZE=100000<br><br># Better history handling across multiple sessions<br>setopt APPEND_HISTORY             # Append history instead of overwriting<br>setopt INC_APPEND_HISTORY         # Write each command to the history file as it&#39;s entered<br>setopt SHARE_HISTORY              # Share history across all sessions<br>setopt HIST_IGNORE_ALL_DUPS       # Avoid duplicate entries<br>setopt HIST_REDUCE_BLANKS         # Remove extra spaces from commands</pre><p>Then, apply the changes</p><pre>source ~/.zshrc</pre><h3>🎉 Done!</h3><p>Now your command history will be shared across all terminal sessions, updated in real-time, and free of duplicates.</p><p>Happy terminaling! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24bf589263e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Cron Job to Monitor and Restart MariaDB]]></title>
            <link>https://medium.com/@manishtrivedi/creating-a-cron-job-to-monitor-and-restart-mariadb-f06a05b109ed?source=rss-306ebf5389a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f06a05b109ed</guid>
            <category><![CDATA[automating-system-tasks]]></category>
            <category><![CDATA[mariadb-monitoring]]></category>
            <category><![CDATA[server-maintenance]]></category>
            <category><![CDATA[schedule-tasks-on-server]]></category>
            <category><![CDATA[cronjob]]></category>
            <dc:creator><![CDATA[Manish Trivedi]]></dc:creator>
            <pubDate>Thu, 08 Jun 2023 04:20:53 GMT</pubDate>
            <atom:updated>2023-06-08T04:20:53.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Cron-Jib" src="https://cdn-images-1.medium.com/max/1024/1*NbRbT2ZmuJ0nXPN-4XzI3A.png" /></figure><p>One of the most common tasks in managing a server is ensuring that essential services remain up and running. Cron, a time-based job scheduler in Unix-like operating systems, allows us to automate such tasks.</p><p>In this post, we will explore how to create a cron job that monitors the MariaDB service and restarts it if it is down. We will also look at how to set the proper permissions for this task.</p><h3>Cron Jobs</h3><p>Cron jobs are tasks scheduled to run at fixed times or intervals. These jobs are typically used for system maintenance tasks such as stats generation, backups, updates, or monitoring. The list of cron jobs is stored in a crontab file. Each user on the system can have their own crontab file.</p><h3>Monitoring MariaDB</h3><p>In our example, we want to monitor the status of MariaDB. MariaDB is a popular open-source relational database management system, used in many applications and environments. To ensure our application’s availability, we need to make sure that the MariaDB service is always running.</p><p>Here’s a simple script that uses the systemctl command to check if the MariaDB service is running and restarts it if it&#39;s not:</p><pre>#!/bin/bash<br><br># Check if MariaDB is running<br>systemctl is-active --quiet mariadb<br><br># Restart the MariaDB service if it&#39;s not running.<br>if [ $? != 0 ]; then<br>    systemctl start mariadb<br>fi</pre><h3>Setting Script Permissions</h3><p>Before a script can be run as a cron job, it needs to have the correct permissions. Here’s how to make the script executable:</p><ol><li>Open the terminal</li><li>Navigate to the directory where your script is located with cd /path/to/your/script/</li><li>Type chmod +x check_mariadb.sh and press enter. This command will make your script executable.</li></ol><p>Now your script is ready to be added to a crontab file.</p><h3>Adding the Script to Cron</h3><p>To add our script to the root user’s cron jobs, we would do the following:</p><ol><li>Open the terminal</li><li>Type sudo crontab -e to open the root crontab file</li><li>Add the line */5 * * * * /path/to/your/script/check_mariadb.sh at the end of the file</li><li>Save the file and exit</li></ol><p>This line tells cron to run the script every five minutes. The */5 part means &quot;every five minutes,&quot; and the five * symbols represent different date parts in the order: minute, hour, day of the month, month, day of the week.</p><h3>Important Notes</h3><p>Running scripts as root could be risky if not managed properly, as it gives the script full permissions on your system. Make sure your script is secure and only performs the necessary actions.</p><p>Also, always test scripts and cron jobs in a safe environment before deploying them to production. A poorly written or malfunctioning script could cause serious problems.</p><p><strong>In conclusion,</strong> cron is a powerful tool for automating system tasks. By creating a cron job to monitor the MariaDB service, we can ensure that our application remains available and our database service remains reliable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f06a05b109ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>