Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joaopgrassi
joaopgrassi / guide.md
Created February 17, 2024 15:54 — forked from Kranzes/guide.md
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@joaopgrassi
joaopgrassi / main.go
Created February 9, 2023 17:11
OTel Go exporting metrics via OTLP HTTP
package main
import (
"context"
"fmt"
"math/rand"
"os"
"time"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
@joaopgrassi
joaopgrassi / LICENSE
Last active October 11, 2021 08:53
Go application properly propagating the Context
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@joaopgrassi
joaopgrassi / LICENSE
Last active October 11, 2021 08:52
Go application not propagating the Context
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@joaopgrassi
joaopgrassi / metrics-dotnet-issues.md
Last active October 12, 2021 11:38
OTel .NET metrics SDK questions

Questions about the .NET OTel metrics SDK

Same instrument names, different meters

Spec says:

Different Meters MUST be treated as separate namespaces. The names of the Instruments under one Meter SHOULD NOT interfere with Instruments under another Meter.

Usecase: I have an app that has a request_count instrument to count requests. I consume an external library that also has a request_count under a meter that it controls internally. I want to get metrics from both my app and from the external library.

@joaopgrassi
joaopgrassi / jaeger-k8s.md
Created September 8, 2021 15:11
Deploy an all-in-one Jaeger in k8s
@joaopgrassi
joaopgrassi / deploy-collector.md
Last active September 8, 2021 15:14
OpenTelemetry collector configured to export to Jaeger

Deploying a OpenTelemetry collector in a k8s cluster

  1. Make sure to first have a working Jaeger in the cluster: https://gist.github.com/joaopgrassi/8eb001d94310effef038364e4f6994ab

  2. Run the following command to deploy the collector in your k8s cluster:

Note: The yml below expects the Jaeger services to be deployed within the observability using the names from the gist above. If you follow that it should all work. If not, make sure the dns names are the correct.

@joaopgrassi
joaopgrassi / keptn-win-setup.md
Last active September 6, 2021 11:17
Keptn Windows development setup

Setting up keptn on Windows with WSL2 + basic demo podtato-head/podtatoserver

Configuring Windows/WLS/Docker

The next steps are to be executed only once, when first setting up everything.

  1. Install WSL2 with Ubuntu 20 https://docs.microsoft.com/en-us/windows/wsl/install-win10

  2. Install Docker desktop and enable "Use the WSL 2 based engine" (if already installed, update and check the option Use WSL 2 is marked in settings)

@joaopgrassi
joaopgrassi / wsl2-network.ps1
Created August 24, 2021 08:56
WSL2 expose ports to windows host
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
echo $remoteport
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
devices: ({
name: "Wireless Mouse MX Master 3";
// A lower threshold number makes the wheel switch to free-spin mode
// quicker when scrolling fast.
smartshift: { on: true; threshold: 50; };
hiresscroll: {
hires: false;
invert: false;