Nicolas Mesa

Dad, husband, geek

Booting Your Own Kernel on Raspberry Pi via Uart

For the last few weeks, I’ve been reading a great book about building your own operating system for a Raspberry Pi from scratch. It has been a great experience, and I’ve learned a lot. One thing I didn’t like was my development workflow, which looked like this: Make a code change. Build the change. Unplug the Raspberry Pi. Remove the SD card. Plug the SD card to my laptop. Read more →

SaaS Like Isolation in Django Rest Framework

Hi there! In this post, we talk about how to add SaaS-like isolation to a Django Rest Framework service without bringing in third-party libraries. First, let’s start with why? I wanted to learn how to use Django Rest Framework by building a small SaaS service. I started googling to see if there were any resources available. Most of them suggested to use a third-party library such as Django Organizations, Django tenant schemas or use DB namespaces, all of which are only compatible with Postgres. Read more →

How to Access Logged Objects in the Javascript Console

In this short post, we go through the process of making a console.logged Object available in Chrome’s javascript console. TLDR Right-click the Object you want to inspect and click Store as global variable. This creates a variable with name temp<n> where <n> is a number (starts from 1). Use the variable to access the Object. Explanation The Hack Version Sometimes when I’m debugging, I need to access an Object and its methods from the Javascript console. Read more →

How Does Traceroute Work

In this post, we take a look at how the traceroute command works. traceroute is a utility command that prints the route (or hops) that a packet takes to reach another host. We start with an example of traceroute. Then we go through what happened behind the scenes. Finally, we run the traceroute command one more time while sniffing the traffic with tcpdump. Traceroute example Let’s look at an example: Read more →

Serve Your Current Directory With Python and HTTP

This is going to be a short post showing how to run an HTTP server to serve your current working directory. TLDR For Python 3 run: python3 -m http.server For Python 2 run: python -m SimpleHTTPServer .bashrc alias: alias serve="python3 -m http.server" Explanation Sometimes at work, I’ve had the need to spin up a quick HTTP server to serve my current working directory. I usually need this for two use cases: Read more →

Container Creation Using Namespaces and Bash

A few weeks ago, I saw a great video explaining how Docker works under the hood (see video below). The video ends with a demo where Jérôme Petazzoni creates a container using nothing but bash. I found many of the commands that he used pretty cryptic, so I decided to explain what he did and the purpose of each command. Video (The demo starts around minute 41) Read more →

Var vs Let vs Const

Hi there! In this post, we’re going to talk about javascript. We’ll start by looking at some examples of var, let and const variable declarations and their properties. Then we’re going to go through my recommendations of when to use each one. var var is the original way to do variable declaration in javascript. Here’s an example of how you can declare a variable using var: var myVariable = 10; var is function-scoped Variables defined using var are function scoped. Read more →

What Happens When You Type a Url in Your Browser and Press Enter

Disclaimer: Hello! This is my first blog post! I’m super excited to share it with the world but should also warn you that it’s a bit long and repetitive. Hopefully, I’ll become a better writer as I blog more. I hope you enjoy it :) Introduction I’ve heard this question many times during my career and want to try to answer it. I’m going to dive deep into the networking part of the question since this is the part that I find the most interesting. Read more →