"<a class=\"internal-link\" href=\"05.02 Networks/GitHub - matriphemonit2telegram A simple script to send Monit alerts using Telegram bot..md\"> GitHub - matriphemonit2telegram A simple script to send Monit alerts using Telegram bot. </a>",
"<a class=\"internal-link\" href=\"ReadItLater Inbox/GitHub - fxkjdlogwatch-telegram-bot Send logwatch results to your telegram account.md\"> GitHub - fxkjdlogwatch-telegram-bot Send logwatch results to your telegram account </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Ego is the Enemy The Legend of Genghis Khan - Farnam Street.md\"> Ego is the Enemy The Legend of Genghis Khan - Farnam Street </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>"
],
],
"Renamed":[
"Renamed":[
"<a class=\"internal-link\" href=\"00.03 News/Ego is the Enemy The Legend of Genghis Khan - Farnam Street.md\"> Ego is the Enemy The Legend of Genghis Khan - Farnam Street </a>",
"<a class=\"internal-link\" href=\"00.03 News/What i learnt during my 3 days offline.md\"> What i learnt during my 3 days offline </a>",
"<a class=\"internal-link\" href=\"00.03 News/What i learnt during my 3 days offline.md\"> What i learnt during my 3 days offline </a>",
"<a class=\"internal-link\" href=\"00.04 IT/How to migrate your Nextcloud database-backend from MySQLMariaDB to PostgreSQL.md\"> How to migrate your Nextcloud database-backend from MySQLMariaDB to PostgreSQL </a>",
"<a class=\"internal-link\" href=\"00.04 IT/How to migrate your Nextcloud database-backend from MySQLMariaDB to PostgreSQL.md\"> How to migrate your Nextcloud database-backend from MySQLMariaDB to PostgreSQL </a>"
"<a class=\"internal-link\" href=\"00.06 Professional/The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr.md\"> The 10 Keys to A Successful Board Meeting How to Make Them Great and Not Something Everyone Dreads from Ajay Agarwal, Bain Capital Partners SaaStr </a>",
"<a class=\"internal-link\" href=\"00.03 News/Ego is the Enemy The Legend of Genghis Khan - Farnam Street.md\"> Ego is the Enemy The Legend of Genghis Khan - Farnam Street </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"<a class=\"internal-link\" href=\"03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"<a class=\"internal-link\" href=\"03.03 Food & Wine/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/How To Protect an Apache Server with Fail2Ban on Ubuntu 20.04.md\"> How To Protect an Apache Server with Fail2Ban on Ubuntu 20.04 </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/How To Protect an Apache Server with Fail2Ban on Ubuntu 20.04.md\"> How To Protect an Apache Server with Fail2Ban on Ubuntu 20.04 </a>",
"<a class=\"internal-link\" href=\"01.01 Life Orga/@Life Admin.md\"> @Life Admin </a>",
"<a class=\"internal-link\" href=\"01.01 Life Orga/@Life Admin.md\"> @Life Admin </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Three Bodies in Texas - Believer Magazine.md\"> Three Bodies in Texas - Believer Magazine </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Three Bodies in Texas - Believer Magazine.md\"> Three Bodies in Texas - Believer Magazine </a>"
"<a class=\"internal-link\" href=\"00.02 Inbox/‘I’m the Operator’ The Aftermath of a Self-Driving Tragedy.md\"> ‘I’m the Operator’ The Aftermath of a Self-Driving Tragedy </a>"
],
],
"Linked":[
"Linked":[
"<a class=\"internal-link\" href=\"00.02 Inbox/How to Install Prometheus on Ubuntu 20.04.md\"> How to Install Prometheus on Ubuntu 20.04 </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Ego is the Enemy The Legend of Genghis Khan - Farnam Street.md\"> Ego is the Enemy The Legend of Genghis Khan - Farnam Street </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/Server Alias.md\"> Server Alias </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/Server Cloud.md\"> Server Cloud </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/Server Tools.md\"> Server Tools </a>",
"<a class=\"internal-link\" href=\"05.02 Networks/Server VPN.md\"> Server VPN </a>",
"<a class=\"internal-link\" href=\"00.03 News/Putin’s New Iron Curtain.md\"> Putin’s New Iron Curtain </a>",
"<a class=\"internal-link\" href=\"00.03 News/Putin’s New Iron Curtain.md\"> Putin’s New Iron Curtain </a>",
"<a class=\"internal-link\" href=\"00.03 News/Vladimir Putin’s Revisionist History of Russia and Ukraine.md\"> Vladimir Putin’s Revisionist History of Russia and Ukraine </a>",
"<a class=\"internal-link\" href=\"00.03 News/Vladimir Putin’s Revisionist History of Russia and Ukraine.md\"> Vladimir Putin’s Revisionist History of Russia and Ukraine </a>",
"<a class=\"internal-link\" href=\"00.03 News/Will the Bush Dynasty Die With George P. Bush.md\"> Will the Bush Dynasty Die With George P. Bush </a>",
"<a class=\"internal-link\" href=\"00.03 News/Will the Bush Dynasty Die With George P. Bush.md\"> Will the Bush Dynasty Die With George P. Bush </a>",
"<a class=\"internal-link\" href=\"00.03 News/The Great Resignation has morphed into the Great Sabbatical.md\"> The Great Resignation has morphed into the Great Sabbatical </a>",
"<a class=\"internal-link\" href=\"00.03 News/The Great Resignation has morphed into the Great Sabbatical.md\"> The Great Resignation has morphed into the Great Sabbatical </a>"
"<a class=\"internal-link\" href=\"00.03 News/Why Epicureanism, not Stoicism, is the philosophy we need now.md\"> Why Epicureanism, not Stoicism, is the philosophy we need now </a>",
"<a class=\"internal-link\" href=\"00.03 News/Opinion The Russia Sanctions That Could Actually Stop Putin.md\"> Opinion The Russia Sanctions That Could Actually Stop Putin </a>",
"<a class=\"internal-link\" href=\"00.03 News/Why Indian universities are ditching English-only education.md\"> Why Indian universities are ditching English-only education </a>",
"<a class=\"internal-link\" href=\"00.03 News/Society has a trust problem. More censorship will only make it worse..md\"> Society has a trust problem. More censorship will only make it worse. </a>",
"<a class=\"internal-link\" href=\"00.03 News/Notes apps are where ideas go to die. And that’s good..md\"> Notes apps are where ideas go to die. And that’s good. </a>",
"<a class=\"internal-link\" href=\"00.03 News/Imagine Scythia’s fierce warrior women, the real Amazons Aeon Essays.md\"> Imagine Scythia’s fierce warrior women, the real Amazons Aeon Essays </a>",
"<a class=\"internal-link\" href=\"00.03 News/L’enquête « Suisse Secrets » relance le débat sur la liberté de la presse face au secret bancaire.md\"> L’enquête « Suisse Secrets » relance le débat sur la liberté de la presse face au secret bancaire </a>",
"<a class=\"internal-link\" href=\"00.03 News/In Kashmir, indigenous Muslim healers cure broken bones with spirituality — and science.md\"> In Kashmir, indigenous Muslim healers cure broken bones with spirituality — and science </a>",
"<a class=\"internal-link\" href=\"00.03 News/How the enigmatic Nefertiti came to be locked away in Germany Aeon Essays.md\"> How the enigmatic Nefertiti came to be locked away in Germany Aeon Essays </a>",
"<a class=\"internal-link\" href=\"00.03 News/Google Search Is Dying.md\"> Google Search Is Dying </a>",
"<a class=\"internal-link\" href=\"00.03 News/He spent 25 years infiltrating the Klan.md\"> He spent 25 years infiltrating the Klan </a>",
"<a class=\"internal-link\" href=\"00.03 News/Javanka in Exile.md\"> Javanka in Exile </a>"
],
],
"Removed Tags from":[
"Removed Tags from":[
"<a class=\"internal-link\" href=\"06.02 Investments/Le Miel de Paris.md\"> Le Miel de Paris </a>",
"<a class=\"internal-link\" href=\"06.02 Investments/Le Miel de Paris.md\"> Le Miel de Paris </a>",
@ -3674,7 +3691,8 @@
"<a class=\"internal-link\" href=\"00.04 IT/ntfy.sh - email to message.md\"> ntfy.sh - email to message </a>",
"<a class=\"internal-link\" href=\"00.04 IT/ntfy.sh - email to message.md\"> ntfy.sh - email to message </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"<a class=\"internal-link\" href=\"00.02 Inbox/Fresh Tomato Eggs in Purgatory with Chickpeas.md\"> Fresh Tomato Eggs in Purgatory with Chickpeas </a>",
"title":"[[Selfhosting]], [[Server Cloud|Cloud]]: Upgrader & Health checks",
"time":"2022-05-01",
"rowNumber":436
},
{
{
"title":"[[Server Cloud]]: Backup server",
"title":"[[Server Cloud]]: Backup server",
"time":"2022-09-06",
"time":"2022-09-06",
@ -53,17 +58,37 @@
}
}
],
],
"05.02 Networks/Server Alias.md":[
"05.02 Networks/Server Alias.md":[
{
"title":"[[Selfhosting]], [[Server Alias|Email Alias]]: Upgrader & Health checks",
"time":"2022-03-31",
"rowNumber":304
},
{
{
"title":"[[Server Alias]]: Backup server",
"title":"[[Server Alias]]: Backup server",
"time":"2022-09-06",
"time":"2022-09-06",
"rowNumber":304
"rowNumber":306
}
}
],
],
"05.02 Networks/Server Tools.md":[
"05.02 Networks/Server Tools.md":[
{
{
"title":"[[Server Tools]]: Backup server",
"title":"[[Server Tools]]: Backup server",
"time":"2022-04-05",
"time":"2022-04-05",
"rowNumber":560
"rowNumber":566
},
{
"title":"[[Selfhosting]], [[Server Tools|Tools]]: Upgrader Bitwarden & Health checks",
"time":"2022-04-18",
"rowNumber":573
},
{
"title":"[[Selfhosting]], [[Server Tools|Tools]]: Upgrader Standard Notes & Health checks",
"time":"2022-05-18",
"rowNumber":575
},
{
"title":"[[Selfhosting]], [[Server Tools|Tools]]: Upgrader Gitea & Health checks",
"time":"2022-06-18",
"rowNumber":571
}
}
],
],
"05.02 Networks/Server VPN.md":[
"05.02 Networks/Server VPN.md":[
@ -71,6 +96,11 @@
"title":"[[Server VPN]]: Backup server",
"title":"[[Server VPN]]: Backup server",
"time":"2022-04-05",
"time":"2022-04-05",
"rowNumber":283
"rowNumber":283
},
{
"title":"[[Selfhosting]], [[Server VPN|VPN]]: Check VPN state & dashboard",
"time":"2022-06-18",
"rowNumber":287
}
}
],
],
"04.01 lebv.org/Hosting Tasks.md":[
"04.01 lebv.org/Hosting Tasks.md":[
@ -456,41 +486,66 @@
"06.02 Investments/VC Tasks.md":[
"06.02 Investments/VC Tasks.md":[
{
{
"title":"[[VC Tasks#internet alerts|monitor VC news and publications]]",
"title":"[[VC Tasks#internet alerts|monitor VC news and publications]]",
"time":"2022-03-18",
"time":"2022-03-25",
"rowNumber":74
"rowNumber":74
}
}
],
],
"06.02 Investments/Crypto Tasks.md":[
"06.02 Investments/Crypto Tasks.md":[
{
{
"title":"[[Crypto Tasks#internet alerts|monitor Crypto news and publications]]",
"title":"[[Crypto Tasks#internet alerts|monitor Crypto news and publications]]",
"time":"2022-03-18",
"time":"2022-03-25",
"rowNumber":74
"rowNumber":74
}
}
],
],
"06.02 Investments/Equity Tasks.md":[
"06.02 Investments/Equity Tasks.md":[
{
{
"title":"[[Equity Tasks#internet alerts|monitor Equity news and publications]]",
"title":"[[Equity Tasks#internet alerts|monitor Equity news and publications]]",
"time":"2022-03-18",
"time":"2022-03-25",
"rowNumber":74
"rowNumber":74
}
}
],
],
"05.02 Networks/Configuring UFW.md":[
"05.02 Networks/Configuring UFW.md":[
{
{
"title":"[[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix",
"title":"[[Selfhosting]], [[Configuring UFW|Firewall]] Get IP addresses caught by Postfix",
"time":"2022-03-19",
"time":"2022-03-26",
"rowNumber":239
"rowNumber":239
},
},
{
{
"title":"[[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list",
"title":"[[Selfhosting]], [[Configuring UFW|Firewall]]: Update the Blocked IP list",
"time":"2022-03-19",
"time":"2022-03-26",
"rowNumber":240
"rowNumber":241
}
}
],
],
"00.01 Admin/Memos/2022-03-18.md":[
"00.01 Admin/Memos/2022-03-18.md":[
{
{
"title":"07:35 [[Selfhosting]], [[Configuring Fail2ban]]: look at the filter for the Postfix jail",
"title":"11:34 [[Selfhosting]], [[Configuring Fail2ban|Fail2ban]], [[Configuring UFW|UFW]]: voir si la liste d'IP peut etre partagee avec [crowdsec](https://crowdsec.net)",
"time":"2022-03-19",
"time":"2022-04-30",
"rowNumber":88
"rowNumber":90
},
{
"title":"11:36 [[@IT & Computer]]: Find a HackerNews reader",
"time":"2022-03-31",
"rowNumber":91
},
{
"title":"11:39 [[Selfhosting]], [[@News]], [[Server Tools|Tools]]: explore self hosting a RSS reader like [selfoss](https://selfoss.aditu.de)",
"time":"2022-03-31",
"rowNumber":92
},
{
"title":"11:41 [[Selfhosting]], [[Server Tools|Tools]]: explore self hosting a web automation tool like [huginn](https://github.com/huginn/huginn)",
"time":"2022-04-10",
"rowNumber":93
},
{
"title":"15:39 [[Selfhosting]], [[Configuring Caddy|caddy]]: Mettre en place le monitoring par Prometheus",
"time":"2022-04-03",
"rowNumber":95
},
{
"title":"22:33 [[Selfhosting]], [[Server Tools|Tools]]: install SN extensions",
- [ ] 11:34 [[Selfhosting]], [[Configuring Fail2ban|Fail2ban]], [[Configuring UFW|UFW]]: voir si la liste d'IP peut etre partagee avec [crowdsec](https://crowdsec.net) 📆2022-04-30
# Ego is the Enemy: The Legend of Genghis Khan - Farnam Street
**In his book, [Ego is the Enemy](https://www.amazon.com/gp/product/1591847818/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=farnamstreet-20&creative=9325&linkCode=as2&creativeASIN=1591847818&linkId=ea6830b2cd6dce2e3b20e3f5becde10b), Ryan Holidaytells the story of Genghis Khan and how his openness to learning was the foundation of his success.**
The legend of Genghis Khan has echoed through history: A barbarian conqueror, fueled by bloodlust, terrorizing the civilized world. We have him and his Mongol horde traveling across Asia and Europe, insatiable, stopping at nothing to plunder, rape, and kill not just the people who stood in their way, but the cultures they had built. Then, not unlike his nomadic band of warriors, this terrible cloud simply disappeared from history, because the Mongols built nothing that could last. Like all reactionary, emotional assessments, this could not be more wrong. For not only was Genghis Khan one of the greatest military minds who ever lived, he was a perpetual student, whose stunning victories were often the result of his ability to absorb the best technologies, practices, and innovations of each new culture his empire touched. In fact, if there is one theme in his reign and in the several centuries of dynastic rule that followed, it’s this: appropriation.
Under Genghis Khan’s direction, the Mongols were as ruthless about stealing and absorbing the best of each culture they encountered as they were about conquest itself. Though there were essentially no technological inventions, no beautiful buildings or even great Mongol art, with each battle and enemy, their culture learned and absorbed something new. Genghis Khan was not born a genius. Instead, as one biographer put it, his was “a persistent cycle of pragmatic learning, experimental adaptation, and constant revision driven by his uniquely disciplined and focused will.”
He was the greatest conqueror the world ever knew because he was more open to learning than any other conqueror has ever been.
Khan’s first powerful victories came from the reorganization of his military units, splitting his soldiers into groups of ten. This he stole from neighboring Turkic tribes, and unknowingly converted the Mongols to the decimal system. Soon enough, their expanding empire brought them into contact with another “technology” they’d never experienced before: walled cities. In the Tangut raids, Khan first learned the ins and outs of war against fortified cities and the strategies critical to laying siege, and quickly became an expert. Later, with help from Chinese engineers, he taught his soldiers how to build siege machines that could knock down city walls. In his campaigns against the Jurched, Khan learned the importance of winning hearts and minds. By working with the scholars and royal family of the lands he conquered, Khan was able to hold on to and manage these territories in ways that most empires could not. Afterward, in every country or city he held, Khan would call for the smartest astrologers, scribes, doctors, thinkers, andadvisers—anyone who could aid his troops and their efforts. His troops traveled with interrogators and translators for precisely this purpose.
It was a habit that would survive his death. While the Mongols themselves seemed dedicated almost solely to the art of war, they put to good use every craftsman, merchant, scholar, entertainer, cook, and skilled worker they came in contact with. The Mongol Empire was remarkable for its religious freedoms, and most of all, for its love of ideas and convergence of cultures. It brought lemons to China for the first time, and Chinese noodles to the West. It spread Persian carpets, German mining technology, French metalworking, and Islam. The cannon, which revolutionized warfare, was said to be the resulting fusion of Chinese gunpowder, Muslim flamethrowers, and European metalwork. It was Mongol openness to learning and new ideas that brought them together.
As we first succeed, we will find ourselves in new situations, facing new problems. The freshly promoted soldier must learn the art of politics. The salesman, how to manage. The founder, how to delegate. The writer, how to edit others. The comedian, how to act. The chef turned restaurateur, how to run the other side of the house.
This is not a harmless conceit. The physicist John Wheeler, who helped develop the hydrogen bomb, once observed that “as our island of knowledge grows, so does the shore of our ignorance.” In other words, each victory and advancement that made Khan smarter also bumped him against new situations he’d never encountered before. It takes a special kind of humility to grasp that you know less, even as you know and grasp more and more. It’sremembering Socrates’ wisdom lay in the fact that he knew that he knew next to nothing.
With accomplishment comes a growing pressure to pretend that we know more than we do. To pretend we already know everything. Scientia infla (knowledge puffs up). That’s the worry and the risk—thinking that we’re set and secure, when in reality understanding and mastery is a fluid, continual process.
The nine-time Grammy– and Pulitzer Prize–winning jazz musician Wynton Marsalis once advised a promising young musician on the mind-set required in the lifelong study of music: “Humility engenders learning because it beats back the arrogance that puts blinders on. It leaves you open for truths to reveal themselves. You don’t stand in your own way. . . .Do you know how you can tell when someone is truly humble? I believe there’s one simple test: because they consistently observe and listen, the humble improve. They don’t assume, ‘I know the way.’”
No matter what you’ve done up to this point, you better still be a student. If you’re not still learning, you’re already dying.
It is not enough only to be a student at the beginning. It is a position that one has to assume for life. Learn from everyone and everything. From the people you beat, and the people who beat you, from the people you dislike, even from your supposed enemies. At every step and every juncture in life, there is the opportunity to learn—and even if the lesson is purely remedial, we must not let ego block us from hearing it again.
Too often, convinced of our own intelligence, we stay in a comfort zone that ensures that we never feel stupid (andare never challenged to learn or reconsider what we know). It obscures from view various weaknesses in our understanding, until eventually it’s too late to change course. This is where the silent toll is taken.
Each of us faces a threat as we pursue our craft. Like sirens on the rocks, ego sings a soothing, validating song— which can lead to a wreck. The second we let the ego tell us we have graduated, learning grinds to a halt. That’s whyFrank Shamrock said, “Always stay a student.” As in, it never ends.
The solution is as straightforward as it is initially uncomfortable: Pick up a book on a topic you know next to nothing about. Put yourself in rooms where you’re the least knowledgeable person. That uncomfortable feeling, that defensiveness that you feel when your most deeply held assumptions are challenged—what about subjecting yourself to it deliberately? Change your mind. Change your surroundings
An amateur is defensive. The professional finds learning (and even, occasionally, being shown up) to be enjoyable; they like being challenged and humbled, and engage in education as an ongoing and endless process.
Most military cultures—and people in general—seek to impose values and control over what they encounter. What made the Mongols different was their ability to weigh each situation objectively, and if need be, swap out previous practices for new ones. All great businesses start this way, but then something happens. Take the theory of disruption, which posits that at some point in time, every industry will be disrupted by some trend or innovation that, despite all the resources in the world, the incumbent interests will beincapable of responding to. Why is this? Why can’t businesses change and adapt?
A large part of it is because they lost the ability to learn. They stopped being students. The second this happens to you, your knowledge becomes fragile.
The great manager and business thinker Peter Drucker says that it’s not enough simply to want to learn. As people progress, they must also understand how they learn and then set up processes to facilitate this continual education. Otherwise, we are dooming ourselves to a sort of self-imposed ignorance.
Source: [Ego is the Enemy](https://www.amazon.com/gp/product/1591847818/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=farnamstreet-20&creative=9325&linkCode=as2&creativeASIN=1591847818&linkId=ea6830b2cd6dce2e3b20e3f5becde10b) and used with permission from the author.
Configuration requires to add the following in the sub-domain definition:
Configuration requires to add the following in the sub-domain definition of the [[Configuring Caddy#Caddy configuration file|Caddyfile]]:
```ad-code
```ad-code
~~~yaml
~~~javascript
handle_path /(suffix)* {
handle_path /(suffix)* {
root * /(path to suffix)
root * /(path to suffix)
file_server
file_server
@ -257,7 +257,7 @@ Configuration requires to add the following in the sub-domain definition:
Configuration of a service attached to the docker network is easy:
Configuration of a service attached to the docker network is easy:
```ad-code
```ad-code
~~~yaml
~~~javascript
(hostname) {
(hostname) {
encode zstd gzip
encode zstd gzip
reverse_proxy xxx.yyy.zzz.aaa:port
reverse_proxy xxx.yyy.zzz.aaa:port
@ -292,8 +292,10 @@ caddy hash-password
2. **Define the array of users and hashed password**
2. **Define the array of users and hashed password**
In the [[Configuring Caddy#Caddy configuration file|Caddyfile]]:
```ad-code
```ad-code
~~~yaml
~~~javascript
(basic-auth) {
(basic-auth) {
basicauth / {
basicauth / {
user hashed-password
user hashed-password
@ -304,8 +306,10 @@ caddy hash-password
3. **Define the snippet to test whether the cookie is installed**
3. **Define the snippet to test whether the cookie is installed**
In the [[Configuring Caddy#Caddy configuration file|Caddyfile]]:
```ad-code
```ad-code
~~~yaml
~~~javascript
(proxy-auth) {
(proxy-auth) {
% if cookie not = some-token-nonsense
% if cookie not = some-token-nonsense
@no-auth {
@no-auth {
@ -325,10 +329,10 @@ caddy hash-password
##### Intermediary authentication page
##### Intermediary authentication page
[[#^Top|TOP]]
[[#^Top|TOP]]
After setting up a new subdomain/page and appropriate DNS records, define it as follows:
After setting up a new subdomain/page and appropriate DNS records, define it as follows in the [[Configuring Caddy#Caddy configuration file|Caddyfile]]:
```ad-code
```ad-code
~~~yaml
~~~javascript
auth.example.com {
auth.example.com {
route / {
route / {
% require authentication
% require authentication
@ -357,7 +361,7 @@ auth.example.com {
Simply add the following at the top of all declarations for sub-domain definitions:
Simply add the following at the top of all declarations for sub-domain definitions:
```ad-code
```ad-code
~~~yaml
~~~javascript
import proxy-auth
import proxy-auth
~~~
~~~
```
```
@ -370,11 +374,11 @@ import proxy-auth
#### Configuring logging for Caddy
#### Configuring logging for Caddy
1. In the Caddyfile, add a logging module:
1. In the [[Configuring Caddy#Caddy configuration file|Caddyfile]], add a logging module:
```ad-code
```ad-code
title: logging script
title: logging script
~~~bash
~~~javascript
(log) {
(log) {
log {
log {
@ -383,7 +387,7 @@ title: logging script
roll_local_time
roll_local_time
# Other parameters can be found on the Caddy website
# Other parameters can be found on the Caddy website
}
}
format console # (or stoud)
format json # (or console)
level INFO # (or ERROR)
level INFO # (or ERROR)
}
}
}
}
@ -392,6 +396,16 @@ title: logging script
 
 
2. In the global configuration section, add the `import log` directive
```ad-code
~~~javascript
{
import log
}
~~~
```
2. In each subdomain definition, add the following line
2. In each subdomain definition, add the following line
`import log`
`import log`
@ -416,6 +430,18 @@ Look for a folder with the following sequence:
 
 
#### Reading the log file
Caddy does offer a `common_log` field in their JS log that can be called for consumption by other software:
This not runs through the installation and use of Prometheus as a monitoring tool.
Prometheus interacts better with json logs rather than common log language, which is caddy's output.
```
 
```toc
style: number
```
 
---
 
### Introduction
 
[Prometheus](https://prometheus.io/docs/introduction/overview/) is a free and open-source monitoring and alerting tool that was initially used for monitoring metrics at SoundCloud back in 2012. It is written in Go programming language.
Prometheus monitors and records real-time events in a time-series database. Since then it has grown in leaps and bounds and had been adopted by many organizations to monitor their infrastructure metrics. Prometheus provides flexible queries and real-time alerting which helps in quick diagnosis and troubleshooting of errors.
Prometheus comprises the following major components:
- The main Prometheus server for scraping and storing time-series data.
- Unique exporters for services such as Graphite, HAProxy, StatsD and so much more
- An alert manager for handling alerts
- A push-gateway for supporting transient jobs
- Client libraries for instrumenting application code
 
---
 
### Installing Prometheus
 
#### Installing the main modules
But first, we need to create the configuration and data directories for Prometheus.
To create the configuration directory, run the command:
```ad-command
~~~bash
sudo mkdir -p /etc/prometheus
~~~
```
 
For the data directory, execute:
```ad-command
~~~bash
sudo mkdir -p /var/lib/prometheus
~~~
```
 
Once the directories are created, grab the compressed installation file:
Enable the Prometheus service to run at startup. Therefore invoke the command:
```ad-command
~~~bash
sudo systemctl enable prometheus
~~~
```
 
Then confirm the status of the Prometheus service.
```ad-command
~~~bash
sudo systemctl status prometheus
~~~
```
![Check status of Prometheus services](https://linoxide.com/wp-content/uploads/2021/11/2021-10-1003-Check-status-of-Prometheus-services.png)![Check status of Prometheus services](https://linoxide.com/wp-content/uploads/2021/11/2021-10-1003-Check-status-of-Prometheus-services.png)
 
#### Configuration of user acccess
Finally, to access Prometheus, parameter your reverse-proxy ([[Configuring Caddy|caddy]]) to point back to the service.