Flash Sonoff S20 WiFi outlet with custom MQTT firmware

Sonoff S20 (specs) is a smart power outlet that is controllable with a WiFi connection. The device comes with a built-in firmware and an accompanied mobile app, but it is also possible to flash it with custom firmware. This allows to control the device with standard MQTT protocol making integration to DIY home automation or IoT cloud systems easier. This post provides a step-by-step guide how to flash the device and also examples how to interface with it using MQTT. Continue reading “Flash Sonoff S20 WiFi outlet with custom MQTT firmware”

Git: easily auto-squash changes to previous commit

After committing, I always like to go through the diff before pushing the changes upstream. Just to make sure that everything is as it should be. Well, quite often I still spot some typos, commented out code that I was supposed to remove or some other minor things that need to be fixed. So I ended up running the same exact commands time and time again. First new commit for the fixes and then interactive rebase to squash the changes to the previous commit. Perfect opportunity to make an alias to save those precious keystrokes. Continue reading “Git: easily auto-squash changes to previous commit”

Improved git CLI with git-completion and git-prompt

Git-completion and git-prompt are scripts that provide versatile completion support as well as visualization of current branch and status when working from the command line. Even though I work with git daily I hadn’t bumped into these scripts until quite recently. They have proven to be very useful, so I decided to share this tip. Continue reading “Improved git CLI with git-completion and git-prompt”