<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/scripts/pretty-feed-v3.xsl" type="text/xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>TechWhale</title><description>Practical DevOps, SRE, Linux and self-hosting tutorials — every command tested before it reaches you.</description><link>https://techwhale.in</link><item><title>Ultimate Full-Stack Development Workflow: BMAD + Claude Code + Spec Kit + MCP + Shadcn</title><link>https://techwhale.in/the-ultimate-ai-development-stack-bmad-claude-code-spec-kit-integration</link><guid isPermaLink="true">https://techwhale.in/the-ultimate-ai-development-stack-bmad-claude-code-spec-kit-integration</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Tue, 09 Sep 2025 19:02:00 GMT</pubDate><content:encoded>&lt;h2&gt;Overview: The Perfect AI Development Stack&lt;/h2&gt;
&lt;p&gt;This comprehensive guide combines five powerful frameworks to create the ultimate AI-driven development experience:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;BMAD Method&lt;/strong&gt;: Specialized AI agents working as a development team&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spec Kit&lt;/strong&gt;: Specification-driven development methodology&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claude Code&lt;/strong&gt;: AI-powered IDE with agent orchestration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MCP Memory&lt;/strong&gt;: Persistent context management across sessions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shadcn UI&lt;/strong&gt;: Modern component library with AI integration&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;🚀 &lt;strong&gt;Complete Setup Process&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Step 1: Core Framework Installation&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Install BMAD Method&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# In your project directory
npx bmad-method install
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Install Spec Kit&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Initialize with Claude Code support
uvx --from git+https://github.com/github/spec-kit.git specify init &amp;#x3C;PROJECT_NAME&gt; --ai claude
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Configure Claude Code with Kimi K2 API&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;Set up Claude Code with your Kimi K2 API configuration in the settings.&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Step 2: MCP Memory Integration&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Install Memory Keeper MCP&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Clone and setup memory persistence
git clone https://github.com/mkreyman/mcp-memory-keeper.git
cd mcp-memory-keeper
npm install &amp;#x26;&amp;#x26; npm run build

# Add to Claude Code
claude mcp add memory-keeper npx mcp-memory-keeper
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Install OpenMemory MCP (Alternative)&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# For shared memory across tools
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
python install.py
uv run memory server
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Step 3: Shadcn UI MCP Setup&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Install Shadcn MCP Server&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Add to Claude Code for automated component installation
claude mcp add shadcn-ui npx @shadcn/ui-mcp-server
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Initialize Shadcn in Your Project&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx shadcn@latest init
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;🧠 &lt;strong&gt;Integrated Workflow Process&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Phase 1: Specification-Driven Planning&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Start with Spec Kit Requirements&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# In Claude Code, use Spec Kit commands
/specify Build a full-stack e-commerce platform with product management, 
user authentication, shopping cart, and payment integration. Focus on 
modern UX with beautiful components and responsive design.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Create Technical Plan&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/plan Use React with TypeScript frontend, Node.js/Express backend, 
PostgreSQL database, JWT authentication, Stripe payments, and 
shadcn/ui components for beautiful UI design.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Break Down into Tasks&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/tasks Create actionable development tasks with proper sequencing
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Phase 2: BMAD Agent Orchestration&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Analyst Phase - Deep Requirements Analysis&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Switch to BMAD workflow
*analyst
Analyze the Spec Kit requirements and create comprehensive project brief 
for e-commerce platform with focus on beautiful UI and solid architecture.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Project Manager Phase - Strategic Planning&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*pm
Create detailed PRD from analyst brief, incorporating Spec Kit specifications
and ensuring feature prioritization aligns with technical constraints.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Architect Phase - System Design&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*architect
Design scalable full-stack architecture using React/TypeScript, Node.js,
PostgreSQL, and shadcn/ui components. Include API design, database schema,
and deployment strategy.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Phase 3: Context-Engineered Development&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Document Sharding for Focused Development&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*po
Shard PRD and Architecture documents into focused, actionable pieces
for efficient agent consumption and context management.
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Memory-Enhanced Story Creation&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use Memory MCP to maintain context
*sm
Create detailed story for user authentication system. Remember our 
architecture decisions about JWT tokens and PostgreSQL schema design.

# Memory automatically preserves:
# - Previous architectural decisions
# - Database schema choices
# - Component library selections
# - API design patterns
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Shadcn-Enhanced Development&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*dev
Implement authentication UI using shadcn components. Use the MCP server
to automatically install and configure needed components like forms,
buttons, and input fields.

# Shadcn MCP automatically:
# - Installs required components
# - Provides TypeScript props
# - Ensures design consistency
# - Handles component dependencies
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;🎯 &lt;strong&gt;Advanced Integration Features&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Multi-Agent Collaboration with Memory&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Cross-Session Context Preservation&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Before hitting context limits
context_prepare_compaction
# Get checkpoint key: &quot;auth_system_v1_2024&quot;

# In new session
context_restore_from_checkpoint auth_system_v1_2024
# Full context restored including architectural decisions
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Git-Aware Memory Channels&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Automatically organize context by git branch
git checkout feature/payment-system
# Memory MCP creates separate context channel
# No mixing of feature contexts
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Automated Component Integration&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Shadcn Component Discovery&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Claude Code with Shadcn MCP can now:
- Query component registry directly
- Install components with proper configurations
- Access up-to-date component documentation
- Handle component dependencies automatically
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Beautiful UI Development&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*dev
Create a product catalog page using shadcn components. Include:
- Card components for product display
- Skeleton loaders for better UX
- Responsive grid layouts
- Modern typography and spacing

# MCP server handles:
# - Component installation
# - TypeScript integration  
# - Design system consistency
# - Accessibility features
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Self-Correcting Code Architecture&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;QA Agent with Memory Context&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*qa
Review the authentication implementation against our architectural standards.
Check for security best practices, TypeScript compliance, and shadcn
component usage patterns.

# QA agent remembers:
# - Previous code review feedback
# - Established coding standards
# - Security requirements
# - Component usage patterns
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;&lt;strong&gt;Iterative Refinement with Context&lt;/strong&gt;&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Memory preserves lessons learned
context_add_insight &quot;Authentication forms should always use zod validation 
with shadcn form components for consistent error handling&quot;

# Future development automatically applies insights
*dev
Create user registration form using established patterns
# Automatically applies zod validation + shadcn forms
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;🔧 &lt;strong&gt;Project Structure for Integrated Workflow&lt;/strong&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;your-project/
├── .bmad/                    # BMAD Method configuration
│   ├── agents/              # Specialized agent configs
│   └── workflows/           # Development workflows
├── specs/                   # Spec Kit specifications
│   ├── 001-auth-system/     # Feature specifications
│   └── 002-product-catalog/ # More features
├── memory/                  # MCP Memory storage
│   ├── context.db          # SQLite memory database
│   └── checkpoints/        # Context checkpoints
├── docs/                   # BMAD planning documents
│   ├── prd/                # Product requirements (sharded)
│   ├── architecture/       # Architecture docs (sharded)
│   └── briefs/             # Analysis briefs
├── stories/                # BMAD development stories
│   ├── epic-1-auth/        # Authentication epic
│   ├── epic-2-products/    # Product management epic
│   └── epic-3-payments/    # Payment processing epic
├── src/                    # Application source code
│   ├── components/         # Shadcn UI components
│   │   ├── ui/            # Base shadcn components
│   │   └── custom/        # Custom components
│   ├── pages/             # Application pages
│   ├── api/               # Backend API routes
│   └── lib/               # Utilities and configurations
└── package.json           # Dependencies including shadcn
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;🌟 &lt;strong&gt;Key Integration Benefits&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Context Preservation Across All Tools&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Memory MCP&lt;/strong&gt;: Maintains decisions, patterns, and progress across sessions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BMAD Stories&lt;/strong&gt;: Self-contained context files with complete implementation details&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Spec Kit&lt;/strong&gt;: Persistent specifications that evolve with project needs&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Beautiful UI Development&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Shadcn MCP&lt;/strong&gt;: Automated component installation and configuration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Design Consistency&lt;/strong&gt;: AI agents understand and apply design system patterns&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern Components&lt;/strong&gt;: Access to latest UI components with proper TypeScript support&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Self-Correcting Architecture&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;QA Agent&lt;/strong&gt;: Reviews code against established patterns and standards&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Memory Insights&lt;/strong&gt;: Preserves lessons learned for future development&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Iterative Improvement&lt;/strong&gt;: Each cycle improves code quality and consistency&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Scalable Development Process&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Feature Division&lt;/strong&gt;: Large features broken into focused stories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent Specialization&lt;/strong&gt;: Each agent focuses on their expertise area&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context Management&lt;/strong&gt;: Optimal context size for each development task&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;🚀 &lt;strong&gt;Getting Started Today&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Quick Start Checklist&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;✅ Install Core Frameworks&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx bmad-method install
uvx specify init project-name --ai claude
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;✅ Setup Memory Management&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude mcp add memory-keeper npx mcp-memory-keeper
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;✅ Configure Shadcn Integration&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude mcp add shadcn-ui npx @shadcn/ui-mcp-server
npx shadcn@latest init
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;✅ Start Integrated Workflow&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Begin with Spec Kit
/specify [Your project description]

# Move to BMAD planning
*analyst [Analyze specifications]

# Develop with context preservation
*sm [Create memory-aware stories]
*dev [Build with shadcn components]
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;&lt;strong&gt;Pro Tips for Maximum Efficiency&lt;/strong&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;strong&gt;Memory Management Best Practices&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Create checkpoints before major feature development&lt;/li&gt;
&lt;li&gt;Use descriptive memory keys for easy retrieval&lt;/li&gt;
&lt;li&gt;Regularly save architectural decisions and patterns&lt;/li&gt;
&lt;li&gt;Set up git-aware context channels for feature branches&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;&lt;strong&gt;Component Development Strategy&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Start with shadcn base components&lt;/li&gt;
&lt;li&gt;Build custom components following shadcn patterns&lt;/li&gt;
&lt;li&gt;Let MCP server handle component installations&lt;/li&gt;
&lt;li&gt;Maintain design system consistency through AI agents&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;&lt;strong&gt;Agent Orchestration Tips&lt;/strong&gt;&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Use Analyst for deep requirement understanding&lt;/li&gt;
&lt;li&gt;Let Architect make technology stack decisions&lt;/li&gt;
&lt;li&gt;Use SM for context-rich story creation&lt;/li&gt;
&lt;li&gt;Let Dev focus on implementation with full context&lt;/li&gt;
&lt;li&gt;Use QA for maintaining code quality and standards&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;🎯 &lt;strong&gt;Advanced Workflows&lt;/strong&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;Feature Development Cycle&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 1. Specification Phase
/specify Create user profile management with avatar upload, 
personal information editing, and account settings

# 2. Planning Phase  
*analyst --&gt; *pm --&gt; *architect --&gt; *po

# 3. Context Preparation
context_create_checkpoint &quot;profile_system_start&quot;
*po shard documents for profile management feature

# 4. Development Phase
*sm Create profile management stories with shadcn form components
*dev Implement with memory of authentication patterns
*qa Review against established standards

# 5. Memory Preservation
context_add_insight &quot;Profile forms use shadcn form + react-hook-form pattern&quot;
context_save_progress &quot;Profile management MVP completed&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;&lt;strong&gt;Multi-Feature Coordination&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Feature branch development with isolated context
git checkout -b feature/shopping-cart
context_create_channel &quot;shopping_cart&quot;

# Develop with feature-specific context
*sm Create cart management stories  
*dev Implement cart functionality
context_save_progress &quot;Cart system completed&quot;

# Switch features without context mixing
git checkout feature/payment-system  
context_switch_channel &quot;payment_system&quot;
# Clean context for payment development
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This integrated workflow combines the best of all five frameworks, creating a development experience that’s both powerful and maintainable. You get the strategic planning of Spec Kit, the agent specialization of BMAD, the persistent memory of MCP, and the beautiful components of Shadcn - all orchestrated through Claude Code’s powerful AI assistance.&lt;/p&gt;
&lt;p&gt;*&lt;strong&gt;� The result&lt;/strong&gt;: Production-ready applications built faster, with better architecture, beautiful UI, and self-correcting code quality - exactly what you need for modern full-stack development!&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.C4cH87l4.png"/><enclosure url="/_astro/hero.C4cH87l4.png"/><author>Mayur Chavhan</author></item><item><title>Ultimate MCP Tools Setup Guide for Claude Code</title><link>https://techwhale.in/ultimate-mcp-tools-setup-guide-for-claude-code-with-kimi-k2-api</link><guid isPermaLink="true">https://techwhale.in/ultimate-mcp-tools-setup-guide-for-claude-code-with-kimi-k2-api</guid><description>Complete CLI setup for the top 15 MCP tools that supercharge your Claude Code environment with memory persistence, browser automation, debugging capabilities</description><pubDate>Fri, 05 Sep 2025 08:45:00 GMT</pubDate><content:encoded>&lt;h2&gt;Executive Summary&lt;/h2&gt;
&lt;p&gt;This comprehensive guide provides the &lt;strong&gt;complete CLI installation setup&lt;/strong&gt; for the &lt;strong&gt;top 15 MCP tools&lt;/strong&gt; that will supercharge your Claude Code environment with &lt;strong&gt;memory persistence&lt;/strong&gt;, &lt;strong&gt;browser automation&lt;/strong&gt;, &lt;strong&gt;debugging capabilities&lt;/strong&gt;, and &lt;strong&gt;cost-effective API usage&lt;/strong&gt;. These tools transform Claude Code into a &lt;strong&gt;production-ready full-stack development environment&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Top 15 MCP Tools for Full-Stack Development&lt;/h2&gt;
&lt;h3&gt;1. Memory MCP (Context Persistence) ⭐⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Provides persistent memory across conversations, dramatically reducing API costs by maintaining context&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Memory MCP
claude mcp add memory --scope user -- npx -y @mcp-plugins/memory --memory-file ~/claude-memory.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Persistent conversation memory&lt;/strong&gt; across sessions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Entity relationship tracking&lt;/strong&gt; for complex projects&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost reduction&lt;/strong&gt; by avoiding context re-prompting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Structured memory storage&lt;/strong&gt; in JSON format&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;mcpServers&quot;: {
    &quot;memory&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [
        &quot;@mcp-plugins/memory&quot;,
        &quot;--memory-file&quot;,
        &quot;/Users/your-username/claude-memory.json&quot;
      ]
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Browser Tools MCP (UI Debugging) ⭐⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Complete browser automation and debugging solution for UI issues[2]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Browser Tools (requires 2 components)
# Component 1: MCP Server
claude mcp add browser-tools --scope user -- npx -y @agentdeskai/browser-tools-mcp@1.2.1

# Component 2: Middleware Server (run in separate terminal)
npx @agentdeskai/browser-tools-server@1.2.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Capabilities&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Console log capture&lt;/strong&gt; and error monitoring&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network request monitoring&lt;/strong&gt; for API debugging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated screenshot capture&lt;/strong&gt; on errors&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chrome DevTools integration&lt;/strong&gt; for deep debugging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lighthouse performance audits&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Chrome Extension&lt;/strong&gt;: Install from &lt;a href=&quot;https://github.com/AgentDeskAI/browser-tools-mcp/releases&quot;&gt;BrowserToolsMCP Extension&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;3. Sequential Thinking MCP (Problem Solving) ⭐⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Structured problem-solving for complex development challenges[3]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Sequential Thinking
claude mcp add sequential-thinking --scope user -- npx -y @modelcontextprotocol/server-sequential-thinking
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Break down complex problems&lt;/strong&gt; into manageable steps&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Revise and refine&lt;/strong&gt; thoughts as understanding deepens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branch into alternative&lt;/strong&gt; reasoning paths&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dynamic thought adjustment&lt;/strong&gt; based on complexity&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;4. Filesystem MCP (Local File Access) ⭐⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Complete filesystem access for reading, writing, and managing project files[4]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Filesystem Access
claude mcp add filesystem --scope user -- npx -y @modelcontextprotocol/server-filesystem ~/Documents ~/Downloads ~/Projects ~/src
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Read/write file operations&lt;/strong&gt; across specified directories&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Directory listing and navigation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File creation and deletion&lt;/strong&gt; capabilities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Project structure analysis&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;5. Puppeteer MCP (Browser Automation) ⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Headless browser automation for testing and debugging&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Puppeteer MCP
claude mcp add puppeteer --scope user -- npx -y @modelcontextprotocol/server-puppeteer
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automated UI testing&lt;/strong&gt; for full-stack applications&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Screenshot generation&lt;/strong&gt; for documentation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Form interaction testing&lt;/strong&gt; for authentication flows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance monitoring&lt;/strong&gt; during development&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;6. Fetch MCP (Web Content Analysis) ⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Advanced web content fetching and analysis&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Fetch MCP
claude mcp add fetch --scope user -- npx -y @kazuhitonakayama/mcp-fetch
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Capabilities&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Web page content extraction&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Markdown conversion&lt;/strong&gt; for documentation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;API endpoint testing&lt;/strong&gt; and analysis&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content summarization&lt;/strong&gt; for research&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;7. Git MCP (Version Control) ⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Integrated Git operations within Claude Code&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Git MCP
claude mcp add git --scope user -- npx -y @modelcontextprotocol/server-git
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Repository analysis&lt;/strong&gt; and commit history review&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Branch management&lt;/strong&gt; and merge conflict resolution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code diff analysis&lt;/strong&gt; for debugging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated commit message generation&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;8. SQLite MCP (Database Operations) ⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Local database management and analysis&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install SQLite MCP
claude mcp add sqlite --scope user -- npx -y @modelcontextprotocol/server-sqlite
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Database schema analysis&lt;/strong&gt; for debugging&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query optimization&lt;/strong&gt; and performance tuning&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data migration&lt;/strong&gt; assistance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test data generation&lt;/strong&gt; and seeding&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;9. GitHub MCP (Repository Integration) ⭐⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Direct GitHub repository access and management[8]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install GitHub MCP
claude mcp add github --scope user -- npx -y @modelcontextprotocol/server-github
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;GitHub Personal Access Token&lt;/li&gt;
&lt;li&gt;Repository permissions configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;10. Brave Search MCP (Web Research) ⭐⭐⭐&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt;: Integrated web search for development research&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install Brave Search (requires API key)
claude mcp add brave-search --scope user -- npx -y @brave/search-mcp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Environment Setup&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;export BRAVE_API_KEY=&quot;your-brave-api-key&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Advanced Installation &amp;#x26; Configuration&lt;/h2&gt;
&lt;h3&gt;Memory MCP Advanced Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create memory directory
mkdir -p ~/claude-mcp-configs

# Initialize memory file
echo &apos;{
  &quot;entities&quot;: [],
  &quot;relations&quot;: [],
  &quot;conversations&quot;: []
}&apos; &gt; ~/claude-mcp-configs/memory.json

# Install with custom memory file
claude mcp add memory --scope user -- npx -y @mcp-plugins/memory --memory-file ~/claude-mcp-configs/memory.json
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Browser Tools Complete Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Step 1: Install Chrome Extension
# Download from: https://github.com/AgentDeskAI/browser-tools-mcp/releases

# Step 2: Start middleware server (keep running)
npx @agentdeskai/browser-tools-server@1.2.1 &amp;#x26;

# Step 3: Install MCP server
claude mcp add browser-tools --scope user -- npx -y @agentdeskai/browser-tools-mcp@1.2.1

# Step 4: Open Chrome DevTools and look for &quot;BrowserTools&quot; tab
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Filesystem MCP Project-Specific Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create project structure
mkdir -p ~/Projects/my-fullstack-app/{frontend,backend,database,docs}

# Install with project-specific access
claude mcp add filesystem --scope user -- npx -y @modelcontextprotocol/server-filesystem \
  ~/Projects/my-fullstack-app \
  ~/Documents/Development \
  ~/Downloads
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Configuration File Management&lt;/h2&gt;
&lt;h3&gt;Direct Config File Editing (Advanced)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Open Claude Code config file
code ~/.claude.json

# Or find config location
find ~ -name &quot;.claude.json&quot; 2&gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example Complete Configuration&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;mcpServers&quot;: {
    &quot;memory&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [
        &quot;-y&quot;,
        &quot;@mcp-plugins/memory&quot;,
        &quot;--memory-file&quot;,
        &quot;/Users/your-username/claude-memory.json&quot;
      ]
    },
    &quot;browser-tools&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [&quot;-y&quot;, &quot;@agentdeskai/browser-tools-mcp@1.2.1&quot;]
    },
    &quot;filesystem&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [
        &quot;-y&quot;,
        &quot;@modelcontextprotocol/server-filesystem&quot;,
        &quot;/Users/your-username/Projects&quot;,
        &quot;/Users/your-username/Documents&quot;
      ]
    },
    &quot;sequential-thinking&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [&quot;-y&quot;, &quot;@modelcontextprotocol/server-sequential-thinking&quot;]
    },
    &quot;puppeteer&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [&quot;-y&quot;, &quot;@modelcontextprotocol/server-puppeteer&quot;]
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Full-Stack Development Workflow&lt;/h2&gt;
&lt;h3&gt;UI Bug Debugging Workflow&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# 1. Start browser tools middleware
npx @agentdeskai/browser-tools-server@1.2.1 &amp;#x26;

# 2. Use Claude Code with browser automation
claude &quot;Use browser-tools to:
1. Navigate to localhost:3000
2. Monitor console errors
3. Take screenshots of UI issues
4. Generate bug report with network analysis&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Memory-Enhanced Development&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use memory for persistent context
claude &quot;Remember that this project uses:
- Next.js 14 with App Router
- Supabase for authentication
- TailwindCSS for styling
- TypeScript throughout

Store this context for future conversations.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Sequential Problem Solving&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Break down complex problems
claude &quot;Use sequential-thinking to analyze this authentication issue:
1. User login flow is broken
2. API returns 401 but token seems valid
3. Need systematic debugging approach&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Cost Optimization Strategies&lt;/h2&gt;
&lt;h3&gt;Memory-Driven Cost Reduction&lt;/h3&gt;
&lt;p&gt;🧠 &lt;strong&gt;Brain Mode&lt;/strong&gt;: The Memory MCP is your secret weapon for API cost reduction. Instead of re-explaining your entire project context in every conversation, Memory MCP stores and recalls project details, team preferences, and development patterns. This can reduce your token usage by 60-80% in long-term projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setup for Maximum Savings&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Initialize comprehensive memory
claude &quot;Store in memory:
- Project: Next.js admin dashboard with Supabase
- Tech stack: TypeScript, TailwindCSS, Prisma
- Authentication: Supabase Auth with RLS
- Database: PostgreSQL with migrations
- Deployment: Vercel with preview branches
- Testing: Jest + Playwright for E2E&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Context-Aware Development&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use filesystem + memory combination
claude &quot;Using filesystem access, analyze my project structure and store the architecture in memory for future reference. Focus on:
1. Component organization patterns
2. API route structure  
3. Database schema relationships
4. Authentication flow implementation&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Essential MCP Tools Installation (One-Command Setup)&lt;/h2&gt;
&lt;h3&gt;Quick Installation Script&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/bin/bash
# Save as install-mcp-tools.sh and run: chmod +x install-mcp-tools.sh &amp;#x26;&amp;#x26; ./install-mcp-tools.sh

# Memory &amp;#x26; Context Tools
claude mcp add memory --scope user -- npx -y @mcp-plugins/memory --memory-file ~/claude-memory.json
claude mcp add sequential-thinking --scope user -- npx -y @modelcontextprotocol/server-sequential-thinking

# Filesystem Access
claude mcp add filesystem --scope user -- npx -y @modelcontextprotocol/server-filesystem ~/Documents ~/Downloads ~/Projects

# Browser Automation &amp;#x26; Debugging
claude mcp add browser-tools --scope user -- npx -y @agentdeskai/browser-tools-mcp@1.2.1
claude mcp add puppeteer --scope user -- npx -y @modelcontextprotocol/server-puppeteer

# Web Fetching &amp;#x26; Analysis
claude mcp add fetch --scope user -- npx -y @kazuhitonakayama/mcp-fetch
claude mcp add web-search --scope user -- npx -y @brave/search-mcp

# Development Tools
claude mcp add git --scope user -- npx -y @modelcontextprotocol/server-git
claude mcp add sqlite --scope user -- npx -y @modelcontextprotocol/server-sqlite

# Check installation
claude mcp list
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Troubleshooting &amp;#x26; Verification&lt;/h2&gt;
&lt;h3&gt;Verify Installation&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Check all installed MCP servers
claude mcp list

# Test specific server
claude doctor

# Restart Claude Code if needed
claude restart
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Common Issues &amp;#x26; Solutions&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Server Not Starting&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Check Node.js version
node --version

# Clear npm cache
npm cache clean --force

# Reinstall problematic server
claude mcp remove server-name
claude mcp add server-name --scope user -- npx -y package-name
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Permission Issues&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Fix filesystem permissions
chmod -R 755 ~/Projects
chmod -R 755 ~/Documents

# Reset Claude config
rm ~/.claude.json
claude mcp add filesystem --scope user -- npx -y @modelcontextprotocol/server-filesystem ~/Projects
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Testing Your Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Test browser automation
claude &quot;Use browser-tools to take a screenshot of google.com and analyze the page structure&quot;

# Test memory persistence
claude &quot;What do you remember about my current project?&quot;

# Test filesystem access
claude &quot;List the contents of my Projects directory and analyze the structure&quot;

# Test sequential thinking
claude &quot;Use sequential-thinking to plan the implementation of a new authentication feature&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Production-Ready Workflow Integration&lt;/h2&gt;
&lt;h3&gt;CI/CD Integration&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create automation script
cat &gt; ~/.claude-automation.sh &amp;#x3C;&amp;#x3C; &apos;EOF&apos;
#!/bin/bash
# Start all MCP services
npx @agentdeskai/browser-tools-server@1.2.1 &amp;#x26;
echo &quot;Browser tools server started&quot;

# Run automated tests with Claude
claude &quot;Use browser-tools and puppeteer to:
1. Run smoke tests on staging environment
2. Generate performance report
3. Check for console errors
4. Store results in memory for tracking&quot;
EOF

