- plan for code that is easy to delete/replace rather than code that is easy to extend or reuse. As needs change, you're more likely to change the assumptions about what the system should do than in how many ways it should do it. If the code needs extending, it's then easy to replace it with a bit that's easy to extend
- planning for code that is easy to throw away is the best way I've found to properly bake in abstraction and isolation. The question is always "if I take this shit out or change its implementation entirely, do I need to replace anything else?". If the answer is "yes", then you may be leaking into other components. Fix it. turns out when you have that, it's also suddenly easier to reuse code.
- write a prototype of whatever significant task you have to do, and consider it a draft. Use it to figure out requirements or to make your first mistakes in. Throw it away. Try again. As I gain more experience I find my prototypes smaller and individually more solid, but anything where I lack experience t
Dave Cottlehuber dch
Installing FreeBSD on a USB drive with ZFS using bsdinstall unattended
I typically wrap all these commands into a shell script that I can reuse, but here they are in steps.
Please read through all the instructions before actually performing the commands, just to avoid any surprises
- careful typing and copy/paste skills
- USB drive (8 GB+ ?) Make sure you don't need anything on that drive
|%%% This script converts an arbitrary binary file to an Erlang module with a|
|%%% single exported 'bin/0' function that returns the original binary.|
|%%% See the end of the file for how I figured out the correct terms.|
|main(["+debug_info" | Files]) ->|
|io:format("Embedding binaries with debug_info...\n"),|
|lists:foreach(fun(X) -> embed_file_in_beam(X, [debug_info]) end, Files);|
Add the following to
rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000 rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001
Add the following to
rdr-anchor "forwarding" load anchor "forwarding" from "/etc/pf.anchors/myname"