Skip to content

Instantly share code, notes, and snippets.

View ioggstream's full-sized avatar

Roberto Polli ioggstream

View GitHub Profile
@ioggstream
ioggstream / ssh-fido-sk.md
Created November 16, 2023 13:11
Using ssh with FIDO secure keys

@here Ciao a tutti! Se avete una chiavetta FIDO, potete securizzare il vostro ssh creando una coppia di chiavi apposita come segue. Questo permette di accedere con un 2FA al server git anche senza particolari configurazioni lato server, che potrebbe però rifiutare chiavi non -sk.

  1. Plug your FIDO key
  2. create the ssh keypair based on a sk spec (e.g., ed25519-sk or ecdsa-sk)
# Try with ed25519-sk first...
$ ssh-keygen -t ed25519-sk -f ~/.ssh/id_ed25519_sk
Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
@ioggstream
ioggstream / zipdiff.py
Last active March 21, 2023 08:31
Print differences between two zip/jar files.
import zipfile
import yaml
import sys
def zipdiff(z1, z2):
"""A function that compares the files of two zip files and returns a list of files that are result."""
files1 = z1.namelist()
files2 = z2.namelist()
result = []
for file in files1:
@ioggstream
ioggstream / devspace.yaml
Created January 12, 2023 18:24
Super SAST on devspaces
version: v2beta1
name: docker-compose
# This is a list of `deployments` that DevSpace can create for this project
deployments:
super-sast:
helm:
# Under `values` we can define the values for this Helm chart used during `helm install/upgrade`
# You may also use `valuesFiles` to load values from files, e.g. valuesFiles: ["values.yaml"]
values:
@ioggstream
ioggstream / curl-test.kube
Created January 9, 2023 10:27
sample testkube file
{
"command": [
"curl",
"https://reqbin.com/echo/get/json",
"-H",
"'Accept: application/json'"
],
"expected_status": "200",
"expected_body": "{\"success\":\"true\"}"
}
@prefix k8s: <urn:k8s:> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
k8s:Kind a rdfs:Class .
k8s:Namespace a rdfs:Class ;
rdfs:label "Namespace" .
k8s:Application a k8s:Kind .
---
# Data
{
"@graph": [
{
"@id": "_:b0",
"skos:prefLabel": [
{"@language": "fr", "@value": "France" },
{"@language": "it", "@value": "Italia" }
]
@ioggstream
ioggstream / d3fend.yaml
Created May 30, 2022 13:34
Show anchor usage
from rdflib import Graph
import yaml
d = yaml.safe_load(Path("d3fend.yaml").read_text())
g=Graph()
g.parse(data=json.dumps(d), format="application/ld+json")
print(g.serialize(format="application/ld+json"))
---
"@context":
@ioggstream
ioggstream / uri.suomi.fi.context.jsonld
Last active May 24, 2022 12:01
Finland JSON-LD Context
{
"@context": {
"Person": "http://uri.suomi.fi/datamodel/ns/isa2core#Person",
"Location": "http://uri.suomi.fi/datamodel/ns/isa2core#Location",
"Geometry": "http://uri.suomi.fi/datamodel/ns/isa2core#Geometry",
"Address": "http://uri.suomi.fi/datamodel/ns/isa2core#Address",
"Identifier": "http://uri.suomi.fi/datamodel/ns/isa2core#Identifier",
"Agent": "http://uri.suomi.fi/datamodel/ns/isa2core#Agent",
"identifies": {
"@id": "http://uri.suomi.fi/datamodel/ns/isa2core#identifies",
@ioggstream
ioggstream / deleteme-spid-sgd.yaml
Last active May 5, 2022 17:22
Esempio di schemi con rendering generato
openapi: 3.0.1
info:
title: SDG OAuth
version: 1.1.0
description: SDG OAuth
termsOfService: https://sdg-oauth.github.io/sdg-oauth/
contact:
name: SDG OAuth
url: https://sdg-oauth.github.io/sdg-oauth/
license: