Using telegram bots for DevOps notification and script updates
Telegram, one of the largest instant messaging applications, introduces bot support some time ago. Their main purpose, it seems, is to have a sort of interactive communications with users. However, you can use the API for much more prosaic, but constructive purposes.
For example, bots are perfect for sending notifications for your DevOps/admin activities, or for your automation scripts. Of course, you can utilize email for the same purpose, but there are a few pros to using bots, and we will look at them in a minute. First, let’s see how one can use a bot for non-interactive notifications.
Lessons learned from web development with Django
Django is a web development framework for Python. I used it for a few web sites, including a relatively large one. I must say, my overall impression is rather ambivalent.
First of all, Django is definitely excels when you need stuff done, quickly. A lot of stuff simply works out of the box or with minimum effort, including DB access and ORM, caching, templating and so on. And there are so many extensions available! Probably only some PHP frameworks have more plugins and extensions, but who wants to write in PHP for a living?
My first open source python module - Drupal data download
2020 just arrived and it’s time for something new. I have been using Drupal since 2006, so we have been together for almost 14 years! It’s an impressive journey and I am look back with satisfaction - Drupal is simple to use if it fits the requirements exactly, and I stoically avoided touching any of its smelly PHP bowls. However, with the arrival of Drupal 8 I realised, that I couldn’t migrate to it even my simple and straightforward sites. Therefore, I decided to slowly migrate to Django + Wagtail. This will require some coding in Python on my side, but I don’t mind that. I will be able to control the look and feel of my content much better with less effort, and I will hopefully enjoy adding an occasional extension here and there.
Bokeh graphs and pandas dataframe groupby object
Bokeh is a nice library, helping python web developers to visualise your data in the browser. It is on good terms with pandas, the statistical and data manipulation package beloved by data scientists. It can source points from a dataframe object directly. Unfortunately, it can’t get a result of a group by object directly to display it as multiple lines, yet. But no worries, with just a few lines of code you can convince it to draw you a nice multiline graph. Take a look at the code snippet below:
Generating text (ASCII) tables with python
Sometimes you might need to generate tables in good old plain text. Doing so by hand might be very tedious and error prone. Better let the computer to do the job! Luckily, off the self components exist to do just that. Specifically, Python can be used to perform this task. Here’s a link to the relevant python recipe . Alternatively, there is a ready made module TextTable , which is also quite convenient.
YamlDotNet and anchor references
Yaml is a convenient format for config storing . There are bindings in most of the popular programming languages, including .NET. The latter is well served by the library called YamlDotNet.
Yaml has a nice feature calls anchors which allows you to reuse portions of config. It works like this:
foo: &anchor
K1: "One"
K2: "Two"
bar:
<<: *anchor
K2: "I Changed"
K3: "Three"
Essentially bar will start with everything foo has and then either add or override these values as needed. YamlDotNet supports this feature. Unfortunately, it’s documentation isn’t very clear on the subject. In particular, it doesn’t mention that the feature will not work with the vanilla deserializer. Luckily, all you have to do is to use the bundled MergingParser like this:
Visual Studio 2017 and CMake
Microsoft is continuously improving its record with the open source community. First dumping massive chunks of .NET into github, then actually making very dedicated effort to clean it up and make it portable to Linux and Mac. Now comes another step, albeit smaller, in the same direction. Visual Studio 2017 will support CMake projects in a native way, without the need to generate .proj and .sln files first. This is great news, because it saves some effort for those working on cross-platform C++ products.
Cryptocurrency algo trading
The Internet is abuzz with the news about various crypto-currencies. From the old favourite BitCoin to the bold newcomers, such as Etherium and Ripple (not that new actually), lots of frantic trading and even more frenzied discussion is taking place. The new currencies are viewed as the end of era of the old money dominance over the finances of the world.
In my view we are still very far from that. BitCoin suffers from various limitations, well publicised. Other crypto-currencies lack the aura of the first new kid on the block - too much choice, no clear winner. All of them have no recognition by governments or major financial institutions.
Toptal review: developer's perspective
TL;DR; It has been about a year since I joined Toptal as a developer. And overall the experience is rather disappointing so far. For a developer of my level and background I think it’s more or less a waste of time. Let me explain why.
The interview process
I seem to encounter many references to the interview process in Toptal. Some say it’s too hard, but most professionals seem to agree it’s not too difficult. The company itself claims it achieves a high level of success by filtering out the bad developers and letting through only the best 3%. I don’t know whether that’s the case - the process is no more arduous then in many other places that I applied for in the past. Technically - very doable for any decent developer. Maybe they indeed let through only 3% of the applicants - but who knows what sort of people they have applying for them, and whether the figures are even up to date?
Zap all annoyances: images, colours, plugins, iframes etc
Many web sites’ developers seem to think “the more the better” and clutter their pages with endless images, flashy colours, countless videos and flash animations. This is hugely distracting. For years I have been using a couple of buttons to zap these annoyances from this helpful page . And just now I realised I can combine a few of my favourite ones into one button. It removes images, hides iframes and plugins and makes the colour scheme black and white. Here is the relevant JavaScript: