kvz.io

Bash

  • Published on
    Despite testcases, syntax errors still find their way into our commits. - Maybe it was a change in that bash script that wasn't covered by tests. Too bad our deploys relied on it. - Maybe it was just a textual change and we didn't think it was necessary to run the associated code before pushing this upstream. Too bad we missed that quote. Whatever the reason, it's almost 2014 and we are still committing broken code. This needs to change because in the - Best case: Travis or Jenkins prevent those errors from hitting production and it's frustrating to go back and revert/redo that stuff. A waste of your time and state of mind, as you already moved onto other things. - Worst case: your error goes unnoticed and hits production. Git offers commit hooks to prevent bad code from entering the repository, but you have to install them on a local per-project basis. Chances are you have been too busy/lazy and never took the time/effort to whip up a commit hook that could deal with all your projects and programming languages. That holds true for me, however I recently had some free time and decided to invest it in cooking up ochtra. One Commit Hook To Rule All.
  • Published on
    Here are some commands to download the most important pages of your site as plain text (determined by `MAX_DEPTH`), and save it into one big `DOMAIN.txt` file. This could come in handy when you want to have everything checked for grammar & spelling errors. After the spellcheck you'd still have to search through your codebase / database to find & fix the culprits, but this should already save you some time in discovery.
  • Published on
    Unfortunately the Linux DNS resolver has no direct support for detecting and doing failovers for DNS servers. It keeps feeding requests to your primary resolving nameserver, waits for a configured timeout, attempts again, and only then tries the second nameserver. This typically means nearly 30s delay for all request as long as your primary nameserver is unreachable. It doesn't learn to directly target your secondary nameserver so long as there is trouble. Even with the most optimal configuration, the delay will still be measured in seconds per request. For many requests, that's many more seconds. I wanted to solve this.