← Back to Orbital Outpost
. + . . . . . .
. . . *
. * . . . . . . + .
"~tunas" . . + . . .
. | | . . . . . .
| . . . +. + .
\|/ . . . .
. . V . * . . . . + .
+ . . . +
. . + .+. .
. . . + . . . . .
. . . . . . . . ! /
* . . . + . . - O -
. . . + . . * . . / |
. + . . . .. + .
. . . . * . * . +.. . *
. . . . . . . . + . . +
Welcome to my corner of orbitaloutpost.club!
This is your Gemini capsule - a space for sharing your thoughts, projects, and creativity.
About Me
I'm a new member of the Orbital Outpost community!
---
📚 Gemini Capsule Guide
This page will help you get started with your Gemini capsule, from basic text to advanced CGI scripts.
🌱 Level 1: Basic Text & Formatting
Edit this page to make it your own:
nano ~/public_gemini/index.gmi
Gemini uses a simple text format (.gmi). Here are the basics:
# Heading 1
## Heading 2
### Heading 3
* Unordered list item
* Another item
> This is a quote
> It can span multiple lines
Text can have line breaks.
Just write naturally!
Preformatted text (like code) goes in triple backticks:
Code or ASCII art here
🔗 Level 2: Links & Pages
Create links to other pages or sites:
=> /~tunas/blog.gmi My Blog
=> /~tunas/projects.gmi Projects
=> https://example.com External link (note: https, not gemini)
=> gemini://other-server.com Another Gemini site
Create a new page:
nano ~/public_gemini/blog.gmi
Then link to it from this page!
📁 Level 3: Directory Structure
Organize your capsule with folders:
mkdir ~/public_gemini/blog
mkdir ~/public_gemini/projects
nano ~/public_gemini/blog/2024-11-21-first-post.gmi
Link to it:
=> /~tunas/blog/2024-11-21-first-post.gmi My First Blog Post
🎨 Level 4: ASCII Art & Creative Content
Gemini loves ASCII art! Use preformatted blocks:
/\_/\
( o.o )
> ^ <
/| |\
(_| |_)
You can also include diagrams, tables, or any text-based art!
🔧 Level 5: CGI Scripts (Dynamic Content)
CGI scripts let you create dynamic, interactive content!
# Setting Up CGI
First, create a cgi-bin directory:
mkdir ~/public_gemini/cgi-bin
chmod 755 ~/public_gemini/cgi-bin
# Example 1: Simple "Hello World" CGI
nano ~/public_gemini/cgi-bin/hello.sh
Add this content:
#!/bin/bash
echo "20 text/gemini"
echo ""
echo "# Hello from CGI!"
echo ""
echo "This page was generated dynamically at:"
echo "$(date)"
echo ""
echo "Your IP address: $REMOTE_ADDR"
Make it executable:
chmod 755 ~/public_gemini/cgi-bin/hello.sh
Access it at: gemini://orbitaloutpost.club/~tunas/cgi-bin/hello.sh
# Example 2: Random Quote Generator
nano ~/public_gemini/cgi-bin/quote.sh
#!/bin/bash
echo "20 text/gemini"
echo ""
echo "# 🌟 Random Quote"
echo ""
quotes=(
"The cosmos is within us. We are made of star-stuff.|Carl Sagan"
"In space, no one can hear you scream.|Alien (1979)"
"Space: the final frontier.|Star Trek"
"I'm sorry, Dave. I'm afraid I can't do that.|HAL 9000"
)
random_quote=${quotes[$RANDOM % ${#quotes[@]}]}
quote=${random_quote%|*}
author=${random_quote#*|}
echo "$quote"
echo ""
echo "— $author"
echo ""
echo "=> /~tunas/cgi-bin/quote.sh 🔄 Get another quote
Make it executable:
chmod 755 ~/public_gemini/cgi-bin/quote.sh
# Example 3: Visitor Counter
nano ~/public_gemini/cgi-bin/counter.sh
#!/bin/bash
COUNTER_FILE="$HOME/public_gemini/.counter"
# Initialize counter if doesn't exist
if [ ! -f "$COUNTER_FILE" ]; then
echo "0" > "$COUNTER_FILE"
fi
# Increment counter
count=$(cat "$COUNTER_FILE")
count=$((count + 1))
echo "$count" > "$COUNTER_FILE"
# Output
echo "20 text/gemini"
echo ""
echo "# 👁️ Visitor Counter"
echo ""
echo "You are visitor number: $count"
echo ""
echo "=> /~tunas/ Back to home
Make it executable:
chmod 755 ~/public_gemini/cgi-bin/counter.sh
# Example 4: File Listing
nano ~/public_gemini/cgi-bin/files.sh
#!/bin/bash
echo "20 text/gemini"
echo ""
echo "# 📂 My Files"
echo ""
cd "$HOME/public_gemini" || exit 1
for file in *.gmi; do
if [ -f "$file" ]; then
echo "=> /~tunas/$file $file"
fi
done
echo ""
echo "=> /~tunas/ Back to home
Make it executable:
chmod 755 ~/public_gemini/cgi-bin/files.sh
nano ~/public_gemini/cgi-bin/guestbook.sh
#!/bin/bash
GUESTBOOK="$HOME/public_gemini/.guestbook"
# Get query string (user input)
QUERY="$QUERY_STRING"
echo "20 text/gemini"
echo ""
echo "# 📖 Guestbook"
echo ""
# If query exists, save the message
if [ -n "$QUERY" ]; then
# Decode URL encoding and save
MESSAGE=$(echo "$QUERY" | sed 's/+/ /g; s/%20/ /g')
DATE=$(date '+%Y-%m-%d %H:%M')
echo "[$DATE] $MESSAGE" >> "$GUESTBOOK"
echo "✓ Message added!"
echo ""
fi
# Display existing messages
if [ -f "$GUESTBOOK" ]; then
echo "## Recent Messages"
echo ""
tail -10 "$GUESTBOOK" | while read -r line; do
echo "$line"
done
echo ""
fi
echo "---"
echo ""
echo "To add a message, use a Gemini client that supports input."
echo "Or visit: gemini://orbitaloutpost.club/~tunas/cgi-bin/guestbook.sh?Your+message+here"
echo ""
echo "=> /~tunas/ Back to home
Make it executable:
chmod 755 ~/public_gemini/cgi-bin/guestbook.sh
📝 CGI Environment Variables
Your CGI scripts have access to these variables:
- REMOTE_ADDR - Visitor's IP address
- QUERY_STRING - Input from the user
- SERVER_NAME - The server hostname
- SCRIPT_NAME - The script path
- REQUEST_METHOD - Should be blank for Gemini
⚠️ CGI Security Tips
- Always validate user input
- Never execute user input as commands
- Use quotes around variables
- Set proper file permissions (755 for scripts)
- Don't expose sensitive information
- Keep data files outside the public capsule if possible
🎯 Ideas for Your Capsule
- Personal blog or journal
- Project portfolio
- ASCII art gallery
- Quote of the day
- Weather station data
- Server statistics
- Guestbook
- Link collection
- Gemlog (Gemini blog)
- Tinylog (micro-updates)
- Photo gallery (links to images)
- Recipe collection
- Book/movie reviews
- Code snippets
📖 Learn More
Gemini Protocol Specification
Gemini Quickstart Guide
---
Your capsule URL: gemini://orbitaloutpost.club/~tunas/
Happy writing! 🚀