<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by fahryrozy on Medium]]></title>
        <description><![CDATA[Stories by fahryrozy on Medium]]></description>
        <link>https://medium.com/@fahryrozy?source=rss-e45694e2d9e0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ree2yPm4yVGrxrpIklEbUA.jpeg</url>
            <title>Stories by fahryrozy on Medium</title>
            <link>https://medium.com/@fahryrozy?source=rss-e45694e2d9e0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:38:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fahryrozy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Mouse, One Keyboard, Multiple Computers: Connect Your Single KVM Input to Your Multiple…]]></title>
            <link>https://fahryrozy.medium.com/one-mouse-one-keyboard-multiple-computers-connect-your-single-kvm-input-to-your-multiple-fd2e3fba01e5?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd2e3fba01e5</guid>
            <category><![CDATA[kvm-switch]]></category>
            <category><![CDATA[barriers]]></category>
            <category><![CDATA[symless]]></category>
            <category><![CDATA[inputleap]]></category>
            <category><![CDATA[kvm]]></category>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 01:41:00 GMT</pubDate>
            <atom:updated>2026-06-18T01:41:00.769Z</atom:updated>
            <content:encoded><![CDATA[<h3>One Mouse, One Keyboard, Multiple Computers: Connect Your Single KVM Input to Your Multiple Machines</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v6CiASORIPAh8bsO.jpg" /><figcaption>(Reference Image Source: <a href="https://i.ytimg.com/vi/mgNNLyIZF1M/maxresdefault.jpg">https://i.ytimg.com/vi/mgNNLyIZF1M/maxresdefault.jpg</a>)</figcaption></figure><p>If you work with multiple computers on your desk — like in my case, a primary MacBook Pro for development and a Windows laptop for specific corporate tools — you know the pain of clutter.</p><p>Many professionals jump to buying expensive hardware KVM switches to solve this. But physical switches introduce a major headache: <strong>cables</strong>. The more hardware and cables you add to your workspace, the further away you get from a clean desk setup. Before you know it, your desk becomes a messy, frustrating rat’s nest of power bricks, USB cords, and display lines.</p><p>Worse yet, hardware switches completely isolate your machines. When you click a physical button, you are literally jumping between completely separated devices. There is no fluid integration, and you certainly cannot copy a line of code on your Mac and paste it directly onto your Windows machine.</p><p>By using a software-based approach instead, you don’t need to spend money on extra hardware or sacrifice your clean aesthetic. You can integrate your inputs completely — allowing you to use <strong>just one keyboard and one mouse</strong> to control multiple machines, while seamlessly copying and pasting data across different operating systems.</p><p>Enter <strong>InputLeap</strong>, the premier open-source, cross-platform virtual KVM software. This guide covers a clean installation on macOS to host your peripherals, a critical workaround for a known macOS security permission loop, and how to securely link your Windows machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tf2MmrcQyKAZnmeQ.jpg" /><figcaption>(Reference Image Source: <a href="https://i.ytimg.com/vi/nbaImwDORR8/maxresdefault.jpg">https://i.ytimg.com/vi/nbaImwDORR8/maxresdefault.jpg</a>)</figcaption></figure><h3>💡 The Golden Rule of Software KVMs: Read Your Logs!</h3><p>Before diving into configuration, remember the most important rule of debugging virtual KVM switches: <strong>Always look at your logs immediately whenever you face an error on your server or client.</strong> Unlike hardware switches that simply work or fail silently, software KVMs run real network services and encryption handshakes. Whether it’s a security block, a network timeout, or an unrecognized screen layout name, the underlying issue is <em>always</em> clearly printed in the application’s log window. If your cursor stops at the edge of the screen, don’t guess — check the log first.</p><h3>The Architecture: Server vs. Client</h3><p>Before installation, understand the roles:</p><ul><li><strong>The Server (Host):</strong> The computer hosting the physical mouse and keyboard you want to share. In this guide, this is your <strong>Mac</strong>.</li><li><strong>The Client (Target):</strong> The secondary computer receiving the pointer, keystrokes, and shared clipboard data over the network. Here, your <strong>Windows 10/11 laptop</strong>.</li></ul><p>Both machines must be connected to the same local network (Wi-Fi or LAN).</p><h3>Step 1: Download and Install InputLeap</h3><p>Make sure you grab the official distributions to avoid corrupted dependencies:</p><ul><li><strong>On macOS:</strong> Download the latest release from the <a href="https://github.com/input-leap/input-leap/releases">Official InputLeap GitHub Repository Releases</a>. Mount the downloaded .dmg and drag <strong>InputLeap.app</strong> into your <strong>Applications</strong> folder.</li><li><strong>On Windows:</strong> Download the <strong>v3.0.2 </strong>.exe<strong> installer</strong> from the releases page.</li></ul><h3>⚠️ A Warning on the Windows Portable Version</h3><p>Do not download the portable .zip or .7z archive version of the Windows client unless you want to spend hours debugging background architecture. If you use the portable version, you will likely be met with this frustrating error:</p><blockquote><em>input leap error ipc connection error connection refused</em></blockquote><p>This occurs because InputLeap relies on a background service framework to handle Inter-Process Communication (IPC) between the graphical interface and the core execution engine. The portable version does not automatically register or launch this underlying Windows service. The full .exe installer handles this system registration out of the box, completely avoiding the connection refusal.</p><h3>Step 2: Bypassing the macOS Accessibility Loop</h3><p>When hosting a software KVM on modern macOS versions, the operating system’s privacy engine throws a fatal loop. Even if you allow the master application window in your System Settings, the core background server daemon gets silently blocked from reading raw hardware inputs.</p><p>If you check your logs, you will see the server looping endlessly with this specific traceback:</p><pre>[2026-06-16T17:22:10] INFO: starting server<br>[2026-06-16T17:22:10] INFO: config file: /private/var/folders/30/.../T/InputLeap.bXXFCF<br>[2026-06-16T17:22:10] INFO: log level: INFO<br>[2026-06-16T17:22:10] INFO: drag and drop enabled<br>[2026-06-16T17:22:10] FATAL: An error occurred: assistive devices does not trust this process, allow it in system settings.<br>[2026-06-16T17:22:10] ERROR: process exited with error code: 1<br>[2026-06-16T17:22:10] INFO: detected process not running, auto restarting</pre><p>To resolve this issue permanently (tracked under <a href="https://github.com/input-leap/input-leap/issues/2075">InputLeap GitHub Issue #2075</a>), you must explicitly authorize the raw binary compiled inside the application package:</p><ul><li>Open <strong>System Settings &gt; Privacy &amp; Security &gt; Accessibility</strong>.</li><li>If an old version of InputLeap is visible in the list, select it and click the <strong>minus (-) button</strong> to clear its cache.</li><li>Open your <strong>Finder</strong>, head to your <strong>Applications</strong> folder, right-click <strong>InputLeap.app</strong>, and select <strong>Show Package Contents</strong>.</li><li>Navigate through the internal folders: Contents ➔ MacOS.</li><li>Locate the raw binary file named input-leap.</li><li><strong>Drag and drop</strong> that specific input-leap binary file directly out of the Finder window and into the list under <strong>System Settings &gt; Privacy &amp; Security &gt; Accessibility</strong>.</li><li>Ensure the toggle switch next to <strong>input-leap</strong> is explicitly switched <strong>ON</strong> to grant it absolute control over device inputs.</li></ul><h3>Step 3: Configure the macOS Server Grid Layout</h3><ul><li>Launch <strong>InputLeap</strong> on your Mac.</li><li>Select the radio button for <strong>Server (share this computer’s mouse and keyboard)</strong>.</li><li>Click <strong>Configure Server…</strong> to open your screen arrangement matrix.</li><li>From the top-right corner, drag the <strong>Screen Icon</strong> and place it onto the grid relative to your physical desk layout (e.g., if your Windows laptop sits to the right of your monitor, drop it directly to the right of the center square).</li><li>Double-click that new grid icon. In the <strong>Screen name</strong> field, type the exact, case-sensitive <strong>Client Name</strong> displayed on your Windows InputLeap app main window.</li><li>Click <strong>OK</strong>, then click <strong>Save / Apply</strong>.</li></ul><h3>Step 4: Secure Network Tuning &amp; Connecting Options</h3><p>To keep your connection completely secure, we will preserve InputLeap’s built-in TLS encryption while explicitly ensuring the handshake passes across operating systems.</p><h3>1. Whitelist the Windows Firewall Port</h3><p>Windows blocks unauthorized inbound connections on high ports by default. Open <strong>PowerShell as an Administrator</strong> on your Windows laptop and whitelist the communication port (24800):</p><p>PowerShell</p><pre>New-NetFirewallRule -DisplayName &quot;InputLeap KVM Port&quot; -Direction Inbound -LocalPort 24800 -Protocol TCP -Action Allow</pre><p><em>(Ensure your Windows Wi-Fi network profile properties are set to </em><strong><em>Private</em></strong><em> to permit standard local device discoverability).</em></p><h3>2. Choose Your Connection Method: Manual IP vs. Auto-Config</h3><p>You have two ways to map your target client machine to your Mac server depending on your network preferences:</p><h4>Option A: Manual Unicast IP (Most Reliable)</h4><p>If you run advanced networking tools like virtual Docker interfaces, internal subnets, or corporate VPN endpoints, your machines will have multiple active network paths. Forcing a direct connection bypasses network discovery issues:</p><ul><li>On the Windows client app, uncheck <strong>Auto-config</strong>.</li><li>Look at your Mac’s main screen, find its local IP address (e.g., 192.168.1.X), and paste it into the <strong>Server IP</strong> box on Windows.</li><li>Run a quick connection test via Windows PowerShell to ensure your router isn’t blocking the line:</li></ul><pre>Test-NetConnection -ComputerName YOUR_SERVER_IP_HERE -Port 24800</pre><h4>Option B: Clean Auto-Config using Bonjour</h4><p>If you want a seamless, zero-configuration setup where the client automatically rediscovers the server even if your router reassigns your IP addresses, you can use Apple’s <strong>Bonjour</strong> protocol. While baked directly into macOS, Windows needs to be manually provisioned to understand it:</p><ul><li>Download and install the <strong>Bonjour Print Services for Windows</strong> client directly from Apple’s support pages or via an older iTunes deployment package.</li><li>Once the Bonjour daemon is running on your Windows machine, check the <strong>Auto-config</strong> box inside the Windows InputLeap UI. It will automatically scan the local network stack, interpret the host mDNS broadcasts, and discover your Mac without manual IP matching.</li></ul><h3>3. Accept the Encryption Handshake</h3><ul><li>On your Mac server, verify <strong>Enable TLS / Crypto</strong> is checked in your Settings. Note the unique secure <strong>Fingerprint</strong> displayed on the screen.</li><li>Click <strong>Start</strong> on your Mac Server first, followed by <strong>Start</strong> on Windows.</li><li><strong>The Critical Step:</strong> Keep an eye on your Windows desktop. A pop-up dialog box will appear asking you to trust the incoming SSL certificate. Compare the cryptographic fingerprint string to the one shown on your Mac. If they align, click <strong>Yes / Accept</strong>.</li></ul><p>Your connection state will change to connected. Your single KVM mouse and keyboard input are now dynamically mapped across independent operating systems, letting you work, copy, and paste seamlessly without the physical wire clutter!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd2e3fba01e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open WebUI Setup & AI Memory Management on Ubuntu Server]]></title>
            <link>https://fahryrozy.medium.com/open-webui-setup-ai-memory-management-on-ubuntu-server-ceed18ac611a?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceed18ac611a</guid>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 01:36:00 GMT</pubDate>
            <atom:updated>2026-06-01T01:36:00.568Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Practical Guide to Installing Open WebUI and Choosing the Right RAM Strategy for Ollama</h3><p>If you’ve already set up Ollama on your local machine, the next step is giving it a proper interface — and deciding how aggressively it should hold your AI model in memory. This guide covers both.</p><p><strong>What you’ll set up:</strong></p><ul><li>Open WebUI running as a system service (auto-starts on boot)</li><li>A clear understanding of Ollama’s memory management options</li><li>The right KEEP_ALIVE setting for your use case</li></ul><p><strong>Prerequisites:</strong></p><ul><li>Ollama installed and running (systemctl status ollama)</li><li>Python 3.10+ available (python3 --version)</li><li>Ubuntu Server 24.04</li></ul><h3>Part 1 — Install Open WebUI</h3><p><strong>Install Python virtual environment:</strong></p><pre>sudo apt install python3-pip python3-venv -y<br>python3 -m venv ~/.venv/openwebui<br>source ~/.venv/openwebui/bin/activate</pre><p>You’ll see (openwebui) prefix in your terminal when the venv is active.</p><p><strong>Install Open WebUI:</strong></p><pre>pip install open-webui</pre><p>This takes 5–10 minutes — it installs around 150 packages including ML dependencies.</p><p><strong>First run (test mode):</strong></p><pre>OLLAMA_BASE_URL=http://127.0.0.1:11434 open-webui serve --host 0.0.0.0 --port 3000</pre><p>Wait for this exact line before opening your browser:</p><pre>INFO:     Application startup complete.</pre><blockquote><em>⚠️ First launch downloads a 931MB embedding model (all-MiniLM-L6-v2) from HuggingFace. Subsequent starts use the cached version and are much faster.</em></blockquote><p>Open from any device on your network:</p><pre>http://YOUR_SERVER_IP:3000</pre><p>Create your admin account on the signup page. Once confirmed working, press Ctrl+C.</p><p><strong>Open firewall port:</strong></p><pre>sudo ufw allow 3000/tcp</pre><h3>Part 2 — Run as Background Process (Quick Option)</h3><p>If you just want it running without setting up a full service yet:</p><pre>source ~/.venv/openwebui/bin/activate<br>OLLAMA_BASE_URL=http://127.0.0.1:11434 nohup open-webui serve --host 0.0.0.0 --port 3000 &amp;</pre><pre>sleep 5 &amp;&amp; sudo ss -tlnp | grep 3000</pre><p>Logs go to nohup.out:</p><pre>tail -f nohup.out</pre><h3>Part 3 — Set Up as System Service (Recommended)</h3><p>This makes Open WebUI start automatically on every boot — no manual intervention needed.</p><pre>sudo nano /etc/systemd/system/open-webui.service</pre><p>Paste this (replace YOUR_USERNAME with your actual username — check with whoami):</p><pre>[Unit]<br>Description=Open WebUI<br>After=network.target ollama.service<br>Requires=ollama.service</pre><pre>[Service]<br>Type=simple<br>User=YOUR_USERNAME<br>WorkingDirectory=/home/YOUR_USERNAME<br>ExecStart=/home/YOUR_USERNAME/.venv/openwebui/bin/open-webui serve --host 0.0.0.0 --port 3000<br>Restart=always<br>RestartSec=5<br>Environment=&quot;OLLAMA_BASE_URL=http://127.0.0.1:11434&quot;</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Enable and start:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable open-webui<br>sudo systemctl start open-webui<br>sudo systemctl status open-webui<br>journalctl -u open-webui -f</pre><h3>Part 4 — RAM Strategy: Should the Model Stay in Memory?</h3><p>This is where most people get confused. Let me break it down.</p><p>Ollama loads the AI model into RAM when a request arrives, then unloads it after an idle period. The behavior is controlled by a single environment variable: OLLAMA_KEEP_ALIVE.</p><pre>Request arrives<br>      │<br>      ▼<br>Is model in RAM?<br>  ├── YES → respond instantly (~1 sec)<br>  └── NO  → load model from disk (30–90 sec) → respond</pre><p>There are three strategies to choose from.</p><h3>Strategy A — Always in RAM (KEEP_ALIVE=-1)</h3><p>The model is loaded at startup and never unloads.</p><pre>Environment=&quot;OLLAMA_KEEP_ALIVE=-1&quot;</pre><p><strong>Pros:</strong> Instant response every time. No cold start. Essential if a web server is consuming your API — a 60-second delay on the first request after idle feels like the server is broken.</p><p><strong>Cons:</strong> ~4.7GB RAM permanently occupied for qwen2.5:7b. Slightly higher power draw.</p><p><strong>Best for:</strong> Dedicated AI server, production API, frequent requests.</p><h3>Strategy B — Unload After Timeout (KEEP_ALIVE=10m)</h3><p>Model stays in RAM for 10 minutes after the last request, then unloads.</p><pre>Environment=&quot;OLLAMA_KEEP_ALIVE=10m&quot;</pre><p><strong>Pros:</strong> RAM freed when idle. Lower power draw. Good while still setting things up.</p><p><strong>Cons:</strong> 30–90 second cold start after idle period. Inconsistent response times. Risky if a web server calls your API after a long quiet period.</p><p><strong>Best for:</strong> Development phase, occasional personal use, RAM-constrained machines.</p><h3>Strategy C — Unload Immediately (KEEP_ALIVE=0)</h3><p>Model unloads immediately after each request.</p><pre>Environment=&quot;OLLAMA_KEEP_ALIVE=0&quot;</pre><p><strong>Pros:</strong> Minimum RAM usage.</p><p><strong>Cons:</strong> Every single request pays the 30–90 second load penalty. Practically unusable for real workloads.</p><p><strong>Best for:</strong> Not recommended for any server use.</p><h3>Side-by-Side Comparison</h3><p>Always Loaded (-1) 10 Min Timeout Immediate Unload (0) First response ~1 sec 30–90 sec if idle 30–90 sec always RAM when idle ~4.7GB ~600MB ~600MB RAM when active ~4.7GB ~4.7GB ~4.7GB Power draw Higher Medium Lower Web server safe ✅ Yes ⚠️ Risky ❌ No</p><h3>RAM Budget Reference (8GB Machine)</h3><p><strong>Production mode (model always loaded):</strong></p><pre>OS + services:     ~600MB<br>qwen2.5:7b:       ~4.7GB<br>Open WebUI:        ~400MB<br>Total:             ~5.7GB<br>Free:              ~1.8GB ✅</pre><p><strong>Idle mode (model unloaded):</strong></p><pre>OS + services:     ~600MB<br>Open WebUI:        ~400MB<br>Total:             ~1.0GB<br>Free:              ~6.5GB ✅</pre><h3>Part 5 — Apply Your KEEP_ALIVE Setting</h3><p>Edit the Ollama service override:</p><pre>sudo systemctl edit ollama</pre><p>Your override file should look like this:</p><pre>[Service]<br>Environment=&quot;OLLAMA_HOST=0.0.0.0:11434&quot;<br>Environment=&quot;OLLAMA_KEEP_ALIVE=10m&quot;<br>Environment=&quot;OLLAMA_NUM_PARALLEL=1&quot;<br>Environment=&quot;OLLAMA_MAX_LOADED_MODELS=1&quot;</pre><p>Apply:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl restart ollama<br>sudo cat /etc/systemd/system/ollama.service.d/override.conf</pre><p><strong>When you’re ready to switch to always-on</strong> (when your web server is ready and consuming the API):</p><pre>sudo systemctl edit ollama<br># Change: OLLAMA_KEEP_ALIVE=10m → OLLAMA_KEEP_ALIVE=-1<br>sudo systemctl daemon-reload<br>sudo systemctl restart ollama<br>ollama run qwen2.5:7b &quot;warmup&quot;<br>ollama ps</pre><h3>Part 6 — Swap Memory Consideration</h3><p>With 8GB RAM and ~5.7GB used at peak, you have ~1.8GB headroom. Swap isn’t needed for normal operation — but it’s a useful safety net.</p><p><strong>Keep swap, but set swappiness low:</strong></p><pre>cat /proc/sys/vm/swappiness</pre><pre>sudo sysctl vm.swappiness=10<br>echo &#39;vm.swappiness=10&#39; | sudo tee -a /etc/sysctl.conf</pre><p>Swappiness Behavior 60 (default) Aggressively moves RAM to swap — bad for AI workloads 10 Uses swap only when truly necessary ✅ 0 Never swaps — risky, OOM killer may terminate processes</p><p>Why does this matter? RAM is ~24x faster than even a fast SSD. Every time Linux unnecessarily swaps data to disk, your response times suffer. Setting swappiness to 10 tells Linux to keep everything in RAM as long as possible.</p><h3>Part 7 — Useful Commands</h3><pre># Check what model is loaded in RAM<br>ollama ps</pre><pre># Check RAM usage<br>free -h</pre><pre># Check service status<br>sudo systemctl status open-webui<br>sudo systemctl status ollama</pre><pre># Watch live logs<br>journalctl -u ollama -f<br>journalctl -u open-webui -f</pre><pre># Restart both services<br>sudo systemctl restart ollama<br>sudo systemctl restart open-webui</pre><pre># Manually load model into RAM<br>ollama run qwen2.5:7b &quot;hi&quot;</pre><h3>When Your Web Server is Ready</h3><p>Once your consumer (Laptop B, a web app, etc.) is ready to call your Ollama API:</p><ol><li>Switch to OLLAMA_KEEP_ALIVE=-1</li><li>Pre-warm the model: ollama run qwen2.5:7b &quot;warmup&quot;</li><li>Confirm it’s loaded: ollama ps</li></ol><p>From that point, any machine on your network gets instant responses from <a href="http://your_server_ip:11434/api/generate.">http://YOUR_SERVER_IP:11434/api/generate.</a></p><p><em>Ubuntu Server 24.04 · Intel i5–5200U · 7.5GB RAM · Ollama + qwen2.5:7b · Open WebUI v0.9.5</em></p><p><em>Found this useful? Follow for more self-hosted infrastructure guides.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceed18ac611a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Home Lab Server using Ubuntu 24.04 LTS — Fresh Install Post-Guide]]></title>
            <link>https://fahryrozy.medium.com/ubuntu-server-24-04-lts-fresh-install-guide-5bd9b756565b?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bd9b756565b</guid>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Mon, 25 May 2026 08:53:39 GMT</pubDate>
            <atom:updated>2026-05-25T14:52:28.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*nyR4HhFm2lY73qEXV-3ogA.jpeg" /></figure><h3>Part 1: Getting Connected to the Internet After a Fresh Install</h3><p>Just installed Ubuntu Server 24.04 LTS and staring at a blinking cursor with no internet? You’re not alone. WiFi drivers on a fresh Ubuntu Server install are often missing, and the first thing you need is a connection to download them.</p><p>This guide covers the fastest way to get online — using your Android phone as a USB modem. No extra drivers, no WiFi setup, no router access required.</p><h3>Step 1 — Check if You’re Already Connected</h3><p>Before doing anything, check if you already have internet:</p><pre>ping -c 4 8.8.8.8</pre><p>If you get replies, you’re connected — skip to Step 3. If you see <strong>“Network unreachable”</strong> or the command times out, continue to Step 2.</p><h3>Step 2 — Connect via Android USB Tethering</h3><p>Android USB tethering works out of the box on Ubuntu Server — no drivers needed. Your phone essentially acts as a USB network adapter.</p><p><strong>On your Android phone:</strong></p><ol><li>Connect your phone to the laptop via USB cable</li><li>Go to <strong>Settings → Network &amp; Internet → Hotspot &amp; Tethering</strong></li><li>Enable <strong>USB Tethering</strong></li></ol><blockquote><em>On some phones the path is: Settings → Connections → Mobile Hotspot and Tethering → USB Tethering</em></blockquote><p>Make sure <strong>mobile data is enabled</strong> on your phone.</p><p><strong>On your Ubuntu Server — find the new interface:</strong></p><pre>ip link show</pre><p>Look for a new interface that wasn’t there before — it will look something like usb0 or enx629eae637058. This is your phone&#39;s tethering interface.</p><p><strong>Bring the interface up:</strong></p><pre>sudo ip link set enx629eae637058 up</pre><p>Replace enx629eae637058 with your actual interface name from the previous step.</p><p><strong>Request an IP address — try these options one by one:</strong></p><pre>sudo dhcpcd enx629eae637058</pre><p>If that doesn’t work:</p><pre>sudo udhcpc -i enx629eae637058</pre><p><strong>If both fail — assign IP manually:</strong></p><p>Android tethering uses the 192.168.42.x subnet. Your phone acts as the gateway at 192.168.42.1.</p><pre>sudo ip addr add 192.168.42.129/24 dev enx629eae637058<br>sudo ip route add default via 192.168.42.1<br>echo &quot;nameserver 8.8.8.8&quot; | sudo tee /etc/resolv.conf</pre><p><strong>Test the connection:</strong></p><pre>ping -c 4 8.8.8.8</pre><p>You should see replies. If you do, your phone is now providing internet to your server.</p><h3>Step 3 — Update the System</h3><p>Once connected, update immediately:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><p>This pulls the latest package lists and security patches. On a fresh install this can take a few minutes.</p><h3>Troubleshooting</h3><p><strong>No new interface after plugging in</strong> Try a different USB cable — many cables are charge-only and don’t carry data.</p><p><strong>Phone doesn’t show tethering option</strong> Make sure mobile data is turned on. Tethering requires an active data connection.</p><p><strong>Interface shows but no IP assigned</strong> Run this for more detail on what’s happening:</p><pre>sudo dhclient -v enx629eae637058</pre><p><strong>Still no internet after manually assigning IP</strong> Toggle USB tethering off and back on again on your phone, then retry.</p><p><strong>ping command not found</strong> Try these alternatives:</p><pre>curl http://8.8.8.8<br>wget -q --spider http://google.com</pre><h3>Part 2: Connecting to WiFi Using Netplan</h3><p>Got internet via USB tethering in Part 1? Good. Now let’s get WiFi working properly so your server can connect independently without needing your phone plugged in.</p><p>Ubuntu Server 24.04 uses <strong>Netplan</strong> as its network configuration tool. If you’ve used desktop Ubuntu before, forget NetworkManager — on the server edition, Netplan with systemd-networkd is the right approach. It&#39;s lighter, faster, and designed exactly for this use case.</p><h3>Netplan vs NetworkManager — Why it Matters</h3><p>Netplan + networkd NetworkManager Designed for Servers Desktops Config style Single YAML file Multiple config files Resource usage Lighter Heavier Ubuntu Server default ✅ Yes ❌ No</p><h3>Step 1 — Find Your WiFi Interface Name</h3><pre>ip link show</pre><p>Look for an interface starting with wl — for example wlp3s0 or wlan0. Note it down, you&#39;ll need it in the config file.</p><h3>Step 2 — Check Existing Netplan Config</h3><pre>ls /etc/netplan/</pre><p>On a fresh Ubuntu Server install you’ll likely see one of these:</p><ul><li>00-installer-config.yaml — standard installer</li><li>50-cloud-init.yaml — cloud image install</li></ul><blockquote><em>If you have </em><em>50-cloud-init.yaml, do NOT edit it directly. It gets overwritten by cloud-init on reboot. Create a new file instead (explained in Step 3).</em></blockquote><h3>Step 3 — Create a New WiFi Config File</h3><p>Create a new file with a 99- prefix so it loads last and takes priority over existing configs:</p><pre>sudo nano /etc/netplan/99-wifi.yaml</pre><p>Paste this content:</p><pre>network:<br>  version: 2<br>  renderer: networkd<br>  wifis:<br>    wlp3s0:<br>      dhcp4: true<br>      access-points:<br>        &quot;MySSID&quot;:<br>          password: &quot;MyPassword&quot;</pre><p>Replace wlp3s0 with your actual interface name, MySSID with your WiFi name, and MyPassword with your password.</p><p>Save and exit: Ctrl+X → Y → Enter</p><blockquote><em>Why </em><em>99-wifi.yaml? Netplan loads files in numerical order. A file starting with </em><em>99 loads last and overrides everything before it — including </em><em>50-cloud-init.yaml. Your config survives reboots.</em></blockquote><h3>Step 4 — Fix File Permissions</h3><p>Netplan throws a warning if the file is world-readable:</p><pre>sudo chmod 600 /etc/netplan/99-wifi.yaml</pre><h3>Step 5 — Test Before Applying</h3><pre>sudo netplan try</pre><p>This applies the config for 120 seconds. If something breaks, it automatically reverts. Press Enter to confirm and make it permanent once WiFi connects successfully.</p><h3>Step 6 — Apply Permanently</h3><pre>sudo netplan apply</pre><h3>Step 7 — Verify the Connection</h3><pre>ip addr show wlp3s0<br>ping -c 4 google.com</pre><p>You should see an IP address assigned to your WiFi interface and successful ping replies. Your server is now on WiFi.</p><h3>Troubleshooting</h3><p><strong>WiFi interface shows as “unmanaged” or “unavailable”</strong></p><p>Check if the WiFi radio is blocked:</p><pre>rfkill list all</pre><p>If you see Soft blocked: yes, unblock it:</p><pre>rfkill unblock wifi<br>sudo ip link set wlp3s0 up<br>sudo netplan apply</pre><p><strong>Check if the WiFi driver is loaded</strong></p><pre>lspci -k | grep -A3 -i wireless</pre><p>Look for Kernel driver in use: iwlwifi (or similar). If it&#39;s missing, you may need to install firmware — which is why USB tethering from Part 1 comes in handy first.</p><p><strong>Check system logs for errors</strong></p><pre>dmesg | grep -i wlp3s0<br>dmesg | grep -i firmware<br>sudo journalctl -u systemd-networkd -f</pre><h3>Bonus — Keep USB Tethering Alongside WiFi</h3><p>If you want both interfaces active at the same time (useful during transition):</p><pre>network:<br>  version: 2<br>  renderer: networkd<br>  ethernets:<br>    enx629eae637058:<br>      dhcp4: true<br>  wifis:<br>    wlp3s0:<br>      dhcp4: true<br>      access-points:<br>        &quot;MySSID&quot;:<br>          password: &quot;MyPassword&quot;</pre><h3>Part 3: Essential Server Setup — Hardening, Firewall, and SSH</h3><p>WiFi is working, internet is connected. Now let’s turn this bare Ubuntu Server install into something solid. This part covers the foundational setup every server should have — system updates, firewall, SSH hardening, and a few tools that will save you hours later.</p><h3>Step 1 — Update the System</h3><p>Always start here on a fresh install:</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt dist-upgrade -y<br>sudo apt autoremove -y</pre><p>Reboot if the kernel was updated:</p><pre>sudo reboot</pre><p>After reboot, reconnect via SSH and continue.</p><h3>Step 2 — Set Your Hostname</h3><p>Give your server a name that makes sense for its role:</p><pre>sudo hostnamectl set-hostname my-server<br>hostnamectl</pre><h3>Step 3 — Set the Correct Timezone</h3><pre>timedatectl<br>timedatectl list-timezones | grep -i asia<br>sudo timedatectl set-timezone Asia/Jakarta<br>timedatectl</pre><p>Replace Asia/Jakarta with your actual timezone. Run timedatectl list-timezones to see all options.</p><h3>Step 4 — Install Essential Tools</h3><pre>sudo apt install -y \<br>  curl wget git \<br>  htop btop \<br>  net-tools \<br>  unzip zip \<br>  build-essential \<br>  ca-certificates \<br>  gnupg lsb-release</pre><p>What each tool does:</p><p>Tool Purpose curl / wget Download files from the internet git Version control htop / btop Interactive system monitor net-tools Network utilities (ifconfig, netstat) build-essential C/C++ compilers and build tools ca-certificates SSL certificate management gnupg GPG key management (needed for adding repos)</p><h3>Step 5 — Configure the Firewall</h3><p>UFW (Uncomplicated Firewall) is Ubuntu’s standard firewall tool. The order here matters — allow SSH before enabling the firewall, or you’ll lock yourself out.</p><pre>sudo apt install ufw -y<br>sudo ufw default deny incoming<br>sudo ufw default allow outgoing<br>sudo ufw allow ssh<br>sudo ufw enable<br>sudo ufw status verbose</pre><blockquote><em>⚠️ Always allow SSH before running </em><em>ufw enable. If you forget this step on a remote server, you will lose access.</em></blockquote><p>Common rules you’ll likely need later:</p><pre>sudo ufw allow 80/tcp    # HTTP<br>sudo ufw allow 443/tcp   # HTTPS<br>sudo ufw allow 3306/tcp  # MySQL<br>sudo ufw allow 5432/tcp  # PostgreSQL<br>sudo ufw deny 23/tcp     # Block Telnet</pre><h3>Step 6 — Set Up SSH Server</h3><p>SSH lets you access your server remotely from any machine on your network.</p><pre>sudo apt install openssh-server -y<br>sudo systemctl enable ssh<br>sudo systemctl start ssh<br>sudo systemctl status ssh</pre><p>Find your server’s IP:</p><pre>ip addr show wlp3s0</pre><p>Look for the inet line — for example 192.168.1.105. From another machine:</p><pre>ssh your_username@192.168.1.105</pre><h3>Step 7 — Harden SSH</h3><p>The default SSH config is functional but not secure. Edit it:</p><pre>sudo nano /etc/ssh/sshd_config</pre><p>Change or add these lines:</p><pre>PermitRootLogin no<br>PasswordAuthentication yes<br>X11Forwarding no<br>MaxAuthTries 3</pre><p>Save and exit: Ctrl+X → Y → Enter</p><p>Apply the changes:</p><pre>sudo systemctl restart ssh</pre><blockquote><em>💡 Once you’re comfortable with SSH keys, change </em><em>PasswordAuthentication to </em><em>no for much stronger security. Key-based auth makes brute-force attacks practically impossible.</em></blockquote><h3>Step 8 — Enable Automatic Security Updates</h3><pre>sudo apt install unattended-upgrades -y<br>sudo dpkg-reconfigure --priority=low unattended-upgrades</pre><p>Select <strong>Yes</strong> when prompted. This keeps your server automatically patched against security vulnerabilities without manual intervention.</p><h3>Step 9 — Create a New Sudo User</h3><p>Avoid doing everything as your default install user. Create a dedicated account:</p><pre>sudo adduser newusername<br>sudo usermod -aG sudo newusername</pre><p>Verify it has sudo access:</p><pre>su - newusername<br>sudo whoami</pre><p>Should output: root</p><h3>Step 10 — Check System Health</h3><p>Get a snapshot of your server’s current state:</p><pre>df -h<br>free -h<br>lscpu<br>systemctl list-units --type=service --state=running<br>sudo journalctl -p err -b</pre><p>These five commands tell you disk usage, memory, CPU specs, what’s running, and any errors since the last boot. Run them after every major change to catch issues early.</p><h3>Setup Checklist</h3><ul><li>✅ System fully updated</li><li>✅ Hostname set</li><li>✅ Timezone configured</li><li>✅ Essential tools installed</li><li>✅ Firewall enabled with SSH allowed</li><li>✅ SSH server running and hardened</li><li>✅ Automatic security updates enabled</li><li>✅ New sudo user created</li><li>✅ System health verified</li></ul><p>Your Ubuntu Server 24.04 LTS is now properly hardened and ready for its workload.</p><p><em>Ubuntu Server 24.04 LTS · Tested on ThinkPad X250 · Android USB Tethering · Netplan + systemd-networkd · UFW · OpenSSH · systemd</em></p><p><em>If this helped you, consider clapping and following for more self-hosted infrastructure guides.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bd9b756565b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turn Your Old Laptop to be 24/7 AI Machine]]></title>
            <link>https://fahryrozy.medium.com/turn-your-old-laptop-to-be-24-7-ai-machine-4528784f5b06?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4528784f5b06</guid>
            <category><![CDATA[old-laptop]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[qwen-3]]></category>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Mon, 25 May 2026 08:12:49 GMT</pubDate>
            <atom:updated>2026-05-25T08:47:24.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>With Ubuntu, Ollama &amp; Qwen3.5 — No GPU, No Cloud, No Monthly Fees</h3><p>Have an old laptop gathering dust? In this guide, I’ll show you how I transformed a spare ThinkPad with an Intel i5 and 8GB RAM into a fully functional local AI server — running Qwen 3.5 models via Ollama, accessible from any device on my home network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*C4Ak58siDF58pqwuiWrSdw.jpeg" /></figure><p>No dedicated GPU required. No cloud subscription. Just your hardware and open-source software.</p><p><strong>What you’ll have at the end:</strong></p><ul><li>Ollama running as a system service with Qwen 3.5 always ready</li><li>A static IP so every device on your network can reach it</li><li>Open WebUI — a ChatGPT-like browser interface accessible from your phone, laptop, or tablet</li><li>A clean REST API endpoint for other machines to consume</li></ul><p><strong>Hardware used in this guide:</strong></p><ul><li>Laptop: Intel i5–5200U, 7.5GB RAM, 500GB HDD</li><li>OS: Ubuntu Server 24.04</li><li>No dedicated GPU (CPU-only inference)</li></ul><h3>Part 1 — Storage Setup: Claim Your Full Disk</h3><p>Ubuntu’s installer often only allocates 100GB to the root partition, leaving the rest unused in the LVM Volume Group. Let’s fix that first.</p><p><strong>Check your current storage:</strong></p><pre>lsblk<br>df -h /<br>sudo vgs</pre><p>If your logical volume is much smaller than your physical disk, you have free space to claim.</p><p><strong>Expand the Logical Volume:</strong></p><pre>sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv<br>sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv</pre><p><strong>Verify:</strong></p><pre>df -h /</pre><p>Your root / should now show the full disk size.</p><blockquote><em>💡 If you want to keep some space for LVM snapshots, use </em><em>sudo lvextend -L 420G instead.</em></blockquote><h3>Part 2 — Set a Static IP Address</h3><p>Your AI machine needs a fixed IP so other devices can always find it.</p><p><strong>Find your network info:</strong></p><pre>ip a<br>ip route | grep default</pre><p><strong>Check your target IP is free:</strong></p><pre>ping 192.168.1.100 -c 2<br># No response = safe to use</pre><p><strong>Edit your Netplan config:</strong></p><pre>ls /etc/netplan/<br>sudo nano /etc/netplan/99-wifi.yaml</pre><p>Replace the content with:</p><pre>network:<br>  version: 2<br>  renderer: networkd<br>  wifis:<br>    wlp3s0:<br>      dhcp4: no<br>      addresses: [192.168.1.100/24]<br>      routes:<br>        - to: default<br>          via: 192.168.1.1<br>      nameservers:<br>        addresses: [8.8.8.8, 1.1.1.1]<br>      access-points:<br>        &quot;YourWiFiName&quot;:<br>          password: &quot;YourWiFiPassword&quot;</pre><p><strong>Apply:</strong></p><pre>sudo netplan apply<br>ip a show wlp3s0<br>ping 8.8.8.8 -c 3</pre><blockquote><em>💡 Also add a DHCP reservation in your router admin panel using your laptop’s MAC address. This ensures the same IP even if netplan resets.</em></blockquote><h3>Part 3 — Install Ollama</h3><p><strong>Install:</strong></p><pre>curl -fsSL https://ollama.com/install.sh | sh</pre><p><strong>Verify:</strong></p><pre>ollama --version<br>systemctl status ollama</pre><p><strong>Choose and pull your model:</strong></p><p>ModelSizeMin RAMSpeed on CPUqwen3.5:0.8b~0.8GB3GBVery Fastqwen3.5:2b~1.8GB4GBFastqwen3.5:4b~2.8GB5GBGood ✅ Recommended</p><pre>ollama pull qwen3.5:4b</pre><p><strong>Test it locally:</strong></p><pre>ollama run qwen3.5:4b &quot;hello, are you working?&quot;</pre><h3>Part 4 — Expose Ollama on Your Network</h3><p>By default Ollama only listens on localhost. Here’s how to expose it to your LAN.</p><p><strong>Create a service override:</strong></p><pre>sudo mkdir -p /etc/systemd/system/ollama.service.d/<br>sudo nano /etc/systemd/system/ollama.service.d/override.conf</pre><p>Paste:</p><pre>[Service]<br>Environment=&quot;OLLAMA_HOST=0.0.0.0:11434&quot;<br>Environment=&quot;OLLAMA_KEEP_ALIVE=-1&quot;<br>Environment=&quot;OLLAMA_NUM_PARALLEL=1&quot;<br>Environment=&quot;OLLAMA_MAX_LOADED_MODELS=1&quot;</pre><blockquote><em>OLLAMA_KEEP_ALIVE=-1 keeps the model permanently loaded in RAM for instant responses.</em></blockquote><p><strong>Apply:</strong></p><pre>sudo systemctl daemon-reload<br>sudo systemctl restart ollama<br>sudo systemctl enable ollama</pre><p><strong>Verify it’s listening on all interfaces:</strong></p><pre>sudo ss -tlnp | grep 11434<br># Should show: *:11434</pre><p><strong>Open firewall:</strong></p><pre>sudo ufw allow 11434/tcp</pre><p><strong>Test from another device:</strong></p><pre>curl http://192.168.1.100:11434<br># Expected: Ollama is running</pre><pre>curl <a href="http://192.168.1.100:11434/api/generate">http://192.168.1.100:11434/api/generate</a> -d &#39;{<br>  &quot;model&quot;: &quot;qwen3.5:4b&quot;,<br>  &quot;prompt&quot;: &quot;Hello, are you working?&quot;,<br>  &quot;stream&quot;: false<br>}&#39;</pre><h3>Part 5 — Keep the Laptop Awake</h3><p>As a server, the laptop must stay awake even with the lid closed.</p><p><strong>Disable lid sleep:</strong></p><pre>sudo sed -i &#39;s/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/&#39; /etc/systemd/logind.conf<br>sudo sed -i &#39;s/#HandleSuspendKey=suspend/HandleSuspendKey=ignore/&#39; /etc/systemd/logind.conf</pre><p><strong>Mask sleep targets:</strong></p><pre>sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target</pre><p><strong>Apply:</strong></p><pre>sudo systemctl restart systemd-logind</pre><h3>Part 6 — Install Open WebUI</h3><p>Open WebUI gives you a ChatGPT-like interface accessible from any browser on your network.</p><p><strong>Install Python virtual environment:</strong></p><pre>sudo apt install python3-pip python3-venv -y<br>python3 -m venv ~/.venv/openwebui<br>source ~/.venv/openwebui/bin/activate</pre><p><strong>Install Open WebUI:</strong></p><pre>pip install open-webui</pre><p>This takes 5–10 minutes. It downloads ~150 packages including ML dependencies.</p><p><strong>Test run:</strong></p><pre>OLLAMA_BASE_URL=http://127.0.0.1:11434 open-webui serve --host 0.0.0.0 --port 3000</pre><p>Open http://192.168.1.100:3000 from any device. You&#39;ll see a signup page — create your admin account. Once confirmed working, press Ctrl+C.</p><p><strong>Create a system service</strong> so Open WebUI starts automatically on boot:</p><pre>sudo nano /etc/systemd/system/open-webui.service</pre><p>Paste (replace YOUR_USERNAME with your actual username):</p><pre>[Unit]<br>Description=Open WebUI<br>After=network.target ollama.service<br>Requires=ollama.service</pre><pre>[Service]<br>Type=simple<br>User=YOUR_USERNAME<br>WorkingDirectory=/home/YOUR_USERNAME<br>ExecStart=/home/YOUR_USERNAME/.venv/openwebui/bin/open-webui serve --host 0.0.0.0 --port 3000<br>Restart=always<br>RestartSec=5<br>Environment=&quot;OLLAMA_BASE_URL=http://127.0.0.1:11434&quot;</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p><strong>Enable and start:</strong></p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable open-webui<br>sudo systemctl start open-webui<br>sudo ufw allow 3000/tcp</pre><h3>Part 7 — Clean Up Unnecessary Services</h3><p>Free up RAM by disabling services you don’t need on a headless server:</p><pre>sudo systemctl disable --now fwupd<br>sudo systemctl disable --now ModemManager<br>sudo systemctl disable --now multipathd</pre><blockquote><em>Keep </em><em>thermald if your laptop tends to overheat under load.</em></blockquote><h3>Final Architecture</h3><pre>Any Device on Your LAN<br>(laptop, phone, tablet)<br>        │<br>        │  Browser → http://192.168.1.100:3000<br>        ▼<br>  Open WebUI (port 3000)<br>        │<br>        ▼<br>  Ollama API (port 11434)<br>        │<br>        ▼<br>  qwen3.5:4b loaded in RAM 24/7</pre><h3>RAM Budget Reference (8GB Machine)</h3><pre>Ubuntu OS + services:   ~600MB<br>qwen3.5:4b (loaded):   ~2.8GB<br>Open WebUI:            ~400MB<br>Total:                 ~3.8GB<br>Remaining headroom:    ~3.7GB ✅ very comfortable</pre><blockquote><em>Need even faster responses? Try </em><em>qwen3.5:2b (~1.8GB) — lighter and quicker while still supporting vision and thinking mode.</em></blockquote><blockquote>Using the API from Other Machines</blockquote><p>Once everything is running, any machine on your network can call the Ollama API directly:</p><pre>curl http://192.168.1.100:11434/api/generate -d &#39;{<br>  &quot;model&quot;: &quot;qwen3.5:4b&quot;,<br>  &quot;prompt&quot;: &quot;Your prompt here&quot;,<br>  &quot;stream&quot;: false<br>}&#39;</pre><p>Python example:</p><pre>import requests<br>response = requests.post(&quot;http://192.168.1.100:11434/api/generate&quot;, json={<br>    &quot;model&quot;: &quot;qwen3.5:4b&quot;,<br>    &quot;prompt&quot;: &quot;Explain LVM in simple terms&quot;,<br>    &quot;stream&quot;: False<br>})<br>print(response.json()[&quot;response&quot;])</pre><h3>Troubleshooting Quick Reference</h3><p><strong>curl times out from remote machine</strong> Check: sudo ss -tlnp | grep 11434 — if it shows 127.0.0.1 instead of *, the OLLAMA_HOST override didn&#39;t apply. Fix: verify /etc/systemd/system/ollama.service.d/override.conf exists and reload systemd.</p><p><strong>Model not loading</strong> Check: ollama ps — if empty, the model has been unloaded. Fix: run ollama run qwen3.5:4b &quot;hi&quot; to reload, and set OLLAMA_KEEP_ALIVE=-1.</p><p><strong>Laptop going to sleep</strong> Fix: re-run the HandleLidSwitch=ignore and mask sleep targets steps from Part 5.</p><p><strong>Storage only shows 100GB</strong> Fix: lsblk to confirm the LV size, then re-run lvextend + resize2fs.</p><p><strong>Open WebUI won’t start</strong> Check: systemctl status open-webui — most commonly the username in the service file is wrong.</p><h3>All Key Commands at a Glance</h3><pre># Status check<br>systemctl status ollama<br>systemctl status open-webui<br>ollama ps<br>free -h</pre><pre># Restart services<br>sudo systemctl restart ollama<br>sudo systemctl restart open-webui</pre><pre># View logs<br>journalctl -u ollama -f<br>journalctl -u open-webui -f</pre><pre># Model management<br>ollama list<br>ollama pull qwen3.5:2b<br>ollama rm qwen3.5:4b</pre><p><em>Built and tested on Ubuntu Server 24.04 · Intel i5–5200U · 7.5GB RAM · Qwen3.5:4b · Vision + Thinking Mode</em></p><p><em>If this helped you, consider clapping and following for more self-hosted infrastructure guides.</em></p><p>Share</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4528784f5b06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Your Web Reverse Proxy with Nginx]]></title>
            <link>https://fahryrozy.medium.com/setup-your-web-reverse-proxy-with-nginx-f2bebea3ac84?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2bebea3ac84</guid>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Mon, 27 Oct 2025 00:47:17 GMT</pubDate>
            <atom:updated>2025-10-27T00:47:17.110Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide provides the complete steps to install Nginx and configure it as a reverse proxy on a Linux server (Ubuntu/Debian). This setup will allow you to route multiple domain names (subdomains) to different local services running on various ports.</p><h3>🛠️ Phase 1: Install Nginx</h3><p>Start by installing Nginx and ensuring it’s running.</p><p><strong>Update Package Lists and Install Nginx:</strong></p><pre>sudo apt update sudo apt install nginx -y</pre><p>Enable and Start the Service:</p><p>Nginx should start automatically after installation, but it’s good practice to ensure it’s enabled and active.</p><pre>sudo systemctl enable nginx </pre><pre>sudo systemctl start nginx</pre><pre>sudo systemctl status nginx</pre><p>Adjust Firewall (UFW):</p><p>If you are using UFW (Uncomplicated Firewall), allow traffic on the standard HTTP (80) and HTTPS (443) ports.</p><pre>sudo ufw allow &#39;Nginx Full&#39; <br>sudo ufw enable # Only if not already enabled</pre><h3>⚙️ Phase 2: Configure Reverse Proxy</h3><p>We will create a single configuration file that handles all the defined domains and the default catch-all site.</p><h3>1. Create the Configuration File</h3><p>We’ll use a single file for simplicity, but in a production environment, you may prefer one file per site.</p><p>Bash</p><pre># Create and open a new configuration file<br>sudo nano /etc/nginx/sites-available/fahryrozy_proxy</pre><h3>2. Paste the Configuration Block</h3><p>Paste the following Nginx server blocks into the file. The proxy_pass directive is the core of the reverse proxy, pointing the traffic to the correct <strong>local port</strong>.</p><p>Nginx</p><pre>## 1. DEFAULT SITE: your-web.com<br>server {<br>    listen 80 default_server;<br>    listen [::]:80 default_server;<br>    server_name your-web.com www.your-web.com;<br>location / {<br>        # Define a basic default page or forward to a placeholder service<br>        root /var/www/html;<br>        index index.html;<br>        # Example to forward default domain to a placeholder service on port 80:<br>        # proxy_pass http://127.0.0.1:80;<br>    }<br>}<br>## 2. SONARQUBE: sonar.your-web.com (Port 9000)<br>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name sonar.your-web.com;<br>    location / {<br>        proxy_pass http://127.0.0.1:9000;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>    }<br>}<br>## 3. JFROG ARTIFACTORY: cicd-jfrog.your-web.com (Ports 8081 &amp; 8082)<br># Artifactory/JFrog Platform uses a router (8081) and a main UI port (8082).<br># We proxy to the standard Artifactory UI port (8082) for external access.<br>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name cicd-jfrog.your-web.com;<br>    location / {<br>        proxy_pass http://127.0.0.1:8082;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>        proxy_read_timeout 900; # Important for Artifactory performance<br>    }<br>}<br>## 4. LOCAL DEVELOPMENT: soldev.your-web.com (Port 8800)<br>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name soldev.your-web.com;<br>    location / {<br>        proxy_pass http://127.0.0.1:8800;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>    }<br>}<br>## 5. API ENDPOINT: api.your-web.com (Port 9900)<br>server {<br>    listen 80;<br>    listen [::]:80;<br>    server_name api.your-web.com;<br>    location / {<br>        proxy_pass http://127.0.0.1:9900;<br>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>    }<br>}</pre><p><strong>P.S</strong>: make sure you change to your your-web actual domain address</p><h3>3. Activate the Configuration and Test</h3><ul><li><strong>Create Symlink:</strong> Link the configuration file from sites-available to sites-enabled.</li></ul><pre>sudo ln -s /etc/nginx/sites-available/yourweb_proxy /etc/nginx/sites-enabled/</pre><p><strong>Remove Default Site:</strong> Delete the default Nginx configuration to prevent conflicts with your new default server block.</p><pre>sudo rm /etc/nginx/sites-enabled/default</pre><p><strong>Test and Reload Nginx:</strong> Test the configuration for syntax errors before reloading.</p><pre>sudo nginx -t sudo systemctl reload nginx</pre><h3>🌐 Phase 3: DNS Setup (Crucial)</h3><p>For this reverse proxy to work from the internet, you must point all subdomains to your server’s public IP address using <strong>A records</strong> in your domain registrar’s DNS settings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2bebea3ac84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install JFrog Artifactory on Your Ubuntu 24.04]]></title>
            <link>https://fahryrozy.medium.com/install-jfrog-artifactory-on-your-ubuntu-24-04-3ff66497fccb?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ff66497fccb</guid>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Thu, 23 Oct 2025 01:07:04 GMT</pubDate>
            <atom:updated>2025-10-23T01:07:04.178Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide provides the streamlined, step-by-step process we used to successfully install <strong>JFrog Artifactory OSS</strong> on a self-hosted Linux machine (Ubuntu/Debian) using a PostgreSQL database.</p><h3>1. System Preparation and Database Setup</h3><p>Start by installing the prerequisites and setting up your dedicated PostgreSQL database.</p><p><strong>Install Java 21 (OpenJDK):</strong></p><pre>sudo apt update sudo apt install openjdk-21-jdk -y java -version</pre><p><strong>Install PostgreSQL:</strong></p><pre>sudo apt install postgresql postgresql-contrib net-tools -y <br>sudo systemctl enable postgresql sudo systemctl start postgresql</pre><p><strong>Setup the Artifactory Database:</strong> Create the dedicated user and database.</p><pre>Switch to the postgres user sudo -u postgres psql  <br><br># Inside the psql prompt (replace &#39;YOUR_PASSWORD&#39; with a secure value): <br>CREATE USER artifactory_user WITH ENCRYPTED PASSWORD &#39;YOUR_POSTGRES_PASSWORD_HERE&#39;; <br>CREATE DATABASE artifactory_db WITH OWNER artifactory_user ENCODING &#39;UTF8&#39;; <br><br>\q <br># Exit psql</pre><h3>2. Configure JFrog APT Repository and Install</h3><p>Follow the official steps to configure the repository, add the GPG key, and install the OSS package.</p><p><strong>Determine Your Distribution Codename:</strong></p><pre># Run to find your codename (e.g., noble, bullseye) <br>lsb_release -c</pre><p><strong>Configure Artifactory Repository:</strong> <em>Replace </em><em>{distribution} with the codename you found.</em> Note: We use artifactory-debs for the OSS package.</p><pre>echo &quot;deb https://releases.jfrog.io/artifactory/artifactory-debs {distribution} main&quot; | sudo tee /etc/apt/sources.list.d/jfrog-artifactory.list</pre><p><em>Cleanup:</em> Ensure any old, incorrect repository entries in /etc/apt/sources.list.d/jfrog.list are removed or commented out to prevent conflicts.</p><p><strong>Add JFrog Public Key:</strong></p><pre>wget -qO - https://releases.jfrog.io/artifactory/api/v2/repositories/artifactory-debs/keyPairs/primary/public | sudo apt-key add -</pre><p><strong>Update APT Cache and Install:</strong></p><pre>sudo apt update <br><br></pre><pre># Install the latest OSS package <br>sudo apt install jfrog-artifactory-oss -y</pre><h3>3. Post-Installation Configuration</h3><p>Configure the database connection and resolve all critical startup dependencies.</p><p><strong>Install the JDBC Driver:</strong> Download the PostgreSQL driver and move it to the correct Artifactory location.</p><pre>sudo wget --inet4-only https://jdbc.postgresql.org/download/postgresql-42.7.8.jar -P /opt/jfrog/artifactory/var/lib/postgresql/ sudo mv /opt/jfrog/artifactory/var/lib/postgresql/postgresql-42.7.8.jar /opt/jfrog/artifactory/var/lib/postgresql/postgresql.jar</pre><p><strong>Configure </strong><strong>system.yaml:</strong> Add the database settings. <strong>YAML indentation is critical.</strong></p><ul><li>Open the file: sudo nano /opt/jfrog/artifactory/var/etc/system.yaml</li><li>Add this configuration (use the password set before):</li></ul><pre>configVersion: 1<br>shared:<br>  node:<br>    haEnabled: false<br>  database:<br>    type: postgresql<br>    driver: org.postgresql.Driver<br>    url: &quot;jdbc:postgresql://127.0.0.1:5432/artifactory_db&quot;<br>    username: artifactory_user<br>    password: YOUR_POSTGRES_PASSWORD_HERE</pre><p><strong>Directory Permissions:</strong> This is essential to prevent startup timeouts due to lack of write access.</p><pre>sudo chown -R artifactory:artifactory /opt/jfrog/</pre><h3>4. Final Startup and Access</h3><p><strong>Start Service:</strong></p><pre>sudo systemctl daemon-reload </pre><pre>sudo systemctl start artifactory</pre><pre>sudo systemctl enable artifactory</pre><p><strong>Verify Status:</strong> Check the status and logs. The service is running when you see Active: active (running).</p><pre>sudo systemctl status artifactory</pre><p><strong>Access:</strong> Artifactory is available at <strong>http://&lt;YOUR_SERVER_IP&gt;:8082</strong>.</p><p><strong>Initial Credentials:</strong> For the very first login after a fresh installation, Artifactory uses a default, unsecure user/password which you will be prompted to change immediately upon logging in.</p><p><strong>Default Username</strong>admin<br><strong>Default Password</strong>password</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ff66497fccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing SonarQube with Docker Compose: A Quick Tutorial]]></title>
            <link>https://fahryrozy.medium.com/installing-sonarqube-with-docker-compose-a-quick-tutorial-180e07dec9f4?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/180e07dec9f4</guid>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Mon, 20 Oct 2025 01:41:47 GMT</pubDate>
            <atom:updated>2025-10-20T01:41:47.663Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/407/0*1o9rfpegOeRN4tvs" /></figure><p>SonarQube is an open-source platform for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities. Running SonarQube with Docker simplifies installation and management, ensuring a consistent environment.</p><h3>Prerequisites</h3><p>Before you begin, let’s make sure we have:</p><ol><li><strong>Docker</strong> installed on system.</li><li><strong>Docker Compose</strong> installed</li></ol><h3>Step 1: Update Your System</h3><p>Always start by updating your package lists and upgrading any existing packages.</p><pre>sudo apt update<br>sudo apt upgrade -y</pre><h3>Step 2: Install Docker and Docker Compose</h3><p>SonarQube will run inside Docker containers. We&#39;ll also install Docker Compose for easier multi-container management.</p><ul><li><strong>Install Docker:</strong></li></ul><pre>sudo apt install docker.io -y </pre><pre>sudo systemctl start docker <br>sudo systemctl enable docker</pre><ul><li><strong>Add your user to the </strong><strong>docker group</strong> to run Docker commands without sudo:</li></ul><pre>sudo usermod -aG docker $USER</pre><pre>sudo usermod -aG docker $USER</pre><p><strong>Important:</strong> You need to <strong>log out and log back in</strong> (or restart your server) for the group changes to take effect. If you skip this, you&#39;ll still need sudo for Docker commands.</p><ul><li><strong>Install Docker Compose:</strong></li></ul><pre>sudo apt install docker-compose -y</pre><ul><li><strong>Verify Docker Installation:</strong></li></ul><pre>docker run hello-world</pre><p>If successful, you&#39;ll see a message from the hello-world container.</p><h3>Step 3: Set Up Docker Compose for SonarQube</h3><p>SonarQube requires a database. While H2 (an embedded database) is used by default for evaluation, it&#39;s not suitable for production. We&#39;ll set up PostgreSQL to ensure data persistence and reliability.</p><ul><li><strong>Create a directory for SonarQube:</strong></li></ul><pre>mkdir ~/sonarqube cd ~/sonarqube</pre><ul><li><strong>Create a </strong><strong>docker-compose.yml file:</strong> Use your preferred text editor (like nano or vim) to create and edit the file:</li></ul><pre>nano docker-compose.yml</pre><p>Paste the following content into the file:</p><pre>version: &quot;3&quot;<br><br>services:<br>  sonarqube:<br>    image: sonarqube:latest # You can specify a version, e.g., sonarqube:lts<br>    container_name: sonarqube<br>    ports:<br>      - &quot;9000:9000&quot; # SonarQube web UI<br>    environment:<br>      - SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonarqube<br>      - SONAR_JDBC_USERNAME=sonar<br>      - SONAR_JDBC_PASSWORD=sonar<br>      - SONAR_WEB_JAVA_OPTS=-Xmx512m -Xms512m # Adjust if you have more RAM<br>      - SONAR_ES_JAVA_OPTS=-Xmx512m -Xms512m # Adjust if you have more RAM<br>    volumes:<br>      - sonarqube_data:/opt/sonarqube/data # SonarQube data<br>      - sonarqube_extensions:/opt/sonarqube/extensions # Plugins<br>      - sonarqube_logs:/opt/sonarqube/logs # Logs<br>    depends_on:<br>      - db<br>    networks:<br>      - sonarnet<br><br>  db:<br>    image: postgres:15 # Use a specific PostgreSQL version<br>    container_name: sonarqube-db<br>    environment:<br>      - POSTGRES_USER=sonar<br>      - POSTGRES_PASSWORD=sonar<br>      - POSTGRES_DB=sonarqube<br>    volumes:<br>      - postgresql_data:/var/lib/postgresql/data # PostgreSQL data persistence<br>    networks:<br>      - sonarnet<br><br>volumes:<br>  sonarqube_data:<br>  sonarqube_extensions:<br>  sonarqube_logs:<br>  postgresql_data:<br><br>networks:<br>  sonarnet:<br>    driver: bridge</pre><h3>Step 4: Adjust Kernel System Settings (Important!)</h3><p>SonarQube&#39;s Elasticsearch component (used for indexing) requires certain kernel parameters to be adjusted. If you skip this, SonarQube might fail to start or crash later.</p><ul><li><strong>Edit </strong><strong>sysctl.conf:</strong></li></ul><pre>sudo nano /etc/sysctl.conf</pre><ul><li><strong>Add the following lines</strong> to the end of the file:</li></ul><pre>vm.max_map_count=262144 <br>fs.file-max=65536</pre><ul><li><strong>Save and Close</strong> the file.</li><li><strong>Apply the changes:</strong></li></ul><pre>sudo sysctl --system</pre><h3>Step 5: Start SonarQube</h3><p>Now you can start SonarQube and its PostgreSQL database using Docker Compose:</p><pre>docker-compose up -d</pre><p>This command will download the necessary Docker images (SonarQube and PostgreSQL), create the volumes, and start the services. This might take a few minutes depending on your internet connection.</p><p>You can monitor the logs to ensure everything starts correctly:</p><pre>docker-compose logs -f</pre><p>Look for messages indicating that SonarQube is &quot;started&quot; or &quot;up.&quot; Press Ctrl+C to exit the logs.</p><h3>Step 6: Access SonarQube Web UI</h3><p>Once SonarQube has started (it might take a minute or two), you can access its web interface.</p><ol><li><strong>Wait for Startup:</strong> SonarQube can take a couple of minutes to initialize, especially the first time.</li><li><strong>Browse:</strong> Open your web browser and go to <a href="http://localhost:9000."><strong>http://&lt;your-address&gt;:9000</strong>.</a></li><li><strong>Log In:</strong> Use the default administrator credentials:</li></ol><ul><li><strong>Username:</strong> admin</li><li><strong>Password:</strong> admin</li></ul><p><strong>Remember to change the default password immediately!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=180e07dec9f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Docker: Activating Containerization on Your Linux Server]]></title>
            <link>https://fahryrozy.medium.com/install-docker-activating-containerization-on-your-linux-server-8f3d8f3c4cfa?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f3d8f3c4cfa</guid>
            <category><![CDATA[install-docker]]></category>
            <category><![CDATA[docker-container]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containerization]]></category>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 00:11:49 GMT</pubDate>
            <atom:updated>2025-09-28T00:11:49.625Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Docker</strong> is a tool designed to make it easier to create, deploy, and run applications by using <strong>containers</strong>.</p><p>It solves the classic “it works on my machine” problem. Because the container includes all dependencies, your application runs the same way everywhere — from a developer’s laptop to a production server in the cloud. This makes building and shipping software much faster and more reliable.</p><h3>1. Update Server’s Package Repository</h3><p>First, open the terminal and update our server’s package list to ensure we have access to the latest software versions.</p><p>Bash</p><pre>sudo apt-get update</pre><h3>2. Install the Docker Engine</h3><p>Next, install the Docker package using the following command. The -y flag automatically confirms the installation.</p><p>Bash</p><pre>sudo apt-get install docker.io -y</pre><h3>3. Start the Docker Service</h3><p>Once the installation is complete, start the Docker service to get it up and running.</p><p>Bash</p><pre>sudo service docker start</pre><h3>4. Verify the Docker Service Status</h3><p>Now, check that the Docker service is active and running correctly.</p><p>Bash</p><pre>sudo service docker status</pre><p>If you see a message indicating the service is <strong>“active (running),”</strong> you’re all set!</p><h3>5. Check Your Docker Version</h3><p>Finally, you can verify the installed version of Docker with this command:</p><p>Bash</p><pre>docker --version</pre><p>This will display the version number, confirming that Docker has been successfully installed.</p><h3>(Optional) Enable Docker to Start on Boot</h3><p>If you want Docker to start automatically every time you reboot your server, you can enable it with the following command:</p><p>Bash</p><pre>sudo systemctl enable docke</pre><p>And that’s it! You have now activated containerization on your server with Docker and are ready to deploy your applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f3d8f3c4cfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create User & Group Management]]></title>
            <link>https://fahryrozy.medium.com/create-user-group-management-470d403a22d7?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/470d403a22d7</guid>
            <category><![CDATA[group-management]]></category>
            <category><![CDATA[create-user]]></category>
            <category><![CDATA[user-management]]></category>
            <category><![CDATA[permission]]></category>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Fri, 26 Sep 2025 23:27:51 GMT</pubDate>
            <atom:updated>2025-09-26T23:27:51.756Z</atom:updated>
            <content:encoded><![CDATA[<p>As developers and system administrators, one of the fundamental tasks we repeatedly encounter is setting up proper user and group permissions. Applications should not run as <strong>root</strong> user. Creating dedicated, non-privileged users for each service (frontend, backend, admin) is a fundamental security practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*813G1gnEOVEpuvZHWCcVsQ.png" /></figure><p>This isolates applications, limits potential damage from a security breach, simplifies permission management, and provides clear audit trails.</p><h3>Step 1: Create Groups</h3><p>First, create a dedicated group for each application.</p><p>Bash</p><pre>sudo groupadd frontend_group<br>sudo groupadd backend_group<br>sudo groupadd admin_group</pre><p><strong>Verify</strong>:</p><p>Bash</p><pre>getent group frontend_group backend_group admin_group</pre><h3>Step 2: Create Users</h3><p>Next, create a user for each application and assign them to their primary group. The -m flag creates a home directory.</p><p>Bash</p><pre>sudo useradd -m -g frontend_group frontend<br>sudo useradd -m -g backend_group backend<br>sudo useradd -m -g admin_group sysadmin</pre><p><strong>Verify</strong>:</p><p>Bash</p><pre>id frontend &amp;&amp; id backend &amp;&amp; id admin</pre><h3>Step 3: Set User Passwords</h3><p>Set a secure password for each new user.</p><p>Bash</p><pre>sudo passwd frontend<br>sudo passwd backend<br>sudo passwd sysadmin</pre><h3>Step 4: Grant Sudo Access (Optional, for admin_user only)</h3><p>To allow the admin_user to perform system tasks, add them to the sudo group. <strong>Use this with caution.</strong></p><p>Bash</p><pre>sudo usermod -aG sudo sysadmin</pre><p><strong>Verify</strong>:</p><p>Bash</p><pre>su - sysadmin -c &quot;sudo whoami&quot;</pre><p>This command will prompt for the admin_user&#39;s password and should output root.</p><h3>Step 5: Create Application Directories</h3><p>Create directories where your application code and files will reside.</p><p>Bash</p><pre>sudo mkdir -p /opt/apps/frontend_app<br>sudo mkdir -p /opt/apps/backend_app<br>sudo mkdir -p /opt/apps/sysadmin_app</pre><h3>Step 6: Set Ownership and Permissions</h3><p>Assign ownership of each directory to the corresponding user and group. Then, set permissions (750) so only the owner can write to the directory, the group can read/execute, and others have no access.</p><p>Bash</p><pre># Set ownership<br>sudo chown -R frontend:frontend_group /opt/apps/frontend_app<br>sudo chown -R backend:backend_group /opt/apps/backend_app<br>sudo chown -R sysadmin:admin_group /opt/apps/sysadmin_app</pre><pre># Set permissions<br>sudo chmod -R 750 /opt/apps/frontend_app<br>sudo chmod -R 750 /opt/apps/backend_app<br>sudo chmod -R 750 /opt/apps/sysadmin_app</pre><p><strong>Verify</strong>:</p><p>Bash</p><pre>ls -ld /opt/apps/*</pre><p>The output should show the correct owner, group, and drwxr-x--- permissions for each directory.</p><h3>Step 7: Add Any User to a Group (Optional)</h3><p>After setting up your primary users, you may need to grant other existing users access to one of the application groups. For example, you might want to give a developer user access to the backend_group.</p><h4>Command</h4><p>To add an existing user to a group, use the usermod command.</p><p>Bash</p><pre>sudo usermod -aG &lt;desired_group&gt; &lt;your_user&gt;</pre><h4>Command Explanation</h4><ul><li><strong>sudo</strong>: Executes the command with administrative privileges.</li><li><strong>usermod</strong>: The command used to <strong>mod</strong>ify a <strong>user</strong> account.</li><li><strong>-aG</strong>: This is a combination of two important flags.</li><li><strong>-G</strong>: Specifies the supplementary <strong>g</strong>roup(s) to add the user to.</li><li><strong>-a</strong>: Stands for <strong>a</strong>ppend. This crucial flag adds the user to the new group <strong>without</strong> removing them from their current groups.</li><li><strong>&lt;desired_group&gt;</strong>: The placeholder for the name of the group you want to add the user to (e.g., backend_group).</li><li><strong>&lt;your_user&gt;</strong>: The placeholder for the username of the person you are modifying (e.g., fahryrozy).</li></ul><h4>Verification</h4><p>To confirm the user was successfully added to the new group, use the id command.</p><p>Bash</p><pre>id &lt;your_user&gt;</pre><p>Check the groups= section in the output to see the list of all groups the user is a member of.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=470d403a22d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Set Hostname for Newborn Linux Server]]></title>
            <link>https://fahryrozy.medium.com/set-hostname-for-newborn-linux-server-989b0fa8974b?source=rss-e45694e2d9e0------2</link>
            <guid isPermaLink="false">https://medium.com/p/989b0fa8974b</guid>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[hostname]]></category>
            <category><![CDATA[names]]></category>
            <category><![CDATA[vps]]></category>
            <dc:creator><![CDATA[fahryrozy]]></dc:creator>
            <pubDate>Fri, 26 Sep 2025 00:17:47 GMT</pubDate>
            <atom:updated>2025-09-26T00:17:47.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GlA05sQp0tMS2NRoxBgvJA.png" /></figure><p>When I first setup a new VPS, it comes with a generic and unmemorable name.</p><p>root@vps0023215421:~#</p><p>To make this “newborn server” instantly recognizable and easier to manage, my first task is to give it a proper name. Here’s how I give the name of my server to soldev-server, making it instantly familiar.</p><h4>Step 1: Check the Current Hostname</h4><p>Before giving it a new name, I need to know its current, factory-set designation. The hostnamectl command is the best way to formally identify it.</p><p>I run the following command in my terminal:</p><p>Bash</p><pre>hostnamectl</pre><p>The output will give me a summary of the system’s identity. Pay attention to the Static hostname line—this is the name I’m about to change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*MzTd_OFk1ftAcB5p8iizCQ.png" /></figure><h4>Step 2: Give It a Name (Set the New Hostname)</h4><p>This is where I give my server its new identity. I’ll use the same hostnamectl command, but this time with the set-hostname action. This is an administrative task, so we must use sudo.</p><p>Bash</p><pre>sudo hostnamectl set-hostname &lt;our-desired-name&gt;<br></pre><p>In my case i choosesoldev-server as my hostname, so i run this command.</p><pre>sudo hostnamectl set-hostname &quot;soldev-server&quot;</pre><p>The command will execute silently. To confirm it worked, run hostnamectl again. We will see the Static hostname has been updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*gWjY9h90CXi7jCxRrkdDAA.png" /></figure><p>My server now has a new name.</p><h4>Step 3: Teach It Its Own Name (Update the Hosts File)</h4><p>My server has a new name, but now I need to teach it to recognize itself. There is a core file at /etc/hosts that acts as the server&#39;s internal address book. It&#39;s crucial that this file is updated so that applications running on the server don&#39;t get confused by the old name.</p><p>Open the file with the nano text editor:</p><p>Bash</p><pre>sudo nano /etc/hosts</pre><p>We will see a configuration that looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9QpEhsJCcFseLrHKgNnag.png" /></figure><p>Carefully replace the old hostname with the new one.</p><p><strong>Change this line:</strong> 127.0.1.1 vps0023215421.your.address.net vps0023215421</p><p><strong>To this:</strong> 127.0.1.1 soldev-server</p><p>Now, save the file and exit by pressing Ctrl+X, then Y, and finally Enter.</p><h3>A Server I can recognize</h3><p>That’s it. To see the final result, log out and back in. The terminal prompt will now proudly display:</p><p>my_user@soldev-server:~$</p><p>My server is no longer an anonymous. It’s now soldev-server—a partner for my next project and a server I can easily recognize by the name.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=989b0fa8974b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>