flight-journal/journal/12-15-2020-quarantine-5.gmi

60 lines
1.8 KiB
Plaintext

# Quarantine Diary Day 5
## 19:06
I finished day 2 of my new job. I think I have some idea what's going on now.
Today's lunch was really simple. I made slightly fancy instant ramen. Here's
what I used:
* 2 packs instant ramen (Mala Ramen Spicy Beef flavor)
* a small amount of soy sauce
* 4.5-ish cups of water
* One carrot, cut into discs
* One celery stalk, cut into little U-shaped things
I stuck the ramen in the pot once the water started boiling. Once it cooked for 3 minutes I stuck in the flavor packets, vegetables and soy sauce. I let it settle for a few minutes and then served it. It turned out pretty good. When I do this in the future I would want to add the vegetables at the same time I add the noodles.
Tonight we had cambpells chicken noodle soup with parmesean cheese added to thicken it up. It was pretty good.
I'm considering making a pubnix for a community I'm a part of. It'd have a few simple services, including a gemini server. I'd also base it on NixOS so that it'd be easy to add more user accounts.
This is probably gonna end up being a bad idea, but meh yolo.
## 21:30
I'm playing with my gemini framework in Go for Rhea[1] some more and I managed to implement reverse proxying in an impressively small amount of code:
```go
package main
import (
"crypto/tls"
"fmt"
"io"
"math/rand"
"github.com/Xe/rhea/gemini"
)
type ReverseProxy struct {
To []string `json:"to"`
Domain string `json:"domain"`
}
func (rp ReverseProxy) HandleGemini(w gemini.ResponseWriter, r *gemini.Request) {
conn, err := tls.Dial("tcp", rp.To[rand.Intn(len(rp.To))], &tls.Config{InsecureSkipVerify: true})
if err != nil {
w.Status(gemini.StatusProxyError, err.Error())
return
}
defer conn.Close()
r.URL.Host = rp.Domain
fmt.Fprintf(conn, "%s\r\n", r.URL.String())
io.Copy(w, conn)
}
```
That's it. I love how minimal this is.