Skip to content

Instantly share code, notes, and snippets.

View skarllot's full-sized avatar
💭
I may be slow to respond.

Fabrício Godoy skarllot

💭
I may be slow to respond.
View GitHub Profile
@skarllot
skarllot / README.md
Created February 19, 2026 18:20
Pop!_OS 22.04 → 24.04 Upgrade Troubleshooting

Pop!_OS 22.04 → 24.04 Upgrade Troubleshooting

Summary

This documents two issues encountered when upgrading Pop!_OS from 22.04 (Jammy) to 24.04 (Noble) using pop-upgrade, and how they were resolved.


Issue 1: Upgrade aborted due to VS Code repository checksum mismatch

@skarllot
skarllot / README.md
Created February 19, 2026 16:39
Fixing APT GPG Key Errors on Ubuntu / Pop!_OS

Fixing APT GPG Key Errors on Ubuntu / Pop!_OS

A practical guide to resolve NO_PUBKEY and EXPKEYSIG errors from Microsoft and Spotify repositories, and fix .NET package conflicts on Ubuntu 22.04 / Pop!_OS.


The Problem

After running sudo apt update, you may see errors like:

@skarllot
skarllot / Convert-EdgeWorkProfileToPersonal.ps1
Last active January 2, 2026 11:27
Convert Microsoft Edge Work/School Profile to Personal Profile - Allows signing in with personal Microsoft accounts (MSA) instead of requiring corporate Azure AD accounts
<#
.SYNOPSIS
Converts a Microsoft Edge Work/School profile to a Personal profile.
.DESCRIPTION
This script converts an Edge profile that was created as a Work/School profile
(requiring Azure AD/Entra ID corporate accounts) to a Personal profile that
accepts personal Microsoft accounts (MSA).
The script:
@skarllot
skarllot / MyMiddleware.cs
Created September 18, 2025 14:27
Detect kind of trigger in middleware
internal class MyMiddleware : IFunctionsWorkerMiddleware
{
public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next)
{
var triggerType = context.FunctionDefinition.InputBindings.Values.First(a => a.Type.EndsWith("Trigger")).Type;
var logger = context.GetLogger<MyMiddleware>();
logger.LogInformation($"TriggerType: {triggerType}");
await next(context);
@skarllot
skarllot / problem.yaml
Created September 1, 2025 17:41
OpenAPI data types for problem messages, compliant to RFC 9457 - Problem Details for HTTP APIs (which obsoletes RFC 7807)
openapi: 3.0.0 #Ref: https://github.com/belgif/openapi-problem/blob/6d8c8839130a3e7dd459ad08989b8bec1bae982a/src/main/openapi/problem/v1/problem-v1.yaml
info:
title: problem types
version: "${project.version}"
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers: []
paths: {}
components:
@skarllot
skarllot / program.cs
Created July 25, 2025 15:02
OpenAPI 3.0 with Bearer authentication using Swashbuckle
//First we define the security scheme
c.AddSecurityDefinition("Bearer", //Name the security scheme
new OpenApiSecurityScheme{
Description = "JWT Authorization header using the Bearer scheme.",
Type = SecuritySchemeType.Http, //We set the scheme type to http since we're using bearer authentication
Scheme = "bearer" //The name of the HTTP Authorization scheme to be used in the Authorization header. In this case "bearer".
});
c.AddSecurityRequirement(new OpenApiSecurityRequirement{
{
@skarllot
skarllot / MsSqlTestBase.cs
Last active July 16, 2025 17:46
Test EF Core (Entity Framework) migrations
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Configurations;
using DotNet.Testcontainers.Containers;
using Microsoft.EntityFrameworkCore;
using Testcontainers.MsSql;
using Xunit;
namespace Tests;
public abstract class MsSqlTestBase : IAsyncLifetime
{
"analysisServicesServers": "as",
"apiManagementService": "apim-",
"appConfigurationStores": "appcs-",
"appManagedEnvironments": "cae-",
"appContainerApps": "ca-",
"authorizationPolicyDefinitions": "policy-",
"automationAutomationAccounts": "aa-",
"blueprintBlueprints": "bp-",
"blueprintBlueprintsArtifacts": "bpa-",
@skarllot
skarllot / windows-ntp.ps1
Created June 6, 2025 13:13
Synchronize Windows clock with NTP server
Get-TimeZone
w32tm /config /manualpeerlist:"pool.ntp.br" /syncfromflags:manual /reliable:YES /update
Restart-Service w32time
w32tm /resync
w32tm /query /peers
w32tm /query /status
@skarllot
skarllot / bash.cmd
Created April 27, 2025 19:46
Gitlab runner using Bash shell on Windows
@"C:\Program Files\Git\usr\bin\bash.exe" -l