Hacker News new | ask | show | jobs
Docker container to tweet at your ISP when your speed drops below threshold
8 points by monoxane 3219 days ago
I got pretty fed up with my ISP giving me substandard speeds (usually 10 to 15mbps) than what I pay for (30mbps) so I build a docker container that runs a speed test and if its below the level you set it will tweet at your ISP with the speedtest results, go to sllep for 15 minutes and run another speedtest, if the speed is above your threshold it will simply sleep for 5 min and run again.

You can see it in action on my twitter: https://twitter.com/monoxane

And of course I believe in OSS so its all available on my github: https://github.com/monoxane/docker-speedtweet

7 comments

This is a pretty cool hack!

Next time, when you you are showing off a project you may want to consider doing a Show HN[1]

1.https://news.ycombinator.com/showhn.html

This is cool. I periodically have a related idea that coincides with my isp downtime. I once had 3 straight weeks of downtime.

It's an app to monitor a connection for downtime and give exact reports for when the connection is down. Then treat the data collection server as a quasi political group and use the data to push the FTC, ACCC, etc to force ISPs to give pro-rata refunds for these downtime and or substandard speed periods. Nothing would speed up a fix like lost $$.

Since you're using docker for educational purposes, just a tip. You have multiple `RUN` commands. Each command will create an individual docker layer, causing your image to take up unnecessary amounts of space.

Instead you should run all of the bootstrap (apt-get, etc) under a single run, using `&&` to chain commands.

Ah cool, I'll have to try that, thanks for the information.
I sometimes use this linter: https://github.com/lukasmartinelli/hadolint
Docker is a bit of an overkill for such a tiny app IMHO
Oh yea it entirely is but I wanted to experiment with docker as ive never used it before, you can just pull the python and use export to set the vars if you want.

Edit: Docker is also an easy way to run in the background.

A bit of an overkill?

According to the developer, this is a Python script. So, rather than running on any desktop OS with minimal resources, it requires Docker, which requires a Linux Kernel. So for the vast majority of desktop users, this will require a Virtual Machine.

To send a fucking tweet.

This is the perfect example of developers doing dumb things, "because devops".

I think packaging it up as a ready-to-use, cross-platform installable (which just happens to be in the docker container format) is better than expecting every desktop user to "install python3 python3-pip -y pip3 install pyspeedtest hurry.filesize tweepy". If the typical "desktop user" can't install one software with easily accessible installation instructions, is it reasonable to expect them to install 5 without?
I didn't say packaging is bad.

I said expecting desktop users to install docker to run a 35 line python script is fucking crazy.

You think someone who can't install python and 3 pip modules, is going to manage to install a Hypervisor, a Linux Guest, and Docker?

Maybe. We taught our support people how to install Docker via Docker Machine, and while that is resource-intensive and sometimes they come with questions, it did reduce the complexity of deploying new internal tools to them.
I've added instructions for pure python if you want it. I used docker because I've never used docker.
I've never used a concrete trowel to make waffle batter, doesn't mean I'm going to try it.
This comment made me laugh so hard I got some weird looks from the person in the cube next to me.

On a more serious note, if you had never used a concrete trowel before and you weren't totally sure what it was, using it to make waffle batter would give you a better understanding of what it was and what it is good for.

A bit of an overreaction don't you think? Especially after the OP explained that he is using docker for educational purposes and even included instructions for pure python. Seems unnecessary to continue ragging on him.
Using Docker to run a tool intended for home-use (i.e. not on a server) for 'educational purposes' is like learning to shave your bikini line by cutting the neighbourhood hedges.
Perfect example where Go would be a great fit.
It uses Python 3 and several third party PIP installs, so nice for Mac users and people who are careful about running random unsandboxed code off the net.

It runs things as root inside Docker though, so not that much isolation from untrusted code.

How does it know you are not filling up the pipe yourself?
I can only imagine the posts if people with NBN use this
Maybe ISPs would get around to fixing their network if hundreds or thousands of people had it running.
More likely they'll just update their ToS to prohibit running it.
Then I'll just modify it to directly input a support ticket into their system >:D
It's not quite that simple here in AU. But I hope this takes off!
Using fucking docker to run a python script that tweets about poor network performance is the epitome of technical irony.

Although, on the upside we've finally found something that can be referenced for X in the statement "well at least Electron apps aren't as bad as $X"

Its one hundred and ten percent overkill, like I've said, you can just run the python if you want and I used docker because I've never used docker and wanted too