Hello, world!
Hello, world! First blog post. Ivan Bessarabov ivan@bessarabov.ru 12 march 2013
Ivan Bessarabov blog
Hello, world! First blog post. Ivan Bessarabov ivan@bessarabov.ru 12 march 2013
Perl versions available in Travis CI Travis CI — is a marvelous system to run test in open source projects. Travis CI can work with programming language Perl, unfortunately in Travis CI documentation there is no complete list of Perl versions Travis CI can work with. I made several experiments to find out what Perl versions are supported in Travis CI. Here is .travis.yml with the list of all…
Perl versions in Mac OS X Mac OS 10.10 — Yosemite (releases 2014-10-16) — perl 5.18.2 Mac OS 10.11 — El Capitan (releases 2015-09-30) — perl 5.18.2 macOS 10.12 — Sierra (released 2016-09-20) — perl 5.18.2 Ivan Bessarabov ivan@bessarabov.ru 28 may 2017
100 most popular Perl libraries In the world of Perl programming language there is a great thing called CPAN. CPAN — is a storage for Perl libraries. Everybody can write Perl library, upload it to CPAN and then others would be able to take that library and to use it in their project. There are several different web interfaces. All of them are working with the same CPAN storage, but shows its data…
What is the difference between ADD and COPY in Dockerfile? In Dockerfile instructions ADD and COPY can be used to add files to docker image. But what is the difference between these instructions? Short answer: use COPY if you uncertain what to use. ADD and COPY works in a very similar way, but there are 2 differences. ADD can download files Here is a two-line Dockerfile: FROM ubuntu:14.04.5 ADD…
JSON pretty print with jq There is a very popular tool to work with json in command line — jq With jq it is very easy to convert messy json to json that is easy to read. Here is an example: $ echo '{"a":"a","d":{"e":88},"b":[],"c":false}' | jq . { "a": "a", "d": { "e": 88 }, "b": [], "c": false } It is not visible in the text, but jq uses color to output json. Here is a screenshot: By default jq…
Python oneliner to start webserver There is a great thing in the Python programming language — the module that creates web server that serves files from the current directory. To start it you need to run: python -mSimpleHTTPServer 3000 After running this command there will be web server running on http://127.0.0.1:3000 and it will be serving files from the directory where you have run it. The…
How to find out what version of Perl library is installed There are a lot of ways to find out what version of Perl library is installed. $VERSION variable The most common way is to output value of the $VERSION variable. Here is an example: $ perl -MMojolicious -E 'say $Mojolicious::VERSION' 7.01 Here we are using Perl oneliner. With the option -M we are importing Perl library Mojolicious, and then…
First version of PHP was not written in Perl There is an opinion that several first versions of PHP programming language were written in Perl language. Sometimes even some clever people state it as a fact. I've heard this statement several times and I was sure that it is true. Well, it looks like it can be true. I'm writing a lot of Perl, so I was pleased to think that Perl was used to create PHP.…
How to output all the lines except the last one in console Here is the task. There is some text in console. It can be the content of a file or a result of some sommand. Beforehand it is not known how many lines there are in that text. The task is to output all the lines, but the last one. The most simple way to do it in Linux is to use head command and to pass it negative number as a value for the…
YouTube and Instagram links from The Grand Tour season 3 episode 10 I've just watched the 10th episode of the third season of The Grand Tour. In this episode Richard, James and Jeremy were playing with cars that were designed for millennials. There was a contest in the show who get more likes on Instagram for the photo of the car and who get more views on YouTube. After watching the episode I…
At what time of day do famous programmers work? I was curious when the famous programmers do their work. And it is quite easy to find. The result of programmers work is a code. Code is stored in version control systems (VCS). When you put code in VCS the time is record. One of the most popular version control system is git. When you put code in it you create the thing called "commit". Here is an…
At what time of day do famous programmers work? Part 2. Workweek vs Weekend. Some time ago I've published a blog post At what time of day do famous programmers work? . I've parsed serveral git repositors, filtered out the commits by one person and created graphs — the hour of day and how many commits were done in that hour by that person (and the results are pretty interesting). Chris Lattner was…
Author and Committer in Git One of the most popular Version Control System is git. Git is created by Linus Torvalds as a tool to work with linux kernel source code. The most important thing in git is a thing called "commit". Here is an example. I create a new directory, make it a git working copy, create empty README.md file and create a commit: $ mkdir repo/; cd repo/; git init; touch README.md;…
How to clone git repo without using "git clone" The most common way to clone git repository is to use "git clone REPO_URL". git clone https://github.com/bessarabov/Moment.git (the repo specified here does not matter, this text is not about this repo, it is about git itself). But it also possible to clone a repo without running "git clone". So, how can it be done? Git has a great idea. Git is a…
Command line tool "date" On macOS and Linux there a very useful command line tool "date". It is there out-of-the-box. You don't need to install anything in addition to access it. If you run "date" command without parameters it will output date and time in the pretty common linux format: $ date Tue Sep 24 13:49:09 MSK 2019 But it is possible to customize output. Here is some examples. Output…
How to make a cheap WiFi Temperature/humidity sensor What it is all about? Here is a small story how I have created a simple WiFi sensor that records temperature and humidity. You plug it into the wall power socket, it connects to your WiFi network and twice a minute sends data to the server. If you make it yourself then the price of the device is less than 10 USD. (but you also need a USB cable…
How to clone git repo to the current directory The most common way to clone git repository is to enter in the terminal command that looks like something like this: git clone https://github.com/bessarabov/my_project.git This command will create the directory "my_project" in the current directory and it will clone repo to that directory. Here is an example: $ pwd /Users/bessarabov $ git clone…
Cybertruck preorders VS Ford F-Series sales On 21 November 2019 Elon Musk has presented long anticipated Tesla Truck. It is called Cybertruck. And it is looks like it is from Sci Fi movie. You can't buy the this car now, but you can preorder . The starting price for the car is $39,900 but when you preorder you don't have to pay the full sum of money. You only need to pay $100. And it is fully…
Using Python datetime Here is the simplest possible example of Python datetime usage: from datetime import datetime dt = datetime.now() print(dt) It will output something like: 2019-12-17 11:16:23.609382 Common incorrect usage There is one common mistake that is done with datetime. Here is an example of such error code: import datetime dt = datetime.now() print(dt) If you run this code it will…
Wire colors to use when flashing ESPHome I have recently flashed my first device with ESPHome. It was Sonoff Basic. When you know what to do the process of flashing is simple: Remove cover from the device Find the places where to connect wires Solder wires to that places Connect wires with the flasher device Upload the new firmware to the device Each part of this process can be described with a…
How to find out DCHP lease time on macOS When my macbook connects to WiFi network it gets its ip address via DCHP. It is fairly easy to find out the basic information about the connection, but today I had to find out DHCP lease time (the time when the network settings expire and the computer must update its settings). The basic info Go to System Preferences -> Network -> Advanced and there you can…
Analysing James Bond movies data. What actor is the best James Bond? In April 2020 the new movie about James Bond is released. It is going to be 25th movie about agent 007 in the official movie series. There are, at least, two more movies about James Bond that are not in the official series: "Casino Royale" (released in 1967) Woody Allen plays in this movie "Never Say Never Again" (1983) Bond is…
Adding Venta LW25 humidifier to Home Assistant with smart plug TP-Link HS110 Some time ago I've installed Home Assistant. I continue to play with this awesome thing. For a couple of year I own a simple humidifier Venta LW25. It is very simple device, no WiFi, no ZibBee. Venta LW25 has only two buttons: on/off and the button to switch mode. There are 3 modes available: low, medium, high. And that's…
Home Assistant custom card "animated-consumption-card" The Tesla company is not only about cars. The other product that this company is selling is a huge battery Tesla Powerwall. This devices is created to work with solar panels. The house is getting electricity from the grid and from the solar panels on the roof. If the house is consuming less power than the solar panels create, then the excess…
Site mdi.bessarabov.com I have released a new project. Site https://mdi.bessarabov.com/ . This is a site with Material Design Icons gallery. And there is also an icon search. What is this site about I really like the software Home Assistant. It is used to create smart home. I can press a button on my phone and turn the light on. From my phone I can start robot vacuum cleaner, or switch off the…
How to create zigbee map in zigbee2mqtt with Home Assistant Sometimes it is useful to view the information about zigbee network as a picture with devices. It is called zigbee map. There are several way how to create zigbee map with Home Assistant and zigbee2mqtt. You can install some additional soft. I know about several projects that can create zigbee maps:…
Home Assistant releases Open source system for creating smart home Home Assistant is moving very fast. New versions are releases very often (Frankly speaking, I'm a bit tired of constantly upgrading) I have decided to expect the history of releases. I have taken Home Assistant source code and I have created a small script. The script gets all the tags and the information about the date and time of…