wget in 9 lines of Python For Hostile Environments

by Wojciech Adam Koszek   ⋅   Oct 4, 2015   ⋅   Menlo Park, CA

Bootstrapping 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:


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

Subscribe for updates

Once a month I send updates on the new content and hints for software engineers.

Liked it? Share it!

About the author: I'm Wojciech Adam Koszek. I like software, business and design. Poland native. In Bay Area since 2010.   More about me