wget in 9 lines of Python For Hostile Environments
by Wojciech Adam Koszek ⋅ Oct 4, 2015 ⋅ Menlo Park, CABootstrapping a system on a UNIX distribution where not all the tools are installed and those installed are out-of-date can be challenging. I've missed `wget` on Synology distro, and I show how you can work-around it.
HTTPS seems to be everywhere these days, including GitHub. It’s great to see the security of the Web improved, but sometimes this comes at a cost. Recently I wanted to actually fetch and test my own repository for bootstrapping my storage box from Synology:
https://github.com/wkoszek/synology
The DS214play model which I have comes with the wget
program without HTTPS, so doing a command line bootstrapping is difficult. This is one of this weird chicken-and-egg problems we sometimes experience, and to test my software releases published on GitHub, I wrote this simple thing, which lets me fetch the release and do further bootstrapping and testing:
Oh, and GitHub Gists are HTTPS too, so to actually get it, I had to transfer the content through PasteBin;
wget -O - 'http://pastebin.com/raw.php?i=PcbNtyh9' | tr 'r' ' ' > wget2
chmod 755 wget2
./wget2 https://github.com/wkoszek/synology/archive/0.0.4.zip
Why like that? Well in the middle of testing it, I learned that: Pastebin adds DOS new-line separators at the end snippets