惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - Franky
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
S
SegmentFault 最新的问题
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
B
Blog RSS Feed
Last Week in AI
Last Week in AI
Jina AI
Jina AI
博客园 - 司徒正美
The Cloudflare Blog
博客园_首页
博客园 - 聂微东
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏

Rc-2020 on Julia Evans

Day 57: Trying to set up GitHub Actions Day 56: A little WebAssembly Day 52: testing how many Firecracker VMs I can run Day 51: Fixed my logging and made a couple of puzzles Day 50: Building some tarballs for puzzles, and trying to make a kernel boot faster Day 49: making the VMs boot faster Day 48: Another Go program, and a little vim configuration Day 47: Using device mapper to manage Firecracker images Day 46: debugging an iptables problem Day 44: Building my VMs with Docker Day 43: Building VM images Day 42: Writing a Go program to manage Firecracker VMs Day 41: Trying to understand what a bridge is Day 40: screen flickering & a talk about containers Day 39: Customizing gotty's terminal Day 38: Modifying gotty to serve many different terminal applications at once Day 37: A new laptop and a little Vue Day 35: Launching my VMs more reliably Day 34: Learning about qemu Day 33: pairing is magic and beautiful git diffs Day 32: A Rails model that doesn't use the database with ActiveHash Day 24: a short talk about blogging myths, and a debugging tip Day 23: a little Rails testing Day 22: getting OAuth to work in Rails Day 21: wrangling systemd & setting up git deploys to a VM Day 19: Clustering faces (poorly) using an autoencoder Day 20: trying to figure out how Google Cloud IAM works Day 18: an answer to an autoencoder question Day 17: trying to wrap my head around autoencoders Day 13: BPTT, and debugging why a model isn't training is hard
Day 53: a little nginx, IPv6, and wireguard
Julia Evans · 2021-02-04 · via Rc-2020 on Julia Evans

I spent the day on Wednesday trying to run my puzzle thing on fly.io. I got part of the way there and learned a few things along the way:

miscellaneous IPv6 learning

I’d never really used IPv6 before, and I learned that IPv6 address are often in square brackets. For example to get rails to listen on IPv6 addresses, I had to run:

CMD ["rails", "server", "-b", "[::]"]

CMD ["rails", "server", "-b", "0.0.0.0"] will only listen on IPv4 addresses!

But you don’t always seem to need square brackets, for example I ssh’d to an IPv6 address like this:

ssh fdaa:0:bff:a7b:aa4:4c98:4224:2

I think the rule might be that you need to use square brackets if you’re going to include a port, like fade::5 port 53 is [fade::5]:53, because otherwise it would be ambiguous whether the port is part of the IP address or not.

how to make nginx re-resolve DNS every time

I learned that if you do

proxy_pass http://some-website.com:2000;

in an nginx configuration, nginx will resolve some-website.com to an IP address once when it boots, and then never update again. This was not good because the IP addresses of my backends were changing all the time, so I needed to figure out how to get nginx to re-resolve DNS.

Instead I needed to do something like this:

location @rails {
    resolver [fdaa::3];
    set $backend "http://rails.internal:8080";
    proxy_pass $backend;
}

It turns out that if you proxy_pass to something with a variable with it, nginx will resolve DNS. You also need to set a DNS server to use explicitly, nginx won’t use what’s in /etc/resolv.conf.

This actually still doesn’t work and I don’t know why, nginx. Maybe I’ll figure that out today.

setting up Wireguard seems easy

I set up Wireguard for the first time and it was very straightforward!

The other side I was connecting to was already set with Wireguard, so I just needed to set up my laptop using the configuration they said to use. I just needed to:

  1. do apt-get install wireguard
  2. Download the Wireguard configuration file the other side wanted me to use and put it in /etc/wireguard/fly.conf
  3. Run wg-quick up fly
  4. done!