organised and linted all posts

imported workspace into obsidian
linted files
organized yaml frontmatter
unified yaml value formats
removed yaml front matter no longer needed
This commit is contained in:
2024-11-29 02:26:53 +00:00
parent adf127f593
commit 0759020677
24 changed files with 252 additions and 191 deletions
+1
View File
@@ -1,5 +1,6 @@
.hugo_build.lock
.DS_Store
.obsidian/
styles/
node_modules
public/
@@ -1,24 +1,25 @@
---
title: Be More Productive by Being Bored
featureimage: feature.webp
featureimagecaption: Overstimulated brain
date: 2024-01-02T00:00:00
lastmod: 2024-11-16T22:58:00
author: ahmza
draft: false
description: In the modern age we are overwhelmed with stimuli. Learn to cut out the noise.
tags:
- prodcutivity
- lifestyle
- minimalism
description: In the modern age we are overwhelmed with stimuli. Learn to cut out the noise.
weight: null
- prodcutivity
author: ahmza
date: 2024-01-02
draft: false
weight:
featureimage: feature.webp
featureimagecaption: Overstimulated brain
lastmod: 2024-11-16
---
## **Introduction**
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".
## **The problem ?**
## **The Problem ?**
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
@@ -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.**_
## **Is this important ?**
## **Is This Important ?**
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
@@ -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
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
and force yourself to find enjoyment in completing tasks you would consider
+7 -4
View File
@@ -1,12 +1,15 @@
---
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
author: "ahmza"
draft: false
weight:
tags: ["web dev"]
description: "HUGO is a static site generator. No idea what that is ? Check out this post to learn more !"
featureimage: feature.webp
lastmod:
---
## **Introduction**
+19 -17
View File
@@ -1,12 +1,14 @@
---
title: You Need to Learn Linux 🐧
description: Here's why you should learn Linux
tags:
- linux
author: ahmza
date: 2021-12-17
author: "ahmza"
draft: false
weight:
tags: ["linux"]
description: "Here's why you should learn Linux"
featureimage: feature.webp
lastmod:
---
## **Introduction**
@@ -23,33 +25,33 @@ master the basics and unlock its true power.
## **But Why**
- **_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
on _Linux_.
developers at Google use _Linux_. In fact access to the full codebase is given
on _Linux_.
- **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
of booting into a system that's yours from start to finish is something else.
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.
- **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
lot faster than other operating systems.
## **Ok but what about ...**
## **Ok But what about …**
- **Application Support** - Some popular applications you use may not be
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.
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.
- **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
### **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 fastest option to success as you force yourself into learning.
@@ -82,7 +84,7 @@ meaning:
- A CPU capable of virtualization
- 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
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:
- [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
- [Arch Wiki](https://wiki.archlinux.org/) - Although specific to Arch, it's a great knowledge base
+37 -23
View File
@@ -1,17 +1,19 @@
---
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
lastmod: 2024-07-20
author: "ahmza"
draft: false
weight:
tags: ["games", "docker"]
description: "Ever wanted to build a Minecraft server in docker !! Start here"
featureimage: feature.webp
lastmod: 2024-07-20
---
## Introduction
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.
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
performance, especially when you start to add mods and increase player count.
## Prerequisites
- Docker
- Docker Compose
For more information about my Docker setup, see [Pi Cluster](/posts/pi-docker-swarm/)
## Requirements
_Requirements Gathered from [here](https://minecraft.fandom.com/wiki/Server/Requirements/Dedicated#Unix_.28Linux.2C_BSD.2C_macOS.29)_
### Minimum (1-5 Players)
```
- Intel Pentium 4 or AMD Athlon based CPU
- 512 MB RAM
- 2 GB Storage space
```
### Recommended (10-15 Players)
```
- Intel Core or AMD K8 based CPU
- 3 GB RAM
- 16 GB Storage Space
```
### Optimal (20+ Players)
```
- Intel i5/i7 or AMD Ryzen 5/7 Based CPU
- 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.
1. **Create a directory for the Minecraft server files:**
```bash
# Make the folder
mkdir minecraft-server
@@ -72,6 +80,7 @@ cd minecraft-server
2. **Create an environment file for the Docker Container:**
- The `.env` file allows us to specify variables used in the build process.
```bash
# Create a .env file
touch .env
@@ -82,7 +91,9 @@ CONTAINER_NAME=minecraft-server
SERVER_MEM=4096 # Change this to your desired value (in MB)
SERVER_JAR=<downloaded-server-file>.jar # Minecraft server jar file. Change this later
```
3. **Create the `docker-compose.yml` file:**
```bash
# Create the file
touch docker-compose.yml
@@ -91,12 +102,11 @@ vim docker-compose.yml
```
- `docker-compose.yml` specifies the configuration of our Minecraft server:
- Build a Docker image using the current context and pass some arguments.
- Attach the volume .server-data where Minecraft's files will be stored.
- Open network ports to access the Docker container.
- Name the Docker container.
- Ensure the container always restarts unless explicitly stopped.
- Build a Docker image using the current context and pass some arguments.
- Attach the volume .server-data where Minecraft's files will be stored.
- Open network ports to access the Docker container.
- Name the Docker container.
- Ensure the container always restarts unless explicitly stopped.
```yaml
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 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.
- Set the environment variables.
- 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
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:
@@ -175,13 +185,14 @@ cd .server-data
2. **Download a Minecraft server jar file:**
- [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.
- Download with: curl -o server.jar <link you copied here>
- 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>
- [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.
- Download with: Copy the curl command under CLI download
- 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
3. **Go back to the root `minecraft-server` directory:**
```bash
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`:**
```bash
docker compose up
```
You will see something like this:
```bash
minecraft-server | Starting net.minecraft.server.Main
@@ -221,9 +235,9 @@ eula=true
7. **Make any additional changes you want:**
- Notable files:
- server.properties - Configure server name, game mode, world type, etc.
- ops.json - Server operators (can be set in-game).
- whitelist.json - Players allowed to join the server (can be set in-game).
- server.properties - Configure server name, game mode, world type, etc.
- ops.json - Server operators (can be set in-game).
- whitelist.json - Players allowed to join the server (can be set in-game).
## Run the Server
+31 -20
View File
@@ -1,20 +1,16 @@
---
title: My Wilting Mind
date: 2024-06-03T15:48:31+01:00
author: "ahmza"
description: What happens when you stop challenging your mind ?
tags:
- lifestyle
- mental
- health
author: ahmza
date: 2024-06-03
draft: false
weight:
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
weight:
featureimage: feature.webp
lastmod:
---
## **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.
### Self Awareness
Recognising our emotions and being aware of how we feel helps us to make
conscious choices about how we respond.
### Dual-Processing
Humans use two processing systems:
- **System 1 (Emotional)**: Fast, automatic and unconscious processing of emotional cues
- Intuition
- Emotional Response to stimuli
- Habitual behaviour
- Intuition
- Emotional Response to stimuli
- Habitual behaviour
- **System 2 (Rational)**: Slow, controlled and conscious processing of logical information
- Deliberate
- Logical
- Critical Thinking
- Deliberate
- Logical
- Critical Thinking
Leveraging both systems simultaneously reduces cognitive bias, with each system
feeding into the other.
### Emotional Regulation
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
@@ -86,6 +85,7 @@ feel. We can then refocus our perspective to find a more balanced response
> - Response: System 2, Logical, Thought out
### Coping Mechanisms
We can combat overwhelming negative emotions using coping mechanisms such as
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.
### Build Strong Relationships
- Seek Support: Maintain strong connections with family and friends.
- Engage in Community: Participate in community activities
### Improve Emotional Intelligence
- Self-Awareness: Recognize and understand your emotions.
- Emotional Regulation: Learn techniques to manage and respond to emotions effectively.
### Set Realistic Goals
- Small Steps: Break larger goals into smaller, manageable steps.
- Celebrate Progress: Acknowledge and celebrate your achievements, no matter how small.
### Develop Problem-Solving Skills
- Analytical Thinking: Approach problems methodically, considering various solutions and their potential outcomes.
- Adaptability: Be flexible and keep an open mind; not everything will work.
### Self-Confidence
- Self-Efficacy: Believe in your ability to overcome challenges and succeed.
- Past Successes: Reflect on past successes and how you overcame these challenges.
### Develop a Sense of Purpose
- 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.
+54 -9
View File
@@ -1,15 +1,19 @@
---
title: Setup an NGINX Reverse Proxy 🥸
date: 2021-12-01T22:59:00Z
author: "ahmza"
description: Learn to setup a quick and easy reverse proxy using NGINX
tags:
- home
- lab
- networking
author: ahmza
date: 2021-12-01
draft: false
tags: ["home lab", "networking"]
description: "Learn to setup a quick and easy reverse proxy using NGINX"
featureimage: feature.webp
lastmod:
---
# **Introduction**
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
also cover setting up **auto renewing SSL certificates.**
@@ -25,29 +29,36 @@ that a reverse proxy provides are as follows:**
* **Caching**
* **Compression**
# **Creating a Reverse Proxy**
# **Creating A Reverse Proxy**
## **Prerequisites**
* **a server to act as the reverse proxy**
* **a web server**
* **a registered domain name**
* **Have A records setup for the Domain name**
## **Install** ***NGINX***
I'll be using the apt package manager as I'm on Ubuntu server,
this may differ for you
Update packages, then **install** ***NGINX***
``` bash
sudo apt update
sudo apt install nginx
```
Now we want to **enable** ***NGINX*** so the program will start when
the server boots
``` bash
sudo systemctl enable --now nginx
```
# **Firewall**
> **Quick Note:** now is a good time to port forward ports 80 and 443
> 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.
The reverse proxy handles both HTTP and HTTPS so **allow "Nginx Full"**
``` bash
sudo ufw allow 'Nginx full'
```
**If you are using SSH allow it through**
``` bash
sudo ufw allow 'OpenSSH'
```
# **Configure** ***NGINX***
**Unlink the default ***NGINX*** config**
``` bash
sudo unlink /etc/nginx/sites-enabled/default
```
## **Create ***NGINX*** Config**
Create a config file in **/etc/nginx/site-available**
> **Quick Note:** use whichever text editor you want, I'm using vim
``` bash
sudo vim /etc/nginx/sites-available/blog.conf
```
``` nginx
server {
listen 80;
@@ -83,52 +104,71 @@ server {
}
}
```
* **server_name** is the domain name you want use this can include
sub-domains
* **proxy_pass is the IP address of the web server**
## **Enable ***NGINX*** Config**
To activate a config file we need to link the file from the
**sites-available** folder to **sites-enabled**.
> **Pro Tip:** make sure to use full paths when creating symlinks
``` bash
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
reloading *NGINX*
``` bash
sudo nginx -t
```
If the output looks simmiler to below then you're good to go !!
``` bash
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
```
Now **restart the ***NGINX*** service**
``` bash
sudo systemctl restart nginx
```
you should now have a working reverse proxy !!
# **Setting up SSL**
# **Setting Up SSL**
## **Prerequisites**
* Make sure HTTP and HTTPS are port forwarded to the reverse proxy
* Make sure **server_name** is set in the config file you created
## **Installing** ***Certbot***
*Certbot* is a tool that requests an SSL certificate and makes sure it
is renewed when needed.
**Install** ***Certbot*** as well as the **python ***NGINX*** plug-in**
``` bash
sudo apt install certbot python3-certbot-nginx
```
> **Quick Note:** double check firewall rules
## **Request SSL Certificate**
Now all we need to do is **request the certificate** !!
``` bash
sudo certbot --nginx -d blog.example.com
```
* **--nginx** specifies we are using NGINX, this will update the config
file we created to allow the use of SSL
* **-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):
```
**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
certificate for each different domain name or subdomain.
## **Verify Auto Renewal**
All we need to do now is make sure that Certbot can automatically renew
certificates.
``` bash
sudo certbot renew --dry-run
```
If you see no errors then you are ready to go.
# **Conclusion**
By following this you have hopefully managed to setup an *NGINX*
Reverse proxy to handle incoming HTTP/HTTPS requests as well as
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" >}}
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" >}}
+26 -20
View File
@@ -1,12 +1,18 @@
---
title: Building a Docker Swarm With Pi's 👾 👾 👾 👾
date: 2021-12-12T17:23:32Z
author: "ahmza"
description: Pis are very capable computers, when banded together they're almost unstoppable
tags:
- docker
- home
- lab
- raspberry
- pi
author: ahmza
date: 2021-12-12
draft: false
weight:
tags: ["home lab", "docker", "raspberry pi"]
description: "Pis are very capable computers, when banded together they're almost unstoppable"
featureimage: feature.webp
lastmod:
---
> 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.**
![Cluster(fix this image)](/img/pi-docker-swarm/cluster.webp)
### **Point of this post**
### **Point Of This post**
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
@@ -55,7 +61,7 @@ each individual node for us. Some of these tasks are:
- Multi-host networking
- load balancing
### **Well why not** **_Kubernetes_**
### **Well Why not** **_Kubernetes_**
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
@@ -94,7 +100,7 @@ Put it this way, if you have 4 x 8GB nodes then you have a combined total of:
## **BUILD TIME !!**
### **Image the SD Cards**
### **Image The SD Cards**
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
@@ -106,7 +112,7 @@ General:
- Set the hostname
- Set a username and password
- Set Locale settings
Services:
Services:
- Enable SSH
- Allow public-key authentication only
- Set your SSH Key
@@ -114,7 +120,7 @@ General:
> If you dont have an SSH key, read my post on SSH [Securing
> 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
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**
### **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
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
- /etc/dhcpcd.conf
\_ knowing we will be using only static IPs here I delete
everything in the file add the following
\_ knowing we will be using only static IPs here I delete
everything in the file add the following
```
interface eth0
@@ -296,12 +302,12 @@ The steps this playbook takes are as follows:
3. Check for and Install updates
4. Install any build dependencies
5. Check if Docker is Installed
- Download the Docker Script
- Install Docker from script
- Enable the Docker service
- Add user to Docker group
- Download the Docker Script
- Install Docker from script
- Enable the Docker service
- Add user to Docker group
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
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
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
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.
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
4. ssh to one of the worker nodes
5. paste and run the copied command
+19 -24
View File
@@ -1,21 +1,16 @@
---
title: Securing SSH 🤖
date: 2021-12-07T22:41:02Z
author: "ahmza"
description: Ever wanted to make your SSH connections more secure. Read this
tags:
- HomeLab
- RemoteAccess
- SSH
author: ahmza
date: 2021-12-07
draft: false
weight:
tags: ["HomeLab", "SSH", "RemoteAccess"]
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
featureimage: feature.webp
lastmod:
---
# **Introduction**
@@ -154,7 +149,7 @@ fine 😊
- AllowUsers <user>
- ClientAliveInterval 180
```
``` bash
# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $
# 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**
- **Protocol 2** - released in 2006, SSH2 introduced improved encryption
algorithms.
algorithms.
- **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
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
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
password authentication.
password authentication.
- **PermitEmptyPasswords no** - Don't allow empty passwords
- **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
## **Check ability to connect**
## **Check Ability to connect**
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
- **maxretry** - Times the client can attempt a login before being banned
- **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
@@ -429,7 +424,7 @@ password. After 3 failed attempts it should say connection refused.
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" >}}
log back in as your normal user, remove the test user and restore the sshd
+18 -19
View File
@@ -1,19 +1,18 @@
---
title: Setup a HUGO Site
date: 2022-12-31T22:03:52Z
author: "ahmza"
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
tags:
- blog
- HUGO
- web
- development
- website
author: ahmza
date: 2022-12-31
draft: false
weight:
tags: ["blog", "website", "web development", "HUGO"]
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
featureimage: feature.webp
lastmod:
---
## **Introduction**
@@ -33,7 +32,7 @@ Generator](https://blog.ahmza.com/posts/hugo-static-site-generator/)
[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.
### _MacOS_
@@ -56,7 +55,7 @@ sudo pacman -S hugo
hugo version
```
## Create your site
## Create Your Site
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
```
## Start the server
## Start the Server
Now that we have created our site, installed a theme and created a post lets
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
```
_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._
## Configure Site
@@ -173,7 +172,7 @@ vim config.yml
**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.
Here is my config.yml with bits redacted so you can fill them in
@@ -321,7 +320,7 @@ markup:
# lineNos: true
```
## Run the server again
## Run the Server Again
Run the server and check out your hard work. Change settings make posts etc.
Have fun !!
@@ -330,7 +329,7 @@ Have fun !!
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.
+9 -14
View File
@@ -1,21 +1,16 @@
---
title: Setup WSL 🪟 ❤️ 🐧
date: 2022-02-23T11:57:08Z
author: "ahmza"
description: ""
tags:
- linux
- windows
- wsl
author: ahmza
date: 2022-02-23
draft: false
weight:
tags: ["windows", "linux", "wsl"]
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
featureimage: feature.webp
lastmod:
---
## **Introduction**
+8 -12
View File
@@ -1,19 +1,15 @@
---
title: Twitch Layoffs
date: 2023-03-29T12:39:05+01:00
author: "ahmza"
description: My experience getting laid off from twitch
tags:
- career
- twitch
author: ahmza
date: 2023-03-29
draft: true
weight:
tags: ["career", "twitch"]
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
featureimage: feature.webp
lastmod:
---
# Mon 20 Mar 2023
+10 -17
View File
@@ -1,29 +1,22 @@
---
title: Welcome 👋
date: 2021-12-01T13:36:08Z
author: "ahmza"
title: Welcome
tags:
- blog
- misc
- welcome
author: ahmza
date: 2021-12-01
draft: false
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
lastmod:
---
### Hello world
### Hello World
The mandatory hello world when you start something new.
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
learning leads me down many paths, including this website, giving me the