Git: Unsafe repository is owned by someone else (Windows)

After updating git the following message appeared during opening the repository with SourceTree:

I tried out two different possibilities to solve this problem. First, I added the recommended command from the error message

git config --global --add safe.directory <repo-path>

This solution works fine but has the big impact that changing the repository path afterwards would lead to the same error again. So I removed the entry from

C:\Users\<username>\.gitconfig

and I found out that a better soluation would be to adapt the security settings for the repository in Windows by performing the following steps:

  • Open Windows “Explorer” and go to the repository where the error occurred
  • Right click on the repository directory and select “Properties”
  • Open the “Security” tab and click on “Extended”
  • Change the “Owner” in the top of the window to your user account

For me this worked perfectly and I didn’t need to set the repository on the safe list of the global git configuration.

Arctic Liquid Freezer II 280 Fan Settings

Here my setting adapted from ARCTIC Fan Settings in UEFI – User Manual. For me a perfect combination of being silent in desktop mode and keeping temperatures in balance during gaming.

ALF II 280 PWM [%]Case Fans DC [V]
203.6≤ 60
506≤ 75
10012≥ 85

Cooler Master Masterbox CM694 – Mainboard MSI Tomahawk X570 – AMD Ryzen 5900x

Here a 5 minute benchmark run at a room temperature of 22°C:

Ubuntu Gitlab – No new version found

I always got the message

gitlab-ce is already the newest version (11.2.3-ce.0).

so I found out, that my package sources were outdated. To solve this you have to update the package list by executing a predefined script from the official Gitlab package site. If your installation is based on the community edition follow the “quick install instructions” from

gitlab/gitlab-ce – Packages · packages.gitlab.com

otherwise from

gitlab/gitlab-ee – Packages · packages.gitlab.com

After successfully executing the script take a look by

apt list –upgradeable

if there is any new version found. If yes, be shure that your setup won’t be broken on upgrade and follow the recommended upgrade list from

Upgrading GitLab | GitLab

apt list gitlab-ce -a

to list all available gitlab packages.

Then execute the following command

apt upgrade gitlab-ce=14.0.0-ce.0

Grafana Loki

  • Github
    > git clone git@github.com:grafana/loki.git
  • Docker
    > cd loki/production
    > docker-compose pull
    > docker-compose up
  • Grafana
    Used for visualization of log file data.
    • Open Browser
      http://localhost:3000
    • Credentials
      Username: admin
      Password: admin
    • Activate Loki
  • promtail
    Pushes log file content to Grafana Loki.
    1. Open https://github.com/grafana/loki/releases
    2. Download e.g. promtail-windows-amd64.exe.zip
    3. Unzip
    4. Configuration
      1. Create config.yaml, for content see appendix
      2. Hints
        1. Keep attention to parse your timestamp correctly, otherwise you will see only the date/time of the import timestamp. Timestamps are handled by go, so use online editors to check your parsings, https://play.golang.org/
        2. Keep attention on multilines.
        3. Regular expressions can be quiet comprehensive to read, so use online regex parser/checker, e.g. https://regex101.com/
  • Start promtail
    promtail.exe -config.file=config.yaml
  • Back to Grafana

Appendix

config.yaml

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: D:/promtail/positions.yaml # will be created automatically by promtail. This location needs to be writeable by promtail.

client:
  url: http://localhost:3100/loki/api/v1/push
  basic_auth:
    username: admin
    password: admin

scrape_configs:
  - job_name: MyApp
    pipeline_stages:
    - multiline: # identify timestamps as first line of a multiline block.
        firstline: '^\d{4}-\d{2}-\d{2}.\d{1,2}:\d{2}:\d{2}.\d{4}'
        max_wait_time: 3s
    - regex: #https://regex101.com/ #http://www.rexegg.com/regex-quickstart.html#modifiers
        expression: '^(?P<date>\d{1,4}.\d{1,2}.\d{1,2}).(?P<time>\d{1,4}.\d{1,2}.\d{1,2}).(?P<ms>\d{1,3})..(?P<level>[\w\s]+)'
    - template:
        source: time
        template: '{{ .date }}T{{ .time }}.{{ .ms }}+02:00'
    - timestamp:
        source: time
        format: "2006-01-02T15:04:05.000-07:00" # https://play.golang.org/ #time.Parse
    - labels:
        level:
    static_configs:
      - targets:
          - localhost
        labels:
          job: MyApp # A `job` label is fairly standard in prometheus and useful for linking metrics and logs.
          host: workstation # A `host` label will help identify logs from this machine vs others
          agent: promtail
          __path__: D:/logs/*.log

Docker in Hyper-V Image

Using Docker in a Hyper-V image can be that easy – if you know how to do that. The use case is quite simple: imagine you have a company or private infrastructure that runs on a server. This server runs multiple instances of Windows (Server) where one instance is used for developing and another for testing. Now if the assignement is to create a Docker image that runs your application than you might have the same problems that I had – I didn’t work on a fast try. So here is the short and simple solution of a few hours of trying and searching.

Preferences Hyper-V Host

  1. Start Hyper-V-Manager
  2. Write down name of the image that should run Docker for Windows
  3. Download the following script
    https://github.com/MicrosoftDocs/Virtualization-Documentation/blob/live/hyperv-tools/Nested/Enable-NestedVm.ps1
  4. Open powershell as Administrator
  5. Execute script
powershell -ExecutionPolicy Bypass -File .\Enable-NestedVm.ps1 {Hyper-V-image-name-that-should-run-Docker}

Explaination
-ExecutionPolicy Bypass: by default, no one is allowed to execute unsigned scripts, so bypass this setting. Just try it out without this parameter and you will see the response.
-File: the file to execute

Preferences Hyper-V Image

  1. Enable Windows Features
    + Containers
    + Hyper-V
  2. Download
    https://docs.docker.com/docker-for-windows/install/
  3. Install Docker
  4. Concratulation, you successfully installed Docker in a Hyper-V image!