JRehkemper.de

JRehkemper.de

- Homepage and Wiki of Jannik Rehkemper -

New Posts

Frontmatter Aliases - failed to unmarshal YAML: yaml: line 5: found character that cannot start any token

If you try to build your hugo site and get this error message failed to unmarshal YAML: yaml: line 5: found character that cannot start any token try replacing tabs with two spaces manually.

Go Snippets

Define Variables mynumber := 1 mystring := "string" var emptyint int var emptystringarr []string var sum int = 2 Conversions Convert to String mystring := string(var) Convert to Integer number, err := strconv.Atoi(mystring) Loops For Each Loop for index, element := range myarr { } Loop Over Database Rows for routes.Next() { var link string routes.Scan(&link) CheckRoute(link) } Read File In one String func readFileAsString(filename) string { dat, err := os.

K3S - Use private Regestries

If you want to use private Image-Registries or mirrors to cache your images, you need to specify them in the registries.yaml file on all K3S Nodes. Insecure Registry If you want to access your registry over http and instead of https, you have to specify the url as an insecure registry. That way You can pull and push images with an error. You have to create a registries.yaml file on all you K3S nodes.

Monitor Network Stats with sar

The System Actvity Report or sar for short, can be used to track all kinds of system-metrics. Installation sar is part of the sysstat package and can probably be installed with your distributions packagemanager. [tux@server]$ sudo dnf install sysstat [tux@server]$ sudo apt install sysstat Samples and Intervals sar operates by measuring stats over a certain interval and aggregating them afterwards. Because of that we should always define the interval for every sample and how many samples we want.

Mount CIFS or SMB Share on Linux

Linux can not only mount NFS Share but CIFS / SMB shares from Windows environments as well. Provided you have the right helper tools installed. Install Helper-Tools RHEL On RHEL-based systems they are called cifs-utils. [tux@server]$ sudo dnf install cifs-utils Debian On Debian they are called cifs-utils. [tux@server]$ sudo apt install cifs-utils Mount share temporary While NFS authenticates the client by the hostname, CIFS uses credentials. Therefor you need to provide the credentials either via command-line or in a credentials-file.