> For the complete documentation index, see [llms.txt](https://my-learning-journey.devjugal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://my-learning-journey.devjugal.com/content/2024/december/day-21.md).

# December 21, 2024

## Things That I Discovered

### 1. Caddy Load-Balancing

* Turned to Caddy's Load Balancing capabilities to make sure a service stays up even if the server A goes down, and for that we can just declare a Reverse Proxy such that the server B is used when the server A goes down.
* **Example**:

  ```
  :80 {
      reverse_proxy {
          to 100.64.0.1:12345 100.64.0.2:12345
          health_uri /health
          health_interval 5s
          health_timeout 2s
          health_status 200
          health_passes 5
          fail_duration 30s
          lb_policy first
      }
  }
  ```
* **Reference(s):**
  * [Caddy Server Documentation](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#load-balancing)
  * [Linux Training Academy](https://www.linuxtrainingacademy.com/caddy-load-balancing-tutorial/)
  * [Greg Hilston Blog](https://www.greghilston.com/post/how-to-load-balance-with-preference/)

### 2. Show Wi-Fi Networks in Ubuntu Server

* In order to show available WiFi Networks in Ubuntu Server, we can use `iwlist`command.
* **Example:**

  ```
  sudo iwlist <INTERFACE_NAME> scan | grep ESSID
  ```
* **Reference(s):**
  * [LinuxBabe](https://www.linuxbabe.com/ubuntu/connect-to-wi-fi-from-terminal-on-ubuntu-18-04-19-04-with-wpa-supplicant)
  * [Linux Uprising](https://www.linuxuprising.com/2019/11/how-to-show-available-wifi-networks.html)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://my-learning-journey.devjugal.com/content/2024/december/day-21.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
