F5 to Execute Your Program from Gedit – From Go to Python – Gedit External Tools

Gedit editor can run any command or script for you. Even though Gedit looks very simple, it’s easy to integrate Gedit to your own toolchains. Here is a simple script to execute your program by pressing F5. The script handles … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , | Leave a comment

Hello World Python3, Bash, C, C++, Go, Lua, Ruby, Java – Programming Languages on Ubuntu 18.04

Hello world! All programs start with a hello world. It tests that your environment is working, so that you can run your code. This is how you install and run the most important languages on Linux: Python 3, Bash, C, … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , | Leave a comment

CPU Usage Percent – Python One-Liner for Load Average per CPU

Processor usage is 88%. But how do I get a number like this? For gurus, this Python one-liner prints CPU usage $ python3 -c “print(‘{:.0f}%’.format( float(‘$(cat /proc/loadavg)’.split()[0]) / float(‘$(nproc)’)*100 ) )” 12% The rest of us can read on how … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

"IoT Rapid Prototyping Laboratory Setup" published in the International Journal of Engineering Education

Your first Internet of Things prototype in four days? Yes, even beginners successfully built IoT systems from their own ideas. International Journal of Engineering Education published an article I co-authored with Kimmo Karvinen. The article explains BotBook method in the … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , | Leave a comment

200 Lines of Code Saves 20 000 EUR

My student Joram Puumala wrote a program to automatically configure routers. The CEO of NDC Networks, Markus Ahonen: “NDC is expecting to deliver over 5000 routers during 2018, so the calculable savings in direct effort are significant. Especially as handling … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | Leave a comment

Automation of Router Configuration with Python & SSH

My student Joram is automating router configuration for NDC Networks. Joram configures Advantech B+B routers for NDC’s clients. The configuration is done using custom built Python Paramiko SSH script. The routers are configured for clients of NDC, an 8 person … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , | Leave a comment

Print Special Characters as Backslash Escapes – Python3 One-liner with Unicode Support

Let’s find that weird or invisible character that breaks your code $ echo “Hello in Finnish: Päivää”|python3 -c ‘import sys; s=sys.stdin.read(); print(s.encode(“unicode_escape”));’ b’Hello in Finnish: P\\xe4iv\\xe4\\xe4\\n’

Posted in Uncategorized | Tagged , , , , , , , , , , , , | Leave a comment

Using Web APIs with Python – Read Weather Forecast and Send to Your Own IoT Device

Do you want get weather forecast, BitCoin vs EUR valuation and know your power consumption? A lot of data is available on free APIs. Your program can just make a regular HTTP GET request – it’s just like loading a … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , | Leave a comment

Django on Apache – with Python 3 and Apache mod_wsgi on Ubuntu 16.04

Install Python 3 Django on Apache, similar to production installations. These terse notes show how to install Python Django, configure it to use templates and access PostgreSQL database. Finally, we create a simple app to read records from database and … Continue reading

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Write Python 3 Web Apps with Apache2 mod_wsgi – Install Ubuntu 16.04 xenial – Every Tiny Part Tested Separately

Python is a popular language for web applications, used by Youtube, DropBox, Facebook, Pintrest, Reddit, Instagram, Spotify, Washington Post and many others. Apache is the most popular web server in the world. Mod_wsgi is the recommended way to use Python … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments