Rename WiFi Interface on Ubuntu 20.04

During an experiment, I need to use three WiFi interfaces on a Raspberry Pi running Ubuntu 20.04. In addition to Raspberry Pi's internal WiFi interface, I added two USB WiFi adapters. Three network interfaces showed up in the system (ip link command), and they are named wlan0, wlan1, and wlan2 by default.

I often need to capture packets with tcpdump, and I often have to be type these interface names manually. It isn't easy to remember the purpose of each network interface, so I wanted to rename the interfaces to reflect their role in my application. However, this isn't as easy as it sounds.

🚫 Netplan

Ubuntu 20.04 configures network interfaces using Netplan, so my first thought was: I can write a Netplan configuration that matches network interfaces with their MAC addresses, and assigns the desired name to each network interface.

The config file would look like this:

漫步在北京 (上) | Wandering in Beijing (1)

北京是中国的首都,我在2010、2011、2013年去过三次。 在2021年第一次“虚拟旅游”中,我来回顾一下我在北京看到的风景名胜。

Beijing is China's capital. I visited Beijing three times, in 2010, 2011, and 2013. I'd like to revisit my sightseeing trips to Beijing in first "virtual travel" of 2021.

运动员去过的地方 | Where the Athletes Have Been

2008年,北京举办了夏季奥林匹克运动会,其中主要的两个体育场馆“鸟巢”、“水立方”特别令人瞩目。 2010年8月7日,“大约”是奥运会开幕两周年,我来到北京奥林匹克公园参观鸟巢、水立方。

Beijing is the host city of 2008 Summer Olympics. The most notable place of 2008 Olympics was "Bird Nest" and "Water Cube". On August 7, 2010, approximately two years since the opening ceremony of 2008 Olympics, I came to Beijing Olympic Green to visit these two venues.

What is a "Face" in Named Data Networking?

Face is an overloaded term in Named Data Networking (NDN). Most developers have some feeling of what a face is, but often find it hard to explain. This article attempts to demystify the concept of face in NDN.

"Face" as Defined in Publications

The original NDN paper, Networking Named Content, introduces the term face in a footnote:

We use the term face rather than interface because packets are not only forwarded over hardware network interfaces but also exchanged directly with application processes within a machine.

NFD, the original NDN forwarder software, explains in the NFD Developer Guide:

The Reality of NDN Video Streaming

As of 2019, video accounts for over 60% of downstream traffic on the Internet. It is believed that video streaming could benefit from the in-network caching feature of Named Data Networking (NDN), which would reduce the total traffic volume and bring cost savings for Internet service providers and content publishers. Far Cry: Will CDNs Hear NDN's Call?, a paper published at ACM-ICN 2020 conference, is the latest attempt on NDN video streaming.

How iViSA Works

In Far Cry, the authors implemented iViSA, a browser-based video streaming application that runs on the global NDN testbed, and then performed some comparison study between this application and similar HTTP video streaming application deployed on commercial CDN services.

It's said that if you want reproducible science, the software needs to be open source. The authors released most of their source code, and we can get a peek into how iViSA actually works.

The backend server repository contains:

NFD nightly went APT

NOTICE Instructions in this article are outdated. Please see latest information in NFD nightly usage.

Last year, I started building NFD nightly packages in GitHub Actions. So far, installation is a manual procedure: the user must manually download the ZIP files from nfd-nightly.ndn.today, decompress them, and figure out the dependency among various .deb packages. Starting today, I'm publishing NFD nightly packages in an APT repository, and you can install them with apt-get command.

Add the NFD nightly APT repository

Add the repository with the command that matches your platform:

# Ubuntu 18.04 (bionic), amd64 (laptops and servers)
echo "deb [trusted=yes] https://nfd-nightly-apt.ndn.today/ubuntu bionic main" \
  | sudo tee /etc/apt/sources.list.d/nfd-nightly.list

# Ubuntu 20.04 (focal), amd64 (laptops and servers)
echo "deb [trusted=yes] https://nfd-nightly-apt.ndn.today/ubuntu focal main" \
  | sudo tee /etc/apt/sources.list.d/nfd-nightly.list

# Debian 10 (buster), amd64 (laptops and servers)
echo "deb [trusted=yes] https://nfd-nightly-apt.ndn.today/debian buster main" \
  | sudo tee /etc/apt/sources.list.d/nfd-nightly.list

# Debian 10 (buster), armv7 (Raspberry Pi 3 or 4)
echo "deb [trusted=yes] https://nfd-nightly-apt.ndn.today/debian buster main" \
  | sudo tee /etc/apt/sources.list.d/nfd-nightly.list

