I’m generally much more of a sysadmin than a programmer, but I’m working on scripting network deployments, and I wanted to get all the IANA port assignments into a config file that I could reference for NAT/Firewall config.
So I wrote a script in Ruby that takes the XML format of the IANA port assignments from their website and parses it into what is, for me at least, a more useful format (TOML).
The TOML config file ends up being kind of absurdly long, so if anyone has any other format suggestions, let me know. The little Ruby program could be easily adapted to spit the information out differently.
Also, any critiques of my programming would be very welcome. I mostly live in bash, so I’m out of my element.
https://gist.github.com/o0-o/e8ac5d2c374ba505734734b795a74ca4
https://gist.github.com/o0-o/981310698649c95bd366f806b2050e63