Select Page

Speaking more languages

Speaking more languages – 15 minutes Since we have refactored some code into a base class and have now implemented the SSH class, we’re ready to add a new protocol. Let’s get this bad boy talking over Telnet. It’s actually a relatively small implementation to...

Speaking telnet better

Speaking telnet better – 10 minutes In our last iteration of the program we introduced the TelnetHost class. However, the class didn’t really fully implement Telnet communications. It just executed a quick command to make sure that things work. Let’s make that...

Refactoring

Refactoring – 5 minutes When we consider what’s going on in these classes there are some subtle improvements we can make. For example, our TelnetHost and our SSHHost classes each have their own send_command_and_get_response() method. And they do the same thing....

Efficiency

Efficiency – 5 minutes There’s no need to recreate the database every time we run our program. So let’s check whether the database exists and only create a database if it doesn’t exists. We can start by renaming our setup_database() where it’s defined and where...