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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
Jina AI
Jina AI
B
Blog
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
腾讯CDC
C
Check Point Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
罗磊的独立博客
B
Blog RSS Feed
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
M
MIT News - Artificial intelligence
GbyAI
GbyAI

Rc-2020 on Julia Evans

Day 57: Trying to set up GitHub Actions Day 56: A little WebAssembly Day 53: a little nginx, IPv6, and wireguard Day 52: testing how many Firecracker VMs I can run 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 51: Fixed my logging and made a couple of puzzles
Julia Evans · 2021-02-02 · via Rc-2020 on Julia Evans

Here are a couple of things I did yesterday!

some logging improvements

I was having a problem on my server where I was logging in 3 different ways:

  1. Rails was logging to a file called production.log
  2. my Go proxy was logging to Docker Compose’s default log thing (whatever that is)
  3. my Firecracker manager service was logging to journald

This was very annoying because I was constantly confused about where to look for logs and it was impossible to see everything in one place.

I set RAILS_LOG_TO_STDOUT=1 and told Docker Compose to log to journald instead like this:

  rails:
    environment:
      - RAILS_LOG_TO_STDOUT=1 
    logging:
      driver: "journald"
      options:
        tag: "rails"
    build: 
        dockerfile: docker/rails/Dockerfile
        context: .

Once I had the logs in journald, it took me a little while to figure out how to ask journalctl to actually show me the logs for those services and it was pretty unwieldy, so I added this little function to my .bashrc to help me out.

function logs {
    journalctl -b SYSLOG_IDENTIFIER=$1 | less +G
}

some strace puzzles

I wrote a couple of starter puzzles about strace. Here’s the description for the one called “the case of the misconfigured logger”

There’s a program in your home directory called run-me. For some reason, it’s been misconfigured so that it’s writing its logs to /dev/null instead of to a file. But you need to know what it’s writing!

Use strace to find out what it’s writing.

and one called “the case of the mystery log file”

There’s a program in your home directory called run-me. It’s logging its output to a log file, but you can’t find the name of the log file ANYWHERE in its documentation!

Use strace to find out the name of the log file.

These aren’t particularly good yet, probably because I spent maybe 5 minutes writing them. Lots of work to do on this front, but I’ll probably do most of it after RC is over.