365 Days of Code - Day 059

Project Status

ProjectLanguageStatusDue DateLatest Update
Personal WebsiteHugoOngoingNoneThe site is live. Continuous improvements ongoing.
Laravel From ScratchLaravel (PHP)In-Progress2026-03-31Episode 8
PRMLaravel (PHP)In-Progress2026-03-31Working alongside other Laravel projects.
Client Website (J.L.)Laravel (PHP)In-Progress2026-03-31Working alongside other Laravel projects.
Project EulerCOngoingNoneWorking on P25. BigInt (AI gen) was a waste of time, need to rewrite
Practice JavaJavaPausedNoneInstalled, need to find a good project.
Practice PythonPythonPausedNoneInstalled, need to find a good project.
Learn GoGoPausedNoneInstalled, work on LDAP Injector from ippsec.
Learn RustRustHaven’t StartedNoneInstalled, will try network protocols after finishing in C and Zig.
Learn ElixirElixirHaven’t StartedNoneInstalled, need a good tutorial project.
Learn HaskellHaskellHaven’t StartedNoneInstalled, need a good tutorial project.
Learn ZigZigHaven’t StartedNoneInstalled, will try network protocols after finishing in C.
Linux+N/AIn-Progress2026-03-31Reading Chapter 4.
Cyber Quest 2026N/AIn-Progress2026-02-28Finished quiz 1 with 75%.
Operating SystemsN/AIn-Progress2026-03-31Reading Chapter 4: Abstraction
Grey-Hat HackingVariousIn-Progress2026-03-31Reading Chapter 8: Threat Hunting Lab
PHP Time TrackerPHPBeta FinishedNoneWorking on a basic level.
HTTP Status Code ReaderCComplete2026-02-18Complete.
ZSH Configurationbash/zshCompleteNoneSort of an ongoing process, but complete for now. Works good.
Network ProtocolsCIn-ProgressNoneWorking on V3, implementing IPv6.
Discinox WebsiteHTML, CSS, JSComplete2026-03-04The site is live.
DiroffTech WebsiteHTML, CSS, JSComplete2026-03-05The site is live. git-lfs needs to be initialized for images.
Automate BackupsbashComplete2026-03-08Backups done.

Post Refactoring

In preparation for the new image handling that I’m working on, I refactored all the posts into a dated folder structure. All posts were originally is a giant flat folder at content/posts/, and now live in groups separated by year and month, content/posts/YYYY/MM/. This provides numerous benefits, most notably the added ability to create page/leaf bundles for all posts. Images that are directly linked to posts will now live with its post inside the folder.

A nice little script was made to make this easy and fast.

bash
#!/bin/bash

# Loop through all Markdown files in the current directory
for file in *.md; do
  # Skip _index.md or if no .md files exist
  if [[ "$file" == "_index.md" ]] || [[ "$file" == "*.md" ]]; then
    continue
  fi

  # Extract the YYYY-MM string from the 'date =' line in the front matter
  # This matches the first instance of 'date = ' and extracts 'YYYY-MM'
  year_month=$(grep -m 1 "^date[[:space:]]*=" "$file" | grep -oE "[0-9]{4}-[0-9]{2}")

  # Safety check: if no date is found, skip the file
  if [[ -z "$year_month" ]]; then
    echo "⚠️ Warning: Could not parse date in $file. Skipping."
    continue
  fi

  # Split the extracted string into year and month variables
  year="${year_month%-*}"
  month="${year_month#*-}"

  # Get the base filename without the .md extension
  basename="${file%.md}"

  # Define the target directory structure
  target_dir="${year}/${month}/${basename}"

  # Create the directory (-p ensures it creates parent directories if needed and doesn't error if it exists)
  mkdir -p "$target_dir"

  # Move the file to the new directory and rename it to index.md
  mv "$file" "${target_dir}/index.md"

  # Output success message
  echo "✅ Moved: $file -> ${target_dir}/index.md"
done

echo "🎉 Migration complete!"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

# Loop through all Markdown files in the current directory
for file in *.md; do
  # Skip _index.md or if no .md files exist
  if [[ "$file" == "_index.md" ]] || [[ "$file" == "*.md" ]]; then
    continue
  fi

  # Extract the YYYY-MM string from the 'date =' line in the front matter
  # This matches the first instance of 'date = ' and extracts 'YYYY-MM'
  year_month=$(grep -m 1 "^date[[:space:]]*=" "$file" | grep -oE "[0-9]{4}-[0-9]{2}")

  # Safety check: if no date is found, skip the file
  if [[ -z "$year_month" ]]; then
    echo "⚠️ Warning: Could not parse date in $file. Skipping."
    continue
  fi

  # Split the extracted string into year and month variables
  year="${year_month%-*}"
  month="${year_month#*-}"

  # Get the base filename without the .md extension
  basename="${file%.md}"

  # Define the target directory structure
  target_dir="${year}/${month}/${basename}"

  # Create the directory (-p ensures it creates parent directories if needed and doesn't error if it exists)
  mkdir -p "$target_dir"

  # Move the file to the new directory and rename it to index.md
  mv "$file" "${target_dir}/index.md"

  # Output success message
  echo "✅ Moved: $file -> ${target_dir}/index.md"
done

echo "🎉 Migration complete!"

Related content