$ sudo sysctl net.inet.ip.portrange.reservedlow=10
net.inet.ip.portrange.reservedlow: 0 -> 10
$ nc -vvl 1
^C
$ sudo sysctl net.inet.ip.portrange.reservedlow=0
net.inet.ip.portrange.reservedlow: 10 -> 0
$ nc -vvl 1
nc: Permission denied
I'm just getting into electronics but have found the Pi indispensable for this purpose: without much effort, I now have Pi Zero running Homebridge with plugins and hardware to control an AC power outlet switch, ambient temperature and humidity sensors, three contact sensors, and another Raspberry Pi 3 also running Homebridge with a light sensor, fan speed controller (PWM) / tachometer, motion detector, and camera.
What's great about the Raspberry Pi is it is a complete computer system, so it can run the Homebridge stack (Node.js, mDNS, etc.) for bridging your custom home automation devices (via GPIO) to the rest of your IoT system (I wrote up my experiences here if anyone is interested: https://medium.com/@rxseger/home-automation-with-raspberry-p... Home automation with Raspberry Pi + Homebridge).
However, having a full OS is probably overkill for most home automation sensors/devices, I'm looking into getting an ESP8266 or other low-power wireless microcontroller next as I continue to build out my automation to other parts of the home. An ESP8266 may be better than e.g. a Pi Zero for many of these use cases, having built-in Wi-Fi support versus an add-on USB Wi-Fi adapter. I also want to put an MSP430 to work on home automation, but need to figure out the wireless story. Instead of a heavyweight Wi-Fi stack, probably a lightweight low-data rate protocol on an unlicensed sub-1 GHz or ISM band, bridging the slower RF connection to the rest of your Wi-Fi or Ethernet network (ala ZigBee/802.15.4 and the Philips Hue bridge).
The Wemos D1 Mini (~$5) looks really nice for an ESP8266 board. I went with a NodeMcu on Aliexpress (~$3), hopefully it works well once it arrives, but at these prices not much to lose, and you can buy many for multiple projects: a computer in every room?! Exciting times, more and more companies are developing expensive home automation products to build an ultimate "smart home", but with the explosion of inexpensive single-board computers/microcontrollers for electronics hobbyists there has never been a better time to get into DIY home automation.