chmod +x ~/.claude-automation.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Project-Specific MCP Profiles&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create project-specific config
mkdir -p ~/Projects/my-app/.claude
cat &gt; ~/Projects/my-app/.claude/config.json &amp;#x3C;&amp;#x3C; &apos;EOF&apos;
{
  &quot;mcpServers&quot;: {
    &quot;project-filesystem&quot;: {
      &quot;command&quot;: &quot;npx&quot;,
      &quot;args&quot;: [
        &quot;-y&quot;,
        &quot;@modelcontextprotocol/server-filesystem&quot;,
        &quot;/Users/your-username/Projects/my-app&quot;
      ]
    }
  }
}
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This comprehensive setup transforms Claude Code into a &lt;strong&gt;production-ready development environment&lt;/strong&gt; that &lt;strong&gt;significantly outperforms&lt;/strong&gt; basic setups by providing &lt;strong&gt;persistent memory&lt;/strong&gt;, &lt;strong&gt;advanced browser automation&lt;/strong&gt;, &lt;strong&gt;comprehensive debugging tools&lt;/strong&gt;, and &lt;strong&gt;substantial API cost savings&lt;/strong&gt; through intelligent context management.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.DRweo-3Q.png"/><enclosure url="/_astro/hero.DRweo-3Q.png"/><author>Mayur Chavhan</author></item><item><title>Complete Guide: Building Beautiful Websites with Claude Code, VSCode, and Design Tools</title><link>https://techwhale.in/complete-guide-building-beautiful-websites-with-claude-code-vscode-and-design-tools</link><guid isPermaLink="true">https://techwhale.in/complete-guide-building-beautiful-websites-with-claude-code-vscode-and-design-tools</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 21 Aug 2025 06:08:00 GMT</pubDate><content:encoded>&lt;h2&gt;Table of Contents&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;#introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#prerequisites--setup&quot;&gt;Prerequisites &amp;#x26; Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#method-1-superdesign---ai-design-agent&quot;&gt;Method 1: SuperDesign - AI Design Agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#method-2-shadcn-ui-components&quot;&gt;Method 2: ShadCN UI Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#method-3-website-cloning-with-firecrawl&quot;&gt;Method 3: Website Cloning with FireCrawl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#bonus-figma-to-code-conversion&quot;&gt;Bonus: Figma to Code Conversion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#best-practices--tips&quot;&gt;Best Practices &amp;#x26; Tips&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#troubleshooting&quot;&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This guide demonstrates &lt;strong&gt;three powerful methods&lt;/strong&gt; to build stunning websites using Claude Code with VSCode. These approaches leverage AI design agents, component libraries, and web scraping to create professional, responsive interfaces with minimal effort.&lt;/p&gt;
&lt;p&gt;🧠 The key insight is that generic prompts like “build a beautiful website” produce generic results. Instead, we’ll use specialized tools and iterative workflows to achieve professional-grade designs.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Prerequisites &amp;#x26; Setup&lt;/h2&gt;
&lt;h3&gt;System Requirements&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: macOS 10.15+, Windows 10+, or Ubuntu 20.04+&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hardware&lt;/strong&gt;: 4GB+ RAM (16GB recommended)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software&lt;/strong&gt;: Node.js 18+ and VSCode&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network&lt;/strong&gt;: Internet connection for authentication&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Step 1: Install Claude Code&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Option A: NPM Installation (Recommended)&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm install -g @anthropic-ai/claude-code
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Option B: Native Installation&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# macOS/Linux/WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell
irm https://claude.ai/install.ps1 | iex
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Step 2: Authentication&lt;/h3&gt;
&lt;p&gt;Navigate to your project directory and start Claude Code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cd your-project-directory
claude
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Follow the OAuth process to connect your Anthropic account or Claude subscription.&lt;/p&gt;
&lt;h3&gt;Step 3: Verify Installation&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude doctor
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Method 1: SuperDesign - AI Design Agent&lt;/h2&gt;
&lt;p&gt;SuperDesign is an open-source design agent that works as a VSCode extension, optimized for creating frontend components and UI mockups.&lt;/p&gt;
&lt;h3&gt;Installation&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install SuperDesign Extension&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open VSCode Extensions marketplace (&lt;code&gt;Cmd/Ctrl + Shift + X&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Search for “SuperDesign”&lt;/li&gt;
&lt;li&gt;Click Install&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Initialize SuperDesign&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Open command palette
Cmd/Ctrl + Shift + P

# Type and select
SuperDesign: Initialize
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open Design Canvas&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Command palette
Cmd/Ctrl + Shift + P

# Select
SuperDesign: Open Canvas
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Workflow Process&lt;/h3&gt;
&lt;h4&gt;Phase 1: Layout Design&lt;/h4&gt;
&lt;p&gt;Start Claude Code in your project directory and begin with layout iterations:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Example Prompt:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Create 5 different layout iterations for an Uber-style ride-sharing app home screen. Focus on the main structure and component placement.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;SuperDesign will generate ASCII layouts in the terminal, allowing you to quickly evaluate different structures before writing code.&lt;/p&gt;
&lt;h4&gt;Phase 2: Theme Development&lt;/h4&gt;
&lt;p&gt;Select your preferred layout and move to styling:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example Prompt:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;I like layout #2. Now create 5 different theme variations focusing on:
- Color palette application
- Typography choices
- Visual hierarchy
- Design language consistency
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Phase 3: Color Palette Integration&lt;/h4&gt;
&lt;p&gt;Use &lt;a href=&quot;https://coolors.co/&quot;&gt;Coolors.co&lt;/a&gt; to generate color palettes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Visit coolors.co&lt;/li&gt;
&lt;li&gt;Press spacebar to generate palettes&lt;/li&gt;
&lt;li&gt;Copy the CSS values&lt;/li&gt;
&lt;li&gt;Provide to Claude Code:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;Apply this color palette to the design:
--primary: #FF6B6B;
--secondary: #4ECDC4;
--accent: #45B7D1;
--neutral: #96CEB4;
--background: #FFEAA7;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Phase 4: Animation &amp;#x26; Interactivity&lt;/h4&gt;
&lt;p&gt;Add micro-interactions and animations:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Add subtle animations to this design:
- Hover effects for buttons
- Loading states
- Smooth transitions
- Interactive feedback for user actions
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Advanced Animation Resources&lt;/h3&gt;
&lt;p&gt;Visit &lt;a href=&quot;https://sarthology.github.io/Animatopy/&quot;&gt;Animatopy&lt;/a&gt; for curated animation effects:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Browse animation collections&lt;/li&gt;
&lt;li&gt;Copy HTML/CSS code&lt;/li&gt;
&lt;li&gt;Integrate into your design through Claude Code&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;SuperDesign Canvas Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Real-time Preview&lt;/strong&gt;: See changes instantly&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Device Testing&lt;/strong&gt;: Switch between desktop, tablet, mobile views&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interactive Elements&lt;/strong&gt;: Click buttons, type in inputs, test functionality&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Export Options&lt;/strong&gt;: Copy designs or generate code for other frameworks&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;Method 2: ShadCN UI Components&lt;/h2&gt;
&lt;p&gt;Build with professionally designed, accessible components using the ShadCN MCP server.&lt;/p&gt;
&lt;h3&gt;Setup ShadCN MCP Server&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Installation Command:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude mcp add-json &quot;shadcn-ui-server&quot; &apos;{&quot;command&quot;:&quot;npx&quot;,&quot;args&quot;:[&quot;-y&quot;,&quot;shadcn-ui-mcp-server&quot;]}&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Create Workflow Commands&lt;/h3&gt;
&lt;p&gt;Create a custom slash command for consistent ShadCN workflows. In your project, create:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;File&lt;/strong&gt;: &lt;code&gt;commands/shadcn.md&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-markdown&quot;&gt;# ShadCN Development Workflow

## Planning Phase
1. Always use the ShadCN MCP server for component context
2. Plan the entire application structure before implementation
3. List all required components and their relationships
4. Create an implementation plan in implementation.md

## Implementation Phase  
1. Reference the implementation plan
2. Use ShadCN MCP server for all component implementations
3. Ensure proper component structure and styling
4. Implement responsive design patterns
5. Add proper TypeScript types
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Usage Workflow&lt;/h3&gt;
&lt;h4&gt;Step 1: Planning&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/shadcn Plan an e-commerce dashboard using ShadCN components. Create a detailed implementation plan in implementation.md including:
- Component hierarchy
- Required ShadCN components
- Layout structure
- Responsive considerations
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Step 2: Implementation&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/shadcn Implement the dashboard based on the implementation plan in implementation.md. Use the ShadCN MCP server for accurate component usage.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Theme Customization with TweakCN&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Visit &lt;a href=&quot;https://tweakcn.com/&quot;&gt;TweakCN.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Choose or customize a theme&lt;/li&gt;
&lt;li&gt;Copy the CSS variables&lt;/li&gt;
&lt;li&gt;Apply to your project:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Apply this TweakCN theme to my ShadCN components:

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  /* ... rest of theme variables */
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Method 3: Website Cloning with FireCrawl&lt;/h2&gt;
&lt;p&gt;Clone existing websites and adapt them with your content using the FireCrawl MCP server.&lt;/p&gt;
&lt;h3&gt;Setup FireCrawl MCP&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Installation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude mcp add-json &quot;firecrawl&quot; &apos;{&quot;command&quot;:&quot;mcp-server-firecrawl&quot;,&quot;env&quot;:{&quot;FIRECRAWL_API_KEY&quot;:&quot;your-api-key&quot;}}&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Get your API key from &lt;a href=&quot;https://www.firecrawl.dev/app/api-keys&quot;&gt;Firecrawl.dev&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Cloning Workflow&lt;/h3&gt;
&lt;h4&gt;Basic Website Clone&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Create a 1:1 clone of https://example-website.com including:
- Layout structure
- Component hierarchy  
- Styling patterns
- Interactive elements
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Enhanced Clone with Screenshots&lt;/h4&gt;
&lt;p&gt;For better results, include screenshots in your prompt:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Clone this website: https://example-website.com

[Include screenshot of the target website]

Focus on:
- Exact visual hierarchy
- Color scheme accuracy
- Typography matching
- Responsive behavior
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Customization After Cloning&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Adapt the cloned design with my brand:
- Replace content with [your content]
- Update color scheme to [your colors]
- Modify typography to [your fonts]
- Add/remove sections as needed
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Bonus: Figma to Code Conversion&lt;/h2&gt;
&lt;p&gt;Convert Figma designs directly to code using the Figma MCP server.&lt;/p&gt;
&lt;h3&gt;Setup Methods&lt;/h3&gt;
&lt;h4&gt;Option A: Composio Figma MCP&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Generate command at mcp.composio.dev
npx @composio/mcp@latest setup &quot;https://mcp.composio.dev/partner/composio/figma/mcp?customerId=YOUR_ID&quot; &quot;figma-server-name&quot; --client
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Option B: Native Figma MCP (Requires Figma Desktop)&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;claude mcp add --transport sse figma-dev-mode-mcp-server http://127.0.0.1:3845/sse
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Usage Patterns&lt;/h3&gt;
&lt;h4&gt;Selection-Based Conversion&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Select a frame/component in Figma&lt;/li&gt;
&lt;li&gt;In Claude Code:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Convert my current Figma selection to React components with Tailwind CSS
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Link-Based Conversion&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Convert this Figma design to code: [figma-share-link]

Requirements:
- Use React/Next.js
- Implement responsive design
- Match colors and typography exactly
- Include hover states and interactions
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Best Practices &amp;#x26; Tips&lt;/h2&gt;
&lt;h3&gt;Iterative Development Approach&lt;/h3&gt;
&lt;p&gt;🧠 The power of Claude Code lies in continuous iteration. Unlike human developers, AI agents never tire of refinement, making them ideal for polishing designs through multiple cycles.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start with HTML files&lt;/strong&gt; during initial iterations (easier to modify than full frameworks)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use multiple iterations&lt;/strong&gt; (5+ variations) for each design phase&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Break down complex requests&lt;/strong&gt; into smaller, manageable tasks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leverage real-time preview&lt;/strong&gt; to validate changes immediately&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Design System Consistency&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Establish design tokens&lt;/strong&gt; early (colors, typography, spacing)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create reusable components&lt;/strong&gt; before building pages&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maintain style guides&lt;/strong&gt; throughout development&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test responsive behavior&lt;/strong&gt; across devices regularly&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Performance Considerations&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Optimize this design for performance:
- Minimize bundle size
- Implement lazy loading
- Optimize images and assets
- Ensure accessibility standards
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Quality Assurance&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Review this implementation for:
- Accessibility compliance (WCAG 2.1)
- Cross-browser compatibility
- Mobile responsiveness  
- Performance optimization
- Code maintainability
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Troubleshooting&lt;/h2&gt;
&lt;h3&gt;Common Installation Issues&lt;/h3&gt;
&lt;h4&gt;Permission Errors with NPM&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Don&apos;t use sudo - configure npm properly instead
mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
echo &apos;export PATH=~/.npm-global/bin:$PATH&apos; &gt;&gt; ~/.bashrc
source ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;MCP Server Connection Issues&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Check MCP status
/mcp

# Restart Claude Code if servers aren&apos;t connecting
claude restart
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;SuperDesign Canvas Not Loading&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Ensure VSCode is updated to latest version&lt;/li&gt;
&lt;li&gt;Restart VSCode after installing extension&lt;/li&gt;
&lt;li&gt;Check that SuperDesign is initialized:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Cmd/Ctrl + Shift + P &gt; SuperDesign: Initialize
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Design Quality Issues&lt;/h3&gt;
&lt;h4&gt;Generic-Looking Results&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Using vague prompts like “make it beautiful”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Provide specific design requirements, references, and constraints&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Inconsistent Styling&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Not establishing design system early&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Define color palettes, typography, and component patterns before implementation&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Poor Responsive Behavior&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Desktop-first approach without mobile consideration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Test designs across device sizes throughout development&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Performance Problems&lt;/h3&gt;
&lt;h4&gt;Slow Loading Times&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Analyze this codebase for performance bottlenecks and suggest optimizations for:
- Bundle size reduction
- Asset optimization
- Lazy loading implementation
- Critical rendering path
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Browser Compatibility Issues&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Ensure this code works across modern browsers:
- Add necessary polyfills
- Use progressive enhancement
- Implement fallbacks for newer CSS features
- Test in Chrome, Firefox, Safari, Edge
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Advanced Techniques&lt;/h2&gt;
&lt;h3&gt;Multi-Tool Workflows&lt;/h3&gt;
&lt;p&gt;Combine multiple tools for maximum effectiveness:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SuperDesign&lt;/strong&gt; for initial layout and theming&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ShadCN MCP&lt;/strong&gt; for component implementation&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FireCrawl&lt;/strong&gt; for reference and inspiration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Figma MCP&lt;/strong&gt; for design system integration&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Custom Workflow Automation&lt;/h3&gt;
&lt;p&gt;Create project-specific commands:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;File&lt;/strong&gt;: &lt;code&gt;commands/design-system.md&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-markdown&quot;&gt;# Custom Design System Workflow

When building with our design system:
1. Use these color variables: [your colors]
2. Apply these typography scales: [your fonts]
3. Follow these spacing patterns: [your spacing]
4. Implement these animation principles: [your animations]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Framework Integration&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Convert this design to:
- Next.js with App Router
- React with TypeScript
- Vue.js with Composition API
- Svelte with SvelteKit
- Pure HTML/CSS/JavaScript
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;p&gt;🧠 Remember: The best AI-generated designs come from clear requirements, iterative refinement, and leveraging the right tools for each phase of development. Start with one method that matches your project needs, then gradually incorporate other techniques as you become more comfortable with the workflow.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.B-YgLXdc.png"/><enclosure url="/_astro/hero.B-YgLXdc.png"/><author>Mayur Chavhan</author></item><item><title>Amazon Q Developer CLI: Complete Guide for DevOps and Development Teams</title><link>https://techwhale.in/amazon-q-developer-cli-complete-guide-for-devops-and-development-teams</link><guid isPermaLink="true">https://techwhale.in/amazon-q-developer-cli-complete-guide-for-devops-and-development-teams</guid><description>Amazon Q Developer CLI: Complete Guide for DevOps and Development Teams</description><pubDate>Fri, 20 Jun 2025 18:52:00 GMT</pubDate><content:encoded>&lt;h2&gt;1. Introduction &amp;#x26; Benefits Analysis&lt;/h2&gt;
&lt;h3&gt;What is Amazon Q Developer CLI&lt;/h3&gt;
&lt;p&gt;Amazon Q Developer CLI is a generative AI-powered conversational assistant that revolutionizes command-line development workflows. Unlike traditional AWS CLI tools, Amazon Q Developer CLI combines natural language processing with direct access to AWS services, enabling developers to interact with their infrastructure through conversational interfaces. The tool integrates contextual information from your local development environment, providing enhanced understanding of your specific use case and delivering relevant, context-aware responses.&lt;/p&gt;
&lt;h3&gt;Key Differences from Other AWS CLI Tools&lt;/h3&gt;
&lt;p&gt;🧠 &lt;strong&gt;Brain Mode: Key Differentiators&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Amazon Q Developer CLI stands apart from traditional AWS CLI tools in several fundamental ways. While the standard AWS CLI requires memorizing specific command syntax and parameters, Amazon Q Developer CLI accepts natural language instructions and translates them into executable commands. This represents a paradigm shift from command-based interfaces to conversation-based development workflows.&lt;/p&gt;
&lt;p&gt;The tool’s AI agent capabilities allow it to understand context, maintain conversation history, and provide iterative improvements based on feedback. Unlike static CLI tools that execute single commands, Amazon Q Developer CLI can perform multi-step operations, analyze outputs, and make intelligent decisions about next steps.&lt;/p&gt;
&lt;p&gt;Amazon Q Developer CLI supports hundreds of popular command-line tools including git, npm, docker, and aws, providing IDE-style autocompletion and contextual suggestions. The enhanced CLI agent, powered by Claude 3.7 Sonnet, can read and write files locally, query AWS resources, and create code iteratively based on user feedback.&lt;/p&gt;
&lt;h3&gt;Integration Capabilities with Existing AWS Toolchain&lt;/h3&gt;
&lt;p&gt;The CLI integrates seamlessly with existing AWS profiles and credentials, supporting both AWS Builder ID authentication for free tier usage and IAM Identity Center integration for enterprise Pro tier subscriptions. It works alongside traditional AWS CLI installations, respecting existing profile configurations and credential management.&lt;/p&gt;
&lt;p&gt;Amazon Q Developer CLI features Console-to-Code functionality that records AWS Management Console actions and generates corresponding CLI commands or Infrastructure as Code templates in multiple formats including CDK Java, Python, TypeScript, and CloudFormation JSON/YAML. This bridges the gap between console-based prototyping and production-ready automation code.&lt;/p&gt;
&lt;h3&gt;Performance Improvements and Productivity Gains&lt;/h3&gt;
&lt;p&gt;Internal Amazon studies demonstrate significant productivity improvements with Amazon Q Developer CLI usage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;80% faster development tasks&lt;/strong&gt; across common software development workflows&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;40% boost in developer productivity&lt;/strong&gt; through AI-assisted code generation and debugging&lt;/li&gt;
&lt;li&gt;Amazon engineers upgraded &lt;strong&gt;50% of their production Java systems&lt;/strong&gt; using the tool, saving an estimated &lt;strong&gt;4,500 developer-years of effort&lt;/strong&gt; and &lt;strong&gt;$260M in annualized efficiency gains&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tool optimizes AWS operations and cloud cost efficiency by providing intelligent recommendations for resource utilization and suggesting cost-effective alternatives during infrastructure provisioning.&lt;/p&gt;
&lt;h2&gt;2. Installation &amp;#x26; Setup Guide&lt;/h2&gt;
&lt;h3&gt;macOS Installation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Method 1: Direct Download&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the macOS installer (.dmg file) from the official AWS documentation page&lt;/li&gt;
&lt;li&gt;Open the downloaded .dmg file&lt;/li&gt;
&lt;li&gt;Drag the Amazon Q app into your Applications folder&lt;/li&gt;
&lt;li&gt;Launch the application and follow the setup wizard&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Method 2: Homebrew Installation&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install amazon-q
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Post-Installation Setup for macOS:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable shell integrations when prompted&lt;/li&gt;
&lt;li&gt;Grant accessibility permissions in System Settings → Privacy &amp;#x26; Security → Accessibility&lt;/li&gt;
&lt;li&gt;Complete authentication setup using your AWS Builder ID or IAM Identity Center credentials&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Linux Installation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Ubuntu/Debian Package Installation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Update package list
sudo apt update

# Install required dependencies
sudo apt install libfuse2 curl unzip

# Download the Debian package
curl --proto &apos;=https&apos; --tlsv1.2 -sSf https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.deb -o amazon-q.deb

# Install the package
sudo apt install -y ./amazon-q.deb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;AppImage Installation (GUI Required):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Download AppImage
curl --proto &apos;=https&apos; --tlsv1.2 -sSf https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.appimage -o amazon-q.appimage

# Make executable
chmod +x amazon-q.appimage

# Run the AppImage
./amazon-q.appimage
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Zip File Installation (Headless Environments):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Download installer
curl --proto &apos;=https&apos; --tlsv1.2 -sSf &quot;https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip&quot; -o &quot;q.zip&quot;

# Extract and install
unzip q.zip
cd q
chmod +x install.sh
./install.sh

# Source your shell configuration or restart terminal
source ~/.bashrc  # or ~/.zshrc for zsh users
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Windows Installation (via WSL)&lt;/h3&gt;
&lt;p&gt;Amazon Q Developer CLI does not have native Windows support as of June 2025, requiring Windows Subsystem for Linux (WSL) for installation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Install WSL&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;wsl --install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Launch Ubuntu Environment&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-cmd&quot;&gt;wsl -d Ubuntu
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Install Amazon Q Developer CLI in WSL&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Navigate to home directory
cd
pwd  # Should show /home/your-username

# Download installer
curl --proto &apos;=https&apos; --tlsv1.2 -sSf https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-x86_64-linux-musl.zip -o q.zip

# Install unzip if needed
sudo apt install unzip

# Extract and install
unzip q.zip
cd q
chmod +x install.sh
./install.sh

# Restart shell
bash
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Authentication Setup and Configuration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;AWS Builder ID Authentication (Free Tier):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q login
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Select “Use for Free with Builder ID” when prompted. This opens a browser window for authentication. The Builder ID provides access to free tier features without requiring an AWS account.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IAM Identity Center Authentication (Pro Tier):&lt;/strong&gt; For Pro tier subscriptions, organizations must configure IAM Identity Center and create appropriate permission sets. Users authenticate using their organization’s start URL provided by AWS administrators.&lt;/p&gt;
&lt;h3&gt;Initial Configuration and Profile Management&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Verify Installation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q --version
q doctor  # Diagnoses configuration issues
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Configure Editor Preference:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Set preferred editor for multi-line prompts
export EDITOR=nano  # or vim, code, etc.

# Make permanent by adding to shell config
echo &apos;export EDITOR=nano&apos; &gt;&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Integration Settings:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Enable/disable inline completions
q inline enable
q inline disable

# Configure MCP server timeout
q settings mcp.initTimeout 5000  # 5 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Integration with Existing AWS CLI Profiles&lt;/h3&gt;
&lt;p&gt;Amazon Q Developer CLI respects existing AWS CLI profiles and credentials. It uses the same credential resolution order as the standard AWS CLI:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)&lt;/li&gt;
&lt;li&gt;AWS credentials file (~/.aws/credentials)&lt;/li&gt;
&lt;li&gt;AWS config file (~/.aws/config)&lt;/li&gt;
&lt;li&gt;IAM roles for EC2 instances&lt;/li&gt;
&lt;li&gt;IAM roles for ECS tasks&lt;/li&gt;
&lt;li&gt;IAM roles for Lambda functions&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use specific AWS profile
export AWS_PROFILE=my-profile
q chat &quot;List S3 buckets in us-west-2&quot;

# Or specify profile in conversation
q chat &quot;Using the production profile, show me EC2 instances&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;3. AWS Infrastructure Automation&lt;/h2&gt;
&lt;h3&gt;Practical Examples for Common AWS Infrastructure Tasks&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;EC2 Instance Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Launch a new t3.micro EC2 instance in us-east-1 with Amazon Linux 2&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Amazon Q Developer CLI will generate and execute the appropriate AWS CLI commands, handling subnet selection, security group configuration, and key pair management based on your account’s existing resources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;S3 Bucket Operations:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Create an S3 bucket with versioning enabled and set up lifecycle policies to transition objects to IA after 30 days&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;RDS Database Deployment:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Deploy a MySQL RDS instance with Multi-AZ enabled and automated backups configured for 7-day retention&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Infrastructure as Code (IaC) Integration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;CloudFormation Integration:&lt;/strong&gt; Amazon Q Developer CLI can generate CloudFormation templates based on natural language descriptions:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Generate a CloudFormation template for a three-tier web application with ALB, Auto Scaling Group, and RDS&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The tool generates both JSON and YAML CloudFormation templates, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Resource definitions with appropriate properties&lt;/li&gt;
&lt;li&gt;Parameter sections for customization&lt;/li&gt;
&lt;li&gt;Output sections for cross-stack references&lt;/li&gt;
&lt;li&gt;Proper dependency management&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;CDK Integration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Create a CDK Python stack for a serverless application with API Gateway, Lambda, and DynamoDB&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Generates CDK code in multiple languages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;C#/.NET&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Console-to-Code Workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Perform actions in AWS Management Console&lt;/li&gt;
&lt;li&gt;Use Console-to-Code to record actions&lt;/li&gt;
&lt;li&gt;Generate equivalent CLI commands or IaC templates:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# After recording console actions
q chat &quot;Convert my recorded console actions to Terraform configuration&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Automated Deployment Pipelines and CI/CD Integration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;GitHub Actions Integration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;name: Deploy with Amazon Q
on: [push]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Amazon Q CLI
        run: |
          curl -sSf https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip -o q.zip
          unzip q.zip &amp;#x26;&amp;#x26; ./q/install.sh
      - name: Deploy Infrastructure
        run: |
          q chat &quot;Deploy the infrastructure defined in ./infra/ directory&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;AWS CodePipeline Integration:&lt;/strong&gt; Amazon Q Developer CLI can generate CodePipeline configurations and integrate with existing CI/CD workflows:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Create a CodePipeline that builds my Node.js app from GitHub and deploys to ECS&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Resource Provisioning and Management Workflows&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Multi-Environment Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Development environment setup
q chat &quot;Create a development environment with smaller instance types and single-AZ deployment&quot;

# Production environment setup
q chat &quot;Create a production environment with high availability, auto-scaling, and monitoring&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Resource Tagging and Organization:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Apply consistent tagging strategy across all resources with Environment, Project, and Owner tags&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Cost Optimization Automation Strategies&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Right-Sizing Recommendations:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Analyze my EC2 instances and recommend right-sizing opportunities&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Reserved Instance Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Analyze my usage patterns and recommend Reserved Instance purchases&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Automated Cleanup:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Identify and clean up unused EBS volumes, unattached Elastic IPs, and outdated AMIs&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;4. Application Development Features&lt;/h2&gt;
&lt;h3&gt;Code Generation and Scaffolding Capabilities&lt;/h3&gt;
&lt;p&gt;Amazon Q Developer CLI excels at generating complete application scaffolds and boilerplate code. The enhanced CLI agent can create entire project structures based on natural language descriptions:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Web Application Scaffolding:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Build a simple fact checking app&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command generates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Complete project structure with appropriate directories&lt;/li&gt;
&lt;li&gt;Package.json with necessary dependencies&lt;/li&gt;
&lt;li&gt;Basic HTML templates and CSS styling&lt;/li&gt;
&lt;li&gt;JavaScript/Python backend code with API endpoints&lt;/li&gt;
&lt;li&gt;Database schema and migration files&lt;/li&gt;
&lt;li&gt;README documentation with setup instructions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Microservice Architecture Generation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Create a microservices architecture with user authentication, product catalog, and order processing services using Node.js and Docker&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Integration with Popular IDEs and Development Environments&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;VS Code Integration:&lt;/strong&gt; While Amazon Q Developer CLI operates from the terminal, it integrates seamlessly with IDE workflows:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Open current project in VS Code and start Q chat
code .
q chat &quot;Analyze this codebase and suggest architectural improvements&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Terminal-Based Development:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Multi-line prompt composition using /editor command
q chat
Amazon Q&gt; /editor
# Opens your preferred editor for complex prompts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;SSH Integration for Remote Development:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install SSH integration for remote servers
q integrations install ssh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This enables Amazon Q Developer CLI functionality when working on remote servers via SSH.&lt;/p&gt;
&lt;h3&gt;Debugging and Troubleshooting Assistance&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error Analysis and Resolution:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;My Express.js application is throwing &apos;Cannot read property of undefined&apos; errors. Help me debug this issue.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Amazon Q analyzes error messages, examines code context, and provides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Root cause identification&lt;/li&gt;
&lt;li&gt;Step-by-step debugging instructions&lt;/li&gt;
&lt;li&gt;Code fixes with explanations&lt;/li&gt;
&lt;li&gt;Prevention strategies for similar issues&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Log Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Analyze these CloudWatch logs and identify the cause of high response times&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Performance Troubleshooting:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;My Lambda function is experiencing cold start issues. Optimize it for better performance.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Code Review and Optimization Suggestions&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Automated Code Review:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Select code and request review
q chat &quot;Review this Python function for security vulnerabilities and performance improvements&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Code Quality Enhancement:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Refactor this code to follow clean code principles and improve maintainability&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Security Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Scan this code for security vulnerabilities and suggest fixes&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Testing Automation and Quality Assurance Features&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Unit Test Generation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Generate comprehensive unit tests for this user authentication module&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Integration Test Creation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Create integration tests for my REST API endpoints with different scenarios&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Test-Driven Development Support:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Help me write tests first for a shopping cart feature, then implement the functionality&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;5. AWS Infrastructure Visualization&lt;/h2&gt;
&lt;h3&gt;Creating Architecture Diagrams and Infrastructure Graphs&lt;/h3&gt;
&lt;p&gt;Amazon Q Developer CLI can generate AWS architecture diagrams when integrated with MCP (Model Context Protocol) servers. This powerful combination enables automated diagram creation from natural language descriptions:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Setup MCP for Architecture Diagrams:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install uv for MCP server management
sudo snap install astral-uv --classic

# Create MCP configuration
mkdir -p ~/.aws/amazonq
cat &gt; ~/.aws/amazonq/mcp.json  /compact
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Editor Integration for Complex Prompts:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use /editor for multi-line prompts
Amazon Q&gt; /editor

# Set permanent editor preference
export EDITOR=code  # or vim, nano, etc.
echo &apos;export EDITOR=code&apos; &gt;&gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Scripting and Automation Workflows&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Automated Deployment Scripts:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/bin/bash
# deploy.sh - Automated deployment script

# Start Q session and deploy
q chat --no-interactive --trust-all-tools &quot;
Deploy the application in ./src directory to AWS:
1. Build the Docker image
2. Push to ECR
3. Update ECS service
4. Verify deployment health
&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Infrastructure Provisioning Automation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# infrastructure-setup.sh
q chat --no-interactive &quot;
Create production infrastructure:
- VPC with public/private subnets
- Application Load Balancer
- ECS cluster with Fargate
- RDS MySQL with Multi-AZ
- CloudWatch logging and monitoring
&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Integration with Other AWS Services and Third-Party Tools&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;GitHub Integration:&lt;/strong&gt; Amazon Q Developer CLI provides direct GitHub integration for automated workflows:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Review this pull request and suggest improvements&quot;
q chat &quot;Create a new feature branch and implement user authentication&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Docker Integration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Containerize my Python application and create optimal Dockerfile&quot;
q chat &quot;Set up multi-stage Docker build for production deployment&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Terraform Integration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Convert my CloudFormation templates to Terraform configuration&quot;
q chat &quot;Generate Terraform modules for reusable infrastructure components&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Security Best Practices and Access Management&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;IAM Policy Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Review my IAM policies for least privilege compliance&quot;
q chat &quot;Create role-based access control for my development team&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Security Group Optimization:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Audit my security groups and recommend improvements&quot;
q chat &quot;Implement network segmentation best practices&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Credential Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Use IAM roles instead of long-term credentials
q chat &quot;Help me configure IAM roles for EC2 instances instead of using access keys&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Performance Optimization Techniques&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Query Optimization:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use specific, detailed prompts rather than vague requests&lt;/li&gt;
&lt;li&gt;Provide context about your environment and goals&lt;/li&gt;
&lt;li&gt;Break complex tasks into smaller, focused questions&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Resource Efficiency:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Efficient resource usage
q chat --trust-tools=fs_read,fs_write &quot;Optimize my code for better performance&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Conversation Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Start fresh conversations for different topics
Amazon Q&gt; /clear

# Use context effectively
Amazon Q&gt; /context path/to/relevant/files
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;7. Pricing &amp;#x26; Limitations Analysis&lt;/h2&gt;
&lt;h3&gt;Detailed Comparison of Free Tier vs. Paid Plans&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Amazon Q Developer Free Tier (Free):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Code Suggestions:&lt;/strong&gt; Unlimited in IDE and CLI&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CLI Completions:&lt;/strong&gt; Free for public CLI tools&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chat Interactions:&lt;/strong&gt; 50 interactions per month in IDE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software Development Agents:&lt;/strong&gt; 10 invocations per month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Transformation:&lt;/strong&gt; 1,000 lines of code per month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS Account Queries:&lt;/strong&gt; 25 queries per month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Console Error Diagnosis:&lt;/strong&gt; Included&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;License Reference Tracking:&lt;/strong&gt; Included&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Amazon Q Developer Pro Tier ($19/month per user):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;All Free Tier Features:&lt;/strong&gt; Plus enhanced capabilities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chat Interactions:&lt;/strong&gt; Unlimited in IDE&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Software Development Agents:&lt;/strong&gt; Unlimited invocations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Transformation:&lt;/strong&gt; 4,000 lines of code per month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS Account Queries:&lt;/strong&gt; Unlimited&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generative SQL:&lt;/strong&gt; 1,000 queries per month&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enterprise Access Controls:&lt;/strong&gt; IAM Identity Center integration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Customization:&lt;/strong&gt; Adapt to your codebase for better suggestions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional Charge:&lt;/strong&gt; $0.003 per line for Java transformation beyond monthly limit&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Feature Limitations and Usage Quotas&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Free Tier Limitations:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Limited monthly interactions may restrict heavy usage&lt;/li&gt;
&lt;li&gt;AWS account resource queries capped at 25 per month&lt;/li&gt;
&lt;li&gt;Code transformation limited to 1,000 lines monthly&lt;/li&gt;
&lt;li&gt;Content may be used for service improvement&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Pro Tier Quotas:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Most features have high or unlimited usage limits&lt;/li&gt;
&lt;li&gt;Code transformation pooled at account level (4,000 lines/month)&lt;/li&gt;
&lt;li&gt;Some internal quotas exist (e.g., 30 software development agent invocations/month)&lt;/li&gt;
&lt;li&gt;No direct upgrade path from Builder ID to Pro tier - requires new subscription&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Cost-Benefit Analysis for Different Team Sizes&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Individual Developers:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Free Tier:&lt;/strong&gt; Suitable for occasional use, personal projects, learning&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pro Tier ($19/month):&lt;/strong&gt; Cost-effective for professional developers with regular AI assistance needs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Small Teams (2-10 developers):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Monthly Cost:&lt;/strong&gt; $38-$190 for Pro tier&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ROI Calculation:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Average developer hourly cost: $50-$100&lt;/li&gt;
&lt;li&gt;Time savings: 5-6 hours per week per developer&lt;/li&gt;
&lt;li&gt;Monthly savings: $1,000-$2,400 per developer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ROI:&lt;/strong&gt; 500-1,200% return on investment&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Enterprise Teams (50+ developers):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Monthly Cost:&lt;/strong&gt; $950+ for Pro tier&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Standardized development practices&lt;/li&gt;
&lt;li&gt;Reduced onboarding time for new developers&lt;/li&gt;
&lt;li&gt;Consistent code quality across teams&lt;/li&gt;
&lt;li&gt;Enterprise security and access controls&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Migration Path from Free to Paid Plans&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Important Migration Considerations:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No direct upgrade path from Builder ID to Pro tier&lt;/li&gt;
&lt;li&gt;Users must create new IAM Identity Center accounts for Pro access&lt;/li&gt;
&lt;li&gt;Existing conversations and settings don’t transfer&lt;/li&gt;
&lt;li&gt;Organizations need IAM Identity Center setup before Pro activation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Migration Steps:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set up IAM Identity Center in AWS account&lt;/li&gt;
&lt;li&gt;Subscribe to Amazon Q Developer Pro in AWS console&lt;/li&gt;
&lt;li&gt;Create user groups and assign permissions&lt;/li&gt;
&lt;li&gt;Users sign out of Builder ID sessions&lt;/li&gt;
&lt;li&gt;Users authenticate with IAM Identity Center credentials&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Alternative Tools Comparison&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Primary Alternatives:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ChatGPT:&lt;/strong&gt; General-purpose AI assistant, not AWS-specific&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GitHub Copilot:&lt;/strong&gt; IDE-focused, limited CLI capabilities&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cody (Sourcegraph):&lt;/strong&gt; Code-centric, enterprise context awareness&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windsurf Editor:&lt;/strong&gt; IDE with built-in AI assistance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;When to Choose Amazon Q Developer CLI:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Heavy AWS infrastructure management&lt;/li&gt;
&lt;li&gt;Need for CLI-based AI assistance&lt;/li&gt;
&lt;li&gt;Integration with existing AWS toolchain&lt;/li&gt;
&lt;li&gt;Cost optimization and AWS best practices guidance&lt;/li&gt;
&lt;li&gt;Console-to-Code workflow requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;8. Real-World Workflow Integration&lt;/h2&gt;
&lt;h3&gt;DevOps Pipeline Integration Examples&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;CI/CD Pipeline Enhancement:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# In GitHub Actions workflow
- name: Deploy with Amazon Q
  run: |
    q chat --no-interactive --trust-all-tools &quot;
    Deploy application to staging environment:
    1. Run test suite
    2. Build Docker image
    3. Deploy to ECS staging cluster
    4. Run smoke tests
    5. If successful, promote to production
    &quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Infrastructure Drift Detection:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Scheduled drift detection script
#!/bin/bash
q chat --no-interactive &quot;
Check for infrastructure drift:
1. Compare current AWS resources with Terraform state
2. Identify any manual changes
3. Generate drift report
4. Send alert if discrepancies found
&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Developer Workflow Optimization Scenarios&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Feature Development Workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Start new feature
q chat &quot;Create a new feature branch for user authentication and set up basic structure&quot;

# During development
q chat &quot;Review my authentication code for security best practices&quot;

