CLI for the Moon
After trudging through the grossness of trying to add to $PS1 from a script, I got to thinking it would be fun to have the phase of the moon on my shell prompt.
After trudging through the grossness of trying to add to $PS1 from a script, I got to thinking it would be fun to have the phase of the moon on my shell prompt.
I wanted to add some information to the shell prompt from a script recently and learned some things about bash, PS1 and shell variables along the way. What is a shell prompt and why would I want to set it? The shell prompt is the chunk of text that comes before your cursor when you open a terminal. For instance, a bash prompt might look like this: bash-3.2$ echo "hi" hi bash-3....
An exchange I had a few months ago went something like this: Me: Weird, my requests aren’t getting through, but I can ping the server just fine. Coworker: I can’t telnet to the port… the firewall is probably blocking your traffic. <later> Me (to myself): 🤨 wtf does telnet do? telnet came up again as I was reading Compute Networking: A Top Down Approach. It demonstarted using telnet to interact with a mail server using SMTP....
TL;DR Here are things I found helpful the past few days: Set goals, set time limits, enforce with timers Outline, outline, outline Be genuine The Experiment Last Wednesday, I decided to try out a new blog format with shorter posts covering topics that I was learning about that day. My goal was to write a post a day for 3 days. I anticipated investing an hour a day into this....
The 3-way handshake. It’s inevitable in any TCP discussion that you mention the TCP connection establishment three-way handshake. After writing about QUIC and how it aims to have 0-RTT connection establishment cost, I started wondering why TCP needed that 1-RTT 3-way handshake in the first place.
QUIC (Quick UDP Internet Connections) is a new(ish) protocol for developing applications on the internet. It aims to provide TLS-like encryption without the overhead of TCP.
Motivation In this post, I’m going to go over two tools for inspecting the socket states (netstat and ss), and why to choose one over the other (spoiler: you can really choose either). This is not going to be a 12 ways to inspect socket states article, there are lots of those. What is a socket? A socket is a Linux file descriptor for communicating with the network. In Linux, they say everything is a file....
I’ve been collecting information for a “Practical Guide to Linux Networking” by reading material I can find. Two things I’ve been reading recently are: A Practical Guide to (Correctly) Troubleshooting with Traceroute a presentation by Richard A Steenbergen Compute Networking: A Top Down Approach a textbook by Kurose and Ross In the traceroute guide, Richard mentions that it’s useful to find the boundaries of your network and that it’s also useful to be able to translate DNS names to ISP’s....
I am going to try a new format where I write about something I learned. My goals with this format are: Increase the amount of writing I do Increase the frequency of writing Lower the barrier for making a new post Document things I’ve learned My rough goal is to spend: 20 minutes researching / outlining 20 minutes writing 20 minutes editting We’ll see how this time commitment works out, it may be a little extreme for daily writing....
Why write a DNS client When I started digging in to DNS, I thought it would be interesting to try implementing a very simple DNS client similar to dig, but using Rust. My goal was to better understand DNS at the protocol level. I wanted to know what bytes were being sent and received to drive the system. The final result is in this repo). In the rest of the post, I’ll detail what I found out along the way....