Merge branch 'main' of github.com:ahmzaa/blog-ahmza-com
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
.hugo_build.lock
|
.hugo_build.lock
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.obsidian/
|
||||||
styles/
|
styles/
|
||||||
node_modules
|
node_modules
|
||||||
public/
|
public/
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
---
|
---
|
||||||
title: Be More Productive by Being Bored
|
title: Be More Productive by Being Bored
|
||||||
featureimage: feature.webp
|
description: In the modern age we are overwhelmed with stimuli. Learn to cut out the noise.
|
||||||
featureimagecaption: Overstimulated brain
|
|
||||||
date: 2024-01-02T00:00:00
|
|
||||||
lastmod: 2024-11-16T22:58:00
|
|
||||||
author: ahmza
|
|
||||||
draft: false
|
|
||||||
tags:
|
tags:
|
||||||
- prodcutivity
|
|
||||||
- lifestyle
|
- lifestyle
|
||||||
- minimalism
|
- minimalism
|
||||||
description: In the modern age we are overwhelmed with stimuli. Learn to cut out the noise.
|
- prodcutivity
|
||||||
weight: null
|
author: ahmza
|
||||||
|
date: 2024-01-02
|
||||||
|
draft: false
|
||||||
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
|
featureimagecaption: Overstimulated brain
|
||||||
|
lastmod: 2024-11-16
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
|
|
||||||
In the modern age we can get overwhelmed with so much information. In this post
|
In the modern age we can get overwhelmed with so much information. In this post
|
||||||
I try to explain the concept of increasing productivity through "boredom".
|
I try to explain the concept of increasing productivity through "boredom".
|
||||||
|
|
||||||
## **The problem ?**
|
## **The Problem ?**
|
||||||
|
|
||||||
I think the reason this is more relevant in our lifetime compared to past
|
I think the reason this is more relevant in our lifetime compared to past
|
||||||
generations is the availability of stimuli. If you want to spend hours scrolling
|
generations is the availability of stimuli. If you want to spend hours scrolling
|
||||||
@@ -26,7 +27,7 @@ through social media, all you have to do is pick up your phone.
|
|||||||
|
|
||||||
_**The availability of tasks we can use to procrastinate keeps increasing.**_
|
_**The availability of tasks we can use to procrastinate keeps increasing.**_
|
||||||
|
|
||||||
## **Is this important ?**
|
## **Is This Important ?**
|
||||||
|
|
||||||
Our lives are full of stimulation and we try to race to the next "fun" thing.
|
Our lives are full of stimulation and we try to race to the next "fun" thing.
|
||||||
Count the times you have sat doing nothing, and without thinking pick up
|
Count the times you have sat doing nothing, and without thinking pick up
|
||||||
@@ -42,7 +43,7 @@ _**Example 2:**_ Walking into a room with a book and a phone, almost
|
|||||||
instinctively we will go for the phone. Walk into a room with only books this
|
instinctively we will go for the phone. Walk into a room with only books this
|
||||||
changes. Maybe not straight away but you will pick up a book and start reading.
|
changes. Maybe not straight away but you will pick up a book and start reading.
|
||||||
|
|
||||||
## **What can we do ?**
|
## **What Can We Do ?**
|
||||||
|
|
||||||
Remove over stimulating activities or "fun" activities to free up brain space
|
Remove over stimulating activities or "fun" activities to free up brain space
|
||||||
and force yourself to find enjoyment in completing tasks you would consider
|
and force yourself to find enjoyment in completing tasks you would consider
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
---
|
---
|
||||||
title: HUGO Static Site Generator
|
title: HUGO Static Site Generator
|
||||||
|
description: HUGO is a static site generator. No idea what that is ? Check out this post to learn more !
|
||||||
|
tags:
|
||||||
|
- dev
|
||||||
|
- web
|
||||||
|
author: ahmza
|
||||||
date: 2021-12-26
|
date: 2021-12-26
|
||||||
author: "ahmza"
|
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["web dev"]
|
lastmod:
|
||||||
description: "HUGO is a static site generator. No idea what that is ? Check out this post to learn more !"
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
---
|
---
|
||||||
title: You Need to Learn Linux 🐧
|
title: You Need to Learn Linux 🐧
|
||||||
|
description: Here's why you should learn Linux
|
||||||
|
tags:
|
||||||
|
- linux
|
||||||
|
author: ahmza
|
||||||
date: 2021-12-17
|
date: 2021-12-17
|
||||||
author: "ahmza"
|
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["linux"]
|
lastmod:
|
||||||
description: "Here's why you should learn Linux"
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
@@ -23,33 +25,33 @@ master the basics and unlock its true power.
|
|||||||
## **But Why**
|
## **But Why**
|
||||||
|
|
||||||
- **_Linux_ is everywhere**, from data centres to your smart fridge. A lot of
|
- **_Linux_ is everywhere**, from data centres to your smart fridge. A lot of
|
||||||
developers at Google use _Linux_. In fact access to the full codebase is given
|
developers at Google use _Linux_. In fact access to the full codebase is given
|
||||||
on _Linux_.
|
on _Linux_.
|
||||||
|
|
||||||
- **Power user?** The ability to personalise all aspects of the system **make it
|
- **Power user?** The ability to personalise all aspects of the system **make it
|
||||||
your** system. This can result in you chasing the white rabbit, but the feeling
|
your** system. This can result in you chasing the white rabbit, but the feeling
|
||||||
of booting into a system that's yours from start to finish is something else.
|
of booting into a system that's yours from start to finish is something else.
|
||||||
|
|
||||||
- **Make it pretty** - You can create something that's **functional and beautiful**
|
- **Make it pretty** - You can create something that's **functional and beautiful**
|
||||||
[r/unixporn](https://www.reddit.com/r/unixporn/)
|
[r/unixporn](https://www.reddit.com/r/unixporn/)
|
||||||
|
|
||||||
**Lightweight and extensible** limiting the fluff. Making _Linux_ by default a
|
**Lightweight and extensible** limiting the fluff. Making _Linux_ by default a
|
||||||
lot faster than other operating systems.
|
lot faster than other operating systems.
|
||||||
|
|
||||||
## **Ok but what about ...**
|
## **Ok But what about …**
|
||||||
|
|
||||||
- **Application Support** - Some popular applications you use may not be
|
- **Application Support** - Some popular applications you use may not be
|
||||||
available e.g Microsoft Office and the Adobe suite. All is not lost though,
|
available e.g Microsoft Office and the Adobe suite. All is not lost though,
|
||||||
there are alternatives if you can spend the time learning new software.
|
there are alternatives if you can spend the time learning new software.
|
||||||
|
|
||||||
- **Drivers** - More often than not _Linux_ just works. Edge cases could rise
|
- **Drivers** - More often than not _Linux_ just works. Edge cases could rise
|
||||||
that you might struggle with, don't give up Google it and dig in !!
|
that you might struggle with, don't give up Google it and dig in !!
|
||||||
|
|
||||||
## **How can you start**
|
## **How Can You start**
|
||||||
|
|
||||||
> please note the steps below will require further reading to set up
|
> please note the steps below will require further reading to set up
|
||||||
|
|
||||||
### **Install Linux as your main OS**
|
### **Install Linux as Your Main OS**
|
||||||
|
|
||||||
**This is the full send option.** It may take you a while to acclimate but I feel
|
**This is the full send option.** It may take you a while to acclimate but I feel
|
||||||
this is the fastest option to success as you force yourself into learning.
|
this is the fastest option to success as you force yourself into learning.
|
||||||
@@ -82,7 +84,7 @@ meaning:
|
|||||||
- A CPU capable of virtualization
|
- A CPU capable of virtualization
|
||||||
- enough free RAM for the VMs
|
- enough free RAM for the VMs
|
||||||
|
|
||||||
### **Buy a secondary device**
|
### **Buy A Secondary device**
|
||||||
|
|
||||||
Have another cheap laptop or desktop to run _Linux_. This will cost you a bit
|
Have another cheap laptop or desktop to run _Linux_. This will cost you a bit
|
||||||
more than the options above. If you're considering a second device then look
|
more than the options above. If you're considering a second device then look
|
||||||
@@ -105,6 +107,6 @@ I have linked some great resources for other great _Linux_ related content that
|
|||||||
helped me:
|
helped me:
|
||||||
|
|
||||||
- [DT YouTube Channel](https://www.youtube.com/channel/UCVls1GmFKf6WlTraIb_IaJg) -
|
- [DT YouTube Channel](https://www.youtube.com/channel/UCVls1GmFKf6WlTraIb_IaJg) -
|
||||||
Covers _Linux_ related topics
|
Covers _Linux_ related topics
|
||||||
- [r/unixporn](https://www.reddit.com/r/unixporn/) - Get inspired and make _Linux_ pretty
|
- [r/unixporn](https://www.reddit.com/r/unixporn/) - Get inspired and make _Linux_ pretty
|
||||||
- [Arch Wiki](https://wiki.archlinux.org/) - Although specific to Arch, it's a great knowledge base
|
- [Arch Wiki](https://wiki.archlinux.org/) - Although specific to Arch, it's a great knowledge base
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: Minecraft Server on Docker ⛏ 🐳
|
title: Minecraft Server on Docker ⛏ 🐳
|
||||||
|
description: Ever wanted to build a Minecraft server in docker !! Start here
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- games
|
||||||
|
author: ahmza
|
||||||
date: 2022-05-24
|
date: 2022-05-24
|
||||||
lastmod: 2024-07-20
|
|
||||||
author: "ahmza"
|
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["games", "docker"]
|
lastmod: 2024-07-20
|
||||||
description: "Ever wanted to build a Minecraft server in docker !! Start here"
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Minecraft is a great game that becomes even more enjoyable when played with
|
Minecraft is a great game that becomes even more enjoyable when played with
|
||||||
friends. One of the best ways to do this is by setting up a dedicated server.
|
friends. One of the best ways to do this is by setting up a dedicated server.
|
||||||
This guide will help you do just that!
|
This guide will help you do just that!
|
||||||
@@ -20,30 +22,35 @@ Setting up and running a Minecraft server does not require a lot of resources,
|
|||||||
but based on my experience, allocating more resources significantly enhances
|
but based on my experience, allocating more resources significantly enhances
|
||||||
performance, especially when you start to add mods and increase player count.
|
performance, especially when you start to add mods and increase player count.
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Docker
|
- Docker
|
||||||
- Docker Compose
|
- Docker Compose
|
||||||
|
|
||||||
For more information about my Docker setup, see [Pi Cluster](/posts/pi-docker-swarm/)
|
For more information about my Docker setup, see [Pi Cluster](/posts/pi-docker-swarm/)
|
||||||
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
_Requirements Gathered from [here](https://minecraft.fandom.com/wiki/Server/Requirements/Dedicated#Unix_.28Linux.2C_BSD.2C_macOS.29)_
|
_Requirements Gathered from [here](https://minecraft.fandom.com/wiki/Server/Requirements/Dedicated#Unix_.28Linux.2C_BSD.2C_macOS.29)_
|
||||||
|
|
||||||
### Minimum (1-5 Players)
|
### Minimum (1-5 Players)
|
||||||
|
|
||||||
```
|
```
|
||||||
- Intel Pentium 4 or AMD Athlon based CPU
|
- Intel Pentium 4 or AMD Athlon based CPU
|
||||||
- 512 MB RAM
|
- 512 MB RAM
|
||||||
- 2 GB Storage space
|
- 2 GB Storage space
|
||||||
```
|
```
|
||||||
|
|
||||||
### Recommended (10-15 Players)
|
### Recommended (10-15 Players)
|
||||||
|
|
||||||
```
|
```
|
||||||
- Intel Core or AMD K8 based CPU
|
- Intel Core or AMD K8 based CPU
|
||||||
- 3 GB RAM
|
- 3 GB RAM
|
||||||
- 16 GB Storage Space
|
- 16 GB Storage Space
|
||||||
```
|
```
|
||||||
|
|
||||||
### Optimal (20+ Players)
|
### Optimal (20+ Players)
|
||||||
|
|
||||||
```
|
```
|
||||||
- Intel i5/i7 or AMD Ryzen 5/7 Based CPU
|
- Intel i5/i7 or AMD Ryzen 5/7 Based CPU
|
||||||
- 6 GB RAM
|
- 6 GB RAM
|
||||||
@@ -63,6 +70,7 @@ a few players, there is no need to go higher than 3-4 GB.
|
|||||||
Let's get started on building the Minecraft server.
|
Let's get started on building the Minecraft server.
|
||||||
|
|
||||||
1. **Create a directory for the Minecraft server files:**
|
1. **Create a directory for the Minecraft server files:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Make the folder
|
# Make the folder
|
||||||
mkdir minecraft-server
|
mkdir minecraft-server
|
||||||
@@ -72,6 +80,7 @@ cd minecraft-server
|
|||||||
|
|
||||||
2. **Create an environment file for the Docker Container:**
|
2. **Create an environment file for the Docker Container:**
|
||||||
- The `.env` file allows us to specify variables used in the build process.
|
- The `.env` file allows us to specify variables used in the build process.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create a .env file
|
# Create a .env file
|
||||||
touch .env
|
touch .env
|
||||||
@@ -82,7 +91,9 @@ CONTAINER_NAME=minecraft-server
|
|||||||
SERVER_MEM=4096 # Change this to your desired value (in MB)
|
SERVER_MEM=4096 # Change this to your desired value (in MB)
|
||||||
SERVER_JAR=<downloaded-server-file>.jar # Minecraft server jar file. Change this later
|
SERVER_JAR=<downloaded-server-file>.jar # Minecraft server jar file. Change this later
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Create the `docker-compose.yml` file:**
|
3. **Create the `docker-compose.yml` file:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create the file
|
# Create the file
|
||||||
touch docker-compose.yml
|
touch docker-compose.yml
|
||||||
@@ -91,12 +102,11 @@ vim docker-compose.yml
|
|||||||
```
|
```
|
||||||
|
|
||||||
- `docker-compose.yml` specifies the configuration of our Minecraft server:
|
- `docker-compose.yml` specifies the configuration of our Minecraft server:
|
||||||
- Build a Docker image using the current context and pass some arguments.
|
- Build a Docker image using the current context and pass some arguments.
|
||||||
- Attach the volume .server-data where Minecraft's files will be stored.
|
- Attach the volume .server-data where Minecraft's files will be stored.
|
||||||
- Open network ports to access the Docker container.
|
- Open network ports to access the Docker container.
|
||||||
- Name the Docker container.
|
- Name the Docker container.
|
||||||
- Ensure the container always restarts unless explicitly stopped.
|
- Ensure the container always restarts unless explicitly stopped.
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -131,7 +141,7 @@ vim Dockerfile
|
|||||||
```
|
```
|
||||||
|
|
||||||
- Use the [eclipse-temurin:21](https://hub.docker.com/_/eclipse-temurin) image to provide the Java JRE
|
- Use the [eclipse-temurin:21](https://hub.docker.com/_/eclipse-temurin) image to provide the Java JRE
|
||||||
- Use the required Java version for the version of Minecraft you are running.
|
- Use the required Java version for the version of Minecraft you are running.
|
||||||
- Collect the arguments from the .env file.
|
- Collect the arguments from the .env file.
|
||||||
- Set the environment variables.
|
- Set the environment variables.
|
||||||
- Set the working directory to /server, on our local system is .server-data.
|
- Set the working directory to /server, on our local system is .server-data.
|
||||||
@@ -153,7 +163,7 @@ CMD echo "Minecraft Server is starting\n" && java -Xms128M -Xmx${SERVER_MEM}M -j
|
|||||||
|
|
||||||
## Setup the Server Files
|
## Setup the Server Files
|
||||||
|
|
||||||
We’re almost there, just a few steps to go.
|
We're almost there, just a few steps to go.
|
||||||
|
|
||||||
When you try to start the container, you might encounter the following error:
|
When you try to start the container, you might encounter the following error:
|
||||||
|
|
||||||
@@ -175,13 +185,14 @@ cd .server-data
|
|||||||
2. **Download a Minecraft server jar file:**
|
2. **Download a Minecraft server jar file:**
|
||||||
|
|
||||||
- [Vanilla Minecraft Server](https://www.minecraft.net/en-us/download/server)
|
- [Vanilla Minecraft Server](https://www.minecraft.net/en-us/download/server)
|
||||||
- Right-click the green link that says minecraft_server.<version>.jar and copy the link address.
|
- Right-click the green link that says minecraft_server.<version>.jar and copy the link address.
|
||||||
- Download with: curl -o server.jar <link you copied here>
|
- Download with: curl -o server.jar <link you copied here>
|
||||||
- [Fabric Mod loader server](https://fabricmc.net/use/server/)
|
- [Fabric Mod loader server](https://fabricmc.net/use/server/)
|
||||||
- Select the Minecraft version, Fabric Loader Version, and the Installer Version of your choice. I tend to go with the latest.
|
- Select the Minecraft version, Fabric Loader Version, and the Installer Version of your choice. I tend to go with the latest.
|
||||||
- Download with: Copy the curl command under CLI download
|
- Download with: Copy the curl command under CLI download
|
||||||
|
|
||||||
3. **Go back to the root `minecraft-server` directory:**
|
3. **Go back to the root `minecraft-server` directory:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ..
|
cd ..
|
||||||
```
|
```
|
||||||
@@ -198,10 +209,13 @@ SERVER_JAR=<downloaded-server-file>.jar # Change this to the name of the .jar yo
|
|||||||
```
|
```
|
||||||
|
|
||||||
5. **Run the container to generate necessary files like `eula.txt`:**
|
5. **Run the container to generate necessary files like `eula.txt`:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
You will see something like this:
|
You will see something like this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
||||||
minecraft-server | Starting net.minecraft.server.Main
|
minecraft-server | Starting net.minecraft.server.Main
|
||||||
@@ -221,9 +235,9 @@ eula=true
|
|||||||
|
|
||||||
7. **Make any additional changes you want:**
|
7. **Make any additional changes you want:**
|
||||||
- Notable files:
|
- Notable files:
|
||||||
- server.properties - Configure server name, game mode, world type, etc.
|
- server.properties - Configure server name, game mode, world type, etc.
|
||||||
- ops.json - Server operators (can be set in-game).
|
- ops.json - Server operators (can be set in-game).
|
||||||
- whitelist.json - Players allowed to join the server (can be set in-game).
|
- whitelist.json - Players allowed to join the server (can be set in-game).
|
||||||
|
|
||||||
## Run the Server
|
## Run the Server
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
---
|
---
|
||||||
title: My Wilting Mind
|
title: My Wilting Mind
|
||||||
date: 2024-06-03T15:48:31+01:00
|
description: What happens when you stop challenging your mind ?
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- lifestyle
|
||||||
|
- mental
|
||||||
|
- health
|
||||||
|
author: ahmza
|
||||||
|
date: 2024-06-03
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
|
lastmod:
|
||||||
tags: ["lifestyle", "mental health"]
|
|
||||||
description: "What happens when you stop challenging your mind ?"
|
|
||||||
canonicalURL: "https://blog.ahmza.com/Page%28/posts/my-wilting-brain%29"
|
|
||||||
|
|
||||||
cover:
|
|
||||||
image: "webp/posts/my-wilting-brain/feature-anim.webp" # image path/url
|
|
||||||
alt: "Wilting Brain" # alt text
|
|
||||||
caption: "<text>" # display caption under cover
|
|
||||||
relative: false # when using page bundles set this to true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
@@ -58,24 +54,27 @@ priority. We have "more important" things to focus on, such as work, family, and
|
|||||||
relationships. However, our emotions play a significant role in everything we do.
|
relationships. However, our emotions play a significant role in everything we do.
|
||||||
|
|
||||||
### Self Awareness
|
### Self Awareness
|
||||||
|
|
||||||
Recognising our emotions and being aware of how we feel helps us to make
|
Recognising our emotions and being aware of how we feel helps us to make
|
||||||
conscious choices about how we respond.
|
conscious choices about how we respond.
|
||||||
|
|
||||||
### Dual-Processing
|
### Dual-Processing
|
||||||
|
|
||||||
Humans use two processing systems:
|
Humans use two processing systems:
|
||||||
- **System 1 (Emotional)**: Fast, automatic and unconscious processing of emotional cues
|
- **System 1 (Emotional)**: Fast, automatic and unconscious processing of emotional cues
|
||||||
- Intuition
|
- Intuition
|
||||||
- Emotional Response to stimuli
|
- Emotional Response to stimuli
|
||||||
- Habitual behaviour
|
- Habitual behaviour
|
||||||
- **System 2 (Rational)**: Slow, controlled and conscious processing of logical information
|
- **System 2 (Rational)**: Slow, controlled and conscious processing of logical information
|
||||||
- Deliberate
|
- Deliberate
|
||||||
- Logical
|
- Logical
|
||||||
- Critical Thinking
|
- Critical Thinking
|
||||||
|
|
||||||
Leveraging both systems simultaneously reduces cognitive bias, with each system
|
Leveraging both systems simultaneously reduces cognitive bias, with each system
|
||||||
feeding into the other.
|
feeding into the other.
|
||||||
|
|
||||||
### Emotional Regulation
|
### Emotional Regulation
|
||||||
|
|
||||||
Once we acknowledge and accept our emotions we can begin to regulate how we
|
Once we acknowledge and accept our emotions we can begin to regulate how we
|
||||||
feel. We can then refocus our perspective to find a more balanced response
|
feel. We can then refocus our perspective to find a more balanced response
|
||||||
|
|
||||||
@@ -86,6 +85,7 @@ feel. We can then refocus our perspective to find a more balanced response
|
|||||||
> - Response: System 2, Logical, Thought out
|
> - Response: System 2, Logical, Thought out
|
||||||
|
|
||||||
### Coping Mechanisms
|
### Coping Mechanisms
|
||||||
|
|
||||||
We can combat overwhelming negative emotions using coping mechanisms such as
|
We can combat overwhelming negative emotions using coping mechanisms such as
|
||||||
mindfulness or humor. These help us find a sense of equilibrium.
|
mindfulness or humor. These help us find a sense of equilibrium.
|
||||||
|
|
||||||
@@ -123,21 +123,32 @@ aspects that make up resiliency; I have listed some of them that are important
|
|||||||
to me.
|
to me.
|
||||||
|
|
||||||
### Build Strong Relationships
|
### Build Strong Relationships
|
||||||
|
|
||||||
- Seek Support: Maintain strong connections with family and friends.
|
- Seek Support: Maintain strong connections with family and friends.
|
||||||
- Engage in Community: Participate in community activities
|
- Engage in Community: Participate in community activities
|
||||||
|
|
||||||
### Improve Emotional Intelligence
|
### Improve Emotional Intelligence
|
||||||
|
|
||||||
- Self-Awareness: Recognize and understand your emotions.
|
- Self-Awareness: Recognize and understand your emotions.
|
||||||
- Emotional Regulation: Learn techniques to manage and respond to emotions effectively.
|
- Emotional Regulation: Learn techniques to manage and respond to emotions effectively.
|
||||||
|
|
||||||
### Set Realistic Goals
|
### Set Realistic Goals
|
||||||
|
|
||||||
- Small Steps: Break larger goals into smaller, manageable steps.
|
- Small Steps: Break larger goals into smaller, manageable steps.
|
||||||
- Celebrate Progress: Acknowledge and celebrate your achievements, no matter how small.
|
- Celebrate Progress: Acknowledge and celebrate your achievements, no matter how small.
|
||||||
|
|
||||||
### Develop Problem-Solving Skills
|
### Develop Problem-Solving Skills
|
||||||
|
|
||||||
- Analytical Thinking: Approach problems methodically, considering various solutions and their potential outcomes.
|
- Analytical Thinking: Approach problems methodically, considering various solutions and their potential outcomes.
|
||||||
- Adaptability: Be flexible and keep an open mind; not everything will work.
|
- Adaptability: Be flexible and keep an open mind; not everything will work.
|
||||||
|
|
||||||
### Self-Confidence
|
### Self-Confidence
|
||||||
|
|
||||||
- Self-Efficacy: Believe in your ability to overcome challenges and succeed.
|
- Self-Efficacy: Believe in your ability to overcome challenges and succeed.
|
||||||
- Past Successes: Reflect on past successes and how you overcame these challenges.
|
- Past Successes: Reflect on past successes and how you overcame these challenges.
|
||||||
|
|
||||||
### Develop a Sense of Purpose
|
### Develop a Sense of Purpose
|
||||||
|
|
||||||
- Meaningful Activities: Engage in activities that align with your values and give your life meaning.
|
- Meaningful Activities: Engage in activities that align with your values and give your life meaning.
|
||||||
- Help Others: A small action goes a long way. An act of kindness will fill your soul.
|
- Help Others: A small action goes a long way. An act of kindness will fill your soul.
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: Setup an NGINX Reverse Proxy 🥸
|
title: Setup an NGINX Reverse Proxy 🥸
|
||||||
date: 2021-12-01T22:59:00Z
|
description: Learn to setup a quick and easy reverse proxy using NGINX
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- home
|
||||||
|
- lab
|
||||||
|
- networking
|
||||||
|
author: ahmza
|
||||||
|
date: 2021-12-01
|
||||||
draft: false
|
draft: false
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["home lab", "networking"]
|
lastmod:
|
||||||
description: "Learn to setup a quick and easy reverse proxy using NGINX"
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
# **Introduction**
|
# **Introduction**
|
||||||
|
|
||||||
In this post we will go over setting up an *NGINX* reverse proxy to
|
In this post we will go over setting up an *NGINX* reverse proxy to
|
||||||
**allow different web services to reach the outside world.** We will
|
**allow different web services to reach the outside world.** We will
|
||||||
also cover setting up **auto renewing SSL certificates.**
|
also cover setting up **auto renewing SSL certificates.**
|
||||||
@@ -25,29 +29,36 @@ that a reverse proxy provides are as follows:**
|
|||||||
* **Caching**
|
* **Caching**
|
||||||
* **Compression**
|
* **Compression**
|
||||||
|
|
||||||
# **Creating a Reverse Proxy**
|
# **Creating A Reverse Proxy**
|
||||||
|
|
||||||
## **Prerequisites**
|
## **Prerequisites**
|
||||||
|
|
||||||
* **a server to act as the reverse proxy**
|
* **a server to act as the reverse proxy**
|
||||||
* **a web server**
|
* **a web server**
|
||||||
* **a registered domain name**
|
* **a registered domain name**
|
||||||
* **Have A records setup for the Domain name**
|
* **Have A records setup for the Domain name**
|
||||||
|
|
||||||
## **Install** ***NGINX***
|
## **Install** ***NGINX***
|
||||||
|
|
||||||
I'll be using the apt package manager as I'm on Ubuntu server,
|
I'll be using the apt package manager as I'm on Ubuntu server,
|
||||||
this may differ for you
|
this may differ for you
|
||||||
|
|
||||||
Update packages, then **install** ***NGINX***
|
Update packages, then **install** ***NGINX***
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install nginx
|
sudo apt install nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
Now we want to **enable** ***NGINX*** so the program will start when
|
Now we want to **enable** ***NGINX*** so the program will start when
|
||||||
the server boots
|
the server boots
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo systemctl enable --now nginx
|
sudo systemctl enable --now nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
# **Firewall**
|
# **Firewall**
|
||||||
|
|
||||||
> **Quick Note:** now is a good time to port forward ports 80 and 443
|
> **Quick Note:** now is a good time to port forward ports 80 and 443
|
||||||
> from the router to the reverse proxy
|
> from the router to the reverse proxy
|
||||||
|
|
||||||
@@ -55,25 +66,35 @@ Ubuntu server comes with a firewall (ufw), so be sure to allow access
|
|||||||
to *NGINX* and enable it.
|
to *NGINX* and enable it.
|
||||||
|
|
||||||
The reverse proxy handles both HTTP and HTTPS so **allow "Nginx Full"**
|
The reverse proxy handles both HTTP and HTTPS so **allow "Nginx Full"**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo ufw allow 'Nginx full'
|
sudo ufw allow 'Nginx full'
|
||||||
```
|
```
|
||||||
|
|
||||||
**If you are using SSH allow it through**
|
**If you are using SSH allow it through**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo ufw allow 'OpenSSH'
|
sudo ufw allow 'OpenSSH'
|
||||||
```
|
```
|
||||||
|
|
||||||
# **Configure** ***NGINX***
|
# **Configure** ***NGINX***
|
||||||
|
|
||||||
**Unlink the default ***NGINX*** config**
|
**Unlink the default ***NGINX*** config**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo unlink /etc/nginx/sites-enabled/default
|
sudo unlink /etc/nginx/sites-enabled/default
|
||||||
```
|
```
|
||||||
|
|
||||||
## **Create ***NGINX*** Config**
|
## **Create ***NGINX*** Config**
|
||||||
|
|
||||||
Create a config file in **/etc/nginx/site-available**
|
Create a config file in **/etc/nginx/site-available**
|
||||||
|
|
||||||
> **Quick Note:** use whichever text editor you want, I'm using vim
|
> **Quick Note:** use whichever text editor you want, I'm using vim
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo vim /etc/nginx/sites-available/blog.conf
|
sudo vim /etc/nginx/sites-available/blog.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
``` nginx
|
``` nginx
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@@ -83,52 +104,71 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
* **server_name** is the domain name you want use this can include
|
* **server_name** is the domain name you want use this can include
|
||||||
sub-domains
|
sub-domains
|
||||||
* **proxy_pass is the IP address of the web server**
|
* **proxy_pass is the IP address of the web server**
|
||||||
|
|
||||||
## **Enable ***NGINX*** Config**
|
## **Enable ***NGINX*** Config**
|
||||||
|
|
||||||
To activate a config file we need to link the file from the
|
To activate a config file we need to link the file from the
|
||||||
**sites-available** folder to **sites-enabled**.
|
**sites-available** folder to **sites-enabled**.
|
||||||
|
|
||||||
> **Pro Tip:** make sure to use full paths when creating symlinks
|
> **Pro Tip:** make sure to use full paths when creating symlinks
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo ln -s /etc/nginx/sites-available/blog.conf /etc/nginx/sites-enabled/blog.conf
|
sudo ln -s /etc/nginx/sites-available/blog.conf /etc/nginx/sites-enabled/blog.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
**Check the config**, this is an important step as it warns you of any errors before
|
**Check the config**, this is an important step as it warns you of any errors before
|
||||||
reloading *NGINX*
|
reloading *NGINX*
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo nginx -t
|
sudo nginx -t
|
||||||
```
|
```
|
||||||
|
|
||||||
If the output looks simmiler to below then you're good to go !!
|
If the output looks simmiler to below then you're good to go !!
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
|
||||||
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
nginx: configuration file /etc/nginx/nginx.conf test is successful
|
||||||
```
|
```
|
||||||
|
|
||||||
Now **restart the ***NGINX*** service**
|
Now **restart the ***NGINX*** service**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo systemctl restart nginx
|
sudo systemctl restart nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
you should now have a working reverse proxy !!
|
you should now have a working reverse proxy !!
|
||||||
|
|
||||||
# **Setting up SSL**
|
# **Setting Up SSL**
|
||||||
|
|
||||||
## **Prerequisites**
|
## **Prerequisites**
|
||||||
|
|
||||||
* Make sure HTTP and HTTPS are port forwarded to the reverse proxy
|
* Make sure HTTP and HTTPS are port forwarded to the reverse proxy
|
||||||
* Make sure **server_name** is set in the config file you created
|
* Make sure **server_name** is set in the config file you created
|
||||||
|
|
||||||
## **Installing** ***Certbot***
|
## **Installing** ***Certbot***
|
||||||
|
|
||||||
*Certbot* is a tool that requests an SSL certificate and makes sure it
|
*Certbot* is a tool that requests an SSL certificate and makes sure it
|
||||||
is renewed when needed.
|
is renewed when needed.
|
||||||
**Install** ***Certbot*** as well as the **python ***NGINX*** plug-in**
|
**Install** ***Certbot*** as well as the **python ***NGINX*** plug-in**
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo apt install certbot python3-certbot-nginx
|
sudo apt install certbot python3-certbot-nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Quick Note:** double check firewall rules
|
> **Quick Note:** double check firewall rules
|
||||||
|
|
||||||
## **Request SSL Certificate**
|
## **Request SSL Certificate**
|
||||||
|
|
||||||
Now all we need to do is **request the certificate** !!
|
Now all we need to do is **request the certificate** !!
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo certbot --nginx -d blog.example.com
|
sudo certbot --nginx -d blog.example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
* **--nginx** specifies we are using NGINX, this will update the config
|
* **--nginx** specifies we are using NGINX, this will update the config
|
||||||
file we created to allow the use of SSL
|
file we created to allow the use of SSL
|
||||||
* **-d** is the domain name you want to use
|
* **-d** is the domain name you want to use
|
||||||
@@ -148,19 +188,24 @@ change by editing your web server's configuration.
|
|||||||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
|
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):
|
||||||
```
|
```
|
||||||
|
|
||||||
**If you want all traffic to be SSL encrypted choose option 2**
|
**If you want all traffic to be SSL encrypted choose option 2**
|
||||||
That's it we have SSL certificates installed. You will need a new
|
That's it we have SSL certificates installed. You will need a new
|
||||||
certificate for each different domain name or subdomain.
|
certificate for each different domain name or subdomain.
|
||||||
|
|
||||||
## **Verify Auto Renewal**
|
## **Verify Auto Renewal**
|
||||||
|
|
||||||
All we need to do now is make sure that Certbot can automatically renew
|
All we need to do now is make sure that Certbot can automatically renew
|
||||||
certificates.
|
certificates.
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo certbot renew --dry-run
|
sudo certbot renew --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
If you see no errors then you are ready to go.
|
If you see no errors then you are ready to go.
|
||||||
|
|
||||||
# **Conclusion**
|
# **Conclusion**
|
||||||
|
|
||||||
By following this you have hopefully managed to setup an *NGINX*
|
By following this you have hopefully managed to setup an *NGINX*
|
||||||
Reverse proxy to handle incoming HTTP/HTTPS requests as well as
|
Reverse proxy to handle incoming HTTP/HTTPS requests as well as
|
||||||
configured automatically renewing SSL certificates.
|
configured automatically renewing SSL certificates.
|
||||||
@@ -172,6 +217,6 @@ My reverse proxy handling non existent traffic
|
|||||||
|
|
||||||
{{< video label="i-know-kung-fu" webm="/webm/i-know-kung-fu.webm" >}}
|
{{< video label="i-know-kung-fu" webm="/webm/i-know-kung-fu.webm" >}}
|
||||||
|
|
||||||
Give it a few months and this blog will ...
|
Give it a few months and this blog will …
|
||||||
|
|
||||||
{{< video label="this is fine" webm="/webm/matrix-jump-fail.webm" >}}
|
{{< video label="this is fine" webm="/webm/matrix-jump-fail.webm" >}}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: Building a Docker Swarm With Pi's 👾 👾 👾 👾
|
title: Building a Docker Swarm With Pi's 👾 👾 👾 👾
|
||||||
date: 2021-12-12T17:23:32Z
|
description: Pis are very capable computers, when banded together they're almost unstoppable
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- docker
|
||||||
|
- home
|
||||||
|
- lab
|
||||||
|
- raspberry
|
||||||
|
- pi
|
||||||
|
author: ahmza
|
||||||
|
date: 2021-12-12
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["home lab", "docker", "raspberry pi"]
|
lastmod:
|
||||||
description: "Pis are very capable computers, when banded together they're almost unstoppable"
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> This post is no longer valid as the cluster runs Kubernetes. The build process
|
> This post is no longer valid as the cluster runs Kubernetes. The build process
|
||||||
@@ -35,7 +41,7 @@ a **bare metal server that sucks a lot of power to a low power solution.**
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### **Point of this post**
|
### **Point Of This post**
|
||||||
|
|
||||||
After following this post you will have setup _Docker swarm_ on a cluster of Pis
|
After following this post you will have setup _Docker swarm_ on a cluster of Pis
|
||||||
**- stay even if you have one -** and understand how to bend it
|
**- stay even if you have one -** and understand how to bend it
|
||||||
@@ -55,7 +61,7 @@ each individual node for us. Some of these tasks are:
|
|||||||
- Multi-host networking
|
- Multi-host networking
|
||||||
- load balancing
|
- load balancing
|
||||||
|
|
||||||
### **Well why not** **_Kubernetes_**
|
### **Well Why not** **_Kubernetes_**
|
||||||
|
|
||||||
Although _Kubernetes_ is awesome, it adds a bunch of complexity I'm not ready
|
Although _Kubernetes_ is awesome, it adds a bunch of complexity I'm not ready
|
||||||
for. As well as that, from my experience creating _docker-compose_ files is a
|
for. As well as that, from my experience creating _docker-compose_ files is a
|
||||||
@@ -94,7 +100,7 @@ Put it this way, if you have 4 x 8GB nodes then you have a combined total of:
|
|||||||
|
|
||||||
## **BUILD TIME !!**
|
## **BUILD TIME !!**
|
||||||
|
|
||||||
### **Image the SD Cards**
|
### **Image The SD Cards**
|
||||||
|
|
||||||
The CPU in a RaspberryPi 4 is the ARM64 architecture. When selecting Raspbian
|
The CPU in a RaspberryPi 4 is the ARM64 architecture. When selecting Raspbian
|
||||||
pick the 64-BIT option. 32bit variants will work but not make use of the hardware
|
pick the 64-BIT option. 32bit variants will work but not make use of the hardware
|
||||||
@@ -106,7 +112,7 @@ General:
|
|||||||
- Set the hostname
|
- Set the hostname
|
||||||
- Set a username and password
|
- Set a username and password
|
||||||
- Set Locale settings
|
- Set Locale settings
|
||||||
Services:
|
Services:
|
||||||
- Enable SSH
|
- Enable SSH
|
||||||
- Allow public-key authentication only
|
- Allow public-key authentication only
|
||||||
- Set your SSH Key
|
- Set your SSH Key
|
||||||
@@ -114,7 +120,7 @@ General:
|
|||||||
> If you dont have an SSH key, read my post on SSH [Securing
|
> If you dont have an SSH key, read my post on SSH [Securing
|
||||||
> SSH](https://blog.ahmza.com/posts/securing-ssh/)
|
> SSH](https://blog.ahmza.com/posts/securing-ssh/)
|
||||||
|
|
||||||
### Assemble the cluster
|
### Assemble the Cluster
|
||||||
|
|
||||||
Assembly depends on the case you bought, instructions should be included. Go
|
Assembly depends on the case you bought, instructions should be included. Go
|
||||||
ahead and piece together the cluster 🛠
|
ahead and piece together the cluster 🛠
|
||||||
@@ -128,7 +134,7 @@ ahead and piece together the cluster 🛠
|
|||||||
|
|
||||||
**Now allow the Pis to boot for a few minutes**
|
**Now allow the Pis to boot for a few minutes**
|
||||||
|
|
||||||
### **Sort out the Network bits**
|
### **Sort Out the Network bits**
|
||||||
|
|
||||||
There are two methods you can use to set a static IP address, one is on your
|
There are two methods you can use to set a static IP address, one is on your
|
||||||
DHCP server and the other is on the device itself. Personally I prefer to set
|
DHCP server and the other is on the device itself. Personally I prefer to set
|
||||||
@@ -144,8 +150,8 @@ the DHCP leases for the Pis.
|
|||||||
**SSH to the Pi** then open and edit the following files
|
**SSH to the Pi** then open and edit the following files
|
||||||
|
|
||||||
- /etc/dhcpcd.conf
|
- /etc/dhcpcd.conf
|
||||||
\_ knowing we will be using only static IPs here I delete
|
\_ knowing we will be using only static IPs here I delete
|
||||||
everything in the file add the following
|
everything in the file add the following
|
||||||
|
|
||||||
```
|
```
|
||||||
interface eth0
|
interface eth0
|
||||||
@@ -296,12 +302,12 @@ The steps this playbook takes are as follows:
|
|||||||
3. Check for and Install updates
|
3. Check for and Install updates
|
||||||
4. Install any build dependencies
|
4. Install any build dependencies
|
||||||
5. Check if Docker is Installed
|
5. Check if Docker is Installed
|
||||||
- Download the Docker Script
|
- Download the Docker Script
|
||||||
- Install Docker from script
|
- Install Docker from script
|
||||||
- Enable the Docker service
|
- Enable the Docker service
|
||||||
- Add user to Docker group
|
- Add user to Docker group
|
||||||
6. Check if docker-compose is installed
|
6. Check if docker-compose is installed
|
||||||
- Install docker-compose (This will take a while on each pi so be patient, grab a coffee)
|
- Install docker-compose (This will take a while on each pi so be patient, grab a coffee)
|
||||||
7. Change raspi config to wait for network before boot
|
7. Change raspi config to wait for network before boot
|
||||||
8. Reboot
|
8. Reboot
|
||||||
|
|
||||||
@@ -348,7 +354,7 @@ if you can do it in the cli you can do it in _Ansible_ !!
|
|||||||
Now that the _Ansible_ script is done we can go ahead and actually
|
Now that the _Ansible_ script is done we can go ahead and actually
|
||||||
configure all the Pis into the cluster.
|
configure all the Pis into the cluster.
|
||||||
|
|
||||||
### **Creating/Joining the swarm**
|
### **Creating/Joining The swarm**
|
||||||
|
|
||||||
Creating and joining the cluster is easy - It is manual and tedious so this is
|
Creating and joining the cluster is easy - It is manual and tedious so this is
|
||||||
something you could implement into the _Ansible_ playbook using host groups.
|
something you could implement into the _Ansible_ playbook using host groups.
|
||||||
@@ -357,7 +363,7 @@ something you could implement into the _Ansible_ playbook using host groups.
|
|||||||
|
|
||||||
1. ssh to the main Pi, this will be the manager node.
|
1. ssh to the main Pi, this will be the manager node.
|
||||||
2. run `docker swarm init`
|
2. run `docker swarm init`
|
||||||
- This will return a command and token. Make sure to copy them
|
- This will return a command and token. Make sure to copy them
|
||||||
3. exit the main Pi
|
3. exit the main Pi
|
||||||
4. ssh to one of the worker nodes
|
4. ssh to one of the worker nodes
|
||||||
5. paste and run the copied command
|
5. paste and run the copied command
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
---
|
---
|
||||||
title: Securing SSH 🤖
|
title: Securing SSH 🤖
|
||||||
date: 2021-12-07T22:41:02Z
|
description: Ever wanted to make your SSH connections more secure. Read this
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- HomeLab
|
||||||
|
- RemoteAccess
|
||||||
|
- SSH
|
||||||
|
author: ahmza
|
||||||
|
date: 2021-12-07
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["HomeLab", "SSH", "RemoteAccess"]
|
lastmod:
|
||||||
description: "Ever wanted to make your SSH connections more secure. Read this"
|
|
||||||
canonicalURL: "https://blog.ahmza.com/Page%28/posts/securing-ssh.md%29"
|
|
||||||
|
|
||||||
cover:
|
|
||||||
image: "/webp/posts/secure-ssh/feature-anim.webp"
|
|
||||||
alt: "ssh-alt image" # alt text
|
|
||||||
caption: "<text>" # display caption under cover
|
|
||||||
relative: false # when using page bundles set this to true
|
|
||||||
showtoc: true
|
|
||||||
searchHidden: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# **Introduction**
|
# **Introduction**
|
||||||
@@ -154,7 +149,7 @@ fine 😊
|
|||||||
- AllowUsers <user>
|
- AllowUsers <user>
|
||||||
- ClientAliveInterval 180
|
- ClientAliveInterval 180
|
||||||
|
|
||||||
```
|
``` bash
|
||||||
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
|
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
|
||||||
|
|
||||||
# This is the sshd server system-wide configuration file. See
|
# This is the sshd server system-wide configuration file. See
|
||||||
@@ -289,21 +284,21 @@ Subsystem sftp /usr/lib/openssh/sftp-server
|
|||||||
**Now lets explain what we just did**
|
**Now lets explain what we just did**
|
||||||
|
|
||||||
- **Protocol 2** - released in 2006, SSH2 introduced improved encryption
|
- **Protocol 2** - released in 2006, SSH2 introduced improved encryption
|
||||||
algorithms.
|
algorithms.
|
||||||
- **Port 2222** - The port number can be whatever number you want. Choose
|
- **Port 2222** - The port number can be whatever number you want. Choose
|
||||||
something other than 22 this will help hide your device from malicious actors
|
something other than 22 this will help hide your device from malicious actors
|
||||||
- **PermitRootLogin no** - If the root account gets compromised then the
|
- **PermitRootLogin no** - If the root account gets compromised then the
|
||||||
attacker has full control so we stop root from logging in over ssh.
|
attacker has full control so we stop root from logging in over ssh.
|
||||||
- **MaxAuthTries 5** - After 5 failed attempts the remote host blocks requests
|
- **MaxAuthTries 5** - After 5 failed attempts the remote host blocks requests
|
||||||
from that IP for some of time.
|
from that IP for some of time.
|
||||||
- **PasswordAuthentication no** - The SSH key is installed, no need to have
|
- **PasswordAuthentication no** - The SSH key is installed, no need to have
|
||||||
password authentication.
|
password authentication.
|
||||||
- **PermitEmptyPasswords no** - Don't allow empty passwords
|
- **PermitEmptyPasswords no** - Don't allow empty passwords
|
||||||
- **AllowUsers username** - Add the users you want to connect to the remote
|
- **AllowUsers username** - Add the users you want to connect to the remote
|
||||||
host, others will be dropped.
|
host, others will be dropped.
|
||||||
- **Client Alive Interval 180** - Drop the connection after 180s of inactivity
|
- **Client Alive Interval 180** - Drop the connection after 180s of inactivity
|
||||||
|
|
||||||
## **Check ability to connect**
|
## **Check Ability to connect**
|
||||||
|
|
||||||
restart sshd service
|
restart sshd service
|
||||||
|
|
||||||
@@ -384,7 +379,7 @@ The config for _Fail2Ban_ is nice and short
|
|||||||
- **logpath** - where the log you want fail2ban to read is
|
- **logpath** - where the log you want fail2ban to read is
|
||||||
- **maxretry** - Times the client can attempt a login before being banned
|
- **maxretry** - Times the client can attempt a login before being banned
|
||||||
- **findtime** - An amount of time which maxretry must occur to trigger a ban
|
- **findtime** - An amount of time which maxretry must occur to trigger a ban
|
||||||
for example in 10 minutes if 3 login attempts fail ban the IP
|
for example in 10 minutes if 3 login attempts fail ban the IP
|
||||||
|
|
||||||
**Restart** **_Fail2Ban_** to load the configuration
|
**Restart** **_Fail2Ban_** to load the configuration
|
||||||
|
|
||||||
@@ -429,7 +424,7 @@ password. After 3 failed attempts it should say connection refused.
|
|||||||
ssh test@host -p 2222
|
ssh test@host -p 2222
|
||||||
```
|
```
|
||||||
|
|
||||||
_Fail2Ban_ should do something along the lines of ...
|
_Fail2Ban_ should do something along the lines of …
|
||||||
{{< video label="you shall not pass" webm="/webm/you-shall-not-pass.webm" >}}
|
{{< video label="you shall not pass" webm="/webm/you-shall-not-pass.webm" >}}
|
||||||
|
|
||||||
log back in as your normal user, remove the test user and restore the sshd
|
log back in as your normal user, remove the test user and restore the sshd
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
---
|
---
|
||||||
title: Setup a HUGO Site
|
title: Setup a HUGO Site
|
||||||
date: 2022-12-31T22:03:52Z
|
description: Always wanted to setup a static website. Look no further !! In this post we go over the basics of setting up a HUGO site
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- blog
|
||||||
|
- HUGO
|
||||||
|
- web
|
||||||
|
- development
|
||||||
|
- website
|
||||||
|
author: ahmza
|
||||||
|
date: 2022-12-31
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["blog", "website", "web development", "HUGO"]
|
lastmod:
|
||||||
description: "Always wanted to setup a static website. Look no further !! In this post we go over the basics of setting up a HUGO site"
|
|
||||||
canonicalURL: "https://blog.ahmza.com/Page%28/posts/setting-up-a-hugo-site.md%29"
|
|
||||||
|
|
||||||
cover:
|
|
||||||
image: "/img/hugo/feature.webp" # image path/url
|
|
||||||
alt: "HUGO Logo" # alt text
|
|
||||||
caption: "The HUGO logo" # display caption under cover
|
|
||||||
relative: false # when using page bundles set this to true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
@@ -33,7 +32,7 @@ Generator](https://blog.ahmza.com/posts/hugo-static-site-generator/)
|
|||||||
|
|
||||||
[Official steps](https://gohugo.io/installation/)
|
[Official steps](https://gohugo.io/installation/)
|
||||||
|
|
||||||
The _HUGO_ binary is used to initialize our site then create posts etc... Below
|
The _HUGO_ binary is used to initialize our site then create posts etc… Below
|
||||||
are the steps for _MacOS_ and _Arch_ based _Linux_ distros.
|
are the steps for _MacOS_ and _Arch_ based _Linux_ distros.
|
||||||
|
|
||||||
### _MacOS_
|
### _MacOS_
|
||||||
@@ -56,7 +55,7 @@ sudo pacman -S hugo
|
|||||||
hugo version
|
hugo version
|
||||||
```
|
```
|
||||||
|
|
||||||
## Create your site
|
## Create Your Site
|
||||||
|
|
||||||
This assumes choices for you, i.e the theme used.
|
This assumes choices for you, i.e the theme used.
|
||||||
|
|
||||||
@@ -121,7 +120,7 @@ hugo new posts/<post-name>.md
|
|||||||
vim content/posts/<post-name>.md
|
vim content/posts/<post-name>.md
|
||||||
```
|
```
|
||||||
|
|
||||||
## Start the server
|
## Start the Server
|
||||||
|
|
||||||
Now that we have created our site, installed a theme and created a post lets
|
Now that we have created our site, installed a theme and created a post lets
|
||||||
start the server.
|
start the server.
|
||||||
@@ -160,7 +159,7 @@ Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
|||||||
Press Ctrl+C to stop
|
Press Ctrl+C to stop
|
||||||
```
|
```
|
||||||
|
|
||||||
_Notice the second line to the bottom. Web Server... This line gives you a
|
_Notice the second line to the bottom. Web Server… This line gives you a
|
||||||
localhost URL that you can use in your browser to view your site locally._
|
localhost URL that you can use in your browser to view your site locally._
|
||||||
|
|
||||||
## Configure Site
|
## Configure Site
|
||||||
@@ -173,7 +172,7 @@ vim config.yml
|
|||||||
|
|
||||||
**Important changes you need to make**
|
**Important changes you need to make**
|
||||||
|
|
||||||
- baseURL - External URL. In my case. https://blog.ahmza.com
|
- baseURL - External URL. In my case. <https://blog.ahmza.com>
|
||||||
- title - Title of your site.
|
- title - Title of your site.
|
||||||
|
|
||||||
Here is my config.yml with bits redacted so you can fill them in
|
Here is my config.yml with bits redacted so you can fill them in
|
||||||
@@ -321,7 +320,7 @@ markup:
|
|||||||
# lineNos: true
|
# lineNos: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run the server again
|
## Run the Server Again
|
||||||
|
|
||||||
Run the server and check out your hard work. Change settings make posts etc.
|
Run the server and check out your hard work. Change settings make posts etc.
|
||||||
Have fun !!
|
Have fun !!
|
||||||
@@ -330,7 +329,7 @@ Have fun !!
|
|||||||
hugo server -D
|
hugo server -D
|
||||||
```
|
```
|
||||||
|
|
||||||
## Publish your site
|
## Publish Your Site
|
||||||
|
|
||||||
Once you are happy with your site, you may want to publish it to the internet.
|
Once you are happy with your site, you may want to publish it to the internet.
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
---
|
---
|
||||||
title: Setup WSL 🪟 ❤️ 🐧
|
title: Setup WSL 🪟 ❤️ 🐧
|
||||||
date: 2022-02-23T11:57:08Z
|
description: ""
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- wsl
|
||||||
|
author: ahmza
|
||||||
|
date: 2022-02-23
|
||||||
draft: false
|
draft: false
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["windows", "linux", "wsl"]
|
lastmod:
|
||||||
description: ""
|
|
||||||
canonicalURL: "https://blog.ahmza.com/Page%28/posts/setup-wsl.md%29"
|
|
||||||
|
|
||||||
cover:
|
|
||||||
image: "webp/posts/wsl/feature-anim.webp" # image path/url
|
|
||||||
alt: "Windows Loves Linux" # alt text
|
|
||||||
caption: "<text>" # display caption under cover
|
|
||||||
relative: false # when using page bundles set this to true
|
|
||||||
showtoc: true
|
|
||||||
searchHidden: false
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## **Introduction**
|
## **Introduction**
|
||||||
|
|||||||
@@ -1,19 +1,15 @@
|
|||||||
---
|
---
|
||||||
title: Twitch Layoffs
|
title: Twitch Layoffs
|
||||||
date: 2023-03-29T12:39:05+01:00
|
description: My experience getting laid off from twitch
|
||||||
author: "ahmza"
|
tags:
|
||||||
|
- career
|
||||||
|
- twitch
|
||||||
|
author: ahmza
|
||||||
|
date: 2023-03-29
|
||||||
draft: true
|
draft: true
|
||||||
weight:
|
weight:
|
||||||
|
featureimage: feature.webp
|
||||||
tags: ["career", "twitch"]
|
lastmod:
|
||||||
description: ""
|
|
||||||
canonicalURL: "https://blog.local.ahmza.com/Page%28/posts/twitch-layoffs.md%29"
|
|
||||||
|
|
||||||
cover:
|
|
||||||
image: "webp/posts/twitch-layoffs/feature-anim.webp" # image path/url
|
|
||||||
alt: "Bleed Purple" # alt text
|
|
||||||
caption: "Bleed Purple" # display caption undercover
|
|
||||||
relative: false # when using page bundles set this to true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Mon 20 Mar 2023
|
# Mon 20 Mar 2023
|
||||||
|
|||||||
@@ -1,29 +1,22 @@
|
|||||||
---
|
---
|
||||||
title: Welcome 👋
|
title: Welcome
|
||||||
date: 2021-12-01T13:36:08Z
|
tags:
|
||||||
author: "ahmza"
|
- blog
|
||||||
|
- misc
|
||||||
|
- welcome
|
||||||
|
author: ahmza
|
||||||
|
date: 2021-12-01
|
||||||
draft: false
|
draft: false
|
||||||
|
lastmod:
|
||||||
tags: ["welcome", "misc"]
|
|
||||||
canonicalURL: "https://blog.ahmza.com/Page%28/posts/Setup-an-NGINX-Reverse-Proxy.md%29"
|
|
||||||
|
|
||||||
#cover:
|
|
||||||
#image: "/img/Reverse-Proxy/feature-anim.gif" # image path/url
|
|
||||||
#alt: "abstracted reverse proxy diagram" # alt text
|
|
||||||
#caption: "<text>" # display caption under cover
|
|
||||||
#relative: false # when using page bundles set this to true
|
|
||||||
|
|
||||||
showtoc: false
|
|
||||||
searchHidden: true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Hello world
|
### Hello World
|
||||||
|
|
||||||
The mandatory hello world when you start something new.
|
The mandatory hello world when you start something new.
|
||||||
|
|
||||||
I'd like to say thank you for visiting this site.
|
I'd like to say thank you for visiting this site.
|
||||||
|
|
||||||
### A bit about me
|
### A Bit about Me
|
||||||
|
|
||||||
As a tinkerer, I'm always looking to expand my knowledge. My passion for
|
As a tinkerer, I'm always looking to expand my knowledge. My passion for
|
||||||
learning leads me down many paths, including this website, giving me the
|
learning leads me down many paths, including this website, giving me the
|
||||||
|
|||||||
Reference in New Issue
Block a user