-- Leo's gemini proxy

-- Connecting to krauserd.xyz:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

David Krauser's Gemini Capsule

gemini://krauserd.xyz


Index Source Code

This Gemini capsule is somewhat dynamic. It has a user visit count, and each page is generated on-the-fly from files on disk. These are the hacky bits that make the index page:


#!/bin/sh

echo -n 1 >> count
count=$(wc -c count | cut -d' ' -f1)

unix2dos < header.gmi

unix2dos << EOF

I am a software engineer living in FL with my wife, three boys, a cat, and a dog. I love free software, simple technologies, and a good cup of coffee.



## Logbook

This is a collection of random thoughts, hacks, and ideas in reverse chronological order. I don't have a feed for these, yet, but I plan to add one at some point.

EOF

for log in $(ls logs/*.gmi | grep -v index | sort -r); do
  title=$(sed 1q $log | cut -c5-) # | unix2dos
  timestamp=$(sed '1d;2q' $log)
  slug=$(basename $log)
  /usr/bin/echo -ne '=> gemini://krauserd.xyz/logs/index.gmi?'${slug%%.gmi}' '$timestamp' - '$title'\r\n' # - '$timestamp' ∞\r\n'
  #sed 1,2d $log | unix2dos
  #/usr/bin/echo -ne '\r\n\r\n'
done

/usr/bin/echo -ne '\r\n\r\n\r\n'
unix2dos < contact.gmi

/usr/bin/echo -ne '\r\n\r\n\r\n'
unix2dos < leo.gmi

unix2dos << EOF

You are visitor #$count to this capsule today:
=> ./stats/ Capsule Statistics
EOF

/usr/bin/echo -ne '\r\n\r\n\r\n'
/usr/bin/echo -ne '=> gemini://krauserd.xyz/src/index.gmi Source code for this page\r\n'
unix2dos < footer.gmi

Licensed under CC BY-SA 4.0

-- Response ended

-- Page fetched on Mon May 6 12:36:04 2024