<?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 MH Mihiranga on Medium]]></title>
        <description><![CDATA[Stories by MH Mihiranga on Medium]]></description>
        <link>https://medium.com/@hm7.mihiranga?source=rss-3854d8285990------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Hg48qZYH1lR0S2iF</url>
            <title>Stories by MH Mihiranga on Medium</title>
            <link>https://medium.com/@hm7.mihiranga?source=rss-3854d8285990------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 03:38:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hm7.mihiranga/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[Securing Autonomous AI Agents: The 5 Core Threats and the Guardrail Stack That Stops Them]]></title>
            <link>https://medium.com/@hm7.mihiranga/securing-autonomous-ai-agents-the-5-core-threats-and-the-guardrail-stack-that-stops-them-937c21db2f07?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/937c21db2f07</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[llm-guardrails]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 15:27:21 GMT</pubDate>
            <atom:updated>2026-11-21T15:27:21.223Z</atom:updated>
            <content:encoded><![CDATA[<p>Moving an LLM product from prototype to production requires more than a clever system prompt. Here is how to defend your AI agents against prompt injection, tool misuse, and memory poisoning.</p><p>Building an AI prototype is deceptively easy. You write a detailed system prompt, connect a few external tools or Model Context Protocol (MCP) servers, and watch your agent reason through complex tasks.</p><p>Then you push the product to production, and everything changes.</p><p>Once an AI agent interacts with real users, live databases, and untrusted external content, a standard system prompt is no longer a security boundary. To build reliable, enterprise-ready AI products, engineers must understand the modern agent threat landscape and wrap their models in deterministic and AI-driven guardrails.</p><h3>The AI Agent Threat Model: What Can Go Wrong?</h3><p>Unlike passive chatbots that only generate text, AI agents take actions, maintain state, and read external data. According to the <strong>AI Agent Threat Model</strong>, five critical failure modes can compromise a live system:</p><blockquote><strong>Prompt Injection:</strong> An attacker hijacks an AI agent using crafted user inputs or poisoned retrieved content. Because agents frequently ingest untrusted external data — such as web pages, emails, and documents, prompt injection stands out as one of the most critical threats facing AI agents today.</blockquote><blockquote><strong>Tool Misuse:</strong> When an agent is tricked or fails to reason properly, it can call connected tools with wrong or dangerous arguments. In production, this can result in sending unauthorized emails or executing destructive database queries.</blockquote><blockquote><strong>Memory Poisoning:</strong> Modern agents rely on persistent memory to personalize interactions across sessions. If poisoned content is stored in that memory, it can corrupt future behavior for affected users, and potentially compromise other users if the memory is shared or broadly retrieved.</blockquote><blockquote><strong>Data Exfiltration:</strong> Attackers can manipulate an AI agent into leaking sensitive internal data through its tool calls or generated responses.</blockquote><blockquote><strong>Runaway Execution:</strong> Without strict execution boundaries, agents caught in error loops or complex recursive tasks can trigger overruns and severe system strain.</blockquote><h3>The Production Guardrail Stack: Top Tools to Secure Your System</h3><p>To mitigate these threats without breaking the user experience, modern AI architectures use a <strong>defense-in-depth</strong> approach. Rather than relying on a single filter, engineering teams combine specialized guardrail frameworks and safety classifiers across the agent lifecycle.</p><p>Here are five of the most effective guardrail tools available for production AI systems today:</p><h3>1. NVIDIA NeMo Guardrails</h3><p><strong>Best for:</strong> Controlling conversational boundaries and tool execution.</p><p>Developed by NVIDIA, this open-source framework allows you to define programmable rules, called Rails, using a modeling language named Colang.</p><ul><li><strong>How it protects agents:</strong> It enforces <strong>topical rails</strong> to keep the agent from wandering off-topic and <strong>execution rails</strong> to inspect and validate arguments before the agent invokes external APIs or MCP servers, directly mitigating <strong>tool misuse.</strong></li></ul><h3>2. Guardrails AI</h3><p><strong>Best for:</strong> Output validation and preventing data leaks.</p><p>Guardrails AI is an open-source Python framework backed by the <strong>Guardrails Hub</strong>, a rich library of pre-built validators that inspect both inputs and outputs.</p><ul><li><strong>How it protects agents:</strong> It automatically detects and redacts Personally Identifiable Information (PII) and sensitive secrets before responses leave your system, serving as a strong defense against <strong>Data Exfiltration</strong>. It also enforces strict JSON schemas and checks for hallucinations against retrieved context.</li></ul><h3>3. Meta Llama Guard &amp; Prompt Guard</h3><p><strong>Best for:</strong> Self-hosted, open-weights threat classification.</p><p>Rather than rule-based frameworks, these are specialized, fine-tuned safety models designed to act as an AI firewall in front of your primary LLM.</p><ul><li><strong>How it protects agents:</strong> <strong>Prompt Guard</strong> is specifically trained to detect both direct jailbreaks and indirect <strong>Prompt Injection</strong> hidden inside retrieved documents. Pairing it with <strong>Llama Guard</strong> ensures unsafe content is flagged before it can corrupt your agent’s reasoning or trigger <strong>Memory Poisoning</strong>.</li></ul><h3>4. Google Cloud Model Armor</h3><p><strong>Best for:</strong> Enterprise cloud deployments and MCP security.</p><p>For teams building on Google Cloud, Model Armor provides an enterprise-grade security service that screens prompts and responses inline.</p><ul><li><strong>How it protects agents:</strong> It blocks prompt injection and jailbreak attempts, detects malicious URLs, enforces Data Loss Prevention (DLP) policies, and secures connections between enterprise agents and remote MCP servers.</li></ul><h3>5. Lakera Guard</h3><p><strong>Best for:</strong> Ultra-low-latency real-time detection.</p><p>When every millisecond of latency counts in a customer-facing application, heavy safety checks can degrade the user experience.</p><ul><li><strong>How it protects agents:</strong> Lakera Guard offers a lightweight, API-based defense layer capable of detecting prompt injections and data leakage risks in just a few milliseconds, allowing real-time protection at scale.</li></ul><h3>4 Architectural Best Practices Before You Go Live</h3><p>Adding tools to your stack works best when paired with disciplined engineering practices:</p><ol><li><strong>Enforce Least Privilege &amp; Human-in-the-Loop (HITL):</strong> Keep database and tool permissions read-only by default. For high-stakes actions, like modifying records, transferring funds, or sending external communications, require explicit user confirmation before execution.</li><li><strong>Sanitize Memory Writes:</strong> Never allow raw, unverified external data or unscreened user inputs to be written directly into long-term vector memory. Run an injection and toxicity check before committing any context to shared memory stores.</li><li><strong>Set Hard Execution Budgets:</strong> Prevent <strong>Runaway Execution</strong> by enforcing strict limits on maximum reasoning steps, tool-call recursion depth, token consumption, and API timeouts.</li><li><strong>Run Automated Red-Teaming:</strong> Before launch, and after every major prompt or model update, use automated red-teaming frameworks (such as Promptfoo or Garak) to simulate adversarial attacks and uncover blind spots in your guardrail thresholds.</li></ol><p>Shipping an AI agent to production is a milestone, not the finish line. By pairing an honest assessment of agent threat models with layered, specialized guardrails, you can move past fragile prototypes and build autonomous systems that users and enterprises, can genuinely trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hn7D6hS0kzs6Pimk0mlRCQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=937c21db2f07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Robust CI/CD Pipeline for RAG Applications: From Dockerization to Google Cloud Run]]></title>
            <link>https://medium.com/@hm7.mihiranga/building-a-robust-ci-cd-pipeline-for-rag-applications-from-dockerization-to-google-cloud-run-f8eafdce6f48?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8eafdce6f48</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 04:35:27 GMT</pubDate>
            <atom:updated>2026-04-24T04:35:27.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wavG3cAt91f-Hzmm4crRBw.jpeg" /></figure><h3>Sub-headline: A complete guide to building a cost-effective, automated CI/CD pipeline using GitHub Actions, Docker, and OIDC.</h3><h3>The Vision: A Production-Ready RAG System</h3><p>Developing a RAG (Retrieval-Augmented Generation) application is one thing; deploying it to a scalable, cost-effective production environment is another. In this article, I’ll share the exact blueprint I used to deploy a multi-service system — a <strong>FastAPI backend</strong> and a <strong>Streamlit frontend</strong> — on Google Cloud Run.</p><h3>1. Architecture Strategy: Minimal-Cost Cloud Run Settings</h3><p>Cloud Run is powerful because it scales to zero. To keep costs at a minimum for personal projects or MVPs, aim for these settings:</p><ul><li><strong>Scale to Zero:</strong> Set min-instances=0 so you only pay when someone uses the app.</li><li><strong>Cap Your Spend:</strong> Set max-instances=1 to prevent unexpected billing spikes.</li><li><strong>CPU Throttling:</strong> Use the default “CPU only during requests” to avoid paying for idle time.</li><li><strong>Concurrency Tuning:</strong> * <strong>Streamlit:</strong> Set concurrency=1. Streamlit maintains stateful sessions that can break if multiple users hit the same instance.</li><li><strong>FastAPI:</strong> Set concurrency=10–40 depending on your memory footprint.</li></ul><h3>2. One-Time Google Cloud Setup</h3><p>Before the automation begins, we need to prepare the GCP environment.</p><h3>Enable Necessary APIs</h3><p>Bash</p><pre>gcloud services enable run.googleapis.com artifactregistry.googleapis.com iamcredentials.googleapis.com sts.googleapis.com</pre><pre>gcloud services enable run.googleapis.com \<br>  artifactregistry.googleapis.com \<br>  iamcredentials.googleapis.com \<br>  sts.googleapis.com</pre><h3>Create the Artifact Registry</h3><p>Choose a cheap region (e.g., us-central1) to host your images:</p><p>Bash</p><pre>gcloud artifacts repositories create dialog-repo \<br>  --repository-format=docker \<br>  --location=us-central1 \<br>  --description=&quot;dialog images&quot;</pre><h3>Security: Workload Identity Federation (OIDC)</h3><p><strong>Stop using JSON keys!</strong> They are a security risk if committed to GitHub. Instead, use OIDC to allow GitHub to securely impersonate a service account (github-deployer).</p><h3>3. GitHub Secrets Configuration</h3><p>To make our pipeline work, we need to store our sensitive parameters in <strong>GitHub → Settings → Secrets and variables → Actions</strong>.</p><p><strong>Secret NameDescription</strong>GCP_PROJECT_IDYour unique Google Project ID<br>GCP_REGIONe.g., us-central1AR_REPO<br>Your Artifact Registry name (e.g., dialog-repo)<br>GCP_SERVICE_ACCOUNTThe deployer email address<br>WORKLOAD_IDENTITY_PROVIDERThe full OIDC provider resource name<br>GOOGLE_API_KEYYour Gemini/LLM API Key</p><h3>4. The Automation: Dual-Service CI/CD Workflow</h3><p>We use a single Docker image to power both services. This saves storage and ensures consistency.</p><h3>The Workflow Logic</h3><ul><li><strong>Auth:</strong> GitHub “logs in” to GCP using OIDC.</li><li><strong>Build/Push:</strong> A single image is built and tagged with the GitHub SHA.</li><li><strong>Deploy API:</strong> We launch the backend and capture its dynamic URL.</li><li><strong>Deploy UI:</strong> We launch Streamlit, injecting the API_BASE URL so the frontend knows where to send requests.</li></ul><p>YAML</p><pre># Simplified snippet of our deploy-cloudrun.yml<br>- name: Deploy API service<br>  run: |<br>    gcloud run deploy &quot;dialog-api&quot; \<br>      --image &quot;$IMAGE&quot; \<br>      --port 8080 \<br>      --cpu 1 --memory 1Gi \<br>      --command uvicorn \<br>      --args &quot;src.api:app,--host,0.0.0.0,--port,8080&quot;</pre><pre>- name: Read API URL<br>  run: |<br>    API_URL=&quot;$(gcloud run services describe dialog-api --format=&#39;value(status.url)&#39;)&quot;<br>    echo &quot;API_URL=$API_URL&quot; &gt;&gt; $GITHUB_ENV</pre><pre>- name: Deploy UI service<br>  run: |<br>    gcloud run deploy &quot;dialog-ui&quot; \<br>      --image &quot;$IMAGE&quot; \<br>      --set-env-vars &quot;API_BASE=${API_URL}&quot; \<br>      --command streamlit \<br>      --args &quot;run,ui/app.py,--server.port,8080&quot;</pre><pre># This is Full YAML file<br>name: Deploy to Cloud Run (API + UI)<br><br>on:<br>  push:<br>    branches: [&quot;main&quot;]<br><br>permissions:<br>  contents: read<br>  id-token: write<br><br>env:<br>  PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}<br>  REGION: ${{ secrets.GCP_REGION }}<br>  AR_REPO: ${{ secrets.AR_REPO }}<br>  SERVICE_API: dialog-api<br>  SERVICE_UI: dialog-ui<br><br>jobs:<br>  deploy:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - name: Checkout<br>        uses: actions/checkout@v4<br><br>      - name: Auth (OIDC)<br>        uses: google-github-actions/auth@v2<br>        with:<br>          workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}<br>          service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}<br><br>      - name: Setup gcloud<br>        uses: google-github-actions/setup-gcloud@v2<br>        with:<br>          project_id: ${{ secrets.GCP_PROJECT_ID }}<br><br>      - name: Configure Docker auth<br>        run: gcloud auth configure-docker $REGION-docker.pkg.dev --quiet<br><br>      - name: Build &amp; push image (single image)<br>        run: |<br>          IMAGE=&quot;${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.AR_REPO }}/dialog:${{ github.sha }}&quot;<br>          docker build -t &quot;$IMAGE&quot; .<br>          docker push &quot;$IMAGE&quot;<br>          echo &quot;IMAGE=$IMAGE&quot; &gt;&gt; $GITHUB_ENV<br><br>      - name: Deploy API service<br>        run: |<br>          gcloud run deploy &quot;${{ env.SERVICE_API }}&quot; \<br>            --image &quot;${{ env.IMAGE }}&quot; \<br>            --region &quot;${{ env.REGION }}&quot; \<br>            --platform managed \<br>            --allow-unauthenticated \<br>            --port 8080 \<br>            --cpu 1 --memory 2Gi \<br>            --min-instances 0 --max-instances 1 \<br>            --concurrency 20 \<br>            --set-env-vars &quot;GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}&quot; \<br>            --command uvicorn \<br>            --args &quot;src.api:app,--host,0.0.0.0,--port,8080&quot;<br><br>      - name: Read API URL<br>        run: |<br>          API_URL=&quot;$(gcloud run services describe &quot;$SERVICE_API&quot; --region &quot;$REGION&quot; --format=&#39;value(status.url)&#39;)&quot;<br>          echo &quot;API_URL=$API_URL&quot; &gt;&gt; $GITHUB_ENV<br><br>      - name: Deploy UI service (Streamlit)<br>        run: |<br>          gcloud run deploy &quot;${{ env.SERVICE_UI }}&quot; \<br>            --image &quot;${{ env.IMAGE }}&quot; \<br>            --region &quot;${{ env.REGION }}&quot; \<br>            --platform managed \<br>            --allow-unauthenticated \<br>            --port 8501 \<br>            --cpu 1 --memory 512Mi \<br>            --min-instances 0 --max-instances 1 \<br>            --concurrency 10 \<br>            --set-env-vars &quot;API_BASE=${{ env.API_URL }}&quot; \<br>            --command streamlit \<br>            --args &quot;run,ui/app.py,--server.port,8501,--server.address,0.0.0.0,--server.headless,true&quot;</pre><h3>5. Lessons from the Trenches: Issues &amp; Solutions</h3><h3>Issue 1: The Ephemeral Filesystem</h3><p><strong>The Problem:</strong> I noticed my FAISS vector index vanished every time the app restarted.</p><p><strong>The Solution:</strong> Cloud Run’s disk is <strong>ephemeral</strong>. If you need persistence for your index files, you must store faiss.index in <strong>Google Cloud Storage</strong> and download it during container startup.</p><h3>Issue 2: The Memory “Red Zone”</h3><p><strong>The Problem:</strong> The app crashed with “Memory limit exceeded.”</p><p><strong>The Solution:</strong> Machine learning libraries like torch are heavy. Moving from 512Mi to 2GiB for the API was necessary to handle the model weights without timing out.</p><h3>Issue 3: Port Confusion</h3><p><strong>The Problem:</strong> Cloud Run health checks failing.</p><p><strong>The Solution:</strong> Cloud Run expects your app to listen on $PORT (standard 8080). Ensure your uvicorn and streamlit arguments explicitly bind to 8080.</p><h3>Conclusion</h3><p>Deploying AI applications doesn’t have to be expensive or manual. By leveraging Cloud Run’s “Scale to Zero” and GitHub Actions’ OIDC authentication, you can build a secure, professional, and almost-free deployment pipeline.</p><h3>Final Tips for Medium Readers:</h3><ul><li><strong>Rotate your keys:</strong> If you accidentally committed an API key, delete it and generate a new one before going live.</li><li><strong>Minimal Docker:</strong> Use python:3.11-slim to keep image sizes small and reduce &quot;cold start&quot; times.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8eafdce6f48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Mobile Apps for Distribution: A Complete Guide]]></title>
            <link>https://medium.com/@hm7.mihiranga/building-mobile-apps-for-distribution-a-complete-guide-13cabbbd030f?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/13cabbbd030f</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[releases]]></category>
            <category><![CDATA[apk]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Wed, 05 Nov 2025 18:13:24 GMT</pubDate>
            <atom:updated>2025-11-05T18:13:24.956Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9NjUeuoMhT8-YjwBtaG-g.jpeg" /></figure><h3>Part 1: Android APK Generation and Distribution</h3><h3>Introduction</h3><p>Creating a release-ready Android application package (APK) is a crucial step in mobile app development. This comprehensive guide walks you through the entire process of generating, optimizing, and distributing your Android application to end users.</p><h3>Prerequisites</h3><p>Before beginning the build process, ensure you have:</p><ul><li>Flutter SDK installed and configured</li><li>Android SDK with proper build tools</li><li>A completed Flutter project</li><li>Access to command line interface</li><li>Sufficient storage space for build artifacts</li></ul><h3>Step 1: Preparing Your Application for Release</h3><h4>Configure Build Settings</h4><p>First, navigate to your project’s Android configuration directory and locate the main build file. Update the version information:</p><pre>android {<br> compileSdkVersion 34<br> <br> defaultConfig {<br> applicationId &quot;com.yourcompany.yourapp&quot;<br> minSdkVersion 21<br> targetSdkVersion 34<br> versionCode 1<br> versionName &quot;1.0.0&quot;<br> }<br>}</pre><h4>Optimize Application Performance</h4><p>Ensure your application is optimized for production:</p><ul><li>Remove debug logging statements</li><li>Minimize asset sizes</li><li>Enable code obfuscation</li><li>Configure proper error handling</li></ul><h3>Step 2: Building the Release APK</h3><h4>Clean Previous Builds</h4><p>Start with a clean build environment:</p><pre>flutter clean<br>flutter pub get</pre><h4>Generate Release Build</h4><p>Execute the build command for release mode:</p><pre>flutter build apk --release</pre><p>For multiple architecture support:</p><pre>flutter build apk --split-per-abi --release</pre><h4>Verify Build Success</h4><p>Check the output directory for generated files:</p><ul><li>Universal APK (larger file, works on all devices)</li><li>Split APKs (smaller files, architecture-specific)</li></ul><h3>Step 3: Testing and Validation</h3><h4>Local Testing</h4><p>Before distribution, thoroughly test your release build:</p><ul><li>Install on physical devices</li><li>Test all application features</li><li>Verify performance metrics</li><li>Check memory usage</li></ul><h4>Compatibility Testing</h4><p>Ensure compatibility across different:</p><ul><li>Android versions</li><li>Device screen sizes</li><li>Hardware configurations</li><li>Network conditions</li></ul><h3>Step 4: Distribution Preparation</h3><h4>Create Distribution Package</h4><p>Organize your release files:</p><ul><li>Primary APK file</li><li>Installation instructions</li><li>Application documentation</li><li>Version changelog</li></ul><h4>Installation Guide Creation</h4><p>Prepare user-friendly installation instructions:</p><p><strong>### Installation Steps:</strong></p><p>1. Enable installation from unknown sources</p><p>2. Download the APK file</p><p>3. Locate and tap the downloaded file</p><p>4. Follow on-screen installation prompts</p><p>5. Grant necessary permissions</p><h3>Step 5: Distribution Methods</h3><h4>Direct Distribution</h4><p>For direct sharing:</p><ul><li>Upload to cloud storage services</li><li>Share via email or messaging</li><li>Host on your website</li><li>Use file sharing platforms</li></ul><h4>Alternative App Stores</h4><p>Consider publishing to:</p><ul><li>Third-party app marketplaces</li><li>Enterprise distribution platforms</li><li>Beta testing services</li></ul><h3>Best Practices</h3><h4>Security Considerations</h4><ul><li>Sign your APK with a proper certificate</li><li>Use ProGuard for code obfuscation</li><li>Implement proper permission handling</li><li>Validate all user inputs</li></ul><h4>Performance Optimization</h4><ul><li>Minimize APK size</li><li>Optimize image assets</li><li>Reduce dependency bloat</li><li>Implement lazy loading</li></ul><h3>Troubleshooting Common Issues</h3><h4>Build Failures</h4><p>Common solutions for build problems:</p><ul><li>Clear cache and rebuild</li><li>Update dependencies</li><li>Check SDK versions</li><li>Verify configuration files</li></ul><h4>Installation Problems</h4><p>Address user installation issues:</p><ul><li>Provide clear error explanations</li><li>Offer alternative download methods</li><li>Create video tutorials</li><li>Maintain FAQ documentation</li></ul><h3>Part 2: iOS Application Development and Distribution</h3><h3>Introduction</h3><p>iOS application distribution follows Apple’s strict guidelines and requires specific tools and processes. Unlike Android’s flexible APK system, iOS uses a more controlled ecosystem with multiple distribution channels, each serving different purposes.</p><h3>Understanding iOS Distribution</h3><h4>Distribution Methods Overview</h4><p>iOS offers several distribution approaches:</p><ul><li>App Store distribution (public release)</li><li>TestFlight beta testing (limited audience)</li><li>Enterprise distribution (internal use)</li><li>Development provisioning (testing only)</li></ul><h4>Requirements and Prerequisites</h4><p>Essential requirements for iOS development:</p><ul><li>macOS operating system</li><li>Xcode development environment</li><li>Apple Developer Program membership</li><li>iOS development certificates</li><li>Provisioning profiles</li></ul><h3>Development Environment Setup</h3><h4>Installing Required Tools</h4><p>Begin with proper tool installation:</p><pre># Install Xcode from App Store<br># Install Flutter for iOS development<br>flutter doctor --verbose</pre><h4>Configuring Development Certificates</h4><p>Set up your development identity:</p><ol><li>Create developer certificate in Apple Developer portal</li><li>Generate App ID for your application</li><li>Create provisioning profiles</li><li>Configure Xcode with proper signing identity</li></ol><h3>Building iOS Applications</h3><h4>Project Configuration</h4><p>Configure your iOS project settings:</p><pre># In pubspec.yaml<br>name: your_application<br>version: 1.0.0+1<br><br>flutter:<br>  uses-material-design: true</pre><h4>iOS-Specific Settings</h4><p>Update iOS configuration files:</p><ul><li>Info.plist for app metadata</li><li>App icons and launch screens</li><li>Permissions and capabilities</li><li>Deployment target settings</li></ul><h3>App Store Distribution Process</h3><h4>Preparation Phase</h4><p>Before App Store submission:</p><ul><li>Complete application development</li><li>Implement all required features</li><li>Test thoroughly on multiple devices</li><li>Prepare app store assets (screenshots, descriptions)</li></ul><h4>App Store Connect Setup</h4><p>Configure your application in App Store Connect:</p><ol><li>Create new app record</li><li>Fill application information</li><li>Set pricing and availability</li><li>Configure app review information</li></ol><h4>Build and Upload Process</h4><p>Generate and submit your build:</p><pre># Build for iOS release<br>flutter build ios --release<br><br># Archive in Xcode<br># Upload to App Store Connect</pre><h4>Review and Approval</h4><p>Navigate the App Store review process:</p><ul><li>Submit for review</li><li>Address reviewer feedback</li><li>Respond to rejection reasons</li><li>Monitor review status</li></ul><h3>TestFlight Beta Testing</h3><h4>Setting Up TestFlight</h4><p>Configure beta testing environment:</p><ol><li>Upload build to App Store Connect</li><li>Configure test information</li><li>Add beta testers</li><li>Set testing guidelines</li></ol><h4>Managing Beta Versions</h4><p>Effective beta testing practices:</p><ul><li>Regular build updates</li><li>Feedback collection systems</li><li>Issue tracking and resolution</li><li>Communication with testers</li></ul><h3>Alternative Distribution Methods</h3><h4>Enterprise Distribution</h4><p>For internal company apps:</p><ul><li>Requires Enterprise Developer Program</li><li>Direct distribution to employees</li><li>No App Store review process</li><li>Limited to organization members</li></ul><h4>Ad Hoc Distribution</h4><p>For limited testing:</p><ul><li>Up to 100 devices per year</li><li>Direct installation via provisioning</li><li>Suitable for client demonstrations</li><li>Requires device UDID registration</li></ul><h3>Web-Based Solutions for iOS</h3><h4>Progressive Web Applications</h4><p>Create web-based alternatives:</p><ul><li>Responsive design for mobile browsers</li><li>Offline functionality support</li><li>Push notification capabilities</li><li>Home screen installation option</li></ul><h4>Implementation Approach</h4><pre>// Service Worker for offline support<br>self.addEventListener(&#39;fetch&#39;, function(event) {<br>  event.respondWith(<br>    caches.match(event.request)<br>      .then(function(response) {<br>        return response || fetch(event.request);<br>      })<br>  );<br>});</pre><h3>Cross-Platform Considerations</h3><h4>Maintaining Code Consistency</h4><p>Strategies for multi-platform development:</p><ul><li>Shared business logic</li><li>Platform-specific UI adaptations</li><li>Unified testing approaches</li><li>Consistent user experience</li></ul><h4>Performance Optimization</h4><p>Optimize for both platforms:</p><ul><li>Memory management</li><li>Battery usage optimization</li><li>Network efficiency</li><li>Startup time minimization</li></ul><h3>Troubleshooting and Common Issues</h3><h4>Certificate and Provisioning Problems</h4><p>Resolve signing issues:</p><ul><li>Verify certificate validity</li><li>Check provisioning profile status</li><li>Update expired credentials</li><li>Match bundle identifiers</li></ul><h4>Build and Deployment Failures</h4><p>Address common problems:</p><ul><li>Xcode version compatibility</li><li>Dependency conflicts</li><li>Configuration mismatches</li><li>Architecture compatibility</li></ul><h3>Best Practices for iOS Development</h3><h4>User Experience Guidelines</h4><p>Follow Apple’s design principles:</p><ul><li>Human Interface Guidelines compliance</li><li>Consistent navigation patterns</li><li>Appropriate use of system fonts</li><li>Accessibility considerations</li></ul><h4>Security and Privacy</h4><p>Implement proper security measures:</p><ul><li>Data encryption</li><li>Secure network communications</li><li>Privacy policy compliance</li><li>User consent management</li></ul><h3>Conclusion</h3><p>Both Android and iOS platforms offer unique opportunities and challenges for mobile app distribution. While Android provides more flexibility with direct APK distribution, iOS requires adherence to Apple’s ecosystem but offers better security and user trust.</p><p>Success in mobile app distribution depends on understanding each platform’s requirements, following best practices, and maintaining high-quality user experiences across all distribution channels.</p><p>The key to successful mobile app deployment lies in thorough preparation, comprehensive testing, and clear communication with your target audience, regardless of the chosen distribution method.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13cabbbd030f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firestore & Firebase Storage Activation (Common Guide for Blaze Plan)]]></title>
            <link>https://medium.com/@hm7.mihiranga/firestore-firebase-storage-activation-common-guide-for-blaze-plan-225512431ae2?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/225512431ae2</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[firestore]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[activation]]></category>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Wed, 05 Nov 2025 18:01:53 GMT</pubDate>
            <atom:updated>2025-11-05T18:04:54.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kCyFwxcBWCzHQYVpRwFhA.png" /></figure><h3>Problem</h3><p>Users experience confusion when upgrading to the Blaze plan on Firebase, especially regarding the activation of Firebase Storage, due to changes in Firebase’s pricing and workflow.</p><h3>Key Points</h3><ul><li>On the Spark Plan, it’s not possible to activate Firebase Storage anymore due to pricing policy updates. Upgrading to the Blaze Plan is required.</li><li>The Blaze Plan only charges if you exceed the free quota (pay-as-you-go).</li></ul><h3>Steps to Activate Firebase Storage on Blaze Plan</h3><ol><li>Upgrade to the Blaze Plan.</li></ol><ul><li>Go to Firebase Console → Project Settings → Usage and billing → Upgrade to Blaze.</li><li>Only charges if you go over the free quota.</li></ul><p>2. Go to the Storage section in Firebase Dashboard.</p><ul><li>If you see a “Get started” button, it means you now have permission to create a storage bucket.</li><li>Click “Get started” to actually provision the storage bucket. You don’t have to upgrade again.</li></ul><p>3. Set the access rules for your storage bucket:</p><ul><li>allow read, write: if request.auth != null;</li><li>Use these rules for basic authentication (suitable for prototyping or testing, not production).</li></ul><p>Thank You !……</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=225512431ae2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complete Guide: Deploy Your Application to Google Cloud Run with Docker]]></title>
            <link>https://medium.com/@hm7.mihiranga/complete-guide-deploy-your-application-to-google-cloud-run-with-docker-7dcf0a00c3cf?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dcf0a00c3cf</guid>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 17:25:24 GMT</pubDate>
            <atom:updated>2025-08-12T17:25:24.848Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*EYF_zGiA3Otvelp2ga8RRQ.png" /></figure><p><strong>Step 1: Initial Authentication and Project Setup</strong></p><pre># Login to your GCP account<br>gcloud auth login<br><br># Set your project ID (replace with your actual project ID)<br>gcloud config set project YOUR_PROJECT_ID<br><br># Configure Docker to use gcloud as credential helper<br>gcloud auth configure-docker</pre><p><strong>Step 2: Tag Your Docker Image for Google Container Registry</strong></p><pre># Tag your existing Docker image for GCR<br>docker tag docker-image-name gcr.io/YOUR_PROJECT_ID/docker-image-name:tag</pre><p><strong>Step 3: Enabling Required Google Cloud APIs (Before deploying, we need to enable several APIs)</strong></p><pre># Enable Artifact Registry API<br>gcloud services enable artifactregistry.googleapis.com<br><br># Enable Container Registry API (legacy but still useful)<br>gcloud services enable containerregistry.googleapis.com<br><br># Enable Cloud Run API<br>gcloud services enable run.googleapis.com<br><br># Enable Cloud Build API (optional, for CI/CD)<br>gcloud services enable cloudbuild.googleapis.com<br><br># Verify APIs are enabled (wait a few minutes after enabling)<br>gcloud services list --enabled --filter=&quot;name:artifactregistry.googleapis.com OR name:containerregistry.googleapis.com&quot;</pre><p><strong>Step 4: Push Image to Google Container Registry (You should already make the docker image.)</strong></p><pre># Push your image to GCR<br>docker push gcr.io/YOUR_PROJECT_ID/docker-image-name:tag</pre><p><strong>Step 5: Manual Deployment via Google Cloud Console</strong></p><p>For beginners, the Google Cloud Console provides an intuitive interface:</p><p>Step 1: Navigate to Cloud Run</p><ul><li>Open the Google Cloud Console</li><li>Search for “Cloud Run” in the top search bar</li><li>Click on the Cloud Run service</li></ul><p>Step 2: Create a New Service</p><ul><li>Click the “CREATE SERVICE” button</li><li>Select “Deploy one revision from an existing container image.”</li></ul><p>Step 3: Configure Your Container</p><ul><li>Container image URL:gcr.io/YOUR_PROJECT_ID/docker-image-name:tag</li><li>Service name: your-app-name (e.g., snakebite-app)</li><li>Region: us-central1 (cost-effective option)</li></ul><p>Step 4: Authentication Settings</p><ul><li>Under “Authentication,” select “Allow unauthenticated invocations” for public access</li></ul><p>Step 5: Advanced Configuration Expand “Container, Networking, Security”:</p><ul><li>Port: 8000 (or your application&#39;s port)</li><li>CPU: 2</li><li>Memory: 4 GiB</li><li>Timeout: 900 seconds</li></ul><p>Step 6: Deploy</p><ul><li>Click “CREATE” to start deployment</li><li>Monitor the deployment progress</li><li>Your application will be live in a few minutes!</li></ul><h3>Final: Automated Deployment Pipeline</h3><p>For advanced users, here’s a complete automation script:</p><pre>#!/bin/bash<br><br># --- Configuration Variables ---<br>YOUR_PROJECT_ID=&quot;your-gcp-project-id&quot;        <br>YOUR_IMAGE_NAME=&quot;your-docker-image-name&quot;     <br>YOUR_SERVICE_NAME=&quot;your-cloud-run-service&quot;   <br>YOUR_REGION=&quot;us-central1&quot;                    <br><br># --- Deployment Steps ---<br><br>echo &quot;🔐 Authenticating with Google Cloud...&quot;<br>gcloud auth login<br><br>echo &quot;🎯 Setting Google Cloud project to: ${YOUR_PROJECT_ID}...&quot;<br>gcloud config set project ${YOUR_PROJECT_ID}<br><br>echo &quot;🐳 Configuring Docker for Google Container Registry...&quot;<br>gcloud auth configure-docker<br><br>echo &quot;🔨 Building Docker image: ${YOUR_IMAGE_NAME}...&quot;<br>docker build -t ${YOUR_IMAGE_NAME} .<br><br>echo &quot;🏷️ Tagging image for Google Container Registry...&quot;<br>docker tag ${YOUR_IMAGE_NAME} gcr.io/${YOUR_PROJECT_ID}/${YOUR_IMAGE_NAME}:latest<br><br>echo &quot;⬆️ Pushing image to Google Container Registry...&quot;<br>docker push gcr.io/${YOUR_PROJECT_ID}/${YOUR_IMAGE_NAME}:latest<br><br>echo &quot;🚀 Deploying service to Cloud Run...&quot;<br>gcloud run deploy ${YOUR_SERVICE_NAME} \<br>    --image gcr.io/${YOUR_PROJECT_ID}/${YOUR_IMAGE_NAME}:latest \<br>    --platform managed \<br>    --region ${YOUR_REGION} \<br>    --allow-unauthenticated \<br>    --memory 4Gi \<br>    --cpu 2 \<br>    --timeout 900 \<br>    --port 8000 \<br>    --min-instances 0 \<br>    --max-instances 5 \<br>    --execution-environment=default \<br>    --set-env-vars=&quot;PYTHONUNBUFFERED=1&quot; \<br>    --set-env-vars=&quot;YOLO_CONFIG_DIR=/home/appuser/.config/Ultralytics&quot; \<br>    --set-env-vars=&quot;PYTHONPATH=/app&quot;<br><br>echo &quot;✅ Deployment complete! Fetching service URL...&quot;<br>gcloud run services describe ${YOUR_SERVICE_NAME} --region=${YOUR_REGION} --format=&quot;value(status.url)&quot;</pre><h3>How to Use the Automation Script</h3><ol><li>Save the script:Create a file named deploy.sh in your project directory</li><li>Open terminal: Use Git Bash or PowerShell in VS Code</li><li>Navigate to directory:cd your-project-directory</li><li>Make executable: chmod +x deploy.sh (Git Bash) or use PowerShell</li><li>Run the script:./deploy.sh</li></ol><h3>Key Benefits of Google Cloud Run</h3><ul><li>Serverless: No infrastructure management required</li><li>Cost-effective: Pay only for what you use</li><li>Scalable: Automatic scaling from 0 to thousands of instances</li><li>Fast deployment: Deploy in minutes</li><li>HTTPS by default: Secure connections out of the box</li></ul><h3>Troubleshooting Tips</h3><p>Common Issues:</p><ul><li>API not enabled: Wait 2–3 minutes after enabling APIs</li><li>Authentication errors: Run gcloud auth login again</li><li>Docker push fails: Verify gcloud auth configure-docker was successful</li><li>Service not accessible: Check firewall rules and authentication settings</li></ul><h3>Cost Optimization</h3><ul><li>Use appropriate regions: Choose regions closer to your users</li><li>Set min-instances to 0: Enable scale-to-zero for cost savings</li><li>Monitor usage: Use Google Cloud Console to track costs</li><li>Optimize container size: Smaller images deploy faster and cost less</li></ul><h3>Conclusion</h3><p>Google Cloud Run provides an excellent platform for deploying containerized applications with minimal configuration. Whether you choose the manual console approach for learning or the automated script for production workflows, you now have the tools to deploy your applications efficiently.</p><p>The combination of VS Code, Docker, and Google Cloud Run creates a powerful development and deployment pipeline that scales with your needs while keeping costs under control.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dcf0a00c3cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bridging Fiction and Reality: Exploring Advanced Technologies Through the Lens of Harry Potter]]></title>
            <link>https://medium.com/@hm7.mihiranga/bridging-fiction-and-reality-exploring-advanced-technologies-through-the-lens-of-harry-potter-7385621b19c9?source=rss-3854d8285990------2</link>
            <guid isPermaLink="false">https://medium.com/p/7385621b19c9</guid>
            <category><![CDATA[harry-potter]]></category>
            <category><![CDATA[ml-with-myths]]></category>
            <category><![CDATA[research-area]]></category>
            <category><![CDATA[magic-and-ai]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <dc:creator><![CDATA[MH Mihiranga]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 19:28:46 GMT</pubDate>
            <atom:updated>2024-08-21T19:28:46.263Z</atom:updated>
            <content:encoded><![CDATA[<p>Watching the <em>Harry Potter films</em>, I noticed several scenes that sparked ideas for potential research areas in Machine Learning, Artificial Intelligence, and innovative technologies. Here are some examples:</p><ol><li><strong>The Knight Bus Transportation</strong>: This could inspire research into Vehicle-to-Vehicle (V2V) communication technology, enabling advanced, autonomous, and seamless public transportation systems.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*4mWMjC36uNnBy-qaqLy_sg.jpeg" /></figure><p>2. <strong>The Sorting Hat</strong>: This magical object could be likened to a system that identifies and categorizes people based on brain signals, possibly using EEG technology to assess personality traits or aptitudes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2U-qKmx4b0eZfPFBABXXJw.jpeg" /></figure><p>3. <strong>Wizard’s Chess Game</strong>: The animated chess pieces suggest an automated chess game involving robots with path identification and voice recognition capabilities, merging robotics with AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*755Orc1EA1WzU-soD55njg.jpeg" /></figure><p>4. <strong>Reinforcement Learning in Magical Creatures</strong>: The way pigeons deliver messages or how specific birds are assigned to each student at Hogwarts can inspire reinforcement learning algorithms, modeling how animals learn and adapt to tasks in the real world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPjqDJBhp3kxAphtn5a0fA.jpeg" /></figure><p>5. <strong>Ron Weasley’s Flying Car</strong>: The car’s ability to find its way through complex paths could be seen as an early concept for path-detection technology, potentially utilizing ant colony optimization algorithms for finding the shortest route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*OVqlSgatzsyYQtiLWye4Og.jpeg" /></figure><p>6. <strong>Moving Images in Newspapers</strong>: The animated images in the wizarding world could lead to explorations in flexible display technologies or dynamic materials that incorporate layers of machine learning to create interactive, responsive media.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*xsCqZs77WvI-CYH6-vGM3w.jpeg" /></figure><p>7. <strong>Bank Security with Stone Patterns</strong>: The magical security system in Gringotts could inspire the development of new biometric systems, like fingerprint pattern recognition or multi-modal security solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*lF62JrEe0Z7StBfULgTDsQ.jpeg" /></figure><p>8. <strong>Time Travel</strong>: While still purely fictional, the concept of time travel could spark theoretical research into quantum mechanics, time dilation, or the simulation of historical environments for educational purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dkw6CNnaqxNRG0qdRhCLew.png" /></figure><p>9. <strong>The Broom of Harry Potter</strong>: It can be control using Hand gestures and there are so many technologies in here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9WouTUvW9SHo3m0JRICqw.jpeg" /></figure><p>10. <strong>AR Systems for Saving Souls</strong>: This could inspire the creation of advanced AR systems that preserve memories or personality traits after death, perhaps as a form of digital legacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*cfHqY6wZ0sG7blju9gCSsA.jpeg" /></figure><p>By exploring these concepts, I believe there’s potential to develop innovative technologies inspired by both fiction and reality. There are already real-world examples, like animal behavior patterns and teachings from various philosophies, that could inform and guide research in these areas. Additionally, creating new sensors or materials might be necessary to bring some of these ideas to life.</p><p>These ideas could form the basis of a research article, with each concept analyzed in terms of its real-world applicability and potential for future innovation. I added more details in my article, I’ll publish that article withing few months. Are there Any comments regarding this ? Thank You !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7385621b19c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>