Author: mattanja

  • Calculating total value from InfluxDB streams

    Calculating total value from InfluxDB streams

    The energy data in my home is collected using Shelly devices. For the total power consumed in the house, I’m using the Shelly 3EM 3-Phase Energy Meter. Data points are pushed to a Mosquitto MQTT server and imported into InfluxDB using Telegraf. Finally, the data is displayed in a Grafana dashboard. The entire setup will…

  • Setting up a WIFI hotspot in Windows 7,8,10

    netsh wlan set hostednetwork mode=allow ssid=yourssid key=YourWifiSecret netsh wlan start hostednetwork

  • Redirecting Apache HTTP to HTTPS

    Now that everyone can enjoy and use free SSL certificates from Let’s Encrypt, let’s all encrypt! To forward HTTP requests to secure HTTPS, there are multiple options. If you’re using some kind of panel to edit Apache configuration (like ISPConfig) that does not allow to edit the virtual host for HTTP separate from the virtual…

  • Restore trashed mails from dovecot maildir

    To remove the “T”rashed flag from mails in a maildir, the files need to be renamed. I have also created a script which can be executed in the Maildir, searching for files and renaming the files: https://gist.github.com/mattanja/1367bc04750dd105317f

  • AngularJS ng-options syntax

    I keep forgetting the correct syntax for ng-options in angular dropdowns. The documentation can be found here: https://docs.angularjs.org/api/ng/directive/ngOptions The syntax used in the documentation is a bit confusing: A concrete example for the syntax would look like this: I hope this helps myself and maybe someone else as well…

  • Running ASP.NET vnext on Ubuntu Linux

    After reading a lot about ASP.NET vNext I finally found an hour to give it a try. I only got as far as running the first sample webs, but it’s very nice to see it work. There where some steps I had to take to get it up and running: https://github.com/aspnet/home is a good starting…

  • Sublime Text customization settings

    Here’s a backup of my custom settings for my favorite text-editor Sublime. Default (Windows).sublime-keymap [ // Add 7 to toggle_comment command for German keyboard handling { “keys”: [“ctrl+shift+7”], “command”: “toggle_comment”, “args”: { “block”: true } }, ] Preferences.sublime-settings { “ignored_packages”: [ “Vintage”, ], “word_wrap”: “false” }

  • automysqlbackup – Backup databases on server

    The easiest way that I have found for an advanced backup of all databases on a web hosting server was using the automysqlbackup tool. By default the tool creates backups with automatic daily, weekly and monthly rotation. The backup files are being compressed and will be placed into your configured backup folder. Email notifications and a…

  • Must-have software tools (2014!)

    I’m starting to build my list of software that is the first to install on a new system: Multi-platform: Sublime text – currently the best text editor around (multi selection editing, yay!) Synergy – using one mouse/keyboard for multiple systems/screens (Windows notebook next to Linux desktop) Git (git package, msysGit, Posh-Git, Github for Windows) Windows: Cmder – finally a really…

  • Don’t use magic numbers

    Quick note to start a new category on this blog: Good practices/Training Everyone who doesn’t know what a “Magic number” in coding is, please quickly read this: http://stackoverflow.com/questions/47882/what-is-a-magic-number-and-why-is-it-bad In some rare cases it might be allowed to use magic numbers (like 0/1 or in a circles calculation you may use 90/180/270/360 if it is clear…