# Debian 10 (buster), armv6 (Raspberry Pi Zero W)
echo "deb [trusted=yes] https://nfd-nightly-apt.ndn.today/raspberrypi buster main" \
  | sudo tee /etc/apt/sources.list.d/nfd-nightly.list

请问大学生买平板电脑的意义大吗?

我从上海交通大学本科、到亚利桑那大学研究生,都是坚持纸质笔记,而不是用电脑作笔记。 我的笔记只在课堂当场书写、课后做作业时完善,之后就记住了。 考试前夕是不看的。

本科阶段(2005-2009年),我买不起平板电脑,也从未见过同学使用。 每天晚上,我捧着笔记本电脑,到D楼空调教室使用无线网络。

研究生阶段(2011-2017年),我先后用过4台平板电脑:

  • 昂达,Android,7in
  • 联想,Android,10in
  • 苹果,iPad Mini 2,8in
  • RCA,Windows 10,10in

平板电脑的主要用途有:

The Worst Server-Side Rendering Pipeline

My server side rendering pipeline: I use nginx to invoke PHP to invoke Node.js to invoke Puppeteer to invoke Chromium. Client side receives a screenshot of the webpage. They can never steal my super secret HTML and JavaScript code again.

How to have hyperlinks?

If the whole webpage is a screenshot picture, how to have hyperlinks you ask?

<A HREF=browse.php>
  <IMG SRC=page.bmp WIDTH=640 HEIGHT=480 ISMAP>
</A>

The ISMAP attribute creates a server-side image map. You click anywhere and the server receives coordinates, like this:

yoursunny.com is Served by Caddy

The last rebuild of yoursunny.com was in Spring 2017, when I moved the whole website into git repositories. It's been more than 3 years, and I think I should share an update on a few changes in the stack that serves this website.

History of HTTP Servers Behind yoursunny.com

Since 2011, my HTTP server of choice was lighttpd. Then, I have PHP running in FastCGI mode to serve the dynamic pages. It works, but I don't really like the lighttpd's script-like configuration structure. Moreover, there were suspected memory leaks in my setup, so that I had to use a cron job to restart the HTTP server weekly.

I keep hearing good words about nginx, as well as the benefits of running PHP in FPM mode. In 2013, I made the switch to nginx and PHP-FPM. The declarative configuration of nginx is easy to understand and makes sense to me.

HTTPS came to yoursunny.com at the end of 2015. Like many other websites, the TLS certificates were issued by Let's Encrypt, and requested through certbot command line client. One problem is that, my VPS at the time had only 64MB memory, and certbot would not work in such a small amount of memory. I had to request the TLS certificate on my laptop, and then upload it to the VPS.

Is ESP32 Big Endian or Little Endian?

I'm programming network protocols on the Espressif ESP32 microcontroller, and I want to know: is ESP32 big endian or little endian? Unfortunately, search results have only videos and forum posts and PDF; the answer, if present, is buried deep in pages and pages of discussions and irrelevant content. So I quickly wrote a little program to determine the endianness of ESP32.

The Straight Answer: ESP32 is Little Endian

I have determined that: the Tensilica Xtensa LX6 microprocessor in ESP32 is little endian.

ESP32 is little endian. Many other processors are little endian, too:

  • Intel and AMD x86 and x86_64 processors are little endian.
  • Raspberry Pi and Beaglebone Black are little endian, although the underlying ARM processor may operate as big endian.
  • ESP8266 is little endian. It has Tensilica Xtensa L106 microprocessor, similar to the ESP32
  • nRF52 series is little endian. This includes the Adafruit Bluefruit nRF52832.

Self-Hosted NDNts Nightly Build

NDNts nightly build is a set of NPM-compatible tarballs compiled automatically from the development branch of NDNts, Named Data Networking (NDN) libraries for the modern web, distributed on https://ndnts-nightly.ndn.today website. Users can install NDNts nightly build following these instructions.

However, this website only stores the latest version of NDNts packages. This has been causing installation conflicts when NPM tries to look for previous versions. Moreover, as I have declared, I don't care much about backwards compatibility. With NPM, all published versions are stored indefinitely, so you can continue using an older version without being affected by breaking changes. On the other hand, once a new nightly build is uploaded, the previous version is overwritten and no longer available for downloads. You are then forced to cope with the breaking changes I introduce from time to time, possibly at higher frequency than you would like to.

Today, I'm introducing two methods for self-hosting NDNts nightly build. Both methods allow you to build a specific version of NDNts codebase from a checkout of the NDNts monorepo, and generate a set of tarballs that you can host locally on a server under your control. Afterwards, you can install NDNts packages from this server, without relying on my website and without being affected by my breaking changes.

Self-Hosted NDNts on an HTTP Server

This section was latest updated on 2024-03-06 to reflect latest changes.