Setting up a PXE boot environment - Part 0

Upon learning that Raspberry Pi 3 and above has PXE boot capabilities, I pulled out my dust gathering, poor Raspberry Pi 3B... My motive is NOT to re-image that MicroSD card every time I want to tinker stuff, simply plug-in, power up, and viola, at least ideally.

Following the guidelines from various sources:

Note that in the second howto, replace KERNEL with DEFAULT, remove APPEND and put the content of those 2 line in to one:
KERNEL DEFAULT vmlinuz-4.4.0-139-generic APPEND root=/dev/nfs ....

My restrictions:
a. I already have a router, which is a nice Ubiquiti USG-PRO-4, and it has support of PXE.
b. I don't want to use 2 Raspberry Pis, i want to setup the DHCP and TFTP on the Ubuntu VM.

I have encountered a few roadblocks initially...

1. Setup a DHCP server without interfering with my router (Ubiquiti USG-Pro-4)
2. Serve different boot config to different hosts, by their MAC addresses
3. Serve different bootloader to different hosts, by their MAC addresses

Problem 1 was solved swiftly (seemingly, maybe it'll screw my network after previous DHCP lease expiring?) from installing the isc-dhcp-server in the second howto. but at least I set it up to only work for certain MAC addresses.

Problem 2 should be fixed by the config itself, at least from this document. I have not test this yet.

Problem 3 is the one that I am struggling now, as the howto is aimed at x86 hosts, which Raspberry Pi is not. I presume it should be easily configured if the isc-dhcp-server is the master dhcp server for my home network. Or I pull out another Raspberry Pi and strictly follow the first howto, or I figure out how to use the advance DHCP options in the router.

My thought from setting these things:

1. PXE boot would speed up spinning up new metal hosts, nowadays maybe they are used for setting up Kubernetes Nodes as we move to a docker world?

2. In real world applications, if you need to setup PXE, you probably should also have a dedicated DHCP/BOOTP server, so it is easier to configure it without messing with your existing networking.

3. Also, I believe it is unlikely that in a real world to have a PXE to support heterogeneous hardware architecture as it would complicate things and make sysadmin's life harder?

On a side note, that Ubuntu VM that runs in bhyve in my 3 years old FreeNAS, is starting to look like a single point of failure.



Building stuff

When I was 12, a relative lend me a set of PC, I vaguely remember it was a Pentium 133, has a turbo button in its case, and a fairly large, 400MB hard drive. He lend it to me so I can take it apart and put it back, see if everything is still working.

I always like taking thing apart and put it back together, sometimes the latter part wasn't smooth, but it is pure fun. For that Pentium 133, after I put it back and POST-ed, I called and ask some questions - it involved using mscdex to load CD-ROM device driver, so I could access it and install Windows.

22 years passed, I have become something that I couldn't imagine at 12. Working in the heart of Technology - Silicon Valley - as a software engineer, and recently, engineering manager. But the fundamentals have not changed for the past two decades. Building stuff. The difference is the target audience. When I build a PC, it is tailored for my preferences. when I build a new module on Yahoo News, it was used by tens of millions of people around the world. However, to my surprise, the joy of building something is just as pure, in both cases.

Whether it's re-compiling ffmpeg for the 1001st time, for it to use NVENC, or to devise yet another IE hack, or assembling the pipe with awk, tee, and find, or build another PC for yourself because yours is getting too old to do any HEVC codec - It is still the same pure joy.


Configure a http/2 Nginx using Let's Encrypt free SSL certificate

Once upon a time (circa. 2015), it would cost you for a few dozen bucks, to a few hundred dollars, per year, to get that shiny green little locky thingy appear on your URL bar in the browser. The cost would be justifiable for someone that runs a large business on the web, not so much for small companies or someone who occasionally runs a random httpd somewhere, like me. That was the dark time of the internet.

Setting up a LAMP alternative on Ubuntu 16.04 - Nginx / HHVM / MariaDB / Nodejs

When I started my freelancer career a decade ago, AppServ was my development environment. It is essentially an one-click setup WAMP. I run Wordpress, xtCommerce, MediaWiki, and lots of other popular packages. Time flies, people changed, things changed. And the time to upgrade my old server has come.


Setting up a FreeNAS from scratch / FreeNAS 開箱與組裝

更新: 似乎有許多外站連結到這篇文章,像是這篇, Google 翻譯出來慘不忍睹,所以我稍微翻譯了一下

Edit: So I got linked from a lot of places like this and Google Translate is horrible, so I decided to translate it myself.


There are two kinds of hard drive: broken ones; and will be broken ones. Two of my hard drives were categorized as the latter three months ago. There is nothing important on those, just inconvenient - thou shalt not be short on storage ever.




Setting up a PXE boot environment - Part 0

Upon learning that Raspberry Pi 3 and above has PXE boot capabilities, I pulled out my dust gathering, poor Raspberry Pi 3B... My motive is ...