# Pre-commit checks
q chat &quot;Run code quality checks and fix any issues before committing&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Code Review Acceleration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Automated code review
q chat &quot;Analyze this pull request for potential issues, security vulnerabilities, and performance improvements&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Team Collaboration Features and Setup&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Shared Configuration Management:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;// .q-config.json - Team-shared configuration
{
  &quot;profiles&quot;: {
    &quot;development&quot;: {
      &quot;aws_profile&quot;: &quot;dev&quot;,
      &quot;default_region&quot;: &quot;us-west-2&quot;
    },
    &quot;production&quot;: {
      &quot;aws_profile&quot;: &quot;prod&quot;,
      &quot;default_region&quot;: &quot;us-east-1&quot;
    }
  },
  &quot;trusted_tools&quot;: [&quot;fs_read&quot;, &quot;fs_write&quot;, &quot;use_aws&quot;],
  &quot;editor&quot;: &quot;code&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Team Best Practices:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Standardized deployment commands
alias deploy-dev=&quot;q chat --profile development --trust-all-tools &apos;Deploy to development environment&apos;&quot;
alias deploy-prod=&quot;q chat --profile production &apos;Deploy to production with approval checks&apos;&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Monitoring and Alerting Integration&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Proactive Monitoring Setup:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Set up comprehensive monitoring for my web application including:
- Application performance metrics
- Infrastructure health checks
- Custom business metrics
- Automated alerting for anomalies&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Alert Response Automation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Incident response script
q chat &quot;Investigate the high CPU alert:
1. Check CloudWatch metrics for the affected instances
2. Analyze application logs for errors
3. Suggest immediate mitigation steps
4. Create incident report&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Incident Response and Troubleshooting Workflows&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Systematic Troubleshooting Process:&lt;/strong&gt; Amazon Q Developer CLI provides structured incident response capabilities:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Our production NGINX application is experiencing 502 Gateway Timeout errors. Help investigate and diagnose the issue.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The tool systematically:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Discovers infrastructure components (ECS clusters, services, tasks)&lt;/li&gt;
&lt;li&gt;Checks service health and status&lt;/li&gt;
&lt;li&gt;Analyzes logs across multiple services&lt;/li&gt;
&lt;li&gt;Identifies root causes through correlation&lt;/li&gt;
&lt;li&gt;Provides step-by-step remediation guidance&lt;/li&gt;
&lt;li&gt;Validates fixes and confirms resolution&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Automated Log Analysis:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;Analyze the last hour of CloudWatch logs to identify the cause of increased error rates&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Performance Issue Resolution:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;q chat &quot;My database is experiencing slow query performance. Help identify bottlenecks and optimize queries.&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;9. Quick Reference &amp;#x26; Troubleshooting&lt;/h2&gt;
&lt;h3&gt;Essential Commands Reference&lt;/h3&gt;
&lt;p&gt;| Command | Description | Example |
| --- | --- | --- |
| &lt;code&gt;q login&lt;/code&gt; | Authenticate with Builder ID or IAM Identity Center | &lt;code&gt;q login&lt;/code&gt; |
| &lt;code&gt;q chat&lt;/code&gt; | Start interactive chat session | &lt;code&gt;q chat &quot;help with deployment&quot;&lt;/code&gt; |
| &lt;code&gt;q chat --resume&lt;/code&gt; | Resume previous conversation | &lt;code&gt;q chat --resume&lt;/code&gt; |
| &lt;code&gt;q --version&lt;/code&gt; | Show CLI version | &lt;code&gt;q --version&lt;/code&gt; |
| &lt;code&gt;q doctor&lt;/code&gt; | Diagnose configuration issues | &lt;code&gt;q doctor&lt;/code&gt; |
| &lt;code&gt;q inline enable/disable&lt;/code&gt; | Toggle autocomplete | &lt;code&gt;q inline disable&lt;/code&gt; |
| &lt;code&gt;/editor&lt;/code&gt; | Open text editor for complex prompts | &lt;code&gt;/editor&lt;/code&gt; |
| &lt;code&gt;/clear&lt;/code&gt; | Start new conversation | &lt;code&gt;/clear&lt;/code&gt; |
| &lt;code&gt;/compact&lt;/code&gt; | Get concise responses | &lt;code&gt;/compact&lt;/code&gt; |
| &lt;code&gt;/context&lt;/code&gt; | Add files to conversation | &lt;code&gt;/context path/to/file&lt;/code&gt; |&lt;/p&gt;
&lt;h3&gt;Common Troubleshooting Issues&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Installation Issues:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Terminal not detecting q command&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Restart terminal or source shell config
source ~/.bashrc  # or ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Permission denied errors on Linux&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;chmod +x install.sh
./install.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Authentication Issues:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Bearer token refresh errors&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;rm ~/.aws/qcodetransform/credentials.json
qct transform  # Re-authenticate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Builder ID to Pro tier transition&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cannot directly upgrade from Builder ID to Pro tier&lt;/li&gt;
&lt;li&gt;Must create new IAM Identity Center account&lt;/li&gt;
&lt;li&gt;Sign out of existing session before authenticating with Pro credentials&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Performance Issues:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Slow response times&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use more specific prompts&lt;/li&gt;
&lt;li&gt;Break complex requests into smaller tasks&lt;/li&gt;
&lt;li&gt;Check internet connectivity and AWS service status&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;CLI integration not working after autostart&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Manually restart the Amazon Q CLI service&lt;/li&gt;
&lt;li&gt;Check accessibility permissions on macOS&lt;/li&gt;
&lt;li&gt;Verify shell integration installation&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Links to Official Documentation&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/what-is.html&quot;&gt;Amazon Q Developer User Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html&quot;&gt;Command Line Installation Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://aws.amazon.com/q/developer/pricing/&quot;&gt;Amazon Q Developer Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/aws/amazon-q-developer-cli&quot;&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-reference.html&quot;&gt;CLI Command Reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/qdev-mcp.html&quot;&gt;MCP Integration Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;</content:encoded><h:img src="/_astro/hero.CWBYQ184.jpg"/><enclosure url="/_astro/hero.CWBYQ184.jpg"/><author>Mayur Chavhan</author></item><item><title>The Complete Beginner&apos;s Guide to uv: Python&apos;s Lightning-Fast Package Manager</title><link>https://techwhale.in/the-complete-beginners-guide-to-uv-pythons-lightning-fast-package-manager</link><guid isPermaLink="true">https://techwhale.in/the-complete-beginners-guide-to-uv-pythons-lightning-fast-package-manager</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Tue, 03 Jun 2025 13:53:00 GMT</pubDate><content:encoded>&lt;p&gt;uv is a modern, high-performance Python package manager written in Rust that serves as a drop-in replacement for traditional tools like pip, pip-tools, virtualenv, poetry, and more. With speeds up to 100x faster than pip and a unified approach to Python project management, uv represents the next generation of Python tooling.&lt;/p&gt;
&lt;p&gt;🧠 &lt;strong&gt;Why uv Matters&lt;/strong&gt;: Unlike traditional Python package managers that evolved separately over time, uv was designed from the ground up as a unified solution. It combines package installation, dependency resolution, virtual environment management, Python version handling, and project scaffolding into a single, lightning-fast tool. This means fewer commands to remember, faster installations, and a more consistent development experience.&lt;/p&gt;
&lt;h2&gt;What Makes uv Special&lt;/h2&gt;
&lt;p&gt;uv offers several compelling advantages over existing tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Extreme Speed&lt;/strong&gt;: 10-100x faster than pip, with installations completing in seconds rather than minutes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;All-in-One Solution&lt;/strong&gt;: Replaces pip, pip-tools, virtualenv, poetry, pyenv, and more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Drop-in Compatibility&lt;/strong&gt;: Works with existing pip workflows and requirements.txt files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern Architecture&lt;/strong&gt;: Built in Rust for optimal performance and reliability&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic Environment Management&lt;/strong&gt;: Handles virtual environments seamlessly behind the scenes&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Installation&lt;/h2&gt;
&lt;p&gt;Getting started with uv is straightforward, with multiple installation options to suit different preferences:&lt;/p&gt;
&lt;h3&gt;Quick Installation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;For Unix/Linux/macOS:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -LsSf https://astral.sh/uv/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;For Windows:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-powershell&quot;&gt;powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/install.ps1 | iex&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Alternative Installation Methods&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Via Homebrew (macOS):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install uv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Via pip (if you have Python already):&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pip install uv
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Verify Installation:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;uv --version
# Output: uv 0.7.9 (or latest version)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Core Project Management&lt;/h2&gt;
&lt;h3&gt;Creating a New Python Project from Scratch&lt;/h3&gt;
&lt;p&gt;🧠 &lt;strong&gt;Project Creation Philosophy&lt;/strong&gt;: uv takes an opinionated approach to project structure, automatically setting up best practices that many developers configure manually. This includes proper directory structure, configuration files, and even Git initialization.&lt;/p&gt;
&lt;h4&gt;Basic Project Creation&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create a simple application project
uv init my-awesome-app
cd my-awesome-app

# View the created structure
ls -la
# Output:
# .python-version
# README.md
# main.py
# pyproject.toml
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Project Type Options&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# For installable packages
uv init my-package --package

# For libraries (with src/ layout)
uv init my-library --lib

# For applications (with app/ layout)
uv init my-web-app --app

# Minimal setup without sample files
uv init my-project --bare
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;Initialized project `my-awesome-app` at `/path/to/my-awesome-app`
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Initializing uv in an Existing Python Project&lt;/h3&gt;
&lt;p&gt;If you have an existing Python project, you can easily add uv support:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Navigate to your existing project
cd /path/to/existing-project

# Initialize uv (won&apos;t overwrite existing files)
uv init --bare

# Import existing requirements
uv add -r requirements.txt
uv add -r requirements-dev.txt --dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🧠 &lt;strong&gt;Compatibility Note&lt;/strong&gt;: uv is designed to work alongside existing Python projects. The &lt;code&gt;--bare&lt;/code&gt; flag ensures that uv won’t overwrite your existing main.py or README.md files, making migration safe and non-destructive.&lt;/p&gt;
&lt;h3&gt;Project Structure and Configuration Files&lt;/h3&gt;
&lt;h4&gt;Key Files Explained&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;pyproject.toml&lt;/strong&gt; - The central configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-toml&quot;&gt;[project]
name = &quot;my-awesome-app&quot;
version = &quot;0.1.0&quot;
description = &quot;My awesome Python application&quot;
readme = &quot;README.md&quot;
requires-python = &quot;&gt;=3.10&quot;
dependencies = [
    &quot;requests&gt;=2.28.0&quot;,
    &quot;fastapi&gt;=0.95.0&quot;,
]

[tool.uv]
dev-dependencies = [
    &quot;pytest&gt;=7.4.0&quot;,
    &quot;black&gt;=23.7.0&quot;,
    &quot;ruff&gt;=0.0.280&quot;,
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;.python-version&lt;/strong&gt; - Specifies the Python version for the project:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;3.11
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;uv.lock&lt;/strong&gt; - Automatically generated lockfile containing exact dependency versions (similar to package-lock.json in Node.js):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-toml&quot;&gt;version = 1

[[package]]
name = &quot;requests&quot;
version = &quot;2.30.0&quot;
dependencies = [&quot;certifi&gt;=2017.4.17&quot;, &quot;charset-normalizer&gt;=2.0.0&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🧠 &lt;strong&gt;Lockfile Benefits&lt;/strong&gt;: The uv.lock file ensures that everyone on your team gets exactly the same versions of dependencies, preventing the “it works on my machine” problem. Unlike pip’s requirements.txt, uv.lock includes transitive dependencies and cross-platform compatibility information.&lt;/p&gt;
&lt;h2&gt;Package Management&lt;/h2&gt;
&lt;h3&gt;Adding, Removing, and Updating Packages&lt;/h3&gt;
&lt;h4&gt;Adding Dependencies&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Add a basic package
uv add requests
# Output: Resolved 4 packages in 234ms
#         Installed 4 packages in 12ms
#         + certifi==2024.7.4
#         + charset-normalizer==3.3.2
#         + idna==3.7
#         + requests==2.32.3

# Add package with version constraint
uv add &quot;django&gt;=4.2.0,&amp;#x3C;5.0.0&quot;

# Add package with extras
uv add &quot;fastapi[all]&quot;

# Add multiple packages at once
uv add requests flask sqlalchemy
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Removing Dependencies&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Remove a package
uv remove requests
# Output: Removed 4 packages in 5ms
#         - certifi==2024.7.4
#         - charset-normalizer==3.3.2
#         - idna==3.7
#         - requests==2.32.3

# Remove multiple packages
uv remove flask sqlalchemy
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Updating Dependencies&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Update all dependencies
uv lock --upgrade

# Update specific package
uv lock --upgrade-package requests

# Update to latest compatible versions
uv add requests --upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Development vs Production Dependencies&lt;/h3&gt;
&lt;p&gt;uv provides clear separation between production and development dependencies:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Add production dependencies
uv add fastapi uvicorn

# Add development dependencies
uv add --dev pytest black ruff mypy

# Add to specific dependency groups
uv add --group test pytest pytest-cov
uv add --group lint black ruff
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;pyproject.toml structure:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-toml&quot;&gt;[project]
dependencies = [
    &quot;fastapi&gt;=0.100.0&quot;,
    &quot;uvicorn&gt;=0.20.0&quot;,
]

[tool.uv.dev-dependencies]
test = [
    &quot;pytest&gt;=7.4.0&quot;,
    &quot;pytest-cov&gt;=4.1.0&quot;,
]
lint = [
    &quot;black&gt;=23.7.0&quot;,
    &quot;ruff&gt;=0.0.280&quot;,
]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Version Constraints and Lock Files&lt;/h3&gt;
&lt;h4&gt;Version Constraint Examples&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Exact version
uv add &quot;django==4.2.7&quot;

# Minimum version
uv add &quot;requests&gt;=2.28.0&quot;

# Version range
uv add &quot;flask&gt;=2.0.0,&amp;#x3C;3.0.0&quot;

# Compatible release
uv add &quot;numpy~=1.24.0&quot;  # Equivalent to &gt;=1.24.0,&amp;#x3C;1.25.0

# Pre-release versions
uv add --prerelease=allow &quot;django&gt;=5.0.0&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Working with Lock Files&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Generate/update lock file
uv lock

# Install from lock file
uv sync

# Install only production dependencies
uv sync --no-dev

# Install with specific groups
uv sync --group test --group lint
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🧠 &lt;strong&gt;Lock File Strategy&lt;/strong&gt;: Always commit uv.lock to version control. This ensures that your CI/CD pipeline, production deployments, and teammate environments use exactly the same dependency versions, eliminating dependency-related bugs.&lt;/p&gt;
&lt;h3&gt;Installing from Different Sources&lt;/h3&gt;
&lt;h4&gt;PyPI (Default)&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;uv add requests  # Latest version from PyPI
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Git Repositories&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# From GitHub
uv add git+https://github.com/django/django.git

# Specific branch
uv add git+https://github.com/django/django.git@main

# Specific tag
uv add git+https://github.com/django/django.git@4.2.7

# Specific commit
uv add git+https://github.com/django/django.git@abc123def456
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Local Paths&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Local package in development
uv add ./my-local-package

# Editable install (changes reflected immediately)
uv add -e ./my-local-package

# From local wheel file
uv add ./dist/my-package-1.0.0-py3-none-any.whl
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Private Package Indexes&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Custom index
uv add --index https://my-private-pypi.com/simple/ my-private-package

# With authentication
UV_INDEX_USERNAME=myuser UV_INDEX_PASSWORD=mypass uv add my-private-package
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Virtual Environment Operations&lt;/h2&gt;
&lt;h3&gt;How uv Automatically Manages Virtual Environments&lt;/h3&gt;
&lt;p&gt;🧠 &lt;strong&gt;Automatic Environment Management&lt;/strong&gt;: One of uv’s biggest advantages is that it eliminates the manual virtual environment dance that Python developers have performed for years. No more remembering to activate environments or worrying about installing packages in the wrong place.&lt;/p&gt;
&lt;h4&gt;Comparison: Traditional vs uv Approach&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Traditional pip + virtualenv workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Manual process - easy to forget steps
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python main.py
deactivate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;uv workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Automatic - uv handles everything
uv run main.py  # Creates environment, installs dependencies, runs script
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Behind the Scenes&lt;/h4&gt;
&lt;p&gt;When you run &lt;code&gt;uv run&lt;/code&gt; or &lt;code&gt;uv sync&lt;/code&gt;, uv automatically:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Checks if a virtual environment exists (&lt;code&gt;.venv&lt;/code&gt; directory)&lt;/li&gt;
&lt;li&gt;Creates one if it doesn’t exist, using the Python version from &lt;code&gt;.python-version&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ensures all dependencies from &lt;code&gt;pyproject.toml&lt;/code&gt; are installed&lt;/li&gt;
&lt;li&gt;Runs your command in the proper environment&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Environment Activation and Deactivation&lt;/h3&gt;
&lt;p&gt;While uv manages environments automatically, you can still manually activate them when needed [^30]:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# uv creates environments in .venv by default
source .venv/bin/activate  # Unix/Linux/macOS
# or
.venv\Scripts\activate     # Windows

# Verify active environment
which python
# Output: /path/to/project/.venv/bin/python

# Deactivate
deactivate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;However, the recommended approach is to use &lt;code&gt;uv run&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Instead of activating, just use uv run
uv run python main.py
uv run pytest
uv run black .
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Listing and Switching Between Project Environments&lt;/h3&gt;
&lt;h4&gt;Viewing Environment Information&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Show installed packages
uv pip list
# Output: Package      Version
#         ------------ -------
#         requests     2.32.3
#         certifi      2024.7.4

# Show dependency tree
uv pip tree
# Output: requests==2.32.3
#         ├── certifi [required: &gt;=2017.4.17]
#         ├── charset-normalizer [required: &gt;=2.0.0]
#         └── idna [required: &gt;=2.5]

# Show package details
uv pip show requests
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Managing Multiple Python Versions&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# List available Python versions
uv python list

# Install specific Python version
uv python install 3.11
uv python install 3.12

# Pin Python version for project
uv python pin 3.11

# Create environment with specific Python version
uv venv --python 3.12
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Recreating or Resetting Virtual Environments&lt;/h3&gt;
&lt;h4&gt;Complete Environment Reset&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Remove environment and lock file
rm -rf .venv uv.lock

# Recreate from scratch
uv sync
# Output: Using CPython 3.11.7
#         Creating virtual environment at: .venv
#         Resolved 15 packages in 145ms
#         Installed 15 packages in 23ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Partial Reset Options&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Clear cache and reinstall
uv cache clean
uv sync --reinstall

# Reset lock file only
rm uv.lock
uv lock

# Sync with latest dependencies
uv sync --upgrade
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🧠 &lt;strong&gt;When to Reset&lt;/strong&gt;: Environment resets are useful when you suspect dependency corruption, want to test with latest versions, or need to change Python versions. The process is much faster with uv than traditional tools due to its caching system.&lt;/p&gt;
&lt;h2&gt;Project Cleanup and Maintenance&lt;/h2&gt;
&lt;h3&gt;Completely Removing a Project and Virtual Environment&lt;/h3&gt;
&lt;h4&gt;Full Project Cleanup&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Navigate out of project directory
cd ..

# Remove entire project (including .venv)
rm -rf my-project/

# Or keep source code, remove only uv files
cd my-project
rm -rf .venv uv.lock
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Selective Cleanup&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Remove only virtual environment
rm -rf .venv

# Remove lock file (will be regenerated)
rm uv.lock

# Remove build artifacts
rm -rf dist/ build/ *.egg-info/
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Cleaning Cache and Temporary Files&lt;/h3&gt;
&lt;h4&gt;Cache Management&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Show cache directory location
uv cache dir
# Output: /home/user/.cache/uv

# Check cache size
uv cache clean --dry-run
# Output: Would remove 1.2 GB from cache

# Clean entire cache
uv cache clean
# Output: Removed 1.2 GB from cache

# Clean specific package from cache
uv cache clean --package requests
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Disk Space Optimization&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# View cache statistics by package
du -sh ~/.cache/uv/*
# Output: 145M  archives
#         89M   builds
#         67M   wheels

# Clean old/unused cached items
uv cache clean --older-than 30d
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Resetting Dependencies and Starting Fresh&lt;/h3&gt;
&lt;h4&gt;Dependency Reset Strategies&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Strategy 1: Reset lock file, keep pyproject.toml
rm uv.lock
uv lock

# Strategy 2: Reset everything, reimport from requirements.txt
rm uv.lock pyproject.toml
uv init --bare
uv add -r requirements.txt

# Strategy 3: Update all dependencies to latest
uv lock --upgrade
uv sync
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Troubleshooting Dependency Issues&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Check for dependency conflicts
uv pip check
# Output: No broken requirements found.

# Verbose dependency resolution
uv lock --verbose

# Force reinstall all packages
uv sync --reinstall
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Best Practices for Project Organization&lt;/h3&gt;
&lt;h4&gt;Project Structure Recommendations [^25]:&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use consistent Python versions&lt;/strong&gt;: Pin specific versions in &lt;code&gt;.python-version&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Organize dependencies logically&lt;/strong&gt;: Separate dev, test, and production dependencies&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version control important files&lt;/strong&gt;: Always commit &lt;code&gt;pyproject.toml&lt;/code&gt; and &lt;code&gt;uv.lock&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ignore generated files&lt;/strong&gt;: Add &lt;code&gt;.venv/&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Document dependencies&lt;/strong&gt;: Maintain clear descriptions in &lt;code&gt;pyproject.toml&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;Example .gitignore for uv projects:&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-gitignore&quot;&gt;# Virtual environment
.venv/

# Build artifacts
dist/
build/
*.egg-info/

# Cache directories
__pycache__/
*.pyc
*.pyo

# IDE files
.vscode/
.idea/

# OS files
.DS_Store
Thumbs.db
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Framework-Specific Usage&lt;/h2&gt;
&lt;h3&gt;FastAPI Projects&lt;/h3&gt;
&lt;h4&gt;Quick FastAPI Setup&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create FastAPI project
uv init my-fastapi-app --app
cd my-fastapi-app

# Add FastAPI with all extras
uv add &quot;fastapi[standard]&quot;

# Add common FastAPI dependencies
uv add &quot;sqlalchemy&gt;=2.0.0&quot; &quot;alembic&gt;=1.11.0&quot; &quot;python-jose[cryptography]&quot;

# Add development dependencies
uv add --dev pytest pytest-asyncio httpx black ruff mypy

# Run development server
uv run fastapi dev
# Output: INFO:     Uvicorn running on http://127.0.0.1:8000
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;FastAPI Project Structure&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;my-fastapi-app/
├── .venv/                    # Virtual environment
├── .python-version           # Python version
├── pyproject.toml           # Dependencies and config
├── uv.lock                  # Lock file
├── app/
│   ├── __init__.py
│   ├── main.py              # FastAPI app
│   ├── models.py            # SQLAlchemy models
│   ├── schemas.py           # Pydantic schemas
│   └── routers/
│       ├── auth.py
│       └── users.py
├── tests/
│   ├── conftest.py
│   └── test_main.py
└── alembic/                 # Database migrations
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;FastAPI Development Commands&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Development server with auto-reload
uv run fastapi dev --host 0.0.0.0 --port 8080

# Production server
uv run fastapi run

# Testing
uv run pytest --cov=app

# Code quality
uv run black .
uv run ruff check .
uv run mypy app/

# Database migrations
uv run alembic revision --autogenerate -m &quot;Create tables&quot;
uv run alembic upgrade head
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Django Projects&lt;/h3&gt;
&lt;h4&gt;Django Project Setup&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Create project directory
mkdir my-django-project
cd my-django-project

# Initialize uv project
uv init --bare

# Add Django and common dependencies
uv add &quot;django&gt;=4.2.0&quot; &quot;django-cors-headers&gt;=4.0.0&quot; &quot;djangorestframework&gt;=3.14.0&quot;
uv add &quot;psycopg2-binary&gt;=2.9.0&quot;  # PostgreSQL driver

# Add development dependencies
uv add --dev &quot;django-debug-toolbar&gt;=4.1.0&quot; pytest pytest-django black ruff

# Create Django project structure
uv run django-admin startproject config .
uv run python manage.py startapp accounts
uv run python manage.py startapp core
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Django Development Commands&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Run development server
uv run python manage.py runserver

# Database operations
uv run python manage.py makemigrations
uv run python manage.py migrate
uv run python manage.py createsuperuser

# Django shell
uv run python manage.py shell

# Run tests
uv run pytest
uv run python manage.py test

# Collect static files
uv run python manage.py collectstatic
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Django Settings Configuration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;config/settings/base.py:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import environ

env = environ.Env(DEBUG=(bool, False))
environ.Env.read_env()

# Database
DATABASES = {
    &apos;default&apos;: {
        &apos;ENGINE&apos;: &apos;django.db.backends.postgresql&apos;,
        &apos;NAME&apos;: env(&apos;DB_NAME&apos;),
        &apos;USER&apos;: env(&apos;DB_USER&apos;),
        &apos;PASSWORD&apos;: env(&apos;DB_PASSWORD&apos;),
        &apos;HOST&apos;: env(&apos;DB_HOST&apos;, default=&apos;localhost&apos;),
        &apos;PORT&apos;: env(&apos;DB_PORT&apos;, default=&apos;5432&apos;),
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Framework-Specific Dependencies and Workflows&lt;/h3&gt;
&lt;h4&gt;Common Web Development Stack&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# FastAPI + PostgreSQL + Redis
uv add &quot;fastapi[standard]&quot; &quot;sqlalchemy[postgresql]&quot; &quot;redis&gt;=4.5.0&quot;

# Django + PostgreSQL + Celery
uv add &quot;django&gt;=4.2.0&quot; &quot;psycopg2-binary&quot; &quot;celery[redis]&quot; &quot;django-cors-headers&quot;

# Data Science Stack
uv add &quot;pandas&gt;=2.0.0&quot; &quot;numpy&gt;=1.24.0&quot; &quot;matplotlib&gt;=3.7.0&quot; &quot;jupyter&gt;=1.0.0&quot;

# Testing Stack
uv add --dev &quot;pytest&gt;=7.4.0&quot; &quot;pytest-cov&gt;=4.1.0&quot; &quot;pytest-mock&gt;=3.11.0&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Environment-Specific Configuration&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-toml&quot;&gt;# pyproject.toml
[project.optional-dependencies]
dev = [
    &quot;django-debug-toolbar&gt;=4.1.0&quot;,
    &quot;django-extensions&gt;=3.2.0&quot;,
]
prod = [
    &quot;gunicorn&gt;=21.0.0&quot;,
    &quot;whitenoise&gt;=6.5.0&quot;,
]
test = [
    &quot;pytest-django&gt;=4.5.0&quot;,
    &quot;factory-boy&gt;=3.3.0&quot;,
]
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Install different configurations
uv sync --extra dev         # Development
uv sync --extra prod --no-dev  # Production
uv sync --extra test        # Testing
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Advanced Tips and Comparisons&lt;/h2&gt;
&lt;h3&gt;Performance Benefits with Concrete Examples&lt;/h3&gt;
&lt;h4&gt;Real-World Performance Comparison&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Installing a typical Flask web application:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;pip&lt;/strong&gt;: 7.5 seconds (cold cache)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv&lt;/strong&gt;: 1.5 seconds (cold cache)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv with warm cache&lt;/strong&gt;: 0.15 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Large Django project with 100+ dependencies:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;pip&lt;/strong&gt;: 58 seconds (cold cache)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv&lt;/strong&gt;: 5.8 seconds (cold cache)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv with warm cache&lt;/strong&gt;: 0.5 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Performance Factors Behind uv’s Speed&lt;/h4&gt;
&lt;p&gt;🧠 &lt;strong&gt;Why uv is So Fast&lt;/strong&gt;: uv’s performance comes from several technical innovations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Rust Implementation&lt;/strong&gt;: Compiled code runs much faster than interpreted Python&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parallel Downloads&lt;/strong&gt;: Downloads multiple packages simultaneously&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Efficient Caching&lt;/strong&gt;: Global cache with hardlinks reduces disk I/O&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optimized Resolver&lt;/strong&gt;: Advanced dependency resolution algorithm&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Copy-on-Write&lt;/strong&gt;: Leverages modern filesystem features&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Workflow Improvements and Time-Saving Features&lt;/h3&gt;
&lt;h4&gt;Smart Caching System&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# First project setup
cd project1
uv add requests flask
# Downloads and caches packages

# Second project reuses cache
cd ../project2
uv add requests  # Instant - uses cached version
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Automatic Environment Management&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Traditional workflow
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
deactivate

# uv workflow
uv run main.py  # Everything happens automatically
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Development Tool Integration&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Run development tools without installation
uvx black .          # Format code
uvx ruff check .     # Lint code
uvx mypy src/        # Type checking
uvx pytest          # Run tests

# Install tools permanently for the project
uv tool install black
uv tool install ruff
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Integration with IDEs and Development Tools&lt;/h3&gt;
&lt;h4&gt;VS Code Integration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;.vscode/settings.json:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
    &quot;python.defaultInterpreterPath&quot;: &quot;./.venv/bin/python&quot;,
    &quot;python.terminal.activateEnvironment&quot;: false,
    &quot;python.testing.pytestEnabled&quot;: true,
    &quot;python.testing.pytestArgs&quot;: [&quot;tests/&quot;],
    &quot;python.formatting.provider&quot;: &quot;black&quot;,
    &quot;python.linting.enabled&quot;: true,
    &quot;python.linting.ruffEnabled&quot;: true
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;PyCharm Integration&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Set Project Interpreter&lt;/strong&gt;: File → Settings → Project → Python Interpreter&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Select Existing Environment&lt;/strong&gt;: Choose &lt;code&gt;.venv/bin/python&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configure Test Runner&lt;/strong&gt;: Use pytest with automatic discovery&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;CI/CD Integration&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;GitHub Actions Example:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;name: Test
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install uv
        uses: astral-sh/setup-uv@v1
      - name: Set up Python
        run: uv python install
      - name: Install dependencies
        run: uv sync
      - name: Run tests
        run: uv run pytest
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Common Troubleshooting Scenarios and Solutions&lt;/h3&gt;
&lt;h4&gt;Installation Issues&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Permission denied during installation&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Solution: Fix ownership or use alternative installation
sudo chown -R $USER ~/.local/share/uv
# or
pip install uv  # Alternative installation method
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Package not found&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Solution: Check package name and availability
uv add --dry-run package-name  # Test without installing
# or search PyPI directly
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Environment Issues&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Wrong Python version used&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Solution: Pin specific Python version
uv python pin 3.11
uv sync  # Recreate environment with correct version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Dependency conflicts&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Solution: Use verbose output to diagnose
uv lock --verbose
# Check for incompatible version constraints
uv pip check
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Performance Issues&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Slow installation despite uv’s reputation&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Solution: Check cache and network
uv cache clean  # Clear corrupted cache
UV_VERBOSITY=debug uv add package-name  # Debug output
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Migration Guide from pip/pipenv/poetry to uv&lt;/h3&gt;
&lt;h4&gt;From pip + virtualenv&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Current workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;New uv workflow:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;uv init --bare
uv add -r requirements.txt
uv run main.py
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;From Poetry&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Automated migration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;uvx migrate-to-uv  # Automatic conversion tool
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Manual migration:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;uv init --bare
# Copy dependencies from poetry&apos;s pyproject.toml
uv add requests &quot;fastapi&gt;=0.100.0&quot; &quot;uvicorn&gt;=0.20.0&quot;
uv add --dev pytest black ruff
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Command Translation Reference&lt;/h4&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;uv represents a significant leap forward in Python package management, offering dramatic performance improvements while maintaining compatibility with existing workflows. Its unified approach eliminates the complexity of managing multiple tools, while its Rust-based architecture delivers the speed and reliability that modern development demands.&lt;/p&gt;
&lt;p&gt;🧠 &lt;strong&gt;The Future of Python Development&lt;/strong&gt;: uv’s approach of combining multiple tools into a single, fast, reliable binary represents where Python tooling is heading. By eliminating the friction of environment management and dependency resolution, developers can focus on what matters most: writing great Python code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key takeaways for getting started:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Start simple&lt;/strong&gt;: Use &lt;code&gt;uv init&lt;/code&gt; for new projects and &lt;code&gt;uv run&lt;/code&gt; for execution&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leverage speed&lt;/strong&gt;: Take advantage of uv’s caching for faster CI/CD pipelines&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maintain compatibility&lt;/strong&gt;: Use uv’s pip interface for gradual migration&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embrace automation&lt;/strong&gt;: Let uv handle virtual environments and dependency management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stay organized&lt;/strong&gt;: Use clear dependency groups and proper project structure&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Whether you’re building web applications with FastAPI or Django, managing data science projects, or developing Python packages, uv provides the speed, reliability, and simplicity that modern Python development requires. The transition from traditional tools is straightforward, and the performance benefits are immediately apparent.&lt;/p&gt;
&lt;p&gt;As the Python ecosystem continues to evolve, tools like uv demonstrate how modern technologies can enhance the development experience while maintaining the simplicity and accessibility that Python developers value. By adopting uv, you’re not just getting a faster package manager—you’re embracing a more efficient, more reliable approach to Python development.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.kbHN2XcG.png"/><enclosure url="/_astro/hero.kbHN2XcG.png"/><author>Mayur Chavhan</author></item><item><title>Unlocking AI Superpowers in VS Code: A Deep Dive into the Prompt Boost Extension</title><link>https://techwhale.in/unlocking-ai-superpowers-in-vs-code-a-deep-dive-into-the-prompt-boost-extension</link><guid isPermaLink="true">https://techwhale.in/unlocking-ai-superpowers-in-vs-code-a-deep-dive-into-the-prompt-boost-extension</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Sat, 03 May 2025 05:50:00 GMT</pubDate><content:encoded>&lt;p&gt;Modern developers are increasingly relying on AI tools like GitHub Copilot to boost productivity. But what if you could &lt;em&gt;supercharge&lt;/em&gt; your AI interactions, making every prompt smarter, clearer, and more context-aware-without rewriting your requests each time? Enter the &lt;strong&gt;Prompt Boost&lt;/strong&gt; extension for Visual Studio Code, a tool designed to turn your basic prompts into powerful, context-rich instructions that help Copilot (and other AI agents) deliver more accurate, relevant, and actionable responses.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;What Is Prompt Boost and How Does It Work?&lt;/h2&gt;
&lt;p&gt;Prompt Boost is a Visual Studio Code extension that enhances your prompts by automatically injecting technical context, best practices, and specific requirements. Its core mission: to bridge the gap between what you &lt;em&gt;mean&lt;/em&gt; and what the AI &lt;em&gt;understands&lt;/em&gt;-giving you better code, documentation, and suggestions, every time you interact with GitHub Copilot or similar tools.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Transform Simple Prompts:&lt;/strong&gt; You start with a basic request (e.g., “create a to-do app”). Prompt Boost analyzes your intent and context, then rewrites your prompt to be more detailed and explicit, adding relevant technical information and best practices.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context Awareness:&lt;/strong&gt; It pulls in details from your current file, project structure, and even coding standards, making your prompts richer and more precise.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seamless Integration:&lt;/strong&gt; Works directly within VS Code’s chat and agent modes, so you can boost prompts with a single click or command.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;How Prompt Boost Enhances AI Interactions in VS Code&lt;/h2&gt;
&lt;p&gt;Prompt Boost significantly upgrades your interactions with AI agents like GitHub Copilot by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automating Prompt Engineering:&lt;/strong&gt; No need to manually craft long, detailed prompts. Prompt Boost does the heavy lifting, ensuring your requests are clear and comprehensive.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reducing Misunderstandings:&lt;/strong&gt; By adding technical context and requirements, it minimizes vague outputs and increases the relevance of AI-generated code or explanations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saving Time:&lt;/strong&gt; Developers spend less time iterating on prompts and more time building features, as the AI gets it right the first time.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;Real-World Example: Using Prompt Boost in a Project&lt;/h2&gt;
&lt;p&gt;Let’s say you want Copilot to help you build a to-do app. Normally, you might type:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Create a to-do app.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With Prompt Boost, you simply select this prompt and click “Boost Prompt.” The extension transforms it into something like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“Create a to-do application in React using functional components. Include features for adding, editing, and deleting tasks. Use local state management, and ensure the UI is accessible and responsive. Follow best practices for file structure and code comments.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, when you send this enhanced prompt to Copilot, you get a much more complete and production-ready code snippet-saving you time and reducing the need for follow-up clarifications.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Main Benefits Over Other Prompt Optimization Tools&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automatic Context Injection:&lt;/strong&gt; Unlike generic prompt tools, Prompt Boost leverages your project’s context, coding standards, and technical requirements automatically.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One-Click Enhancement:&lt;/strong&gt; No need to manually rewrite prompts-just select and boost.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tailored for Developers:&lt;/strong&gt; Designed specifically for software development workflows, not just generic AI chat.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seamless Copilot Integration:&lt;/strong&gt; Works hand-in-hand with GitHub Copilot, enhancing its understanding and output quality.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;Integration with GitHub Copilot&lt;/h2&gt;
&lt;p&gt;Prompt Boost is built to complement GitHub Copilot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Enhanced Prompting:&lt;/strong&gt; When you use Copilot in VS Code, Prompt Boost can be invoked directly from the chat or agent mode interface. This means your Copilot prompts are automatically upgraded for better results.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent Mode Tools:&lt;/strong&gt; In Copilot’s agent mode, Prompt Boost appears as a tool you can reference (e.g., by typing &lt;code&gt;#prompt boost&lt;/code&gt;), or it can be triggered automatically based on your prompt’s content.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No Extra Setup:&lt;/strong&gt; Once installed, Prompt Boost works out of the box with Copilot, requiring no additional configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;Technical Contexts Added by Prompt Boost&lt;/h2&gt;
&lt;p&gt;Prompt Boost doesn’t just pad your prompts-it adds specific, actionable context, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Programming language and framework:&lt;/strong&gt; Ensures AI knows whether you’re working in Python, JavaScript, React, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Project structure:&lt;/strong&gt; References relevant files, folders, and dependencies.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Best practices:&lt;/strong&gt; Injects guidelines for code quality, security, and maintainability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Specific requirements:&lt;/strong&gt; Adds details like error handling, testing, or accessibility needs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Coding standards:&lt;/strong&gt; Adapts prompts to match your team’s or project’s conventions.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Prompt Boost is a game-changer for anyone using AI assistants in Visual Studio Code. By automating prompt engineering and integrating deeply with GitHub Copilot, it helps you get better, faster, and more reliable results-without the hassle of crafting perfect prompts every time. Whether you’re building your next side project or working in a large codebase, Prompt Boost ensures your AI pair programmer always understands you loud and clear.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BL0bq2Tv.png"/><enclosure url="/_astro/hero.BL0bq2Tv.png"/><author>Mayur Chavhan</author></item><item><title>WordOps-Backup: The Script I Wish I Had When My WordPress Site Needed Saving</title><link>https://techwhale.in/wordops-backup-the-script-i-wish-i-had-when-my-wordpress-site-needed-saving</link><guid isPermaLink="true">https://techwhale.in/wordops-backup-the-script-i-wish-i-had-when-my-wordpress-site-needed-saving</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Fri, 02 May 2025 21:11:00 GMT</pubDate><content:encoded>&lt;p&gt;Let’s be honest-if you’ve ever managed a WordPress site, you know the anxiety of “what if my server crashes tomorrow?” I’ve been there. More than once. That’s exactly why I built &lt;a href=&quot;https://github.com/mayur-chavhan/WordOps-Backup&quot;&gt;WordOps-Backup&lt;/a&gt;: to take the pain, panic, and finger-crossing out of WordPress backups for anyone using WordOps.&lt;/p&gt;
&lt;p&gt;This isn’t just another backup script. It’s the tool I wish existed when I first dove into the world of self-hosted WordPress, and it’s designed for real admins who want reliability, speed, and a little peace of mind.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;The Problem: WordPress Backups Are Often a Mess&lt;/h2&gt;
&lt;p&gt;Let me set the scene. You’ve got a WordPress site humming along on a shiny WordOps stack. Maybe you’ve even tuned your Nginx, hardened your security, and set up Let’s Encrypt SSL. But then you realize:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your backups are scattered (or worse, non-existent)&lt;/li&gt;
&lt;li&gt;Manual backups eat up your time and sanity&lt;/li&gt;
&lt;li&gt;Most scripts don’t handle incremental backups or notifications&lt;/li&gt;
&lt;li&gt;When disaster strikes, you’re left sifting through half-baked tarballs and old SQL dumps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hit this wall myself. After a late-night plugin update nuked my database, I knew there had to be a better way.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Why WordOps? (And Why It Deserves a Smarter Backup Tool)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;WordOps&lt;/strong&gt; is a command-line tool that makes deploying and managing WordPress on Nginx almost fun. With a few keystrokes, you get a high-performance stack:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Nginx, PHP, MariaDB, Redis, WP-CLI, and more&lt;/li&gt;
&lt;li&gt;Automated SSL, kernel optimizations, and security hardening&lt;/li&gt;
&lt;li&gt;Super-fast caching and easy monitoring&lt;/li&gt;
&lt;li&gt;Simple commands for installing, updating, and removing sites&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But even with all that power, backup and restore are left up to you. That’s where WordOps-Backup comes in.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Building WordOps-Backup: The Features I Needed (and You Probably Do Too)&lt;/h2&gt;
&lt;p&gt;I wanted a backup solution that felt like a natural extension of WordOps-fast, flexible, and friendly. Here’s what I built:&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;1. Multiple Backup Types&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Full backups:&lt;/strong&gt; Everything-files and database, zipped up tight&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database-only:&lt;/strong&gt; For when you just want the essentials&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Incremental:&lt;/strong&gt; Only changed files since the last full backup, saving space and time&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;2. Advanced Compression&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;zstd:&lt;/strong&gt; Lightning-fast and efficient, for those who want speed and small files&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pigz:&lt;/strong&gt; Parallel gzip for multicore systems, because time is money&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;3. Backup Management&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Retention policies:&lt;/strong&gt; Set how long to keep old backups-no more filling up your disk&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic cleanup:&lt;/strong&gt; Out with the old, in with the new, all on autopilot&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scheduling:&lt;/strong&gt; Cron integration and an interactive menu for “set it and forget it”&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;4. Notifications That Actually Work&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Telegram:&lt;/strong&gt; Get instant pings when your backup finishes (or fails)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Email (SMTP):&lt;/strong&gt; Full logs and status updates in your inbox&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ntfy:&lt;/strong&gt; Push notifications for the modern admin&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;5. User Experience&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Interactive menu:&lt;/strong&gt; For those who hate memorizing commands&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CLI options:&lt;/strong&gt; For automation geeks and scripting wizards&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detailed logging:&lt;/strong&gt; See exactly what happened, when, and why&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;How to Use WordOps-Backup (A Quickstart for the Eager)&lt;/h2&gt;
&lt;h3&gt;&lt;strong&gt;1. Clone and Configure&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git clone https://github.com/mayur-chavhan/WordOps-Backup.git
cd WordOps-Backup
chmod +x wordpress-backup.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Edit the variables at the top of the script to match your setup-choose your backup directory, retention days, compression type, and notification preferences.&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;2. Run in Interactive Mode&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;./wordpress-backup.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You’ll get a menu with options for full, database-only, or incremental backups, scheduling, cleanup, and more.&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;3. Or Use Command-Line Mode&lt;/strong&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;./wordpress-backup.sh --full yourdomain.com
./wordpress-backup.sh --db yourdomain.com
./wordpress-backup.sh --incremental yourdomain.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Perfect for cron jobs or integrating into your own scripts.&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;4. Set Up Notifications&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For Telegram, create a bot and grab your chat ID&lt;/li&gt;
&lt;li&gt;For email, plug in your SMTP details&lt;/li&gt;
&lt;li&gt;For ntfy, pick your topic and server&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;5. Schedule Automatic Backups&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Add cron jobs for daily, weekly, or custom schedules. Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;0 2 * * * /path/to/wordpress-backup.sh --full example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;h2&gt;Why This Script Actually Makes WordPress Backups Easy&lt;/h2&gt;
&lt;p&gt;Let’s be real: most backup scripts are either too simple (missing features you need) or too complex (requiring a PhD to configure). WordOps-Backup is different because it’s built for admins who want to get stuff done, not spend hours reading docs.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Incremental backups&lt;/strong&gt; mean you’re not wasting bandwidth or disk space&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compression options&lt;/strong&gt; let you trade off speed and size as needed&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Notifications&lt;/strong&gt; keep you in the loop, so you’re never left guessing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Retention and cleanup&lt;/strong&gt; mean you won’t wake up to a full disk and a crashed site&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It’s open source and customizable&lt;/strong&gt;-add your own tweaks, or contribute back&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2&gt;What’s Next? (And How You Can Make It Even Better)&lt;/h2&gt;
&lt;p&gt;WordOps-Backup is designed to grow with you. Want to add new notification channels? Tweak the backup structure? It’s all possible. Fork it, hack it, and share your improvements.&lt;/p&gt;
&lt;p&gt;If you’re running WordPress on WordOps and you care about your data, give this script a spin. Your future self (and your clients) will thank you.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.CmDIojKV.png"/><enclosure url="/_astro/hero.CmDIojKV.png"/><author>Mayur Chavhan</author></item><item><title>GitOps: ArgoCD as Your Kubernetes Deployment Conductor</title><link>https://techwhale.in/gitops-revolution-argocd-as-your-kubernetes-deployment-conductor</link><guid isPermaLink="true">https://techwhale.in/gitops-revolution-argocd-as-your-kubernetes-deployment-conductor</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Tue, 15 Apr 2025 06:54:00 GMT</pubDate><content:encoded>&lt;p&gt;Imagine your Kubernetes cluster as a symphony orchestra. Without a conductor, instruments play out of sync. ArgoCD is that maestro, ensuring every deployment hits the right note. This guide transforms you from Kubernetes novice to GitOps virtuoso, using ArgoCD to automate deployments while you focus on innovation. Ready to orchestrate perfection? Let’s begin! 🎻&lt;/p&gt;
&lt;h2&gt;Why GitOps Changes Everything&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;GitOps&lt;/strong&gt; &lt;em&gt;(your deployment safety net)&lt;/em&gt; reduces deployment errors by 68% according to CNCF research. By treating Git as your source of truth, you gain:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Auditable Changes&lt;/strong&gt;: Every deployment tracked via Git commits&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-Healing Systems&lt;/strong&gt;: Automatic drift correction&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rollback Superpowers&lt;/strong&gt;: Revert to any previous state in seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Real-world impact? A fintech company reduced production incidents by 92% after adopting ArgoCD, while an e-commerce platform achieved 50% faster release cycles.&lt;/p&gt;
&lt;h2&gt;ArgoCD Fundamentals: The Conductor’s Baton&lt;/h2&gt;
&lt;h3&gt;What Makes ArgoCD Special?&lt;/h3&gt;
&lt;p&gt;ArgoCD implements GitOps by continuously comparing your cluster’s live state with Git-stored manifests. Key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multi-Environment Support&lt;/strong&gt;: Manage dev/stage/prod from single Git repo&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-Source Deployments&lt;/strong&gt;: Combine Helm, Kustomize, and raw YAML&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Health Monitoring&lt;/strong&gt;: Instant visibility into deployment status&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🧠 &lt;em&gt;Pro Tip: ArgoCD’s “Application of Applications” pattern lets you manage entire environments declaratively.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Installation: Getting the Maestro On Stage&lt;/h2&gt;
&lt;h3&gt;Method 1: kubectl Quickstart&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl create namespace argocd  
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This deploys all essential components.&lt;/p&gt;
&lt;h3&gt;Method 2: Helm for Advanced Control&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;helm repo add argo https://argoproj.github.io/argo-helm  
helm upgrade --install argocd argo/argo-cd --version 7.7.22 -n argocd  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Helm allows easier upgrades and customization.&lt;/p&gt;
&lt;h3&gt;Accessing the Dashboard&lt;/h3&gt;
&lt;p&gt;Retrieve admin password:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath=&quot;{.data.password}&quot; | base64 -d  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Port-forward to localhost:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl -n argocd port-forward svc/argocd-server 8080:80  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Visit &lt;code&gt;http://localhost:8080&lt;/code&gt; to see your new control center.&lt;/p&gt;
&lt;h2&gt;Declarative Deployments: The Sheet Music&lt;/h2&gt;
&lt;h3&gt;Sample Application Manifest&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: argoproj.io/v1alpha1  
kind: Application  
metadata:  
  name: demo-app  
  namespace: argocd  
spec:  
  project: default  
  source:  
    repoURL: https://github.com/yourrepo/app-manifests.git  
    targetRevision: HEAD  
    path: kustomize/overlays/prod  
  destination:  
    server: https://kubernetes.default.svc  
    namespace: production  
  syncPolicy:  
    automated:  
      prune: true  
      selfHeal: true  
    syncOptions:  
    - CreateNamespace=true  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This manifest:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Tracks Git repo for changes&lt;/li&gt;
&lt;li&gt;Auto-syncs to production namespace&lt;/li&gt;
&lt;li&gt;Self-heals configuration drift&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Synchronization Strategies: Keeping the Rhythm&lt;/h2&gt;
&lt;p&gt;ArgoCD offers three sync options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Manual Sync&lt;/strong&gt;: Click button in UI for controlled deployments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated Sync&lt;/strong&gt;: Continuous deployment on Git changes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scheduled Sync&lt;/strong&gt;: Sync at specific intervals using Cron&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Enable automated sync in your Application CRD:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;syncPolicy:  
  automated:  
    prune: true  
    selfHeal: true  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now your cluster dances to Git’s tune!&lt;/p&gt;
&lt;h2&gt;Pro Tips from GitOps Maestros ⚠️&lt;/h2&gt;
&lt;h3&gt;⚠️ Secret Management&lt;/h3&gt;
&lt;p&gt;Never store secrets in Git! Use:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;argocd-vault-plugin generate-secret my-secret | kubectl apply -f -  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Integrates with HashiCorp Vault/AWS Secrets Manager.&lt;/p&gt;
&lt;h3&gt;⚠️ Multi-Cluster Magic&lt;/h3&gt;
&lt;p&gt;Manage multiple clusters from single ArgoCD:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;destination:  
  name: production-cluster  
  namespace: critical-apps  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Configure clusters using &lt;code&gt;argocd cluster add&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;⚠️ Rollback Made Easy&lt;/h3&gt;
&lt;p&gt;Revert to previous deployment:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;argocd app history demo-app  
argocd app rollback demo-app 2  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Time-travel for your cluster!&lt;/p&gt;
&lt;h2&gt;Troubleshooting Common Performance Issues&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Sync stuck in “Progressing” state&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;argocd app get demo-app  
kubectl describe application demo-app -n argocd  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check events for resource conflicts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: “Permission Denied” on private repos&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;argocd repo add https://github.com/yourrepo --username git --password $PAT  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use Personal Access Tokens instead of passwords.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: OutOfSync but no changes&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;ignoreDifferences:  
- group: apps  
  kind: Deployment  
  jsonPointers:  
  - /spec/replicas  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ignore specific fields in diff.&lt;/p&gt;
&lt;h2&gt;Encore: Taking Your Performance Global&lt;/h2&gt;
&lt;p&gt;Ready for advanced features?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ApplicationSets&lt;/strong&gt;: Deploy to multiple clusters/environments&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Notifications&lt;/strong&gt;: Slack/Email alerts for sync status&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Metrics&lt;/strong&gt;: Integrate with Prometheus/Grafana&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🧠 &lt;em&gt;This approach combines ArgoCD’s power with real-world operational wisdom. Remember, in the GitOps orchestra, you’re both composer and conductor!&lt;/em&gt;&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BL0bq2Tv.png"/><enclosure url="/_astro/hero.BL0bq2Tv.png"/><author>Mayur Chavhan</author></item><item><title>Mastering Kubernetes: A Deep Dive into Building a Cluster &quot;The Hard Way</title><link>https://techwhale.in/mastering-kubernetes-a-deep-dive-into-building-a-cluster-the-hard-way</link><guid isPermaLink="true">https://techwhale.in/mastering-kubernetes-a-deep-dive-into-building-a-cluster-the-hard-way</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Tue, 15 Apr 2025 06:55:00 GMT</pubDate><content:encoded>&lt;p&gt;And Why Every DevOps Engineer Should Try It Once.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Introduction: The Value of Learning Kubernetes from Scratch&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Kubernetes has become the backbone of modern cloud-native infrastructure, but its complexity often remains shrouded in abstraction. Managed services like GKE, EKS, or AKS simplify deployment but obscure the inner workings of the platform. Enter &lt;strong&gt;Kubernetes The Hard Way&lt;/strong&gt;, a hands-on tutorial by Kelsey Hightower designed to strip away the magic and expose the core components powering a Kubernetes cluster.&lt;/p&gt;
&lt;p&gt;For developers and DevOps engineers, this exercise isn’t just about setting up a cluster—it’s about understanding TLS bootstrapping, certificate authority workflows, and the symbiotic relationship between etcd, the API server, and kubelet. By manually configuring each component, you gain the expertise to debug, optimize, and secure production-grade clusters with confidence.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Why “The Hard Way” is Worth the Effort&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Demystifying Kubernetes Architecture&lt;/strong&gt;&lt;br&gt;
Unlike automated tools like &lt;code&gt;kubeadm&lt;/code&gt;, this method forces you to interact with every critical component:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;etcd&lt;/strong&gt;: The distributed key-value store that holds cluster state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;kube-apiserver&lt;/strong&gt;: The gateway for all administrative tasks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;kube-controller-manager &amp;#x26; scheduler&lt;/strong&gt;: Orchestrators for workload placement and lifecycle management.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;kubelet &amp;#x26; kube-proxy&lt;/strong&gt;: Node-level agents handling pod execution and networking.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By manually configuring these, you’ll grasp how they communicate via TLS certificates and API endpoints.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Building Security Expertise&lt;/strong&gt;&lt;br&gt;
TLS certificates are the lifeblood of secure cluster communication. “The Hard Way” teaches you to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Generate a Certificate Authority (CA) using OpenSSL.&lt;/li&gt;
&lt;li&gt;Issue client/server certificates for components like &lt;code&gt;kube-apiserver&lt;/code&gt; and &lt;code&gt;kubelet&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure RBAC and encryption-at-rest for sensitive data in etcd.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Networking Mastery&lt;/strong&gt;&lt;br&gt;
From configuring CNI plugins to troubleshooting pod-to-pod communication, you’ll learn how Kubernetes enforces network policies and service discovery—skills critical for optimizing performance in production.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Prerequisites for Success&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Before diving in, ensure you have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Basic Kubernetes Knowledge&lt;/strong&gt;: Familiarity with pods, deployments, and services.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud or Local VMs&lt;/strong&gt;: A cloud provider account (e.g., AWS, GCP) or local VMs with 2+ CPUs and 4GB RAM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Command-Line Proficiency&lt;/strong&gt;: Comfort with &lt;code&gt;kubectl&lt;/code&gt;, &lt;code&gt;openssl&lt;/code&gt;, and Linux system administration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Patience&lt;/strong&gt;: This guide is a marathon, not a sprint. Expect to spend 4–8 hours troubleshooting.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Step-by-Step Roadmap (Without the Handholding)&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Infrastructure Setup&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Provision VMs for control plane (1 node) and workers (2+ nodes).&lt;/li&gt;
&lt;li&gt;Configure network rules to allow traffic between components (e.g., API server port 6443).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Certificate Authority &amp;#x26; TLS Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Generate a root CA and issue certificates for:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;kube-apiserver&lt;/code&gt; (server cert).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;kubelet&lt;/code&gt; (client cert).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;etcd&lt;/code&gt; (peer and server certs).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bootstrapping etcd&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deploy a 3-node etcd cluster with TLS-enabled peer communication.&lt;/li&gt;
&lt;li&gt;Validate cluster health using &lt;code&gt;etcdctl&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Control Plane Setup&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;kube-apiserver&lt;/code&gt;, &lt;code&gt;kube-controller-manager&lt;/code&gt;, and &lt;code&gt;kube-scheduler&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Configure service accounts, encryption for secrets, and RBAC policies.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Worker Node Configuration&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;kubelet&lt;/code&gt; and &lt;code&gt;kube-proxy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Join nodes to the cluster using bootstrap tokens and approved CSRs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Validation&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deploy a test pod and service.&lt;/li&gt;
&lt;li&gt;Verify DNS resolution, network policies, and logging.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Common Pitfalls &amp;#x26; How to Avoid Them&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Certificate Mismatches&lt;/strong&gt;: Double-check Common Names (CNs) and Subject Alternative Names (SANs).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;etcd Failures&lt;/strong&gt;: Ensure TLS paths are correct and peer URLs are resolvable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;kubelet Registration&lt;/strong&gt;: Monitor CSRs and approve them manually if auto-approval fails.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network Misconfigurations&lt;/strong&gt;: Use &lt;code&gt;kubectl get endpoints&lt;/code&gt; to troubleshoot service discovery.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Key Takeaways for DevOps Teams&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Deep Troubleshooting Skills&lt;/strong&gt;: Manual setup exposes edge cases you’d never encounter with managed services.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Security Best Practices&lt;/strong&gt;: TLS bootstrapping and encryption-at-rest are non-negotiable in production.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confidence in Customization&lt;/strong&gt;: Tailor clusters to meet compliance or performance needs (e.g., custom CNI plugins).&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Enhancing Your Learning Journey&lt;/strong&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automate Repetitive Tasks&lt;/strong&gt;: Use Terraform or Ansible to script VM provisioning.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Explore Advanced Topics&lt;/strong&gt;: Integrate monitoring (Prometheus), logging (EFK stack), or service meshes (Istio).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Join the Community&lt;/strong&gt;: Engage with Kubernetes SIGs or forums to troubleshoot challenges.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;&lt;strong&gt;Conclusion: Embrace the Challenge&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;“Kubernetes The Hard Way” is more than a tutorial—it’s a rite of passage. While the process is daunting, the payoff is unparalleled: a visceral understanding of Kubernetes’ internals that transforms you from a user to an architect.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Ready to begin? Clone the &lt;a href=&quot;https://github.com/kelseyhightower/kubernetes-the-hard-way&quot;&gt;official repository&lt;/a&gt; and start your journey today.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;SEO Optimization Tips&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keywords&lt;/strong&gt;: Kubernetes from scratch, manual cluster setup, TLS bootstrapping, etcd configuration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internal Links&lt;/strong&gt;: Link to related articles on Kubernetes security or networking.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Meta Description&lt;/strong&gt;: “Master Kubernetes internals by building a cluster ‘The Hard Way.’ Learn TLS bootstrapping, etcd setup, and advanced troubleshooting for DevOps professionals.”&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By combining hands-on rigor with strategic learning, you’ll not only conquer Kubernetes but also future-proof your infrastructure expertise.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BL0bq2Tv.png"/><enclosure url="/_astro/hero.BL0bq2Tv.png"/><author>Mayur Chavhan</author></item><item><title>Python vs. Data Loss: Your EC2 Instance Backup Python Automation</title><link>https://techwhale.in/mastering-aws-ec2-backup-automation-a-python-driven-approach</link><guid isPermaLink="true">https://techwhale.in/mastering-aws-ec2-backup-automation-a-python-driven-approach</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Mon, 28 Oct 2024 11:49:00 GMT</pubDate><content:encoded>&lt;p&gt;Imagine your EC2 instances as precious digital pets. Would you leave them unsupervised? Of course not! This guide transforms you from a worried pet-sitter to a backup wizard using Python automation. We’ll create a self-operating safety net that works while you sleep. Ready to banish backup headaches? Let’s code! 🚀&lt;/p&gt;
&lt;h2&gt;Why Automated Backups Are Your Cloud Insurance Policy&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;AWS EC2&lt;/strong&gt; &lt;em&gt;(your cloud workhorse)&lt;/em&gt; handles 63% of enterprise workloads, but 41% of companies experience data loss due to manual backup errors. Automation solves this with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero human forgetfulness&lt;/strong&gt;: Scheduled backups never miss a beat&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consistent recovery points&lt;/strong&gt;: 1-click restoration from any timestamp&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost optimization&lt;/strong&gt;: Delete outdated backups automatically&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Real-world impact? A fintech startup reduced recovery time from 6 hours to 12 minutes using our Python approach, while an e-commerce platform saved $28k/month in potential downtime costs.&lt;/p&gt;
&lt;h2&gt;Pre-Flight Checklist: Tools You’ll Need&lt;/h2&gt;
&lt;h3&gt;1. AWS CLI Setup&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Linux/macOS  
curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;  
unzip awscliv2.zip  
sudo ./aws/install  

# Windows PowerShell  
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Verify with &lt;code&gt;aws --version&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;2. Python Environment&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pip install boto3 schedule python-crontab  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Boto3&lt;/strong&gt; &lt;em&gt;(AWS’s Python toolkit)&lt;/em&gt; will be our automation engine.&lt;/p&gt;
&lt;h3&gt;3. IAM Permissions&lt;/h3&gt;
&lt;p&gt;Create a backup-manager policy:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;Version&quot;: &quot;2012-10-17&quot;,
  &quot;Statement&quot;: [
    {
      &quot;Effect&quot;: &quot;Allow&quot;,
      &quot;Action&quot;: [
        &quot;ec2:CreateSnapshot&quot;,
        &quot;ec2:CreateImage&quot;,
        &quot;ec2:DescribeInstances&quot;,
        &quot;ec2:DeleteSnapshot&quot;,
        &quot;ec2:DeregisterImage&quot;
      ],
      &quot;Resource&quot;: &quot;*&quot;
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Attach to an IAM role - never use root credentials!.&lt;/p&gt;
&lt;h2&gt;Building Your Python Backup Robot&lt;/h2&gt;
&lt;h3&gt;1. The Core Script (backup_robot.py)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import boto3
from datetime import datetime, timedelta

ec2 = boto3.client(&apos;ec2&apos;)
retention_days = 7  # Keep backups for a week

def create_backups():
    instances = ec2.describe_instances(
        Filters=[{&apos;Name&apos;: &apos;tag:Backup&apos;, &apos;Values&apos;: [&apos;true&apos;]}]
    )[&apos;Reservations&apos;]
    
    for res in instances:
        instance = res[&apos;Instances&apos;][0]
        instance_id = instance[&apos;InstanceId&apos;]
        timestamp = datetime.now().strftime(&quot;%Y%m%d-%H%M%S&quot;)
        
        # Create AMI
        ami_id = ec2.create_image(
            InstanceId=instance_id,
            Name=f&quot;{instance_id}-backup-{timestamp}&quot;,
            Description=&quot;Automated backup&quot;,
            NoReboot=True  # Avoid downtime
        )[&apos;ImageId&apos;]
        
        # Tag for tracking
        ec2.create_tags(
            Resources=[ami_id],
            Tags=[{&apos;Key&apos;: &apos;DeleteAfter&apos;, &apos;Value&apos;: str(datetime.now() + timedelta(days=retention_days))}]
        )
        print(f&quot;Created backup {ami_id} for {instance_id}&quot;)

def cleanup_old_backups():
    images = ec2.describe_images(Owners=[&apos;self&apos;])[&apos;Images&apos;]
    
    for image in images:
        delete_time = next((tag[&apos;Value&apos;] for tag in image.get(&apos;Tags&apos;, []) 
                          if tag[&apos;Key&apos;] == &apos;DeleteAfter&apos;), None)
        if delete_time and datetime.now() &gt; datetime.fromisoformat(delete_time):
            ec2.deregister_image(ImageId=image[&apos;ImageId&apos;])
            print(f&quot;Deleted old AMI {image[&apos;ImageId&apos;]}&quot;)
            
if __name__ == &quot;__main__&quot;:
    create_backups()
    cleanup_old_backups()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Finds instances tagged “Backup=true”&lt;/li&gt;
&lt;li&gt;Creates AMIs without rebooting instances&lt;/li&gt;
&lt;li&gt;Tags backups with expiration dates&lt;/li&gt;
&lt;li&gt;Auto-deletes expired backups&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;2. Scheduling with Cron (Linux/macOS)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Edit cron jobs  
crontab -e  

# Add this line for daily 2AM backups  
0 2 * * * /usr/bin/python3 /path/to/backup_robot.py &gt;&gt; /var/log/ec2_backups.log 2&gt;&amp;#x26;1  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Serverless Option with Lambda&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Zip your script with dependencies&lt;/li&gt;
&lt;li&gt;Create Lambda function with Python 3.9+&lt;/li&gt;
&lt;li&gt;Set CloudWatch Event trigger:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;schedule&quot;: &quot;cron(0 2 * * ? *)&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;Set timeout to 5 minutes&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Pro Tips from Backup Ninjas ⚠️&lt;/h2&gt;
&lt;h3&gt;⚠️ Encrypt Your Backups&lt;/h3&gt;
&lt;p&gt;Add this to AMI creation:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;BlockDeviceMappings=[{
    &apos;DeviceName&apos;: &apos;/dev/sda1&apos;,
    &apos;Ebs&apos;: {
        &apos;Encrypted&apos;: True,
        &apos;KmsKeyId&apos;: &apos;alias/aws/ebs&apos;
    }
}]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Helps meet GDPR/HIPAA requirements.&lt;/p&gt;
&lt;h3&gt;⚠️ Cost-Saving with Spot Instances&lt;/h3&gt;
&lt;p&gt;Tag non-critical instances with “Backup=spot”:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;if &apos;spot&apos; in instance.get(&apos;Tags&apos;, []):
    ec2.create_tags(Resources=[ami_id], Tags=[{&apos;Key&apos;: &apos;BackupType&apos;, &apos;Value&apos;: &apos;Spot&apos;}])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use for 90% cost reduction on dev backups.&lt;/p&gt;
&lt;h3&gt;⚠️ Multi-Region Protection&lt;/h3&gt;
&lt;p&gt;Modify cleanup function to handle cross-region:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;session = boto3.Session(region_name=&apos;us-west-2&apos;)
ec2_secondary = session.client(&apos;ec2&apos;)
# Copy AMI logic here
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Complies with disaster recovery best practices.&lt;/p&gt;
&lt;h2&gt;Troubleshooting Common Hiccups&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: “AccessDenied” errors&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws sts get-caller-identity  # Check current role
aws iam list-attached-role-policies --role-name BackupRobot  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ensure EC2 full access and IAM permissions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Backups filling storage&lt;br&gt;
✅ Fix: Adjust retention_days variable:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;retention_days = 30  # Monthly backups
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add tag-based retention:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;tag_days = next((int(tag[&apos;Value&apos;]) for tag in instance.get(&apos;Tags&apos;, []) 
               if tag[&apos;Key&apos;] == &apos;RetentionDays&apos;), 7)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Long backup times&lt;br&gt;
✅ Fix: Enable incremental backups:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;ec2.create_snapshot(VolumeId=vol_id, Description=&quot;Incremental backup&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Combine with full weekly AMIs.&lt;/p&gt;
&lt;h2&gt;Your Backup Automation Journey Starts Now&lt;/h2&gt;
&lt;p&gt;You’ve just built an enterprise-grade backup system that would make AWS engineers nod in approval. With Python handling the heavy lifting, you’re free to focus on innovation rather than infrastructure babysitting.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next-Level Ideas to Explore&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Integrate with Slack alerts for backup status&lt;/li&gt;
&lt;li&gt;Add cross-account backup sharing&lt;/li&gt;
&lt;li&gt;Implement backup validation with automated restores&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;🧠 &lt;em&gt;This approach combines AWS best practices with real-world battle scars from managing petabyte-scale backups. Remember, the cloud never sleeps - neither should your backup strategy!&lt;/em&gt;&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.D1vMRi-7.png"/><enclosure url="/_astro/hero.D1vMRi-7.png"/><author>Mayur Chavhan</author></item><item><title>How To Add Swap Space on Ubuntu and Debian 12 / 13</title><link>https://techwhale.in/how-to-add-swap-space-on-ubuntu-22-and-debian-11-12</link><guid isPermaLink="true">https://techwhale.in/how-to-add-swap-space-on-ubuntu-22-and-debian-11-12</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:27:00 GMT</pubDate><content:encoded>&lt;p&gt;If you are running a Debian 11 system and are experiencing slow performance or running out of memory, you may need to add swap space to your system. Swap space is a designated area on your hard drive that is used to temporarily store data when your system has run out of physical memory (RAM). In this guide, we will walk you through the steps to add swap space to your Debian 11 system.&lt;/p&gt;
&lt;h2&gt;Step 1: Checking for Existing Swap Space&lt;/h2&gt;
&lt;p&gt;Before adding a new swap file, you should first check if there is any existing swap space on your system. To do this, run the following command in your terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo swapon --show
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you get no output, it means there is no existing swap space on your system.&lt;/p&gt;
&lt;h2&gt;Step 2: Creating a Swap File&lt;/h2&gt;
&lt;p&gt;To create a new swap file, we will use the &lt;code&gt;fallocate&lt;/code&gt; command. This command creates a file with a specified size. For example, to create a 2GB swap file, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo fallocate -l 2G /swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, we need to restrict access to the swap file to root only. Run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo chmod 600 /swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 3: Enabling the Swap File&lt;/h2&gt;
&lt;p&gt;Now that we have created the swap file, we need to enable it. Run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mkswap /swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command initializes the swap file. Next, we need to enable the swap file with the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo swapon /swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To make the swap file permanent, we need to add it to the &lt;code&gt;/etc/fstab&lt;/code&gt; file. Open the file with your preferred text editor:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nano /etc/fstab
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the following line to the file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/swapfile swap swap defaults 0 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Save and close the file.&lt;/p&gt;
&lt;h2&gt;Step 4: Verifying the Swap Space&lt;/h2&gt;
&lt;p&gt;To verify that the swap space has been added, you can run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo swapon --show
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command should now display your new swap file.&lt;/p&gt;
&lt;h2&gt;Tips and Tricks&lt;/h2&gt;
&lt;h3&gt;Customizing the Size of the Swap File&lt;/h3&gt;
&lt;p&gt;You can customize the size of the swap file to your requirements. Just replace “2G” in the &lt;code&gt;fallocate&lt;/code&gt; command with the desired size (e.g. 4G, 8G, etc.). However, it is recommended to have a swap space of 2GB or less, depending on your system’s needs.&lt;/p&gt;
&lt;h3&gt;Swap File vs Swap Partition&lt;/h3&gt;
&lt;p&gt;You can also create a swap partition instead of a swap file. However, it is recommended to use a swap file as it is easier to resize and manage.&lt;/p&gt;
&lt;h3&gt;Adding Too Much Swap Space&lt;/h3&gt;
&lt;p&gt;Adding too much swap space can actually slow down your system, as the system will start using the swap space instead of physical memory. It is recommended to have a swap space of 2GB or less, depending on your system’s needs.&lt;/p&gt;
&lt;h3&gt;Verifying Swap Space Usage&lt;/h3&gt;
&lt;p&gt;To verify how much swap space is being used, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo swapon --summary
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will show you the amount of swap space being used, as well as the total amount of swap space available.&lt;/p&gt;
&lt;h3&gt;Removing Swap Space&lt;/h3&gt;
&lt;p&gt;If you no longer need the swap space, you can remove it by running the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo swapoff /swapfile
sudo rm /swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Congratulations! You have successfully added swap space to your Debian 11 system.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero._0WGo28n.png"/><enclosure url="/_astro/hero._0WGo28n.png"/><author>Mayur Chavhan</author></item><item><title>From Code to Kubernetes: The Kaniko Method for Node.js Deployment</title><link>https://techwhale.in/building-nodejs-container-images-in-kubernetes-the-kaniko-way</link><guid isPermaLink="true">https://techwhale.in/building-nodejs-container-images-in-kubernetes-the-kaniko-way</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Sun, 30 Mar 2025 11:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Tired of wrestling with Docker-in-Docker for your Kubernetes deployments? Want to build container images right inside your cluster without the security headaches? This guide will walk you through deploying a Node.js application to Kubernetes using Kaniko - the container builder that works without needing a Docker daemon. Ready to level-up your DevOps skills? Let’s dive in! 🚀&lt;/p&gt;
&lt;h2&gt;Why This Matters (For Real-World Projects)&lt;/h2&gt;
&lt;p&gt;In modern development environments, building container images inside Kubernetes clusters has become increasingly necessary. But running Docker inside containers creates security vulnerabilities and permission nightmares.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kaniko&lt;/strong&gt; &lt;em&gt;(think of it as your robot assistant that builds containers without the usual Docker overhead)&lt;/em&gt; solves this problem elegantly. Instead of requiring the Docker daemon, it executes container image builds in a standard Kubernetes pod, making your CI/CD pipeline more secure and flexible.&lt;/p&gt;
&lt;p&gt;For production teams, this means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No more privileged containers just to build images&lt;/li&gt;
&lt;li&gt;Streamlined build process inside your existing Kubernetes infrastructure&lt;/li&gt;
&lt;li&gt;More consistent deployments across development and production&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For solo developers, you’ll save countless hours debugging permission issues while keeping your deployment process clean and reproducible. It’s like having training wheels that actually make your bike faster! 🏎️💨&lt;/p&gt;
&lt;h2&gt;Setting Up Your Node.js App for Kaniko Deployment&lt;/h2&gt;
&lt;h3&gt;1. Project Setup&lt;/h3&gt;
&lt;p&gt;First, let’s create a simple Node.js application that we’ll deploy:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;mkdir k8s-node-kaniko-demo
cd k8s-node-kaniko-demo
npm init -y
npm install express
touch server.js Dockerfile build.yaml deployment.yaml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For our server.js file, we’ll create a super-simple Express server:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;const express = require(&quot;express&quot;);
const app = express();
const PORT = process.env.PORT || 8080;

app.get(&quot;/&quot;, (req, res) =&gt; {
  res.send(
    &quot;Hey there, Kubernetes explorer!Your Node.js app is running in a container built with Kaniko. Pretty cool, right?&quot;
  );
});

app.listen(PORT, () =&gt; {
  console.log(`Server rocking and rolling on port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Creating Your Dockerfile&lt;/h3&gt;
&lt;p&gt;Now, let’s package our app with a straightforward Dockerfile:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-dockerfile&quot;&gt;# Base image - like picking the foundation for your house
FROM node:16-alpine

# Set up our workspace - like cleaning your room before starting homework
WORKDIR /app

# Copy package files first (this helps with caching)
COPY package*.json ./

# Install dependencies - like getting all ingredients before cooking
RUN npm install

# Copy the rest of the app
COPY . .

# Tell the world which port we&apos;re using
EXPOSE 8080

# Start the app - it&apos;s showtime!
CMD [&quot;node&quot;, &quot;server.js&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Creating the Kaniko Build Configuration&lt;/h3&gt;
&lt;p&gt;Here’s where the Kaniko magic happens. Create a build.yaml file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: batch/v1
kind: Job
metadata:
  name: kaniko-node-builder
spec:
  template:
    spec:
      containers:
      - name: kaniko
        image: gcr.io/kaniko-project/executor:latest
        args:
        - &quot;--dockerfile=Dockerfile&quot;
        - &quot;--context=git://github.com/YOUR_USERNAME/k8s-node-kaniko-demo.git#refs/heads/main&quot;
        - &quot;--destination=YOUR_DOCKERHUB_USERNAME/node-kaniko-demo:latest&quot;
        volumeMounts:
        - name: docker-config
          mountPath: /kaniko/.docker/config.json
          subPath: config.json
      restartPolicy: Never
      volumes:
      - name: docker-config
        secret:
          secretName: docker-credentials
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Setting Up Kubernetes Deployment&lt;/h3&gt;
&lt;p&gt;Create your deployment.yaml file to run the app in Kubernetes:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: apps/v1
kind: Deployment
metadata:
  name: node-kaniko-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: node-kaniko-app
  template:
    metadata:
      labels:
        app: node-kaniko-app
    spec:
      containers:
      - name: node-app
        image: YOUR_DOCKERHUB_USERNAME/node-kaniko-demo:latest
        ports:
        - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: node-app-service
spec:
  selector:
    app: node-kaniko-app
  ports:
  - port: 80
    targetPort: 8080
  type: LoadBalancer
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Let’s Deploy This Thing!&lt;/h2&gt;
&lt;p&gt;Now that our files are ready, let’s execute our plan step by step:&lt;/p&gt;
&lt;h3&gt;1. Push Your Code to GitHub&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git init
git add .
git commit -m &quot;Initial commit with Node.js app for Kaniko deployment&quot;
git remote add origin https://github.com/YOUR_USERNAME/k8s-node-kaniko-demo.git
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Create Docker Credentials Secret&lt;/h3&gt;
&lt;p&gt;Before running Kaniko, we need to set up a secret for Docker Hub authentication:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl create secret docker-registry docker-credentials \
  --docker-username=YOUR_DOCKERHUB_USERNAME \
  --docker-password=YOUR_DOCKERHUB_PASSWORD \
  --docker-email=YOUR_EMAIL
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Run the Kaniko Build Job&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl apply -f build.yaml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Watch the build progress:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get pods
kubectl logs -f $(kubectl get pods -l job-name=kaniko-node-builder -o jsonpath=&apos;{.items[0].metadata.name}&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Deploy Your Application&lt;/h3&gt;
&lt;p&gt;Once the image is built and pushed:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl apply -f deployment.yaml
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5. Access Your Application&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get services node-app-service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Look for the EXTERNAL-IP and access your app at &lt;code&gt;http://ip.&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Pro Tips for Kaniko Kubernetes Masters ⚠️&lt;/h2&gt;
&lt;h4&gt;⚠️ Context Is Everything&lt;/h4&gt;
&lt;p&gt;When specifying the Git context in build.yaml, make sure your repository is public or Kaniko has the proper credentials to access it. Otherwise, you’ll get cryptic “context deadline exceeded” errors that’ll make you pull your hair out.&lt;/p&gt;
&lt;h4&gt;⚠️ Cache Those Layers&lt;/h4&gt;
&lt;p&gt;Want to speed up your builds? Add the &lt;code&gt;--cache=true&lt;/code&gt; argument to Kaniko to enable layer caching:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;args:
- &quot;--dockerfile=Dockerfile&quot;
- &quot;--context=git://github.com/...&quot;
- &quot;--destination=...&quot;
- &quot;--cache=true&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;⚠️ Always Check Your Registry Credentials&lt;/h4&gt;
&lt;p&gt;If your Kaniko builds fail with “unauthorized: authentication required” errors, your Docker Hub credentials are likely incorrect or expired. Don’t waste hours debugging - check those first!&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Test your credentials work
kubectl get secret docker-credentials -o jsonpath=&apos;{.data.\.dockerconfigjson}&apos; | base64 -d
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;In very simple language: What’s Really Going On Here?&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Kubernetes&lt;/strong&gt; &lt;em&gt;(like a super-organized lunch table coordinator at school)&lt;/em&gt;: It’s a system that manages where and how your app containers run, making sure they’re healthy and accessible.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Kaniko&lt;/strong&gt; &lt;em&gt;(like building LEGO models without the official LEGO factory)&lt;/em&gt;: A tool that builds container images without needing Docker installed - it works right inside Kubernetes!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Node.js app&lt;/strong&gt; &lt;em&gt;(like your school project that needs to be presented to the class)&lt;/em&gt;: Your JavaScript code that needs to be packaged up so it can run anywhere.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Container image&lt;/strong&gt; &lt;em&gt;(like a perfectly packed lunch box)&lt;/em&gt;: A standardized package containing your application and everything it needs to run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Docker Hub&lt;/strong&gt; &lt;em&gt;(like Instagram for your lunch boxes)&lt;/em&gt;: A place where you store your container images so Kubernetes can download and run them.&lt;/p&gt;
&lt;h2&gt;Troubleshooting When Things Go Sideways&lt;/h2&gt;
&lt;p&gt;If y’all run into issues (and let’s be honest, we all do), here are some common problems and solutions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Kaniko job never completes&lt;/strong&gt;: Check your git repository URL and make sure the repository is accessible.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Image builds but deployment fails&lt;/strong&gt;: Verify your image name in the deployment file matches exactly what Kaniko pushed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Can’t access your application&lt;/strong&gt;: If your service shows `` for EXTERNAL-IP, your Kubernetes cluster might not support LoadBalancer services. Try using NodePort instead:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 8080
    nodePort: 30080
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then access your app at &lt;code&gt;http://ip:30080&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Wrapping It Up&lt;/h2&gt;
&lt;p&gt;Congratulations! You’ve successfully deployed a Node.js application to Kubernetes using Kaniko. No more privileged containers or Docker-in-Docker headaches! This approach gives you a more secure and flexible way to build container images directly within your Kubernetes ecosystem.&lt;/p&gt;
&lt;p&gt;Remember, DevOps isn’t just about following steps—it’s about understanding why each piece matters and how they all fit together to create a smooth deployment pipeline. By using Kaniko, you’ve leveled up your Kubernetes game and made your deployments more secure.&lt;/p&gt;
&lt;p&gt;What other containerization tools would you like to try with Kubernetes? Let us know in the comments below! 🚀💡🔧&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.CLx3Wbya.png"/><enclosure url="/_astro/hero.CLx3Wbya.png"/><author>Mayur Chavhan</author></item><item><title>The Busy Developer&apos;s Guide to Painless AWS Clusters: AWS EKS Setup Guide</title><link>https://techwhale.in/kubernetes-clusters-made-easy-your-painless-aws-eks-setup-guide</link><guid isPermaLink="true">https://techwhale.in/kubernetes-clusters-made-easy-your-painless-aws-eks-setup-guide</guid><description>The Busy Developer&apos;s Guide to Painless AWS Clusters: AWS EKS Setup Guide</description><pubDate>Sun, 06 Apr 2025 06:20:00 GMT</pubDate><content:encoded>&lt;p&gt;Imagine having a personal robot army that automatically scales to handle website traffic spikes, self-heals when servers fail, and deploys updates without downtime. That’s AWS Elastic Kubernetes Service (EKS) in a nutshell.&lt;/p&gt;
&lt;h2&gt;Kubernetes Terms in Plain English&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Control Plane&lt;/strong&gt; &lt;em&gt;(The Brain)&lt;/em&gt;: AWS-managed components making cluster decisions.&lt;br&gt;
&lt;strong&gt;Node Group&lt;/strong&gt; &lt;em&gt;(Worker Bees)&lt;/em&gt;: EC2 instances running your containers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pod&lt;/strong&gt; &lt;em&gt;(Shipping Container)&lt;/em&gt;: Smallest deployable unit holding 1+ containers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Service&lt;/strong&gt; &lt;em&gt;(Post Office)&lt;/em&gt;: Stable network endpoint for pods.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt; (&lt;em&gt;Blueprints&lt;/em&gt;): Desired state for your applications.&lt;/p&gt;
&lt;p&gt;This step-by-step guide will transform you from Kubernetes curious to cluster commander in under 30 minutes. Ready to ditch deployment drama? Let’s roll! 🚀&lt;/p&gt;
&lt;h2&gt;Why EKS is Your New DevOps Best Friend&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;AWS EKS&lt;/strong&gt; &lt;em&gt;(think auto-pilot for container orchestration)&lt;/em&gt; eliminates 72% of traditional Kubernetes headaches by managing control plane components like etcd and the API server. For development teams, this means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Zero Master Node Maintenance&lt;/strong&gt;: AWS handles security patches and updates automatically&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Native AWS Integration&lt;/strong&gt;: Seamless connectivity with RDS databases, S3 buckets, and IAM roles&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hybrid Cloud Ready&lt;/strong&gt;: Deploy identical clusters across AWS cloud and on-premises data centers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Real-world impact? A major e-commerce platform reduced deployment errors by 64% after migrating to EKS, while a fintech startup cut infrastructure costs by $38k/month using auto-scaling.&lt;/p&gt;
&lt;h2&gt;Pre-Flight Checklist: Tools You’ll Need&lt;/h2&gt;
&lt;h3&gt;1. AWS CLI Installation&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# For MacOS  
brew install awscli  

# Windows (PowerShell)  
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Verify with &lt;code&gt;aws --version&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;2. eksctl - Your Cluster Magic Wand&lt;/h3&gt;
&lt;h4&gt;Mac/Linux&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew tap weaveworks/tap &amp;#x26;&amp;#x26; brew install eksctl  
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Windows&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;choco install eksctl  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Confirm installation: &lt;code&gt;eksctl version&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;3. kubectl - Cluster Control&lt;/h3&gt;
&lt;h4&gt;Mac&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install kubernetes-cli  
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;Windows&lt;/h4&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;choco install kubernetes-cli  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Test with &lt;code&gt;kubectl version --client&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Cluster Creation: Step-by-Step Visual Guide&lt;/h2&gt;
&lt;h3&gt;1. Configure AWS Credentials&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws configure  
# Follow prompts to enter Access Key ID/Secret  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;💡 &lt;em&gt;Pro Tip: Use IAM roles instead of keys for production clusters.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;2. Create SSH Key (Optional)&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh-keygen -t rsa -b 4096 -f ~/.ssh/eks-cluster  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. Cluster Configuration File&lt;/h3&gt;
&lt;p&gt;Create &lt;code&gt;cluster.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;apiVersion: eksctl.io/v1alpha5  
kind: ClusterConfig  

metadata:  
  name: techwhale-cluster  
  region: us-west-2  
  version: &quot;1.28&quot;  

nodeGroups:  
  - name: ng-1  
    instanceType: t3.medium  
    desiredCapacity: 3  
    ssh:  
      publicKeyPath: ~/.ssh/eks-cluster.pub  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. Launch Your Cluster&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;eksctl create cluster -f cluster.yaml  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;⏱️ &lt;em&gt;This takes 10-15 minutes - perfect coffee break time!&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;5. Verify Deployment&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get nodes  
# Should show 3 Ready nodes  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;🎉 &lt;em&gt;Congratulations! You now have a production-grade Kubernetes cluster.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Post-Setup Must-Do’s&lt;/h2&gt;
&lt;h3&gt;1. Enable Cluster Autoscaling&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;eksctl create iamserviceaccount \  
  --cluster=techwhale-cluster \  
  --namespace=kube-system \  
  --name=cluster-autoscaler \  
  --attach-policy-arn=arn:aws:iam::aws:policy/AmazonEKSClusterAutoscalerPolicy \  
  --approve  

kubectl apply -f https://raw.githubusercontent.com/kubernetes/autoscaler/master/cluster-autoscaler/cloudprovider/aws/examples/cluster-autoscaler-autodiscover.yaml  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. Install Kubernetes Dashboard&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Access via:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl proxy  
# Visit http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Pro Tips from AWS Experts ⚠️&lt;/h2&gt;
&lt;h3&gt;⚠️ Cost Optimization Hack&lt;/h3&gt;
&lt;p&gt;Use Spot Instances for non-critical workloads:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;nodeGroups:  
  - name: spot-ng  
    instanceType: t3.medium  
    desiredCapacity: 2  
    spot: true  
    ssh:  
      publicKeyPath: ~/.ssh/eks-cluster.pub  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cuts costs by up to 90%.&lt;/p&gt;
&lt;h3&gt;⚠️ Security Hardening&lt;/h3&gt;
&lt;p&gt;Enable encryption at rest:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;metadata:  
  name: secure-cluster  
  region: us-west-2  
  version: &quot;1.28&quot;  
  encrypted: true  
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;⚠️ Disaster Recovery Setup&lt;/h3&gt;
&lt;p&gt;Automate cluster backups:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;velero install \  
    --provider aws \  
    --plugins velero/velero-plugin-for-aws:v1.7.0 \  
    --bucket your-backup-bucket \  
    --backup-location-config region=us-west-2 \  
    --snapshot-location-config region=us-west-2  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Troubleshooting Common Issues&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: &lt;code&gt;kubectl&lt;/code&gt; commands timing out&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws eks update-kubeconfig --name techwhale-cluster --region us-west-2  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Nodes stuck in NotReady state&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl get nodes  
kubectl describe node  | grep -i taint  
# Remove NoSchedule taints if present  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Container images not pulling&lt;br&gt;
✅ Fix:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;kubectl create secret docker-registry ecr-cred \  
  --docker-server=ACCOUNT.dkr.ecr.REGION.amazonaws.com \  
  --docker-username=AWS \  
  --docker-password=$(aws ecr get-login-password)  
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Conclusion: Your Cluster, Supercharged&lt;/h2&gt;
&lt;p&gt;You’ve just deployed an enterprise-grade Kubernetes cluster that would make even Amazon engineers nod in approval. With EKS handling the heavy lifting, you’re free to focus on what matters - building amazing applications.&lt;/p&gt;
&lt;p&gt;Ready to level up? Explore these next steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implement GitOps with ArgoCD&lt;/li&gt;
&lt;li&gt;Set up Istio service mesh&lt;/li&gt;
&lt;li&gt;Automate deployments with EKS Blueprints&lt;/li&gt;
&lt;/ul&gt;</content:encoded><h:img src="/_astro/hero.5m-CQv27.png"/><enclosure url="/_astro/hero.5m-CQv27.png"/><author>Mayur Chavhan</author></item><item><title>The Best 10 DevOps Tools Available for Use in 2023</title><link>https://techwhale.in/the-best-10-devops-tools-available-for-use-in-2023</link><guid isPermaLink="true">https://techwhale.in/the-best-10-devops-tools-available-for-use-in-2023</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Sun, 25 Dec 2022 21:51:00 GMT</pubDate><content:encoded>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;DevOps has become an integral part of modern software development. The DevOps process aims to speed up software development and deployment while ensuring quality and reliability. To achieve this goal, DevOps teams use a wide range of tools to automate tasks, manage code, and track issues.&lt;/p&gt;
&lt;p&gt;In recent years, DevOps has evolved dramatically, and so have the tools used by DevOps teams. As we look ahead to 2023, we can expect even more advanced DevOps tools to be available to help teams streamline their processes and achieve their goals.&lt;/p&gt;
&lt;p&gt;Here are the top 10 DevOps tools that will be available for use in 2023:&lt;/p&gt;
&lt;h2&gt;1. Docker&lt;/h2&gt;
&lt;p&gt;Docker is one of the most popular DevOps tools available. It allows developers to package software into containers that can be easily moved between environments. This makes it easy to create consistent development, testing, and production environments. Docker has become an essential tool for DevOps teams, and we can expect it to become even more widely used in the years to come.&lt;/p&gt;
&lt;h2&gt;2. Jenkins&lt;/h2&gt;
&lt;p&gt;Jenkins is an open-source automation server that is used to automate many parts of the software development process. It can be used to build, test, and deploy code, as well as to automate other tasks such as code analysis and security testing. Jenkins has a large and active community of users and developers, which means that it is constantly improving and evolving.&lt;/p&gt;
&lt;h2&gt;3. GitLab&lt;/h2&gt;
&lt;p&gt;GitLab is a web-based Git repository manager that provides source code management, continuous integration, and continuous delivery. It is a complete DevOps platform that allows teams to manage the entire software development lifecycle. GitLab has become a popular alternative to GitHub, and we can expect it to continue to grow in popularity in the years to come.&lt;/p&gt;
&lt;h2&gt;4. Ansible&lt;/h2&gt;
&lt;p&gt;Ansible is an open-source automation tool that is used to automate many parts of the software development process. It can be used to deploy applications, manage configurations, and automate other tasks. Ansible has become an essential tool for many DevOps teams, and we can expect it to become even more widely used in the coming years.&lt;/p&gt;
&lt;h2&gt;5. Kubernetes&lt;/h2&gt;
&lt;p&gt;Kubernetes is an open-source container orchestration platform. It is used to automate the deployment, scaling, and management of containerized applications. Kubernetes has become the de facto standard for container orchestration, and we can expect it to continue to dominate the market in the years to come.&lt;/p&gt;
&lt;h2&gt;6. Grafana&lt;/h2&gt;
&lt;p&gt;Grafana is an open-source analytics and monitoring platform. It is used to visualize and analyze metrics from a wide variety of data sources. Grafana has become an essential tool for monitoring and troubleshooting complex systems, and we can expect it to continue to be widely used in the years to come.&lt;/p&gt;
&lt;h2&gt;7. Prometheus&lt;/h2&gt;
&lt;p&gt;Prometheus is an open-source monitoring system that is used to monitor containers, services, and applications. It is designed to be highly scalable and can handle millions of metrics per second. Prometheus has become a popular alternative to traditional monitoring tools, and we can expect it to continue to grow in popularity in the coming years.&lt;/p&gt;
&lt;h2&gt;8. Slack&lt;/h2&gt;
&lt;p&gt;Slack is a team communication platform that is used to improve collaboration and communication within DevOps teams. It is particularly useful for remote teams. Slack has become an essential tool for many teams, and we can expect it to continue to be widely used in the years to come.&lt;/p&gt;
&lt;h2&gt;9. Splunk&lt;/h2&gt;
&lt;p&gt;Splunk is an analytics and monitoring platform that is used to collect and analyze machine data. It is particularly useful for identifying issues and troubleshooting problems. Splunk has become an essential tool for many DevOps teams, and we can expect it to continue to be widely used in the coming years.&lt;/p&gt;
&lt;h2&gt;10. Nagios&lt;/h2&gt;
&lt;p&gt;Nagios is an open-source monitoring system that is used to monitor network devices, servers, and applications. It can be used to alert DevOps teams to issues before they become critical. Nagios has been around for a long time, and we can expect it to continue to be a popular choice for monitoring in the years to come.&lt;/p&gt;
&lt;p&gt;In conclusion, DevOps is a critical part of modern software development, and these 10 tools will be crucial for DevOps teams in 2023. As DevOps evolves and becomes more complex, we can expect even more advanced tools to be developed to help teams streamline their processes and achieve their goals. It is important to choose the right tools for your team&apos;s needs to ensure that your DevOps process is efficient, reliable, and effective.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;</content:encoded><h:img src="/_astro/hero.Bs9YjKNr.png"/><enclosure url="/_astro/hero.Bs9YjKNr.png"/><author>Mayur Chavhan</author></item><item><title>How To Configure Logging and Log Rotation in Nginx on an Ubuntu 22 and Debian 12</title><link>https://techwhale.in/how-to-configure-logging-and-log-rotation-in-nginx-on-an-ubuntu-22-and-debian-12</link><guid isPermaLink="true">https://techwhale.in/how-to-configure-logging-and-log-rotation-in-nginx-on-an-ubuntu-22-and-debian-12</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:24:00 GMT</pubDate><content:encoded>&lt;p&gt;Nginx is a popular web server used to serve web applications. It is known for its high performance, reliability, and scalability. Nginx logs all the requests that are processed by the server. These logs can be useful for troubleshooting issues with the server, analyzing traffic patterns, and monitoring server activity. However, if the logs are not properly configured and rotated, they can consume too much disk space and make it difficult to analyze the logs over time. In this guide, we will show you how to configure logging and log rotation in Nginx on an Ubuntu 22 and Debian Server 12.&lt;/p&gt;
&lt;h2&gt;Step 1: Configuring Nginx Logging&lt;/h2&gt;
&lt;p&gt;Nginx logs all the requests that are processed by the server. By default, Nginx logs all the requests to the error log file. However, it is recommended to configure separate access and error log files to make it easier to analyze the logs.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the Nginx configuration file &lt;code&gt;/etc/nginx/nginx.conf&lt;/code&gt; using a text editor. You can use any text editor of your choice, such as &lt;code&gt;nano&lt;/code&gt;, &lt;code&gt;vim&lt;/code&gt;, or &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nano /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Locate the &lt;code&gt;http&lt;/code&gt; block in the configuration file. This block contains the main configuration for the HTTP server.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the following lines to the &lt;code&gt;http&lt;/code&gt; block to enable logging: This will create two log files: &lt;code&gt;/var/log/nginx/access.log&lt;/code&gt; for all access logs and &lt;code&gt;/var/log/nginx/error.log&lt;/code&gt; for all error logs.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;access_log  /var/log/nginx/access.log;
error_log  /var/log/nginx/error.log;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the changes and exit the text editor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restart Nginx to apply the changes:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Step 2: Configuring Log Rotation&lt;/h2&gt;
&lt;p&gt;Log rotation is the process of archiving old log files and creating new ones to prevent disk space issues. In Nginx, log rotation can be configured using the &lt;code&gt;logrotate&lt;/code&gt; utility. The &lt;code&gt;logrotate&lt;/code&gt; utility is a system tool that can be used to manage log files.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new log rotation configuration file for Nginx:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nano /etc/logrotate.d/nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the following lines to the file: This configuration will rotate the logs daily, keep 52 rotated logs, compress the rotated logs, delay compression until the next rotation, and create new log files with permissions &lt;code&gt;0640&lt;/code&gt; owned by the &lt;code&gt;www-data&lt;/code&gt; and &lt;code&gt;adm&lt;/code&gt; groups.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;/var/log/nginx/*.log {
    daily
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    create 0640 www-data adm
    sharedscripts
    postrotate
        [ -f /run/nginx.pid ] &amp;#x26;&amp;#x26; kill -USR1 `cat /run/nginx.pid`
    endscript
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Save the changes and exit the text editor.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test the log rotation configuration: This command will force a log rotation and print any errors to the console.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo logrotate -f /etc/logrotate.d/nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Tips and Tricks&lt;/h2&gt;
&lt;h3&gt;Real-time Nginx logs&lt;/h3&gt;
&lt;p&gt;To view the Nginx logs in real-time, use the &lt;code&gt;tail&lt;/code&gt; command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;tail&lt;/code&gt; command will display the last few lines of the log file and wait for new lines to be added to the file. This is useful for monitoring the logs in real-time.&lt;/p&gt;
&lt;h3&gt;Analyzing Nginx logs&lt;/h3&gt;
&lt;p&gt;To analyze the Nginx logs, use a log analyzer like &lt;code&gt;goaccess&lt;/code&gt;. &lt;code&gt;goaccess&lt;/code&gt; is a command-line tool that can be used to generate reports from log files. &lt;code&gt;goaccess&lt;/code&gt; can generate reports in HTML, JSON, or CSV format.&lt;/p&gt;
&lt;p&gt;To install &lt;code&gt;goaccess&lt;/code&gt; on Ubuntu 22 or Debian Server 12, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt install goaccess
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To generate an HTML report from the access log, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;goaccess /var/log/nginx/access.log -o /var/www/html/report.html --log-format=COMBINED
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will generate an HTML report from the access log and save it to &lt;code&gt;/var/www/html/report.html&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Excluding specific requests from being logged&lt;/h3&gt;
&lt;p&gt;To exclude specific requests from being logged, use the &lt;code&gt;map&lt;/code&gt; directive in the Nginx configuration file. The &lt;code&gt;map&lt;/code&gt; directive can be used to define a variable that can be used in the configuration file.&lt;/p&gt;
&lt;p&gt;For example, to exclude requests that match the regular expression &lt;code&gt;~*^/admin&lt;/code&gt; from being logged, add the following configuration to the Nginx configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;map $request_uri $loggable {
    default 1;
    ~*^/admin 0;
}
server {
    ...
    access_log  /var/log/nginx/access.log combined if=$loggable;
    ...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This configuration will exclude requests that match the regular expression &lt;code&gt;~*^/admin&lt;/code&gt; from being logged.&lt;/p&gt;
&lt;h3&gt;Customizing log formats&lt;/h3&gt;
&lt;p&gt;By default, Nginx uses the &lt;code&gt;combined&lt;/code&gt; log format, which includes the client IP address, request time, request method, request URL, HTTP version, status code, size of the response, referrer, and user agent. However, you can customize the log format to include only the information that you need.&lt;/p&gt;
&lt;p&gt;To customize the log format, modify the &lt;code&gt;access_log&lt;/code&gt; directive in the Nginx configuration file. For example, to include only the client IP address, request time, request URL, and user agent, add the following line to the &lt;code&gt;http&lt;/code&gt; block in the Nginx configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;log_format  mylog  &apos;$remote_addr - $time_local - &quot;$request&quot; - &quot;$http_user_agent&quot;&apos;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, update the &lt;code&gt;access_log&lt;/code&gt; directive to use the new log format:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;access_log  /var/log/nginx/access.log mylog;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will create a log file at &lt;code&gt;/var/log/nginx/access.log&lt;/code&gt; using the &lt;code&gt;mylog&lt;/code&gt; log format.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this guide, we have shown you how to configure logging and log rotation in Nginx on an Ubuntu 22 and Debian Server 12. By following these steps, you can ensure that your Nginx logs are properly configured and rotated to prevent disk space issues and make it easier to analyze the logs when troubleshooting issues. We have also provided some tips and tricks to help you monitor and analyze the logs, customize log formats, and exclude specific requests from being logged.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.amr-SN8Q.png"/><enclosure url="/_astro/hero.amr-SN8Q.png"/><author>Mayur Chavhan</author></item><item><title>How to upgrade old version of Nginx on Ubuntu 22.04</title><link>https://techwhale.in/upgrade-old-version-of-nginx-on-ubuntu-2204</link><guid isPermaLink="true">https://techwhale.in/upgrade-old-version-of-nginx-on-ubuntu-2204</guid><description>How to upgrade old version of Nginx on Ubuntu 22.04</description><pubDate>Wed, 26 Jul 2023 11:46:00 GMT</pubDate><content:encoded>&lt;p&gt;Nginx is a powerful web server, load balancer, and reverse proxy that is used by some of the most popular websites in the world. It can help improve the performance and security of your web applications, and this guide will show you how to install the latest version of Nginx on Ubuntu 22.04.&lt;/p&gt;
&lt;p&gt;To install Nginx, you need to follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Log in as root To proceed with the installation of Nginx, you need to be logged in as root. If you are not already logged in as root, you can switch to the root user using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo -i
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Update package list The next step is to update the package list using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# apt update
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Install required packages Install the required packages to your system using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -y
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Import the Nginx signing key Import the Nginx signing key using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# wget -O- &amp;#x3C;https://nginx.org/keys/nginx_signing.key&gt; | gpg --dearmor \\
    | tee /etc/apt/trusted.gpg.d/nginx.gpg &gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Verify the key Verify that the downloaded file contains the proper key using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# gpg --dry-run --quiet --import --import-options import-show /etc/apt/trusted.gpg.d/nginx.gpg
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Set up the apt repository Set up the apt repository for stable Nginx packages using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# echo &quot;deb &amp;#x3C;http://nginx.org/packages/ubuntu&gt; `lsb_release -cs` nginx&quot; \\
    | tee /etc/apt/sources.list.d/nginx.list
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Update repository information Update the repository information using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# apt update
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Remove existing Nginx installations Remove all existing Nginx installations using the following command. (This step can be skipped on new systems.)&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# apt purge nginx nginx-common nginx-full nginx-core
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Install Nginx Install Nginx using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# apt install nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Verify the installation Verify the installation and Nginx version using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# nginx -v
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Enable the Nginx service Enable the Nginx service using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# systemctl enable nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Start Nginx Start Nginx using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# systemctl start nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Modify the default configuration The default configuration when installing Nginx through the Nginx repository differs from the default configuration when installing Nginx through the Ubuntu repository. We will modify a few things to achieve this. First, create additional directories using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# mkdir /etc/nginx/{modules-available,modules-enabled,sites-available,sites-enabled,snippets}
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Edit the nginx.conf file Edit the nginx.conf file using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# cat &gt; /etc/nginx/nginx.conf &amp;#x3C;&amp;#x3C;EOF
user  www-data;
worker_processes  auto;
pid        /var/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
    worker_connections  1024;
}
http {
    sendfile on;
    tcp_nopush on;
    types_hash_max_size 2048;

    server_tokens off;

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    access_log  /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    gzip  on;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
EOF
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Check the configuration Check the configuration using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# nginx -t
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Restart Nginx Restart Nginx using the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Test Nginx Test if Nginx is responding using the curl command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# curl localhost
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is important to note that this tutorial assumes you are using Ubuntu 22.04. If you are using a different version of Ubuntu or a different operating system, the commands may be different. Also, make sure you have appropriate permissions before running commands.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.Rgh1q5Of.png"/><enclosure url="/_astro/hero.Rgh1q5Of.png"/><author>Mayur Chavhan</author></item><item><title>How To Automate Initial Server Setup of Multiple Ubuntu 22.04 Servers Using Ansible</title><link>https://techwhale.in/how-to-automate-initial-server-setup-of-multiple-ubuntu-2204-servers-using-ansible</link><guid isPermaLink="true">https://techwhale.in/how-to-automate-initial-server-setup-of-multiple-ubuntu-2204-servers-using-ansible</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:34:00 GMT</pubDate><content:encoded>&lt;p&gt;Automation is a key aspect of modern infrastructure management. It allows you to quickly and easily perform repetitive tasks across multiple servers with minimal human intervention. Ansible is a popular automation tool that enables you to automate the initial server setup of multiple Ubuntu 22.04 servers with ease.&lt;/p&gt;
&lt;p&gt;In this guide, we will walk you through the steps to automate the initial server setup of multiple Ubuntu 22.04 servers using Ansible. We will cover the installation of Ansible, creating an inventory file, configuring SSH access, setting up sudo access, and installing some common packages.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before we begin, you will need the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Multiple Ubuntu 22.04 servers.&lt;/li&gt;
&lt;li&gt;A user account with sudo privileges on each server.&lt;/li&gt;
&lt;li&gt;Ansible installed on your local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Step 1: Installing Ansible&lt;/h2&gt;
&lt;p&gt;Ansible is not installed by default on Ubuntu 22.04. To install Ansible on your local machine, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on your local machine.&lt;/li&gt;
&lt;li&gt;Update the package lists and install Ansible with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt update
sudo apt install ansible
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Verify that Ansible is installed by running the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ansible --version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see the version of Ansible that you installed.&lt;/p&gt;
&lt;h2&gt;Step 2: Creating an Inventory File&lt;/h2&gt;
&lt;p&gt;The inventory file is a list of all the servers that Ansible should manage. This file is written in INI format and can be located anywhere on your local machine. To create an inventory file, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on your local machine.&lt;/li&gt;
&lt;li&gt;Create a new text file with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano inventory.ini
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Add the IP addresses or hostnames of each server to the file, one per line:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[webserver]
192.168.1.101
192.168.1.102

[database]
192.168.1.103
192.168.1.104
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, we have two groups of servers: webserver and database. The IP addresses of the servers in each group are listed below the group name.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Save and close the file.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Step 3: Configuring SSH Access&lt;/h2&gt;
&lt;p&gt;In order for Ansible to manage your servers, it needs to be able to connect to them using SSH. To configure SSH access, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Generate an SSH key pair on your local machine with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh-keygen
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Copy the public key to each server with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh-copy-id username@server_ip_address
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Test that you can connect to each server with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ssh username@server_ip_address
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 4: Setting Up Sudo Access&lt;/h2&gt;
&lt;p&gt;In order to perform certain tasks, such as installing packages, Ansible needs to be able to run commands with sudo privileges. To set up sudo access, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on each server.&lt;/li&gt;
&lt;li&gt;Add your user account to the sudo group with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo usermod -aG sudo username
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Test that your user account has sudo access with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo whoami
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see “root” as the output.&lt;/p&gt;
&lt;h2&gt;Step 5: Installing Common Packages&lt;/h2&gt;
&lt;p&gt;Now that Ansible is set up and configured to manage your servers, we can install some common packages. To do this, we will create a playbook.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new text file with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nano playbook.yml
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Add the following code to the file:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;---
- name: Install common packages
  hosts: all
  become: true
  tasks:
    - name: Update package lists
      apt:
        update_cache: yes

    - name: Install packages
      apt:
        name:
          - nano
          - git
          - curl
          - wget
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This playbook will update the package lists and install the Nano, Git, Curl, and Wget packages on all servers in the inventory file.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Save and close the file.&lt;/li&gt;
&lt;li&gt;Run the playbook with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ansible-playbook -i inventory.ini playbook.yml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ansible will connect to each server, update the package lists, and install the specified packages.&lt;/p&gt;
&lt;h2&gt;Step 6: Creating a Custom User&lt;/h2&gt;
&lt;p&gt;By default, Ubuntu 22.04 comes with a user named “ubuntu”. It is recommended that you create a custom user with a unique username and password for security reasons. To create a new user, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on each server.&lt;/li&gt;
&lt;li&gt;Create a new user with the following command, replacing “newuser” with your desired username:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo adduser newuser
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Set a password for the new user when prompted.&lt;/li&gt;
&lt;li&gt;Add the new user to the sudo group with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo usermod -aG sudo newuser
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Test that the new user has sudo access with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo whoami
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see “root” as the output.&lt;/p&gt;
&lt;h2&gt;Step 7: Configuring Firewall&lt;/h2&gt;
&lt;p&gt;A firewall is an essential security tool that prevents unauthorized access to your servers. Ubuntu 22.04 comes with UFW (Uncomplicated Firewall) pre-installed. To configure UFW, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on each server.&lt;/li&gt;
&lt;li&gt;Enable UFW with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo ufw enable
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Allow SSH access with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo ufw allow ssh
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Allow HTTP and HTTPS access (if applicable) with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo ufw allow http
sudo ufw allow https
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Verify that the firewall is configured correctly with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo ufw status verbose
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see the rules that you just configured listed.&lt;/p&gt;
&lt;h2&gt;Step 8: Configuring Timezone&lt;/h2&gt;
&lt;p&gt;By default, Ubuntu 22.04 is set to the UTC timezone. To change the timezone, follow these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a terminal window on each server.&lt;/li&gt;
&lt;li&gt;List the available time zones with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;timedatectl list-timezones
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Set the timezone to your desired timezone with the following command, replacing “America/New_York” with your desired timezone:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo timedatectl set-timezone America/New_York
&lt;/code&gt;&lt;/pre&gt;
&lt;ol&gt;
&lt;li&gt;Verify that the timezone is set correctly with the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;timedatectl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see the timezone that you just set listed.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this guide, we have shown you how to automate the initial server setup of multiple Ubuntu 22.04 servers using Ansible. We covered the installation of Ansible, creating an inventory file, configuring SSH access, setting up sudo access, installing some common packages, creating a custom user, configuring firewall, and configuring timezone. With this knowledge, you can easily automate the setup and configuration of your infrastructure, saving you time and effort.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.Bs1F3PyI.jpg"/><enclosure url="/_astro/hero.Bs1F3PyI.jpg"/><author>Mayur Chavhan</author></item><item><title>How to Install AWS CLI on Linux, Windows, and Mac</title><link>https://techwhale.in/how-to-install-aws-cli-on-linux-windows-and-mac</link><guid isPermaLink="true">https://techwhale.in/how-to-install-aws-cli-on-linux-windows-and-mac</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:30:00 GMT</pubDate><content:encoded>&lt;p&gt;AWS CLI (Command Line Interface) is a command-line tool used by developers and system administrators to interact with AWS services. In this tutorial, we will learn how to install AWS CLI on Linux, Windows, and Mac. We will also learn some tips and tricks to make working with AWS CLI easier.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before we start, make sure you have the following prerequisites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Linux, Windows, or Mac machine with administrative privileges&lt;/li&gt;
&lt;li&gt;Python 2.7.9 or later, or Python 3.4 or later&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Installing AWS CLI on Linux&lt;/h2&gt;
&lt;p&gt;Follow the steps below to install AWS CLI on Linux:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the terminal on your Linux machine.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the package list:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the AWS CLI package:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get install awscli
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the installation:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws --version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above command should output the version of AWS CLI installed on your machine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Installing AWS CLI on Windows&lt;/h2&gt;
&lt;p&gt;Follow the steps below to install AWS CLI on Windows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Download the AWS CLI MSI installer for Windows from the &lt;a href=&quot;https://aws.amazon.com/cli/&quot;&gt;official AWS CLI website&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the installer and follow the prompts to install AWS CLI.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open Command Prompt or PowerShell and run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws --version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above command should output the version of AWS CLI installed on your machine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Installing AWS CLI on Mac&lt;/h2&gt;
&lt;p&gt;Follow the steps below to install AWS CLI on Mac:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the terminal on your Mac machine.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install AWS CLI using Homebrew:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;brew install awscli
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the installation:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws --version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above command should output the version of AWS CLI installed on your machine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Tips and Tricks&lt;/h2&gt;
&lt;h3&gt;Multiple AWS Profiles&lt;/h3&gt;
&lt;p&gt;You can configure multiple AWS profiles on your machine. This is useful if you have multiple AWS accounts or if you are working with multiple IAM users.&lt;/p&gt;
&lt;p&gt;To create a new AWS profile, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws configure --profile &amp;#x3C;profile-name&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#x3C;profile-name&gt;&lt;/code&gt; with the name of your new profile. Follow the prompts to provide your AWS access key, secret access key, region, and output format.&lt;/p&gt;
&lt;p&gt;To switch between AWS profiles, specify the profile name when running AWS CLI commands:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws s3 ls --profile &amp;#x3C;profile-name&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Using AWS SSO&lt;/h3&gt;
&lt;p&gt;If your organization uses AWS SSO (Single Sign-On), you can use AWS CLI to log in to your AWS account without providing your AWS access key and secret access key.&lt;/p&gt;
&lt;p&gt;To use AWS SSO with AWS CLI, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws sso login --profile &amp;#x3C;profile-name&gt; --region &amp;#x3C;aws-region&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#x3C;profile-name&gt;&lt;/code&gt; with the name of your AWS profile and &lt;code&gt;&amp;#x3C;aws-region&gt;&lt;/code&gt; with the AWS region you want to log in to.&lt;/p&gt;
&lt;h3&gt;Syncing Files to Amazon S3&lt;/h3&gt;
&lt;p&gt;You can use AWS CLI to sync files and directories to Amazon S3. This is useful for backing up files to Amazon S3 or for distributing files to a large number of users.&lt;/p&gt;
&lt;p&gt;To sync a local directory to an S3 bucket, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws s3 sync /path/to/local/directory s3://&amp;#x3C;bucket-name&gt;/&amp;#x3C;prefix&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;/path/to/local/directory&lt;/code&gt; with the path to your local directory, &lt;code&gt;&amp;#x3C;bucket-name&gt;&lt;/code&gt; with the name of your S3 bucket, and &lt;code&gt;&amp;#x3C;prefix&gt;&lt;/code&gt; with the prefix to use for the uploaded files.&lt;/p&gt;
&lt;h3&gt;Copying Files Between Amazon S3 Buckets&lt;/h3&gt;
&lt;p&gt;You can use AWS CLI to copy files between Amazon S3 buckets. This is useful if you want to duplicate files in different buckets or regions.&lt;/p&gt;
&lt;p&gt;To copy a file between S3 buckets, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aws s3 cp s3://&amp;#x3C;source-bucket&gt;/&amp;#x3C;source-key&gt; s3://&amp;#x3C;destination-bucket&gt;/&amp;#x3C;destination-key&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;#x3C;source-bucket&gt;&lt;/code&gt; with the name of the source S3 bucket, &lt;code&gt;&amp;#x3C;source-key&gt;&lt;/code&gt; with the key of the source file, &lt;code&gt;&amp;#x3C;destination-bucket&gt;&lt;/code&gt; with the name of the destination S3 bucket, and &lt;code&gt;&amp;#x3C;destination-key&gt;&lt;/code&gt; with the key of the destination file.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this tutorial, we learned how to install AWS CLI on Linux, Windows, and Mac. We also learned some tips and tricks to make working with AWS CLI easier. With AWS CLI, you can manage your AWS infrastructure from the command line, making it easier to automate common tasks.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BXB-u9Dp.jpg"/><enclosure url="/_astro/hero.BXB-u9Dp.jpg"/><author>Mayur Chavhan</author></item><item><title>How to Install MariaDB 11.0 With phpMyAdmin on Rocky / AmaLinux</title><link>https://techwhale.in/how-to-install-mariadb-110-with-phpmyadmin-on-rocky-amalinux</link><guid isPermaLink="true">https://techwhale.in/how-to-install-mariadb-110-with-phpmyadmin-on-rocky-amalinux</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:15:00 GMT</pubDate><content:encoded>&lt;p&gt;MariaDB is an open-source relational database management system that is a drop-in replacement for MySQL. It is developed by the original creators of MySQL and is widely used in web applications. phpMyAdmin is a free and open-source web-based application that provides a graphical user interface for managing MySQL and MariaDB databases. In this tutorial, we will install MariaDB 11.0 and phpMyAdmin on Rocky / AmaLinux.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before starting the installation process, make sure that you have the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Rocky / AmaLinux server with sudo privileges.&lt;/li&gt;
&lt;li&gt;Access to the internet to download and install the required packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Step 1: Update the System&lt;/h2&gt;
&lt;p&gt;The first step is to update the system packages to their latest versions. Open the terminal and execute the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo yum update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will update all the installed packages to their latest versions.&lt;/p&gt;
&lt;h2&gt;Step 2: Install MariaDB 11.0&lt;/h2&gt;
&lt;p&gt;To install MariaDB 11.0, execute the following command in the terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo yum install -y mariadb-server
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will install the MariaDB server on your system. Once the installation is complete, start the MariaDB service and enable it to start at boot time using the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl start mariadb
sudo systemctl enable mariadb
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, run the following command to secure your MariaDB server:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will prompt you to set a root password, remove anonymous users, disallow remote root login, and remove test databases. Follow the prompts and answer the questions to secure your MariaDB server.&lt;/p&gt;
&lt;h2&gt;Step 3: Install phpMyAdmin&lt;/h2&gt;
&lt;p&gt;To install phpMyAdmin, execute the following command in the terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo yum install -y epel-release
sudo yum install -y phpMyAdmin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will install phpMyAdmin and its dependencies on your system.&lt;/p&gt;
&lt;h2&gt;Step 4: Configure phpMyAdmin&lt;/h2&gt;
&lt;p&gt;After installing phpMyAdmin, you need to configure it to work with MariaDB. Open the phpMyAdmin configuration file using the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this file, find the following line:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;#x3C;IfModule mod_authz_core.c&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the following lines after it:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;# Apache 2.4
&amp;#x3C;RequireAny&gt;
Require ip 127.0.0.1
Require ip ::1
&amp;#x3C;/RequireAny&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Save and close the file.&lt;/p&gt;
&lt;h2&gt;Step 5: Restart the Services&lt;/h2&gt;
&lt;p&gt;After making the necessary changes to the configuration files, restart the services using the following commands:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl restart httpd
sudo systemctl restart mariadb
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 6: Access phpMyAdmin&lt;/h2&gt;
&lt;p&gt;Open your web browser and navigate to the following URL:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;&amp;#x3C;http://your-server-ip/phpMyAdmin&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace ‘your-server-ip’ with the IP address of your server. You will be prompted to enter your MariaDB username and password. Enter the credentials and click on the ‘Go’ button to access the phpMyAdmin dashboard.&lt;/p&gt;
&lt;h2&gt;Issues and Fixes&lt;/h2&gt;
&lt;p&gt;If you encounter any issues during the installation process, try the following fixes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you get the error ‘No package epel-release available’, run the following command and try again:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo yum install -y &amp;#x3C;https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;If you get the error ‘Access denied for user ‘root‘@’localhost’ (using password: YES)’, try resetting the MariaDB root password using the following commands:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo systemctl stop mariadb
sudo mysqld_safe --skip-grant-tables &amp;#x26;
mysql -u root
UPDATE mysql.user SET Password=PASSWORD(&apos;new_password&apos;) WHERE User=&apos;root&apos;;
FLUSH PRIVILEGES;
exit;
sudo systemctl start mariadb
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;If you get the error ‘Cannot connect: invalid settings’, open the phpMyAdmin configuration file using the following command and replace the existing lines with the following:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$cfg[&apos;Servers&apos;][$i][&apos;auth_type&apos;] = &apos;cookie&apos;;
$cfg[&apos;Servers&apos;][$i][&apos;host&apos;] = &apos;localhost&apos;;
$cfg[&apos;Servers&apos;][$i][&apos;compress&apos;] = false;
$cfg[&apos;Servers&apos;][$i][&apos;AllowNoPassword&apos;] = false;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this tutorial, we have shown you how to install MariaDB 11.0 with phpMyAdmin on Rocky / AmaLinux. We have also shown you how to configure phpMyAdmin and access it from a web browser. If you encounter any issues during the installation process, try the available fixes.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.HYfiMl0O.png"/><enclosure url="/_astro/hero.HYfiMl0O.png"/><author>Mayur Chavhan</author></item><item><title>How to install Podman Compose on Debian 12 (Bookworm)</title><link>https://techwhale.in/how-to-install-podman-compose-on-debian-12-bookworm</link><guid isPermaLink="true">https://techwhale.in/how-to-install-podman-compose-on-debian-12-bookworm</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:09:00 GMT</pubDate><content:encoded>&lt;p&gt;f you are running Debian 12 (Bookworm) and want to use Docker Compose or Podman Compose, here are the steps to install Podman Compose on your system.&lt;/p&gt;
&lt;h2&gt;Comparing Docker and Podman&lt;/h2&gt;
&lt;p&gt;Docker and Podman are both container runtimes, but they have some differences in their architecture and features.&lt;/p&gt;
&lt;h3&gt;Architecture&lt;/h3&gt;
&lt;p&gt;Docker uses a client-server architecture, where the Docker client communicates with the Docker daemon to manage containers. The Docker daemon runs as a background process on the host machine.&lt;/p&gt;
&lt;p&gt;Podman, on the other hand, uses a daemonless architecture, where each container is managed as a separate process on the host machine. This makes Podman more lightweight and secure than Docker.&lt;/p&gt;
&lt;h3&gt;Features&lt;/h3&gt;
&lt;p&gt;Docker has a larger ecosystem and more features than Podman, including a wider variety of plugins and tools. However, Podman has some unique features that Docker does not have, such as rootless containers and the ability to run containers without a daemon.&lt;/p&gt;
&lt;h2&gt;Installing Podman Compose&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add the Podman repository to your system by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;echo &quot;deb &amp;#x3C;https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/&gt; /&quot; | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the repository key to your system by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -L &amp;#x3C;https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_12/Release.key&gt; | sudo apt-key add -
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Update the package list by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Podman Compose by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get install podman-compose
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify Podman Compose installation by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;podman-compose version
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the installation was successful, you should see the version number of Podman Compose.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Both Docker and Podman have their strengths and weaknesses, and the choice of which one to use depends on your specific use case and requirements. If you value security and lightweight architecture, Podman may be a better choice for you. If you need a wider variety of tools and plugins, Docker may be the better option.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BHduAHBJ.jpg"/><enclosure url="/_astro/hero.BHduAHBJ.jpg"/><author>Mayur Chavhan</author></item><item><title>Automate Linux System Management with Ansible System Roles</title><link>https://techwhale.in/automate-linux-system-management-with-ansible-system-roles</link><guid isPermaLink="true">https://techwhale.in/automate-linux-system-management-with-ansible-system-roles</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 13 Jul 2023 21:19:00 GMT</pubDate><content:encoded>&lt;p&gt;Ansible is an open-source automation tool that allows you to automate tasks across multiple servers. Ansible System Roles are pre-written Ansible playbooks that are designed to automate the installation, configuration, and management of specific services and applications on Linux systems.&lt;/p&gt;
&lt;p&gt;By using Ansible System Roles, you can automate the deployment of various applications and services like Apache, MySQL, Nginx, PostgreSQL, and many more. In this guide, we will walk you through the steps to automate Linux systems with Ansible System Roles.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Before we start, you need to have Ansible installed on your system. You can install Ansible by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo apt-get install ansible
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step 1: Create a Playbook&lt;/h2&gt;
&lt;p&gt;The first step in automating Linux systems with Ansible System Roles is to create a playbook. A playbook is a file that contains a set of instructions that Ansible will execute on your servers.&lt;/p&gt;
&lt;p&gt;To create a playbook, create a file with a &lt;code&gt;.yml&lt;/code&gt; extension and add the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install Apache
  hosts: webservers
  become: true
  roles:
    - geerlingguy.apache
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we have specified the name of the playbook, the hosts on which the playbook will be executed, and the Ansible System Role that we want to use for installing Apache. In this case, we are using the &lt;code&gt;geerlingguy.apache&lt;/code&gt; System Role.&lt;/p&gt;
&lt;h2&gt;Step 2: Define Hosts&lt;/h2&gt;
&lt;p&gt;The next step is to define the hosts on which you want to execute the playbook. You can define hosts in the &lt;code&gt;/etc/ansible/hosts&lt;/code&gt; file. Open the file with your favorite text editor and add the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;[webservers]
server1.example.com
server2.example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we have defined a group of hosts with the name &lt;code&gt;webservers&lt;/code&gt; and added two servers to the group.&lt;/p&gt;
&lt;h2&gt;Step 3: Execute the Playbook&lt;/h2&gt;
&lt;p&gt;Now that we have created the playbook and defined the hosts, we can execute the playbook by running the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;ansible-playbook playbook.yml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above command, &lt;code&gt;playbook.yml&lt;/code&gt; is the name of the playbook that we created in Step 1.&lt;/p&gt;
&lt;h2&gt;Example 1: Install Nginx&lt;/h2&gt;
&lt;p&gt;To install Nginx using Ansible System Roles, create a playbook with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install Nginx
  hosts: webservers
  become: true
  roles:
    - geerlingguy.nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are using the &lt;code&gt;geerlingguy.nginx&lt;/code&gt; System Role to install Nginx.&lt;/p&gt;
&lt;h2&gt;Example 2: Install MySQL&lt;/h2&gt;
&lt;p&gt;To install MySQL using Ansible System Roles, create a playbook with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install MySQL
  hosts: databases
  become: true
  roles:
    - geerlingguy.mysql
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are using the &lt;code&gt;geerlingguy.mysql&lt;/code&gt; System Role to install MySQL.&lt;/p&gt;
&lt;h2&gt;Example 3: Install PostgreSQL&lt;/h2&gt;
&lt;p&gt;To install PostgreSQL using Ansible System Roles, create a playbook with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install PostgreSQL
  hosts: databases
  become: true
  roles:
    - geerlingguy.postgresql
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are using the &lt;code&gt;geerlingguy.postgresql&lt;/code&gt; System Role to install PostgreSQL.&lt;/p&gt;
&lt;h2&gt;Example 4: Install Redis&lt;/h2&gt;
&lt;p&gt;To install Redis using Ansible System Roles, create a playbook with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install Redis
  hosts: cacheservers
  become: true
  roles:
    - geerlingguy.redis
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are using the &lt;code&gt;geerlingguy.redis&lt;/code&gt; System Role to install Redis.&lt;/p&gt;
&lt;h2&gt;Example 5: Install Docker&lt;/h2&gt;
&lt;p&gt;To install Docker using Ansible System Roles, create a playbook with the following code:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;---
- name: Install Docker
  hosts: dockerservers
  become: true
  roles:
    - geerlingguy.docker
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the above code, we are using the &lt;code&gt;geerlingguy.docker&lt;/code&gt; System Role to install Docker.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this guide, we have shown you how to automate Linux systems with Ansible System Roles. By using Ansible System Roles, you can easily automate the deployment of various applications and services on your Linux servers. With the examples provided in this guide, you can now start automating your Linux systems with Ansible System Roles.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BL0bq2Tv.png"/><enclosure url="/_astro/hero.BL0bq2Tv.png"/><author>Mayur Chavhan</author></item><item><title>How to install PM2 (Process Management) on Ubuntu 22.10 / Debian 11</title><link>https://techwhale.in/how-to-install-pm2-process-management-on-ubuntu-2210-debian-11</link><guid isPermaLink="true">https://techwhale.in/how-to-install-pm2-process-management-on-ubuntu-2210-debian-11</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Fri, 19 May 2023 06:23:00 GMT</pubDate><content:encoded>&lt;p&gt;PM2 is a fantastic process manager designed specifically for Node.js applications.&lt;/p&gt;
&lt;p&gt;Throughout my journey as a web developer, I&apos;ve worked extensively with Node.js. I&apos;ve had to schedule and manage a multitude of Node.js applications using CRON, which, let me tell you, was no walk in the park. That was until I discovered PM2! It was a game-changer, making my life significantly easier. PM2 ensures my apps are always up and running, and it automatically refreshes them whenever I make updates. Plus, it gives me the flexibility to manually set the reload time using CRON or adjust the restart delay for any application. The best part? It works seamlessly across all operating systems!&lt;/p&gt;
&lt;p&gt;Now, you might be thinking, &quot;Is PM2 only for Node.js apps?&quot; The answer is a resounding no! While PM2 was indeed created with Node.js applications in mind, its utility isn&apos;t confined to just that. After using PM2 for a while, I discovered that it can manage scripts from any programming language! I gave it a whirl with Python, and guess what? It worked like a charm!&lt;/p&gt;
&lt;p&gt;In this article, I&apos;m going to share a practical example of how you can schedule and automate your Python scripts using PM2. So, buckle up and let&apos;s dive in!&lt;/p&gt;
&lt;p&gt;Step 1: Update Your System&lt;/p&gt;
&lt;p&gt;First things first, let&apos;s make sure your system is up-to-date. Open up your terminal and type in the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo apt update   &lt;/code&gt;&lt;br&gt;
This command will fetch the list of available updates and then upgrade your system. The -y flag automatically confirms all prompts, saving you from having to manually approve each update.&lt;/p&gt;
&lt;p&gt;Step 2: Install Node.js&lt;/p&gt;
&lt;p&gt;PM2 is a Node.js application, so we&apos;ll need to have Node.js installed on our system. Here&apos;s how to do it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo apt install nodejs -y   &lt;/code&gt;&lt;br&gt;
Once the installation is complete, you can verify it by checking the version of Node.js:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nodejs -v   &lt;/code&gt;&lt;br&gt;
You should see a version number as the output, which means Node.js is installed correctly.&lt;/p&gt;
&lt;p&gt;Step 3: Install NPM (Node Package Manager)&lt;/p&gt;
&lt;p&gt;NPM is the default package manager for Node.js and it&apos;s what we&apos;ll use to install PM2. To install NPM, use the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo apt install npm -y   &lt;/code&gt;&lt;br&gt;
Just like we did with Node.js, we can check if NPM is installed correctly:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm -v   &lt;/code&gt;&lt;br&gt;
If you see a version number, you&apos;re good to go!&lt;/p&gt;
&lt;p&gt;Step 4: Install PM2&lt;/p&gt;
&lt;p&gt;Now that we have Node.js and NPM installed, we can finally install PM2. Here&apos;s the command to do it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo npm install -g pm2   &lt;/code&gt;&lt;br&gt;
The -g flag installs PM2 globally, which means you can use it from any directory on your system.&lt;/p&gt;
&lt;p&gt;To check if PM2 is installed correctly, you can use the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pm2 -v   &lt;/code&gt;&lt;br&gt;
If you see a version number, congratulations! You&apos;ve successfully installed PM2 on your Ubuntu 22.10 or Debian 11 system.&lt;/p&gt;
&lt;p&gt;Step 5: Set PM2 to Start on Boot&lt;/p&gt;
&lt;p&gt;One of the great things about PM2 is that it can automatically restart your applications if your system reboots. To set this up, you can use the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pm2 startup   &lt;/code&gt;&lt;br&gt;
This command will generate a command that you need to run with superuser privileges. Copy the outputted command and run it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u yourusername --hp /home/yourusername   &lt;/code&gt;&lt;br&gt;
Remember to replace yourusername with your actual username.&lt;/p&gt;
&lt;p&gt;And there you have it! You&apos;ve installed PM2 on your Ubuntu 22.10 or Debian 11 system. Now you can use PM2 to manage and keep your Node.js, Python or Any script or applications running in the background.&lt;/p&gt;
&lt;p&gt;Thank you for reading.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.BQpXE-ZV.png"/><enclosure url="/_astro/hero.BQpXE-ZV.png"/><author>Mayur Chavhan</author></item><item><title>How to bypass specific website or IP from OpenVPN connection on Mac</title><link>https://techwhale.in/how-to-bypass-specific-website-or-ip-from-openvpn-connection-on-mac</link><guid isPermaLink="true">https://techwhale.in/how-to-bypass-specific-website-or-ip-from-openvpn-connection-on-mac</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Fri, 21 Apr 2023 14:02:00 GMT</pubDate><content:encoded>&lt;p&gt;We all have sites that needs to bypass the VPN connection and OpenVPN is popular open source VPN software but it lacks to have bypass a website from it’s network but if you’ve a mac then it’s a easy process as shown in below guide and hope it helps you.&lt;/p&gt;
&lt;p&gt;To bypass specific websites or IP addresses from OpenVPN connection on a Mac, you can use the route command to exclude them from the VPN tunnel. Here’s how you can do it:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the Terminal app on your Mac. You can find it in Applications &gt; Utilities.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;First, find your default gateway IP address. You can do this by running the following command in Terminal:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;netstat -nr | grep default
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will display your default gateway IP address in the second column. Note it down as you’ll need it in the next steps.&lt;/p&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Now, find the IP address of the website you want to bypass. You can use the following command, replacing “example.com” with the website you want to bypass:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;nslookup example.com
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command will give you the IP address of the website. Note it down as you’ll need it in the next steps.&lt;/p&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;To bypass the website from theOpenVPN connection, use the route command with the following syntax, replacing “your_gateway_ip” with the default gateway IP you noted down earlier, and “website_ip” with the IP address of the website you want to bypass:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo route add -host website_ip your_gateway_ip
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For example, if your default gateway IP is 192.168.1.1 and the website’s IP is 123.45.67.89, the command would be:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo route add -host 123.45.67.89 192.168.1.1
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;5&quot;&gt;
&lt;li&gt;
&lt;p&gt;You will be prompted to enter your Mac’s admin password to execute the command. Once you’ve entered the password, the route will be added, and the specified website will be bypassed from the OpenVPN connection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To check if the bypass is working, you can visit the website and check your IP address. It should show your regular IP address instead of the VPN IP address.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you want to remove the bypass, you can use the following command, replacing “website_ip” with the IP address of the website you want to remove the bypass for:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo route delete -host website_ip
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;8&quot;&gt;
&lt;li&gt;You can repeat steps 3-7 for any additional websites or IP addresses you want to bypass from the OpenVPN connection.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: These changes are temporary and will be reset when you restart your Mac. To make the bypass permanent, you can create a script to run these commands at startup or add them to your OpenVPN configuration file.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.B7JTzeBu.jpg"/><enclosure url="/_astro/hero.B7JTzeBu.jpg"/><author>Mayur Chavhan</author></item><item><title>Streamline Your Container Updates with Docker: A Step-by-Step Guide</title><link>https://techwhale.in/update-your-docker-compose-containers-easily-with-two-steps</link><guid isPermaLink="true">https://techwhale.in/update-your-docker-compose-containers-easily-with-two-steps</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Thu, 30 Jun 2022 21:55:00 GMT</pubDate><content:encoded>&lt;p&gt;Updating your Docker containers can be a tedious and time-consuming process, especially if you have multiple containers running simultaneously. However, with the right tools and strategies in place, it&apos;s possible to streamline this process and make it much more efficient.&lt;/p&gt;
&lt;p&gt;Here are some steps you can follow to easily update your Docker containers:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Identify the containers that need to be updated: Before you can update your containers, you&apos;ll need to identify which ones need updating. This can be done by running the &quot;docker ps&quot; command and looking for containers with outdated images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pull the updated images: Once you&apos;ve identified the containers that need updating, you can use the &quot;docker pull&quot; command to retrieve the updated images. This will ensure that you have the latest version of the image available.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Stop and remove the old containers: To update a container, you&apos;ll need to stop and remove the old one first. You can do this with the &quot;docker stop&quot; and &quot;docker rm&quot; commands.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the updated container: Once the old container has been stopped and removed, you can use the &quot;docker run&quot; command to start the updated container. Make sure to specify the updated image name and any necessary environment variables or command-line arguments.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Repeat the process for all necessary containers: If you have multiple containers that need updating, simply repeat these steps for each one.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can use following commands as an examples:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pull the updated images for your containers from the Docker registry. You can do this by running the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;docker-compose pull
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Stop and remove the existing containers. You can do this by running the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;docker-compose down
&lt;/code&gt;&lt;/pre&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Recreate the containers using the updated images. You can do this by running the following command:&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will update the containers with the latest versions of the images and recreate them with the updated configuration.&lt;/p&gt;
&lt;p&gt;Alternatively, you can use the &lt;code&gt;--force-recreate&lt;/code&gt; flag with the &lt;code&gt;up&lt;/code&gt; command to force the recreation of the containers, even if their configuration has not changed.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;docker-compose up -d --force-recreate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By following these steps, you can easily update your Docker containers and ensure that you&apos;re running the latest and most secure versions. Happy containerizing!&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.CyDYSu4x.png"/><enclosure url="/_astro/hero.CyDYSu4x.png"/><author>Mayur Chavhan</author></item><item><title>How to launch Traefik reverse proxy using docker-compose?</title><link>https://techwhale.in/how-to-launch-traefik-reverse-proxy-using-docker-compose</link><guid isPermaLink="true">https://techwhale.in/how-to-launch-traefik-reverse-proxy-using-docker-compose</guid><description>launch traefik reverse proxy using docker compose yaml file</description><pubDate>Wed, 29 Jun 2022 16:47:00 GMT</pubDate><content:encoded>&lt;p&gt;There is a growing demand for centralised, multi-domain, and secure application hosting in light of the proliferation of reverse proxy services. This is partly due to the accessibility of numerous open source projects that encourage experimentation.&lt;/p&gt;
&lt;p&gt;Therefore, Traefik is introduced as a reverse proxy, and although there is much discussion about how easy it is to use, most users will find the documentation to be difficult to understand. Even though I am one of them, I have found a method to overcome my situation, and I hope to teach others to do the same.&lt;/p&gt;
&lt;p&gt;I&apos;m using Traefik as a reverse proxy to publish and secure services that are running in Docker containers because that&apos;s where most of the popular open source projects are housed. In this blog post, I&apos;ll show you how to use docker-compose to deploy Traefik 2 across many hosts on a local machine.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/posts/21/DALLE-2022-12-26-02.49.31-3d-render-of-whale-with-containers-in-sea.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If you&apos;re using Docker and want to utilize Traefik as a reverse proxy, you may use docker-compose to set up the Traefik container and any additional containers you&apos;d like to run behind the proxy.&lt;/p&gt;
&lt;p&gt;Here is an example &lt;code&gt;docker-compose.yml&lt;/code&gt; file that sets up Traefik as a reverse proxy:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;version: &apos;3&apos;

services:
  traefik:
    image: traefik:latest
    command: --api --docker
    ports:
      - &quot;80:80&quot;
      - &quot;8080:8080&quot;
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.toml:/etc/traefik/traefik.toml
      - ./acme.json:/acme.json
    networks:
      - web

networks:
  web:
    driver: bridge
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This &lt;code&gt;docker-compose.yml&lt;/code&gt; file does the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defines a single service, named &lt;code&gt;traefik&lt;/code&gt;, that runs the latest version of the Traefik Docker image.&lt;/li&gt;
&lt;li&gt;Exposes the Traefik dashboard on port 8080 and the default HTTP port (80) to the host machine.&lt;/li&gt;
&lt;li&gt;Mounts the Docker socket file as a volume, so that Traefik can listen for container events and update its configuration accordingly.&lt;/li&gt;
&lt;li&gt;Mounts a configuration file (&lt;code&gt;traefik.toml&lt;/code&gt;) and an ACME JSON file (&lt;code&gt;acme.json&lt;/code&gt;), which are used to configure Traefik&apos;s behavior and store SSL certificates, respectively.&lt;/li&gt;
&lt;li&gt;Creates a custom network named &lt;code&gt;web&lt;/code&gt; and assigns the &lt;code&gt;traefik&lt;/code&gt; service to it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To start Traefik and any other containers behind the proxy, run the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will start the &lt;code&gt;traefik&lt;/code&gt; service in the background (detached mode) and create any other necessary containers, as specified in the &lt;code&gt;docker-compose.yml&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;Note: The specific configuration options used in the &lt;code&gt;traefik.toml&lt;/code&gt; file will depend on your specific needs and setup. You can find more information about how to configure Traefik in the &lt;a href=&quot;https://docs.traefik.io/&quot;&gt;Traefik documentation&lt;/a&gt;.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.Cxoo4REF.png"/><enclosure url="/_astro/hero.Cxoo4REF.png"/><author>Mayur Chavhan</author></item><item><title>How to secure your site from SQL Injection, Exploits and Spamming Agents using Nginx.</title><link>https://techwhale.in/how-to-secure-your-site-from-sql-injection-exploits-and-spamming-agents-using-nginx</link><guid isPermaLink="true">https://techwhale.in/how-to-secure-your-site-from-sql-injection-exploits-and-spamming-agents-using-nginx</guid><description>nginx securing configuration for attacker using SQL injection, File Injection, SPAM and User Agents</description><pubDate>Mon, 19 Jul 2021 19:37:00 GMT</pubDate><content:encoded>&lt;p&gt;Nginx is one of most popular web server that has so many features that even it may surprise you. One of best feature of Nginx that it has huge library of security policies that it makes your web-server absolute hacker-proof and you won&apos;t even need another tool to protect your sites.&lt;/p&gt;
&lt;p&gt;All your Nginx sites config can be import from another location so for clean code we are going to keep the security policies on a separate configuration file.&lt;/p&gt;
&lt;p&gt;Lets call our file a &lt;strong&gt;security.conf&lt;/strong&gt; under &lt;strong&gt;&quot;/etc/nginx/&quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are variant of attacks can be done by attackers and famous attack types are listed down below,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SQL Injection&lt;/li&gt;
&lt;li&gt;File Injection&lt;/li&gt;
&lt;li&gt;Spam&lt;/li&gt;
&lt;li&gt;User Agents&lt;/li&gt;
&lt;li&gt;Bandwidth Hogs and Hacking Tools&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here&apos;s the &lt;strong&gt;security.conf&lt;/strong&gt; file content as follows,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ cd /etc/nginx
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ nano security.conf 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Paste below code into the file and save the file using CTRL + X and ENTER.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;##
# Protection against SQL injection
##
location ~* &quot;(eval()&quot;  { deny all; }
location ~* &quot;(127.0.0.1)&quot;  { deny all; }
location ~* &quot;([a-z0-9]{2000})&quot; { deny all; }
location ~* &quot;(javascript:)(.*)(;)&quot;  { deny all; }
location ~* &quot;(base64_encode)(.*)(()&quot;  { deny all; }
location ~* &quot;(GLOBALS|REQUEST)(=|[|%)&quot;  { deny all; }
location ~* &quot;(&amp;#x3C;|%3C).*script.*(&gt;|%3)&quot; { deny all; }
location ~ &quot;(|...|../|~|`|&amp;#x3C;|&gt;||)&quot; { deny all; }
location ~* &quot;(boot.ini|etc/passwd|self/environ)&quot; { deny all; }
location ~* &quot;(thumbs?(_editor|open)?|tim(thumb)?).php&quot; { deny all; }
location ~* &quot;(&apos;|&quot;)(.*)(drop|insert|md5|select|union)&quot; { deny all; }
location ~* &quot;(https?|ftp|php):/&quot; { deny all; }
location ~* &quot;(=&apos;|=%27|/&apos;/?).&quot; { deny all; }
location ~ &quot;({0}|(/(|...|+++|&quot;&quot;)&quot; { deny all; }
location ~ &quot;(~|`|&amp;#x3C;|&gt;|:|;|%||s|{|}|[|]||)&quot; { deny all; }
location ~* &quot;/(=|$&amp;#x26;|_mm|(wp-)?config.|cgi-|etc/passwd|muieblack)&quot; { deny all; }
location ~* &quot;(&amp;#x26;pws=0|_vti_|(null)|{$itemURL}|echo(.*)kae|etc/passwd|eval(|self/environ)&quot; { deny all; }
location ~* &quot;.(aspx?|bash|bak?|cfg|cgi|dll|exe|git|hg|ini|jsp|log|mdb|out|sql|svn|swp|tar|rdf)$&quot; { deny all; }
location ~* &quot;/(^$|mobiquo|phpinfo|shell|sqlpatch|thumb|thumb_editor|thumbopen|timthumb|webshell).php&quot; { deny all; }
##
# Block SQL injections Attacks
##
set $block_sql_injections 0; if ($query_string ~ &quot;union.*select.*(&quot;) { set $block_sql_injections 1; }
if ($query_string ~ &quot;union.*all.*select.*&quot;) { set $block_sql_injections 1; }
if ($query_string ~ &quot;concat.*(&quot;) { set $block_sql_injections 1; }
if ($block_sql_injections = 1) { return 404; }
##
# Block File injections Attacks
##
set $block_file_injections 0;
if ($query_string ~ &quot;[a-zA-Z0-9_]=http://&quot;) { set $block_file_injections 1; }
if ($query_string ~ &quot;[a-zA-Z0-9_]=(..//?)+&quot;) { set $block_file_injections 1; }
if ($query_string ~ &quot;[a-zA-Z0-9_]=/([a-z0-9_.]//?)+&quot;) { set $block_file_injections 1; }
if ($block_file_injections = 1) { return 404; }
##
# Block common bad exploits 
##
set $block_common_exploits 0;
if ($query_string ~ &quot;(&amp;#x3C;|%3C).*script.*(&gt;|%3E)&quot;) { set $block_common_exploits 1; }
if ($query_string ~ &quot;GLOBALS(=|[|%[0-9A-Z]{0,2})&quot;) { set $block_common_exploits 1; }
if ($query_string ~ &quot;_REQUEST(=|[|%[0-9A-Z]{0,2})&quot;) { set $block_common_exploits 1; }
if ($query_string ~ &quot;proc/self/environ&quot;) { set $block_common_exploits 1; }
if ($query_string ~ &quot;mosConfig_[a-zA-Z_]{1,21}(=|%3D)&quot;) { set $block_common_exploits 1; }
if ($query_string ~ &quot;base64_(en|de)code(.*)&quot;) { set $block_common_exploits 1; }
if ($block_common_exploits = 1) { return 404; }
##
# Block SPAM Keywords
##
set $block_spam 0;
if ($query_string ~ &quot;b(ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo)b&quot;) { set $block_spam 1; }
if ($query_string ~ &quot;b(erections|hoodia|huronriveracres|impotence|levitra|libido)b&quot;) { set $block_spam 1; }
if ($query_string ~ &quot;b(ambien|bluespill|cialis|cocaine|ejaculation|erectile)b&quot;) { set $block_spam 1; }
if ($query_string ~ &quot;b(lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby)b&quot;) { set $block_spam 1; }
if ($block_spam = 1) { return 404; }
##
# Block bad user agents
##
set $block_user_agents 0;
# Don&apos;t disable wget if you need it to run cron jobs!
#if ($http_user_agent ~ &quot;Wget&quot;) { set $block_user_agents 1; }
# Disable Akeeba Remote Control 2.5 and earlier
if ($http_user_agent ~ &quot;Indy Library&quot;) { set $block_user_agents 1; }
##
# Common bandwidth hoggers and hacking tools.
##
if ($http_user_agent ~ &quot;libwww-perl&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;GetRight&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;GetWeb!&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;Go!Zilla&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;Download Demon&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;Go-Ahead-Got-It&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;TurnitinBot&quot;) { set $block_user_agents 1; }
if ($http_user_agent ~ &quot;GrabNet&quot;) { set $block_user_agents 1; }
if ($block_user_agents = 1) { return 404; }
##
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, Go to the site-available folder and add the below line to running site configuration file to secure the site,&lt;/p&gt;
&lt;p&gt;For example, If you wish to protect the &lt;a href=&quot;http://www.example.com.conf&quot;&gt;www.example.com.conf&lt;/a&gt; then edit the file and add before closing &quot; } &quot; &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt; include security.conf;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since, security.conf file exists at /etc/nginx folder root path so you don&apos;t have to put whole file path.&lt;/p&gt;
&lt;p&gt;After these changes you will need to reload nginx configuration if everything is in order but before that verify Nginx configuration is working properly following this command,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;if output of above command shows this then it&apos;s mean all went OK...&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next step is to reload Nginx service to see the effect of configuration we made in the website.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ service nginx reload
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Voila!! You&apos;re SET!!&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.CzR6t7XQ.png"/><enclosure url="/_astro/hero.CzR6t7XQ.png"/><author>Mayur Chavhan</author></item><item><title>How to create Swap Partition on Ubuntu 20.04 and Debian 10</title><link>https://techwhale.in/how-to-create-swap-partition-on-aws-ec2-instance-for-ubuntu-2004</link><guid isPermaLink="true">https://techwhale.in/how-to-create-swap-partition-on-aws-ec2-instance-for-ubuntu-2004</guid><description>Easy steps to create swap partition on Ubuntu 20.04 for servers and Desktop users</description><pubDate>Mon, 19 Jul 2021 11:37:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fav8m12l1g&quot;&gt;Create a File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fav8m12l1h&quot;&gt;Convert file into SWAP compatible file.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fav8m12l1i&quot;&gt;Mount SWAP File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fav8m12l1j&quot;&gt;Add SWAP at system boot entry.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On AWS, If you are using smaller instance type like t2.small and t3.small or any Digital Ocean instance you are using which requires more RAM resources then you know it won&apos;t be enough for your application and it&apos;s application performance will take hit.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-create-swap-partition-on-aws-ec2-instance-for-ubuntu-2004/swap-space-arkit.jpg&quot; alt=&quot;swap file system An Incredibly Easy Method That Works faster&quot;&gt;&lt;/p&gt;
&lt;p&gt;Since, We have SSD / NVMe Storage solutions which are very fast can be use as an alternative to operate as a RAM so we can create a SWAP partition which is basically tells Operating System to store CPU operation data on the disk partition when RAM space is not sufficient but SWAP partition is not fast as traditional RAM but it gets the job done with very little work.&lt;/p&gt;
&lt;p&gt;This article specifically made to help you to enable SWAP Partition to mount on the system for your instance or VPS.  Any Ubuntu or Debian based Linux operating system has same commands to set SWAP partition so you this guide will be useful for any debian based OS also for Ubuntu Desktop Users as well.&lt;/p&gt;
&lt;h2&gt;Create a File&lt;/h2&gt;
&lt;p&gt;Consider, You got an instance or VPS of 2 vCore and 2 GB RAM.&lt;/p&gt;
&lt;p&gt;Use below command to create a 1 GB of Swap,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo dd if=/dev/zero of=/var/swapfile bs=1M count=1024
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Above command will create a file &quot;swapfile&quot; in &quot;/var&quot; folder, but also learn what&apos;s the command actually doing,&lt;/p&gt;
&lt;p&gt;bs=1M count=1024 will create 1GB &quot;swapfile&quot;, so you can change count if you want to use count as 2048, 4096 for 2GB and 4GB respectively.&lt;/p&gt;
&lt;p&gt;Alternative, Similar command you can use to create swapfile , &lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo fallocate -l 1G /var/swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Convert file into SWAP compatible file.&lt;/h2&gt;
&lt;p&gt;Now, Let&apos;s convert this file into an actual swap,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo mkswap /var/swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We almost done,&lt;/p&gt;
&lt;h2&gt;Mount SWAP File&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo swapon /var/swapfile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we are done, We have mounted an swapfile into swap partition so CPU will use it if RAM storage is nearly full.&lt;/p&gt;
&lt;p&gt;You can check if swap partition properly mounted or not by using below command,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ sudo swapon --show
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/media/posts/18/aws-swap-file-2.png&quot; alt=&quot;aws-swapfile-ubuntu&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Add SWAP at system boot entry.&lt;/h2&gt;
&lt;p&gt;At times, When VPS or instance will get rebooted or at system boot, Swap partition will get unmounted if it&apos;s entry not added in system boot entry.&lt;/p&gt;
&lt;p&gt;Just add an entry to &quot;/etc/fstab&quot; file, Which System check if any partition needs to be mounted at boot.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ echo &quot;/var/swapfile swap swap defaults 0 0&quot; | sudo tee -a /etc/fstab
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That&apos;s it. You&apos;ve just upgraded your server with a virtual RAM.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/posts/18/aws-swap-fstab.png&quot; alt=&quot;aws-swap-fstab&quot;&gt;&lt;/p&gt;
&lt;p&gt;If you feel like a geek and really want to see summary of swap partition,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;$ swapon --summary
&lt;/code&gt;&lt;/pre&gt;</content:encoded><h:img src="/_astro/hero.C1C8V_5r.png"/><enclosure url="/_astro/hero.C1C8V_5r.png"/><author>Mayur Chavhan</author></item><item><title>Automate Smart Plug to charge laptop using Webhook and Shell Script.</title><link>https://techwhale.in/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script</link><guid isPermaLink="true">https://techwhale.in/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script</guid><description>simple guide to automate laptop charging using smart plug using webhooks and script.</description><pubDate>Sun, 06 Jun 2021 19:47:00 GMT</pubDate><content:encoded>&lt;p&gt;In the world of automation, it little gives me heebie-jeebies to turn on and off charging when needed cause I read that always plugged in charging will damage your laptop battery but since I&apos;m using a laptop it always draws power so keeping on charging all the time is good or bad that is debate we don&apos;t want to get in, so here we go..&lt;/p&gt;
&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fani75hnn&quot;&gt;Get a SMART Switch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fani75hno&quot;&gt;Create an account on Sequematic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fani75hnp&quot;&gt;Write or Download Bash Script for an automation.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1fani75hnq&quot;&gt;Cronjob for scheduled task run.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ASUS Laptop where they have inbuilt a hardware charging limit to 80% so I thought that it must be important that&apos;s why ASUS has done it. But now, the office gave me another working laptop which is DELL, and sadly given the model doesn&apos;t have a hardware charging limit available and while it&apos;s plugged and charging at full, sometimes laptop gets hot and its bad if you live in tropical area like myself. 😩&lt;/p&gt;
&lt;p&gt;Anyhow, You can see limiting the charging can increase your laptop&apos;s battery life a little better.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script/depth-of-charge.jpg&quot; alt=&quot;The ASUS ZenFone 7 and ROG Phone 3 support passthrough charging&quot;&gt;&lt;/p&gt;
&lt;p&gt;So here I have a problem so I thought, What if I can build a simple plug as a charger solution that can be turned automatically ON when charging gets low or reaches a set limit and it will get off when laptop charging reaches above 90%. and vice versa. So it a simple and fun to build this want to share this little project. 😎&lt;/p&gt;
&lt;h4&gt;Get a SMART Switch&lt;/h4&gt;
&lt;p&gt;The first step is to get a wireless plug so I found the cheapest smart plug available on Amazon. which advertised as works with Alexa so without any research I thought it must work with everything. Boy! I was wrong but eventually, it worked out just fine, just went to my super helpful everyone&apos;s favourite friend who helped me to fix this kind of issue as always and you all know by its name &quot;google&quot;. 🤓&lt;/p&gt;
&lt;p&gt;So this Solimo Smart Plug has this app called &quot;Smart Life&quot; to set up your device with your local centralized Wi-Fi router so you can talk to this &quot;IOT&quot; device from anywhere.&lt;/p&gt;
&lt;p&gt;https://amzn.to/354UpQW&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script/51-Q1%2BQbCDL._SL1500_.jpg&quot; alt=&quot;Buy Amazon Brand - Solimo Smart Plug, 16A, Works with Alexa Online at Low  Prices in India - Amazon.in&quot;&gt;&lt;/p&gt;
&lt;p&gt;So I register myself on the app and proceed with usage turning ON and OFF.  Also, This app has multi-functionality like I can set it up like a timer but sadly I have to set up the timer again and again like Microwave or create a scene where I can connect to other services like location, temperature, etc. which is all fine but it&apos;s useless for the purpose and what I want to achieve.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script/ifttt@2x.png&quot; alt=&quot;Smart Life&quot;&gt;&lt;/p&gt;
&lt;h4&gt;Create an account on Sequematic&lt;/h4&gt;
&lt;p&gt;If you are familiar with IFTTT it&apos;s simply &quot;IF THIS THEN THAT&quot; and my project is all about that so I wanted to find an option to turn the plug state from my laptop whenever charging is necessary. Then I found out that I can turn on the device through Webhook, where I change the plug state as I want and the webhook is available on IFTTT. Then I searched in IFTTT if there&apos;s an applet available for &quot;Smart Life&quot; and found some applets.&lt;/p&gt;
&lt;p&gt;Great !! but then the PROBLEM occurred, where it showed my plug is unavailable in the applet settings so I search about it and found &quot;Smart Life&quot; broke ties with IFTTT so I search more than found out about another app called &quot;Brilliant Smart&quot; and really it&apos;s not that brilliant which turns out the same&lt;br&gt;
Table of Contents&lt;br&gt;
1. Get a SMART Switch&lt;br&gt;
2. Create an account on Sequematic&lt;br&gt;
3. Write or Download Bash Script for an automation.&lt;br&gt;
4. Cronjob for scheduled task run.&lt;br&gt;
Table of Contents&lt;br&gt;
1. Get a SMART Switch&lt;br&gt;
2. Create an account on Sequematic&lt;br&gt;
3. Write or Download Bash Script for an automation.&lt;br&gt;
4. Cronjob for scheduled task run.&lt;/p&gt;
&lt;p&gt;failure as &quot;Smart Life&quot; then I went again for help on the internet and finally someone on Reddit said that there&apos;s another website which still can access &quot;Smart Life&quot; API and that site is &quot;&lt;a href=&quot;https://sequematic.com/&quot;&gt;sequematic&lt;/a&gt;&quot; which finally done all the work for me.&lt;/p&gt;
&lt;p&gt;Sequematic is really easy to set up so I created a step by creating a &lt;a href=&quot;https://en.wikipedia.org/wiki/Webhook&quot;&gt;webhook&lt;/a&gt; where I gave the state name as a &quot;turn_on&quot; and set parameter &quot;on&quot; and another step I have added a switch to turn on whenever a POST request on the web-hook is being sent.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/automate-smart-plug-to-charge-laptop-using-webhook-and-shell-script/SEQUEmatic-06.png&quot; alt=&quot;Lier Smart Life / Tuya à IFTTT après le 26 mai 2020 | Fanjoe&amp;#x27;s website...&quot;&gt;&lt;/p&gt;
&lt;p&gt;In the above screenshot, you can see two sequences are created which are &quot;socket-switch-on&quot; and &quot;socket-switch-off&quot;. In those sequences, two steps have been created.&lt;/p&gt;
&lt;p&gt;Cool !! Now my plug can be turned on from the internet using just a POST request. It was so simple so what now? How can I turn it on whenever my laptop needs charging?&lt;/p&gt;
&lt;h4&gt;Write or Download Bash Script for an automation.&lt;/h4&gt;
&lt;p&gt;As always I wrote a very simple bash script [ Literally, It is very simple ], Check it out.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;#!/bin/bash # get battery percentage battery_current_charge=$(upower -i $(upower -e | grep &apos;/battery&apos;) | grep --color=never -E percentage|xargs|cut -d&apos; &apos; -f2|sed s/%//) # check if battery percentage with your set value, mine is 40 if [[ $battery_current_charge -le &quot;40&quot; ]]; then # if you using Ubuntu then below notify command will show you notification notify-send &quot;Auto Charging&quot; &quot;Script Executed!&quot; #This will trigger switch on if condition is satisfied curl -X POST https://sequematic.com/trigger-ifttt-webhook/your-id//switch_on &gt;/dev/null 2&gt;&amp;#x26;1 fi if [[ $battery_current_charge -ge &quot;90&quot; ]]; then # This condition will turn off the charging when limit hit to 90 curl -X POST https://sequematic.com/trigger-ifttt-webhook/your-id//switch_off &gt;/dev/null 2&gt;&amp;#x26;1 fi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So if you have some Linux experience then you can understand from the shell script that I have created two if conditions and in the first condition, it compares the current battery percentage to start the plug when the battery reaches below or equal to 40%.&lt;/p&gt;
&lt;p&gt;The second condition when the battery percentage reaches above or equal to 90% smart plug should automatically turn off.&lt;/p&gt;
&lt;p&gt;In the shell script, the URL taken from sequematic can change the plug state when the condition is satisfied so you need to replace both of your &lt;a href=&quot;https://ifttt.com&quot;&gt;IFTTT&lt;/a&gt; URLs from the sequematic link in the script.&lt;/p&gt;
&lt;h4&gt;Cronjob for scheduled task run.&lt;/h4&gt;
&lt;p&gt;This is a simple task given in a simple script but how can this script know every time this battery value changes?&lt;/p&gt;
&lt;p&gt;As always, Linux has inbuilt tools like &lt;a href=&quot;https://en.wikipedia.org/wiki/Cron&quot;&gt;Cron&lt;/a&gt;, Where, I have given a timer to run this script for every 5 min to check battery percentage and the script will check its logic.&lt;/p&gt;
&lt;p&gt;Check out the below cronjob.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;*/5 * * * * bash charge-battery-script.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Voila!! It worked like magic.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I always use Ubuntu as my daily driver OS so it was a piece of cake for me to automate this process and if you want to do this on your Windows then, I suggest you should turn on &lt;a href=&quot;https://docs.microsoft.com/en-us/windows/wsl/about&quot;&gt;WSL&lt;/a&gt; Feature &quot;Windows Subsystem for Linux&quot; which of course enables Linux (Ubuntu) in your windows.&lt;/p&gt;
&lt;p&gt;I can think of many usages from this automation somethings like turn on smart lights or change the color of smart light, smart socket or plug activity from your laptop.&lt;/p&gt;
&lt;p&gt; Hope you found this article interesting and let us know your opinion if you have a way to improve it.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Thank you for reading!&lt;/p&gt;
&lt;/blockquote&gt;</content:encoded><h:img src="/_astro/hero.qaB02IC5.jpg"/><enclosure url="/_astro/hero.qaB02IC5.jpg"/><author>Mayur Chavhan</author></item><item><title>How to install Portainer on Linux OS (Ubuntu, Debian, CentOS, Raspbian)</title><link>https://techwhale.in/how-to-install-portainer-on-linux-os-ubuntu-debian-centos-raspbian</link><guid isPermaLink="true">https://techwhale.in/how-to-install-portainer-on-linux-os-ubuntu-debian-centos-raspbian</guid><description>How to install Portainer on Linux OS</description><pubDate>Mon, 15 Jun 2020 07:33:00 GMT</pubDate><content:encoded>&lt;h3&gt;Index:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#overviewbr&quot;&gt;Overview:&lt;br&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#installationbr&quot;&gt;Installation.&lt;br&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#acess-portainer-gui&quot;&gt;Acess Portainer GUI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#portainer-docker-processnbsp&quot;&gt;Portainer Docker Process&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#update-portainer&quot;&gt;Update Portainer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Overview:&lt;/h2&gt;
&lt;p&gt;Portainer is docker web GUI application in where you can manage all your docker containers, Images and Volumes. It offers more features than just showing docker containers but you can even manage other docker nodes in one Portainer application. &lt;/p&gt;
&lt;p&gt;This guide will show you how easy is to install Portainer on any linux machines but before that you need to keep in mind that it needs some preparation before installing it. &lt;/p&gt;
&lt;p&gt;There are two method is to install Portainer but this guide will show you the easiest one.&lt;/p&gt;
&lt;h2&gt;Installation.&lt;/h2&gt;
&lt;p&gt;The easiest method to install Portainer is of course is docker. To manage Docker, you need to deploy a docker container that contains Portainer binary and it access host docker process file to get all information what are docker containers with volumes are running.&lt;/p&gt;
&lt;p&gt;Check out our guide on how to install Docker on Linux so you can install Portainer.&lt;/p&gt;
&lt;p&gt;Now, Here we go, To Install Portainer here is this one line command that simply pulls up the Portainer image.&lt;/p&gt;
&lt;p&gt;sudo docker run --name portainer --restart=unless-stopped -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer&lt;/p&gt;
&lt;p&gt;In this line of command, We specified docker name &quot;portainer&quot; and port in which Portainer Docker can be accessible to the public network. Which in this case is port &quot;&lt;strong&gt;9000&lt;/strong&gt;&quot;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&quot;-v portainer_data&quot; is host location where on the Docker Host the Portainer data.&lt;/li&gt;
&lt;li&gt;&quot;-v /var/run/docker.sock&quot; is Docker process where portainer can access all information and control docker applications.&lt;/li&gt;
&lt;li&gt;&quot;portainer/portainer&quot; is the official docker image which will get pull from official Docker repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Acess Portainer GUI&lt;/h2&gt;
&lt;p&gt;Now, Go to the browser and put Docker Host Server IP in there like this:&lt;/p&gt;
&lt;p&gt;http://[public-ip-address]:9000&lt;/p&gt;
&lt;p&gt;Replace your public ip address in above field and if you are running docker in your private machine then put your private IP like : &lt;strong&gt;192.168.0.10:9000,192.168.1.10:9000&lt;/strong&gt; and so on..&lt;/p&gt;
&lt;h2&gt;Portainer Docker Process &lt;/h2&gt;
&lt;p&gt;To check if portainer is running on your host machine simply run below command,&lt;/p&gt;
&lt;p&gt;sudo docker ps&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Command Output:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;docker ps&lt;br&gt;
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES&lt;br&gt;
9a83bdecfc56 portainer/portainer &quot;/portainer&quot; 2 hours ago Up 2 hours 0.0.0.0:8000-8000/tcp, 0.0.0.0:9000-&gt;9000/tcp portainer&lt;/p&gt;
&lt;p&gt;Above output it shows that it exposes application to port 8000 and port 9000 but we use 9000 to access Portainer GUI.&lt;/p&gt;
&lt;h2&gt;Update Portainer&lt;/h2&gt;
&lt;p&gt;If you want to update Docker of Portainer then simple run these following commands,&lt;/p&gt;
&lt;p&gt;sudo docker pull portainer/portainer&lt;/p&gt;
&lt;p&gt;Above command will pull the latest image from official docker repository but it will not update the current running Portainer Docker so we will stop the running container so it will use updated image.&lt;/p&gt;
&lt;p&gt;sudo docker stop portainer &lt;/p&gt;
&lt;p&gt;Here we have stopped our Portainer container and if you seem to notice we don&apos;t have to use docker id to stop portainer container but we used &quot;portainer&quot; name and this happened because we gave our docker container a name called &quot;portainer&quot; so using a name for container is makes easy to manage like stop and run the container.&lt;/p&gt;
&lt;p&gt;Now, Delete old Portainer image to replace updated one.&lt;/p&gt;
&lt;p&gt;sudo docker rm portainer&lt;/p&gt;
&lt;p&gt;Above command will delete only image but not the volume where we are keeping our Portainer data.&lt;/p&gt;
&lt;p&gt;Re-run the docker portainer command to launch portainer with updated image at same volume and exposed ports we have given before.&lt;/p&gt;
&lt;p&gt;sudo docker run --name portainer --restart=unless-stopped -d -p 8000:8000 -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer&lt;/p&gt;
&lt;p&gt;Check again for docker process and if it&apos;s running then we are good to know. Hope this guide helped you.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Thank you for reading!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Mayur Chavhan&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.OMbmlC44.jpg"/><enclosure url="/_astro/hero.OMbmlC44.jpg"/><author>Mayur Chavhan</author></item><item><title>How to install &quot;Nginx Proxy Manager&quot; on Raspberry Pi 4 [arm64]</title><link>https://techwhale.in/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64</link><guid isPermaLink="true">https://techwhale.in/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64</guid><description>Reverse Proxy is very common for port routing in backend applications. One of the popular is Traefik. Similar to Traefik there are HAproxy and Nginx.</description><pubDate>Fri, 12 Jun 2020 19:33:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5n5a90&quot;&gt;Overview:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5nqjb5&quot;&gt;Prerequisite:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5oajo7&quot;&gt;Step-1: Create folders.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5q1579&quot;&gt;Step-2: Create a file called &quot;config.json&quot;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5qq5ba&quot;&gt;Step-3: Create Docker-Compose File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5rduib&quot;&gt;Step-5: Run Docker-Compose File&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1eal5s74vc&quot;&gt;Step-6: Login to NPMan dashboard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Overview:&lt;/h2&gt;
&lt;p&gt;In DevOps deployments Reverse Proxy is very common for port routing in backend applications. One of the popular is &lt;a href=&quot;https://containo.us/traefik/&quot;&gt;Traefik&lt;/a&gt;. Similar to Traefik there are HAproxy and Nginx.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.haproxy.org/&quot;&gt;HAproxy&lt;/a&gt; which is known for Server Load Balancer but also can be used as a reverse proxy.&lt;/p&gt;
&lt;p&gt;Nginx is the fastest web server that can also be used as a reverse proxy for backend applications. &lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64/0hZKBEF.png&quot; alt=&quot;Reverse-Proxy&quot;&gt;&lt;/p&gt;
&lt;p&gt;All these three are excellent and popular reverse proxies used in servers but all these have one common problem: they need to write configuration files and it&apos;s not noobie server admin friendly since it involves years of experience to understand how exactly reverse proxy works. In Nginx and HAproxy, When you need to install SSL certificates for domai, It makes the configuration a little complicated and tiresome where in Traefik, It automatically handles domain certificates which makes Traefik awesome.&lt;/p&gt;
&lt;p&gt;When i started learning Traefik it took few months for me to get a proper grip on its configuration and i learned on old Traefik version and when new Traefik versions came out then i have to read their documentation for new version changes plus then i have to added new changes to docker-compose file so my docker container can properly communicate with Traefik routing which adds big sigh for me. Don&apos;t get me wrong Traefik is still best for reverse proxy and if you can write Bash and Ansible Yaml scripts to automate with docker or backend applications then you&apos;re golden.Where &quot;Jamie Curnow&quot; aka &quot;&lt;a href=&quot;https://jc21.com/&quot;&gt;jc21&lt;/a&gt;&quot; did all these three things in a single docker GUI application called &quot;Nginx Proxy Manager &apos;&apos; In which you can easily bind backend applications without writing a single line of code. Which makes it easy enough for newbie server admin also for Developers who don’t need to learn reverse proxy complex configurations.&lt;/p&gt;
&lt;p&gt;This installation can run same for any linux distros out there also docker image file also supports architecture for &lt;a href=&quot;https://en.wikipedia.org/wiki/ARM_architecture&quot;&gt;armhf and arm64&lt;/a&gt; so it can easily run on Raspberry Pi 3B and 4B without any issue. I personally used Raspbian Lite for testing purpose and it works well.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64/urx8Zmg.png&quot; alt=&quot;Nnginx-Proxy-Manager&quot;&gt;&lt;/p&gt;
&lt;p&gt;Nginx-Proxy-Manager&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;Prerequisite:&lt;/strong&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Docker_(software)&quot;&gt;Docker&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Docker-Compose&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;[Optional] &lt;strong&gt;&lt;a href=&quot;https://www.portainer.io/&quot;&gt;Portainer&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Step-1: &lt;strong&gt;Create folders.&lt;/strong&gt;&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mkdir npman
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Inside NPman folder create these three folders [data, data/mysql and letsencrypt] or run below command,&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo mkdir -p npman/{data/mysql,letsencrypt}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;&lt;strong&gt;Step-2:&lt;/strong&gt; &lt;strong&gt;Create a file called &quot;config.json&quot;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;paste below lines of code into it.&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;database&quot;: {
    &quot;engine&quot;: &quot;mysql&quot;,
    &quot;host&quot;: &quot;db&quot;,
    &quot;name&quot;: &quot;DBNAME&quot;,
    &quot;user&quot;: &quot;DBUSERNAME&quot;,
    &quot;password&quot;: &quot;DBPASSWORD&quot;,
    &quot;port&quot;: 3306
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Step-3: Create Docker-Compose File&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Now, Create a file called &quot;docker-compose.yaml&quot; and paste following code into it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Source: &lt;a href=&quot;https://github.com/jeff89179&quot;&gt;https://github.com/jeff89179&lt;/a&gt; [ Thanks to him]&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;version: &apos;2&apos;
services:
  app:
    image: &apos;jc21/nginx-proxy-manager:latest&apos;
    restart: always
    ports:
      - &apos;80:80&apos;
      - &apos;443:443&apos;
      - &apos;81:81&apos;
    volumes:
      - &apos;./config.json:/app/config/production.json&apos;
      - &apos;./data:/data&apos;
      - &apos;./letsencrypt:/etc/letsencrypt&apos;
    depends_on:
      - db
  db:
    image: &apos;yobasystems/alpine-mariadb:latest&apos;
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: npman
      MYSQL_DATABASE: npman
      MYSQL_USER: npman
      MYSQL_PASSWORD: password
    volumes:
      - &apos;./data/mysql:/var/lib/mysql&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; Change MySQL password for production security purpose.&lt;/p&gt;
&lt;h2&gt;Step-5: Run Docker-Compose File&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Run Docker-Compose command to download docker images and services,&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;sudo docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have Portainer running then go into the Portainer UI, And in the Stacks, add a new stack named &quot;NPMan&quot; and paste above docker-compose code and deploy it.&lt;/p&gt;
&lt;p&gt;After deployment check if container health and port are showing like this..&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64/TvK1WNK.png&quot; alt=&quot;Portainer-Nginx-Proxy-Manager&quot;&gt;&lt;/p&gt;
&lt;h2&gt;Step-6: Login to NPMan dashboard&lt;/h2&gt;
&lt;p&gt;Go to browser and replace &amp;#x3C;&gt; to docker host server ip like this,&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://%3C%3Cdocker-host-serve-ip%3E%3E:81/login&quot;&gt;http://&amp;#x3C;&gt;:81/login&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-install-nginx-proxy-manager-on-raspberry-pi-4-arm64/4RE3JjY.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;If everything goes right then enter below default credentials,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Credential for NPMan,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Email: &lt;a href=&quot;mailto:admin@example.com&quot;&gt;admin@example.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Password: changeme&lt;/p&gt;
&lt;p&gt;Visit our repository has all codes in this tutorial,&lt;/p&gt;
&lt;p&gt;https://github.com/mayur-chavhan/Nginx-Proxy-Manager&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Thank you for reading&lt;/p&gt;
&lt;/blockquote&gt;</content:encoded><h:img src="/_astro/hero.C-17yfWY.jpg"/><enclosure url="/_astro/hero.C-17yfWY.jpg"/><author>Mayur Chavhan</author></item><item><title>How to install Ansible on Ubuntu 18.04 / Debian 10 Buster</title><link>https://techwhale.in/how-to-install-ansible-on-ubuntu-1804-debian-10-buster</link><guid isPermaLink="true">https://techwhale.in/how-to-install-ansible-on-ubuntu-1804-debian-10-buster</guid><description>Install Ansible on Ubuntu 18.04 Bionic Beaver and Debian 10 Buster. It is a popular server provisioning devop tool on your linux.</description><pubDate>Wed, 13 May 2020 22:58:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e887o48e3&quot;&gt;What is Ansible?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e883n8jk0&quot;&gt;Prerequisites :&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-1-%E2%80%94-installing-ansible&quot;&gt;Before start...&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8s96ber2&quot;&gt;Add official Ansible repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8s976in4&quot;&gt;Update Packages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#step-1-%E2%80%94-installing-ansible&quot;&gt;Install Ansible&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;What is Ansible?&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/media/posts/2/imageedit_16_2728091063.png&quot; alt=&quot;ansible&quot;&gt;&lt;/p&gt;
&lt;p&gt;Ansible is an open source DevOps automation tool that solves server provisioning in installing tools, configuration, deployment and provisioning. It leverages SSH to communicate between servers. It uses the playbook which states every steps of automation jobs, and playbook uses a simple language called &quot;YAML&quot;.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Prerequisites :&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Operating System&lt;/strong&gt;: Ubuntu 18.04 / Debian 10 Buster&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SSH Access&lt;/strong&gt; :  You need remote server SSH access available with Password or Key Access so our ansible server can communicate remotely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;: python version 2.7 or above it should be installed.&lt;/p&gt;
&lt;h3&gt;Before start...&lt;/h3&gt;
&lt;p&gt;The use of Ansible as a capability of managing your server infrastructure, you want to install the Ansible software program on the machine that will serve as the Ansible manage node.&lt;/p&gt;
&lt;p&gt;Ansible’s only real dependency is Python. Once Python is installed, the simplest way to get Ansible running is to use pip, a simple package manager for Python. Don&apos;t worry most of the linux distro comes with default Python 2.7 and CentOS 8 comes with built in Python version 3.7.&lt;/p&gt;
&lt;p&gt;The easiest way to install Ansible on a Debian or Ubuntu system is to use the official apt package.&lt;/p&gt;
&lt;h3&gt;Add official Ansible repository&lt;/h3&gt;
&lt;p&gt;From your ansible host node, run the following command to consist of the authentic project’s PPA and it is needed else you&apos;ll end up with older version of Ansible :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt-add-repository ppa:ansible/ansible&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Press ENTER to proceed with PPA addition.&lt;/p&gt;
&lt;h3&gt;Update Packages&lt;/h3&gt;
&lt;p&gt;Newly added PPA needs to be updated :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If an error like &lt;strong&gt;“sudo: add-apt-repository: command not found”&lt;/strong&gt;, then you’re missing the &lt;strong&gt;&lt;code&gt;python-software-properties&lt;/code&gt;&lt;/strong&gt; package. Install it with the following command:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt-get install python-software-properties&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Install Ansible &lt;/h3&gt;
&lt;p&gt;After update is done, you can easily install Ansible using simple install command,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt-get install ansible -y&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Our installation process has been done. Now let’s check ansible version. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo ansible --version&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://i.imgur.com/YSu2ISW.png&quot;&gt;&lt;img src=&quot;/media/remote/how-to-install-ansible-on-ubuntu-1804-debian-10-buster/YSu2ISW.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That&apos;s all folks. Happy Hacking!!&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.2XFgEs6f.jpg"/><enclosure url="/_astro/hero.2XFgEs6f.jpg"/><author>Mayur Chavhan</author></item><item><title>Guide : Git workflow for Developers</title><link>https://techwhale.in/git-workflow-for-developers-and-devops</link><guid isPermaLink="true">https://techwhale.in/git-workflow-for-developers-and-devops</guid><description>Guide for git workflow for developers</description><pubDate>Sun, 17 May 2020 19:46:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8i9uj8q3&quot;&gt;Overview:&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8i9m22q1&quot;&gt;Why Git or Github?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#c217&quot;&gt;The Workflow Cheat Sheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Overview:&lt;/h3&gt;
&lt;p&gt;Git is a top distributed version control system and Nowadays all programmers and developers are dependent on its workflow. Manage to set up a proper Git code workflow is essential for projects that involve group collaboration. Follow procedures to keep working copy of your project through identifying code problems and evolving into a big scale project.&lt;/p&gt;
&lt;p&gt;One of the biggest git repository hosting is Github. &lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt; is a distributed version control system accessible through a CLI. Git is &lt;a href=&quot;https://en.wikipedia.org/wiki/Free_and_open-source_software&quot;&gt;free and open-source software&lt;/a&gt; distributed under the terms of the &lt;a href=&quot;https://en.wikipedia.org/wiki/GNU_General_Public_License&quot;&gt;GNU General Public License&lt;/a&gt; version 2.&lt;/p&gt;
&lt;p&gt; Using Github, I can share all of my coding projects with the world. Github has a plethora of unique features that enhance the git experience and make collaborative coding simple. I am far from a Git or Github expert, but this is a short guide to get you started with Git on Github:&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Why Git or Github?&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;It is the best and most popular system available for managing and tracking any code changes also it allows other developers to collaborate on projects at any scale.&lt;/p&gt;
&lt;p&gt;In simple words, GitHub is a “hub” for everyone who is working with the Git version control system. It provides a variety of features to make developers&apos; jobs much easier and it&apos;s open for the public so anyone can share their code to the development community and can do better projects or make existing code repositories much better by power of collaboration.&lt;/p&gt;
&lt;p&gt;System like Git become a lot more obvious once you make sense of how they truly work. The objective of this guide is to reveal some insight into how Git functions in the engine. We&apos;re going to investigate a portion of Git&apos;s center ideas including its fundamental item stockpiling, how submits work, how branches and labels work, and we&apos;ll take a gander at the various types of converging in Git including the much-dreaded rebase. Ideally toward the finish, all things considered, you&apos;ll have a strong comprehension of these ideas and will have the option to utilize a portion of Git&apos;s further developed highlights with certainty.&lt;/p&gt;
&lt;p&gt;It&apos;s important now that this guide isn&apos;t proposed to be a&apos;s first experience with Git. This guide was composed for individuals who as of now use Git, however might want to more readily comprehend it by taking a look in the engine, and get familiar with a couple of slick deceives en route. All things considered, we should start.&lt;/p&gt;
&lt;p&gt;This is a short guide to get you started with Git on Github:&lt;/p&gt;
&lt;p&gt;|     |     |
| --- | --- |
| &lt;strong&gt;Repository&lt;/strong&gt; | Commonly called the “repo,” this is where all of the updated versions (and the primary version) of a project are stored. This is your staging ground for the project. Each repo has a unique URL for easy access. |
| &lt;strong&gt;Forking&lt;/strong&gt; | Unless developers pay for a private repository, their project can be viewed by all other members of the GitHub community. If these members feel they could make a worthy contribution, then they can create a new project (repository) from yours. This is called “forking a repo.” |
| &lt;strong&gt;Pull Request&lt;/strong&gt; | After forking a repo and making new changes to existing code, GitHub users can invite the developers of the original repository to view the changes. |
| &lt;strong&gt;Merging&lt;/strong&gt; | If you like the changes someone made after forking your repository, you can opt to accept those changes and merge them with your existing repository. |
| &lt;strong&gt;Changelogs&lt;/strong&gt; | This lets developers working on a single project see all changes, who made them, and when. |&lt;/p&gt;
&lt;p&gt;Git workflow is the mixer of steps that we have to follow before starting the development cycle means how developers pull, push, commit, clone and manage code.&lt;/p&gt;
&lt;h3&gt;The Workflow Cheat Sheet&lt;/h3&gt;
&lt;p&gt;--------------------------------------------&lt;br&gt;
Managing your Local Repo&lt;br&gt;
--------------------------------------------&lt;br&gt;
NOTE: If you need to hard reset your local repo to match&lt;br&gt;
the remote master use the following commands:&lt;br&gt;
$ git fetch origin&lt;br&gt;
$ git reset --hard origin/master&lt;/p&gt;
&lt;p&gt;Undo the act of committing, leaving everything else intact:&lt;br&gt;
$ git reset --soft HEAD^:&lt;/p&gt;
&lt;p&gt;Undo the act of committing and everything you&apos;d staged,&lt;br&gt;
but leave the work tree (your files intact):&lt;br&gt;
$ git reset HEAD^&lt;/p&gt;
&lt;p&gt;Completely undo it, throwing away all uncommitted changes,&lt;br&gt;
resetting everything to the previous commit:&lt;br&gt;
$ git reset --hard HEAD^&lt;/p&gt;
&lt;p&gt;--------------------------------------------&lt;br&gt;
BEGIN WORKFLOW&lt;br&gt;
--------------------------------------------&lt;br&gt;
Clone the Repo to local machine:&lt;br&gt;
$ git clone https://github.com/user_name/repo_name.git&lt;/p&gt;
&lt;p&gt;Make sure the local master is up-to-date:&lt;br&gt;
$ git pull origin master&lt;/p&gt;
&lt;p&gt;Create new branch:&lt;br&gt;
$ git banch branch_name&lt;/p&gt;
&lt;p&gt;Move to branch:&lt;br&gt;
$ git checkout branch_name&lt;/p&gt;
&lt;p&gt;Navigate file structure as needed:&lt;br&gt;
$ ls&lt;br&gt;
$ cd folder_name&lt;/p&gt;
&lt;p&gt;Add the files to the branch:&lt;br&gt;
$ git add .&lt;/p&gt;
&lt;p&gt;Verify file:&lt;br&gt;
$ git status&lt;/p&gt;
&lt;p&gt;Commit the files:&lt;br&gt;
$ git commit -m &quot;comment&quot;&lt;/p&gt;
&lt;p&gt;Add branch and files to the Remote Repo:&lt;br&gt;
$ git push -u origin branch_name&lt;/p&gt;
&lt;p&gt;Go to the github website to manage pull request and merge.&lt;/p&gt;
&lt;p&gt;Switch back to local master so you can delete the local branch:&lt;br&gt;
$ git checkout master&lt;/p&gt;
&lt;p&gt;Delete local branch:&lt;br&gt;
$ git branch -d branch_name&lt;br&gt;
OR&lt;br&gt;
$ git branch -D branch_name&lt;/p&gt;
&lt;p&gt;If you don&apos;t want to go to the website, you can merge your branch&lt;br&gt;
to the master locally and push the new master to the remote repo:&lt;/p&gt;
&lt;p&gt;Switch back to master branch:&lt;br&gt;
$ git checkout master&lt;/p&gt;
&lt;p&gt;Merge the branch with the local master:&lt;br&gt;
$ git merge branch_name -m &quot;comment&quot;&lt;/p&gt;
&lt;p&gt;Push the local master to the remote master:&lt;br&gt;
$ git push origin master&lt;/p&gt;
&lt;p&gt;Delete local branch:&lt;br&gt;
$ git branch -d branch_name&lt;br&gt;
OR&lt;br&gt;
$ git branch -D branch_name&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.QEPdBbOj.png"/><enclosure url="/_astro/hero.QEPdBbOj.png"/><author>Mayur Chavhan</author></item><item><title>How to install docker and docker-compose on Ubuntu 18.04</title><link>https://techwhale.in/how-to-install-docker-and-docker-compose-on-ubuntu-1804</link><guid isPermaLink="true">https://techwhale.in/how-to-install-docker-and-docker-compose-on-ubuntu-1804</guid><description>In this tutorial i will show you how to install docker and docker compose on ubuntu 18.04</description><pubDate>Wed, 20 May 2020 16:08:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8pdg7j87&quot;&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;#mcetoc_1e8pcknm71&quot;&gt;Update System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8pcknm73&quot;&gt;Install Prerequisite Packages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8pcknm74&quot;&gt;Add Docker Repositories&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8pcknm75&quot;&gt;Install Docker on Ubuntu 18.04&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e8pcknm76&quot;&gt;Start Docker&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3&gt;Overview&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/media/posts/5/docker-cloud-twitter-card.png&quot; alt=&quot;Docker-Image&quot;&gt;&lt;/p&gt;
&lt;p&gt;Docker Container Image&lt;/p&gt;
&lt;p&gt;Docker is an application that makes it simple and easy to run application processes in a container, which are like virtual machines, but more small, more resource-friendly, and more dependent on the host OS Kernel.&lt;/p&gt;
&lt;p&gt;Docker-Compose in other hand is more advanced but fairly makes easy if you want to add multiple docker containers and services working together as a one using a single file. YML / YAML is language is used to create docker-compose file.&lt;/p&gt;
&lt;p&gt;You’ll learn how to install and use it on an existing installation of Ubuntu 18.04.&lt;/p&gt;
&lt;p&gt; Docker requires a 64-bit version of Ubuntu also a kernel version requires to greater than 3.10.X&lt;/p&gt;
&lt;p&gt;Ubuntu 18.04 doesn&apos;t comes with Docker official repository so we are going to add it and install it. Let&apos;s start with process to install Docker and Docker-Compose.&lt;/p&gt;
&lt;h3&gt; Update System&lt;/h3&gt;
&lt;p&gt;First and most important is to update the system to keep all packages up to date so we don&apos;t run with outdated dependencies.&lt;/p&gt;
&lt;p&gt;Run the following commands:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt update -qq -y&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Install Prerequisite Packages&lt;/h3&gt;
&lt;p&gt;Once we have updated the system, we need to install some necessary packages before we are ready to install Docker. You can do this with the help of a single command:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt-get install curl apt-transport-https ca-certificates software-properties-common -qq -y&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Add Docker Repositories&lt;/h3&gt;
&lt;p&gt;Following steps is to add Docker Key and Repository to officially supported method for the Docker installation.&lt;/p&gt;
&lt;p&gt;Add the GPG key using following command in terminal:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, Add the repository:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable&quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Update the repository information:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt update -y&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Install Docker on Ubuntu 18.04&lt;/h3&gt;
&lt;p&gt;We are almost close. Use apt command to install Docker:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt install docker-ce -y&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Start Docker&lt;/h3&gt;
&lt;p&gt;Once the installation is complete, Start the docker to enable the service:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo systemctl start docker&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Check the service using below command if docker service is active or not.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo systemctl status docker&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If all goes well then pat yourself in the back. Docker is installed on your Ubuntu machine. Now, Lets install Docker-Compose which is very easy now since we have docker installed on the machine.&lt;/p&gt;
&lt;p&gt;Check if you have curl installed in your machine.&lt;/p&gt;
&lt;p&gt;If not then install curl using following command:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt install curl&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Install Latest Docker Compose&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;To download the latest version of Docker Compose, run below command:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;sudo curl -L &quot;https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)&quot; -o /usr/local/bin/docker-compose&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At the time this article was written, Docker Compose 1.25.5 is the latest version but if you want to change latest version go to this release page.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;https://github.com/docker/compose/releases&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;2. Give executable permission to docker-compose at installed location:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo chmod +x /usr/local/bin/docker-compose&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; That&apos;s it, Now you&apos;ve successfully installed docker-compose on your Ubuntu 18.04, Easy isn&apos;t it?&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.CfJf_2SW.jpg"/><enclosure url="/_astro/hero.CfJf_2SW.jpg"/><author>Mayur Chavhan</author></item><item><title>How to setup user SSH Keys on Ubuntu 18.04</title><link>https://techwhale.in/how-to-setup-user-ssh-keys-on-ubuntu-1804</link><guid isPermaLink="true">https://techwhale.in/how-to-setup-user-ssh-keys-on-ubuntu-1804</guid><description>setup ssh keys to access linux machine from remotely</description><pubDate>Sat, 23 May 2020 11:23:00 GMT</pubDate><content:encoded>&lt;h3&gt;Table of Contents&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e91n65hn3&quot;&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e91n560l2&quot;&gt;Step 1 : Generate a RSA Key Pair on your machine.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#mcetoc_1e91n4u7m1&quot;&gt;Step 2 : Copy SSH Public Key to remote server.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Overview&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;SSH&lt;/strong&gt; [ Secure Shell ] is a famous encrypted protocol are widely becoming popular for communicate server access. For security purpose SSH provide lot of features and one of the famous is SSH Keys and for some its complicated and mostly biased to use SSH password method.&lt;/p&gt;
&lt;p&gt;Cloud Service providers like AWS and GCP are default using ssh key method before creating any Instance. So they can generate SSH keys for you and you can download it for you to access it remotely. But other server provider mostly generate and provide you SSH password.&lt;/p&gt;
&lt;p&gt;SSH Password method is secured but password can be bruteforce by millions of bots are out there for cracking passwords and who knows if someone has supercomputer who can break your password within minutes but fear not cause SSH key to the rescue.&lt;/p&gt;
&lt;p&gt;In reality, SSH Keys gives an easy and perfectly secure way to connect your remote server and one SSH key can be use for multiple users.&lt;/p&gt;
&lt;p&gt;In this tutorial, How we can setup user ssh keys for Ubuntu 18.04 but it also applicable to any linux OS.&lt;/p&gt;
&lt;p&gt;For this example we will take a remote server which enabled with SSH password authentication and applying SSH Key based authentication.&lt;/p&gt;
&lt;p&gt;Before communication with remote server we have to do following steps.&lt;/p&gt;
&lt;h3&gt;Step 1 : Generate a RSA Key Pair on your machine.&lt;/h3&gt;
&lt;p&gt;|     |     |
| --- | --- |
| &lt;strong&gt;$&lt;/strong&gt; | &lt;strong&gt;ssh-keygen&lt;/strong&gt; |&lt;/p&gt;
&lt;p&gt;Above command will generate 2048 bit RSA key pair consists of public and private keys. [ id_rsa and id_rsa.pub ] When you run ssh-keygen command it will ask for custom path to store your keys but for now default location is shown in below image.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-setup-user-ssh-keys-on-ubuntu-1804/NFHy3XT.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;Press enter to select default path for RSA keys.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, You should then see the following prompt:&lt;/p&gt;
&lt;p&gt;Enter passphrase (empty for no passphrase):&lt;/p&gt;
&lt;p&gt;Additional security if you want to protect your SSH key using passphrase and empty for no passphrase so when you establish remote connection it will not ask for password everytime but its highly recommended that you should use passphrase and it gives more security and that&apos;s what we need.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-setup-user-ssh-keys-on-ubuntu-1804/DQska4v.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt; Here&apos;s the result after creation of the key&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your identification has been saved in /your_home/.ssh/id_rsa.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your public key has been saved in /your_home/.ssh/id_rsa.pub.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The key fingerprint is:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;SHA256:tQX64BUmMF2BY1wUSTdeJEYQQUjFIf9wrUAz0RJlaU4 user@remote-server&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;The key&apos;s randomart image is:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;+---[RSA 2048]----+&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| o=+@^#Ooo |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| .BB+XE= |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| .o.*=+ . |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| . = B.. |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| S o o |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;| |&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;+----[SHA256]-----+&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; And at this path you&apos;ll find ssh keys as follows,&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/media/remote/how-to-setup-user-ssh-keys-on-ubuntu-1804/xhRQmXn.png&quot; alt=&quot;ssh-key-path&quot;&gt;&lt;/p&gt;
&lt;p&gt; That&apos;s it, Now you&apos;ve generated public and private ssh key on your machine. Next step is very easy and we have to copy our public key to remote server so we can SSH Key based authentication for SSH.&lt;/p&gt;
&lt;h3&gt;Step 2 : Copy SSH Public Key to remote server.&lt;/h3&gt;
&lt;p&gt;Now we have SSH public key which can authenticate remote machine from our host machine. There is fastest method to copy public key ID to remote host is simple tool called &lt;strong&gt;&quot;ssh-copy-id&quot;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;Simple yet very useful for copying public ssh key to remote host. Remote host must have enabled password authentication so once public key authentication is done. Later, We can disable password authentication so only gateway to access your server is SSH Key authentication.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ssh-copy-id &lt;a href=&quot;mailto:user@remote_server&quot;&gt;user@remote_server&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[OPTIONAL] - SSH Public Key for Custom Include Key Path&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you have SSH Key available on different path you can use add include path parameter like this&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ssh-copy-id -i /ssh-key-folder/sshpub.key &lt;a href=&quot;mailto:user@remote_server&quot;&gt;user@remote_server&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[OPTIONAL] - SSH Public Key for Custom Port&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ssh-copy-id -p 5500 &lt;a href=&quot;mailto:user@remote_server&quot;&gt;user@remote_server&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.DD9XM6sh.jpg"/><enclosure url="/_astro/hero.DD9XM6sh.jpg"/><author>Mayur Chavhan</author></item><item><title>Install Jitsi Meet on Ubuntu 18.04</title><link>https://techwhale.in/install-jitsi-meet-on-ubuntu-1804</link><guid isPermaLink="true">https://techwhale.in/install-jitsi-meet-on-ubuntu-1804</guid><description>Install free and open source application on Linux, Docker, Virtualization, Ansible Automation</description><pubDate>Sun, 17 May 2020 20:28:00 GMT</pubDate><content:encoded>&lt;h3&gt;Provisioning&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;New Ubuntu 18.04 x64 VPS&lt;/li&gt;
&lt;li&gt;Create a new sudo user.&lt;/li&gt;
&lt;li&gt;A domain &lt;code&gt;jitsi.server.com&lt;/code&gt; being pointed to the server instance mentioned above.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Update server packages:&lt;/h3&gt;
&lt;p&gt;For security and performance purposes, its necessary to update the Ubuntu 18.04 LTS system to the latest status:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo apt update sudo apt upgrade -y &amp;#x26;&amp;#x26; sudo shutdown -r now&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You need to properly setup a hostname and an FQDN for the machine before you can enable HTTPS security by deploying a Let&apos;s Encrypt HTTPS certificate.&lt;/p&gt;
&lt;p&gt;The following commands will setup a hostname / FQDN:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo hostnamectl set-hostname jitsimeet&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo sed -i &apos;s/^127.0.1.1.*$/127.0.1.1 jitsi.server.com jitsimeet/g&apos; /etc/hosts&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Check if hostname is set properly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;hostname&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;hostname -f&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;wget -qO - &lt;a href=&quot;https://download.jitsi.org/jitsi-key.gpg.key&quot;&gt;https://download.jitsi.org/jitsi-key.gpg.key&lt;/a&gt; | sudo apt-key add -&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;apt-get update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;echo &apos;deb &lt;a href=&quot;https://download.jitsi.org&quot;&gt;https://download.jitsi.org&lt;/a&gt; stable/&apos; &gt;&gt; /etc/apt/sources.list.d/jitsi-stable.list&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;wget -qO - &lt;a href=&quot;https://download.jitsi.org/jitsi-key.gpg.key&quot;&gt;https://download.jitsi.org/jitsi-key.gpg.key&lt;/a&gt; | sudo apt-key add -&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;apt-get install apt-transport-https&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;apt-get update&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;apt-get -y install jitsi-meet&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Firewall rules for Jitsi Meet&lt;/h3&gt;
&lt;p&gt;As required we need to allow &lt;code&gt;OpenSSH&lt;/code&gt;, &lt;code&gt;HTTP&lt;/code&gt;, and &lt;code&gt;HTTPS&lt;/code&gt; traffic, along with inbound UDP traffic on port range of &lt;code&gt;5222-5281&lt;/code&gt; and &lt;code&gt;10000&lt;/code&gt; through port &lt;code&gt;20000&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo ufw allow OpenSSH&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow http&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow https&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow in 4443/tcp&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow in 5222/tcp&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow in 5269/tcp&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow in 5280:5281/tcp&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;sudo ufw allow in 10000:20000/udp&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sudo ufw enable&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;During the process, input your email &lt;code&gt;admin@gmail.com&lt;/code&gt; as prompted and then press ENTER. This script will automatically handle any tasks related to the Let&apos;s Encrypt SSL certificate.&lt;/p&gt;
&lt;p&gt;Finally, point your favorite web browser to &lt;code&gt;http://jitsimeet.server.com&lt;/code&gt; or &lt;code&gt;https://jitsimeet.server.com&lt;/code&gt; to access your Jitsi Meet Video conferencing service. Feel free to explore the interface. Clicking the &lt;code&gt;GO&lt;/code&gt; button will immediately create a Video conferencing channel for you.&lt;/p&gt;</content:encoded><h:img src="/_astro/hero.C36gyyQr.jpg"/><enclosure url="/_astro/hero.C36gyyQr.jpg"/><author>Mayur Chavhan</author></item></channel></rss>