From bccb0cda2e0286e059a43d542d5a9b47efa1b7a1 Mon Sep 17 00:00:00 2001 From: Dominik Date: Thu, 13 Nov 2025 01:40:04 +0100 Subject: [PATCH] Some small color and typeface changes --- blog/content/blog/bruteforce.md | 8 +++++--- blog/content/datenschutz.md | 2 ++ blog/layouts/_partials/typed.html | 9 +++++---- blog/static/css/style.css | 32 +++++++++++++++---------------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/blog/content/blog/bruteforce.md b/blog/content/blog/bruteforce.md index b78494e..97ea17e 100644 --- a/blog/content/blog/bruteforce.md +++ b/blog/content/blog/bruteforce.md @@ -14,6 +14,7 @@ After getting my hands on these files I decided that I will try to parse and ana # Data The dataset (fail2ban.log file) consists of relatively simple and understandable logs. Here is a snippet of the average log section: + ```txt // I will not be exposing the IP addresses for obvious reasons 2025-10-25 17:04:35,850 fail2ban.filter [77278]: INFO [sshd] Found xxx.xxx.xxx.xxx - 2025-10-25 17:04:35 @@ -54,7 +55,7 @@ type Logs struct { These are the key value fields we will want to fill with the information from the log file. The log file is read with golangs `os` and `bufio` packages. With these we open the log file and pass it to a scanner instance. The scanner then gives us a multitude of functions to handle the reading of the file. The most simple way is to create a for loop like this: -```golang +```go for scanner.Scan() { line := scanner.Text() @@ -66,7 +67,7 @@ for scanner.Scan() { This ensures that in each iteration of the loop, the `line` variable is given the next row until none are available. `line` now contains a row from the log file. Now comes the parsing. I have decided that I hate myself and that I will use Regex Expressions in order to find and extract the usual values in the fail2ban logs. For this I defined a Regex Expression for each of the above mentioned json tags, these being[^2]: -```golang +```go // For (probably much) better efficiency these expressions can be grouped into one large expression with matching groups for each field. // Because I do not like Regex, I will not do this. dateRegex, _ := regexp.Compile(`\d{4}-\d{2}-\d{2}`) @@ -106,7 +107,8 @@ And there we go, I have written a very simple fail2ban log to json parser. From ## Analysing In order to analyse the data we have collected, I will read our json file containing all the logs and creating a new file which aggregates the different log messages by IP Address. This means we will create a new struct which looks like this: -```golang + +```go type StatsByIp struct { IpAddress string `json:"ipAddress"` TotalLogs int `json:"totalLogs"` diff --git a/blog/content/datenschutz.md b/blog/content/datenschutz.md index 327a3ec..d964f3d 100644 --- a/blog/content/datenschutz.md +++ b/blog/content/datenschutz.md @@ -22,6 +22,8 @@ Welche Rechte haben Sie? Sie haben jederzeit das Recht, unentgeltlich Auskunft # Allgemeine Hinweise und Pflichtinformationen +
+ ## Datenschutz Ich behandle Ihre personenbezogenen Daten vertraulich und entsprechend der gesetzlichen Datenschutzvorschriften sowie dieser Datenschutzerklärung. diff --git a/blog/layouts/_partials/typed.html b/blog/layouts/_partials/typed.html index d1d9c4e..cf359a6 100644 --- a/blog/layouts/_partials/typed.html +++ b/blog/layouts/_partials/typed.html @@ -1,10 +1,11 @@ @@ -18,7 +19,7 @@ document.addEventListener("DOMContentLoaded", function () { if (index < text.length) { element.textContent += text.charAt(index); index++; - setTimeout(type, 120); + setTimeout(type, 256); } } diff --git a/blog/static/css/style.css b/blog/static/css/style.css index ad103be..88c6cdf 100644 --- a/blog/static/css/style.css +++ b/blog/static/css/style.css @@ -20,7 +20,7 @@ --font-weight-regular: 400; --font-weight-bold: 600; - --max-width: 700px; + --max-width: 70ch; --padding-page: 1rem; font-feature-settings: 'liga' 1, 'calt' 1; @@ -46,13 +46,13 @@ main h1, main h2, main h3, main h4 { font-weight: var(--font-weight-bold); line-height: 1.8; display: inline; - /*background-image: linear-gradient(120deg, #E45420 0%, #E87045 100%);*/ - background-repeat: no-repeat; - background-size: 100% 0.6em; - background-position: 0 88%; - transition: background-size 0.5s ease; } +main h1 { font-size: 1.8rem; } +main h2 { font-size: 1.6rem; } +main h3 { font-size: 1.4rem; } +main h4 { font-size: 1.2rem; } + a { color: var(--link); text-decoration: underline; @@ -296,14 +296,13 @@ code { white-space: nowrap; } -.chroma .k { color: #ff79c6; } /* Keywords */ -.chroma .s { color: #f1fa8c; } /* Strings */ -.chroma .n { color: #f8f8f2; } /* Names */ -.chroma .p { color: #bd93f9; } /* Punctuation */ -.chroma .c { color: #6272a4; font-style: italic; } /* Comments */ -.chroma .m { color: #8be9fd; } /* Numbers */ -.chroma .o { color: #ffb86c; } /* Operators */ -.chroma .err { color: #ff5555; background: #2e2e2e; } /* Errors */ +.chroma .k { color: #ff9349; } +.chroma .s { color: #b8e3b7; } +.chroma .c { color: #737983; font-style: italic; } +.chroma .m { color: #eacaa6; } +.chroma .o { color: #e1e5ec; } +.chroma .kt { color: #9bb8ff; } + /* ---------- Landing Page ---------- */ @@ -313,13 +312,12 @@ code { justify-content: center; align-items: center; text-align: center; - min-height: 70vh; + min-height: 55vh; } .landing-welcome h1 { font-size: 2.5rem; - /*font-weight: 300;*/ - margin-bottom: 40px; + margin-bottom: 25px; } .landing-links {