Morphex's blogologue (Life, technology, music, politics, business, mental health and more)

This is the blog of Morten W. Petersen, aka. morphex in various places. I blog about my life, and what I find interesting and/or important. This is a personal blog without any editor or a lot of oversight so treat it as such. :)

My email is morphex@gmail.com.

I am leavingnorway.info.

An OGG/Vorbis player, implemented in Javascript.

My Kiva bragging page
My shared (open source) code on GitHub

Morphex's Blogodex

News
Me on Instagram
Slashdot

Zope hosting by Nidelven IT

Morten Petersen on Linkedin

Morten Petersen on Facebook

Morten Petersen on SoundCloud

Morten Petersen on MixCloud

Blogologue on Twitter



Older entries



Atom - Subscribe - Categories

Facebook icon Share on Facebook Google+ icon Share on Google+ Twitter icon Share on Twitter LinkedIn icon Share on LinkedIn

Python quick-fix of broken router

I have a router which seems to "take the day off" every once in a while, and this started after I filled up all 4 Ethernet ports.

Rebooting, the only fix I've found so far, fixes the problem, so that all 4 Ethernet ports start working again.

Rebooting the router gets boring and annoying after a while, so I decided to write a script to automatically reboot the router every hour.

That script is here:

https://github.com/morphex/netgear_reboot/

Didn't need to write any Python 2 or 3 specific hacks to make it work on either Python 2 or 3 either.

I was reading a Python 2-3 cheat sheet here:

http://python-future.org/compatible_idioms.html

And after getting used to using for example print(1), I like the idea of making things simpler and more consistent, an easier to learn syntax.

An added benefit is that I, and other who use two or more keyboard layouts, don't have to remember where the backticks are located on no_nb and en_us keyboard layouts.

[Permalink] [By morphex] [Python and web (Atom feed)] [15 Dec 15:51 Europe/Oslo]