Yandex Domain API (api v2) and free DDNS client written in Python.

Hi guys,
I would like to share with those of you who are using yandex domain services- free ddns client which can easily find your external ip and update your “A” record.
This client required requests module to be installed and python3. This is command line app, so you need to provide some input such as domain and record you want to add, token one of the parameter which is used as authentication (you have to get it from yandex).
Client behavior is simple, it will check if record exist with same ip that you have had then this app exits and writes output to the console, if ip has been changed client updates record, in case record doesn’t exist client creates it.
Lets save some money and won’t buy static ip from our lovely internet providers:)

Example output:

You can enhance this script with assertions or any other features.
Download client from here.
Have fun:)

Exchange 2016 CU6 and inaccessible OWA.

A lot of users faced inaccessible Outlook Web Access after CU6 installation. This can also affect users who reissue “Microsoft Exchange Server Auth Certificate” (if they are running CU6 version).
This is applied to situation when user gets “Something went wrong” and error with ID 500, on the server side warning appeared in the eventLog as:
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 3/24/2018 12:46:43 PM
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/24/2018 12:46:43 PM
Event time (UTC): 3/24/2018 8:46:43 AM

You should get following phrase in the logEntry: Encryption certificate is absent
This is Microsoft guys, you will never understand whats going wrong when you read log error.

As a workaround you can change your TimeZone to match UTC. From my event you can see that the time is 12:46 PM, just change time zone to UTC, in my case time has been changed from 12 PM to 8 AM and issue with OWA disappeared. I suppose that you can roll-back your timeZone (in my example with GMT +4 timeshift to UTC is 6 hours).

So thanks to Microsoft that they are pushing us out to use O365:)

Update: After 6 hours I changed time zone back and did IISRESET, everything is working so far.

PowerCli. Automate VM deployment with static IP and some others customization.

Recently I’ve been requested to deploy plenty of virtual machines with static IP address and custom password. These VMs should not be controlled by our IT department so I cannot use tools like Config Manager.
I decided to write a custom PowerShell function and share with you. My script require you to be connected to the vcenter with PowerCli module as well as required permission to deploy VM.
You can add forEach loop and pass a CSV file to run script.

Some parameters will be checked prior VM creation, such as:
Datastore Name
VM name, if name already exsist
Resource pool and folder (folder will be created if script won’t find one)
VM cluster if exsist
Provided disk capacity must be greater that source VM

Here is the script:

You should see progress in on your console, here is how it looks like:

You can grab script here.

Feel free to add more functionality if you want or make some piece of code more effective.
This script works with one disk and one network adapter, so you can add these features and of course one good thing is RunOnce that VmWare supports in their PowerCli modeule you should’t forget about.

Keep scripting.

DNS. Let’s point all unmatched request to specified resource.

If you need to point all not existing records to a specific one, you have to create a wildcard record.
For example we have a empty test zone db.local, let’s try to resolve not existing record aaa.db.local:

Default Server: srv
> aaa.db.local
Server: srv
*** srv can’t find aaa.db.local: Non-existent domain

Now lets create an A record inside db.local with following name “*” and as IP Address, here is result:

Default Server: srv
> aaa.db.local
Server: srv
Name: aaa.db.local
> abc.db.local
Server: srv

Name: abc.db.local

As you can see our DNS server returns our *.db.local record. This feature is not a new one and supported by Windows DNS as well as by Bind DNS.

CentOS. How to upgrade MySQL with yum.

I found a lot of links about how to upgrade MySQL to latest version with many manual operations.
Here is how to update with yum, might be helpful for someone:

Install MySQL repository, you can download it from here.

I will use wget to install it:

Then just install this repository:

yum install mysql57-community-release-el6-11.noarch.rpm

And run:
yum update mysql

Now you probably cannot run MySQL daemon because you need to update tables first, to run update you need to start daemon manually with additional options:

[root@web01 ~]# /etc/init.d/mysqld start --skip-grant-tables
[root@web01 ~]# mysql_upgrade
[root@web01 ~]# service mysqld restart

BTW do you know that’s all admins divides in to two commands: who do backups and who doesn’t :)?