/dev/blog/ID10T

Advertisement

How I miraculously fixed my Windows 10 startup DNS problems

• windows • Comments

I once again had a great experience with Windows 10. For some reason my DNS resolution stopped working for roughly two minutes after every startup. Of course there was neither an update around that time, nor were there any unusual messages in the Event Viewer. Therefore I had no idea where to look. I tried a couple of things, manually setting different DNS servers, configuring a static IP, and of course doing the classic ipconfig /flushdns and ipconfig /registerdns. To no avail. I still did not have DNS directly after startup. The DNS issues even occured in the first two minutes of Safe Boot Mode.
So, how did I fix it?

Using Custom executables in Steam applications

• steam and gaming • Comments

Nearly 10 years ago, on the 30th December of 2009, I bought League of Legends on Steam. Back in this time, DOTA 2 wasn’t released yet and there was a Digital Collectors Edition for League available on Steam. Therefore, I’m one of the very few users who are playing League of Legends via Steam. But while the League of Legends client was further developed, the game version in Steam did not. Luckily, the small Steam League of Legends community found workarounds, so the tracking of ingame time still works. A couple of months ago, Riot Games, the company behind League of Legends did a major overhaul of the client, renaming the game launcher in the process. This, in connection with the workaround install of League of Legends in Steam lead to an popup message every time the game was started via Steam shortcut:

League of Legends Launcher Shortcut Popup

League of Legends will now update your desktop shortcuts. Your operating system may ask for Administrator permissions.

While I’m not playing League frequently anymore, this popup still annoyed me. As other players also encountered this problem and simply renaming the executables didn’t work, I did some tinkering and incidentally found a solution which probably enables the easy usage of custom executables for every Steam game.

Understanding multi line strings in YAML and Ansible (Part II - Ansible)

• YAML and Ansible • Comments

In Part I of this series we examined the two block styles of YAML, literal and folded, as well as the three block chomping methods, strip, clip and keep. In this post we want to investigate how these styles and methods interact with different Ansible use cases.

Multi line strings in Modules

The classic usage of a multi line string in Ansible is in the command or shell module. This example is directly taken from the Ansible docs:

# You can use shell to run other executables to perform actions inline
- name: Run expect to wait for a successful PXE boot via out-of-band CIMC
  shell: |
    set timeout 300
    spawn ssh [email protected]

    expect "password:"
    send "\n"

    expect "\n"
    send "connect host\n"

    expect "pxeboot.n12"
    send "\n"

    exit 0
  args:
    executable: /usr/bin/expect
  delegate_to: localhost

A literal style block with clip chomping is used to send several commands. Folded style would not make any sense here, except if you wanted to either pipe the commands or chain them with && or ||.

Understanding multi line strings in YAML and Ansible (Part I - YAML)

• YAML and Ansible • Comments

I had a strange problem with variables spanning multiple lines in Ansible. During the process of debugging it, I learned a bit about multi line strings which are called “blocks” in the official YAML specification. In this blog post we’ll examine the different YAML block styles and block chomping methods. In Part II we will then learn the use cases and quirks of each style when used in Ansible.

We’ll run this base playbook for each style via ansible-playbook -v playbook.yml and will only replace the variable with the corresponding style.

---
- hosts: localhost
  connection: local
  vars:
    my_pattern: |
      With his own sword,
      Which he did wave against my throat, I have ta’en
      His head from him.
  tasks:
    - debug:
        var: my_pattern

Styles

There are two basic styles of blocks in YAML, literal and folded. Both have different advantages and disadvantages, especially when used in Ansible.

Literal

According to the YAML specification literal is “is the simplest, most restricted, and most readable scalar style”. It’s denoted by the pipe, |:

my_pattern: |
  With his own sword,
  Which he did wave against my throat, I have ta’en
  His head from him.

Output:

ok: [localhost] => {                              
    "my_pattern": "With his own sword,\nWhich he did wave against my throat, I have ta’en\nHis head from him.\n"                                                  
}

Horde: Deleting Duplicates from MySQL Database

• MySQL and Horde • Comments

I recently encountered a problem with my Horde installation. Due to an app misconfiguration, my wife created hundreds of calendar entries for the same event [Edit 2018-04-17: It turned out, she also created thousand of duplicate tasks. Yay!]. It is tedious to delete every event by hand, so I wanted to drop the entries from the database. As this is something other people might profit from, I’m documenting it. Of course part of this procedure can be done with other MySQL databases as well.

Get listing of double entries

I wanted to see all duplicate entries first, to make safe I’m not deleting important stuff. This can be done with a SELECT COUNT command:

   SELECT event_title,event_start,COUNT(*) c FROM kronolith_events
     GROUP BY event_title,event_start HAVING c > 1 ORDER BY c ASC;

This is the result:

MySQL count duplicates table

Ouch! That are a lot of duplicate entries. Let’s delete them!

Advertisement