Skip to content

Instantly share code, notes, and snippets.

async function signTextWithYubiKey() {
try {
// Create a new credential
const challenge = new Uint8Array(32);
crypto.getRandomValues(challenge);
const publicKeyCredentialCreationOptions = {
challenge,
rp: { name: 'example.com' },
user: {
{
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
"name": "https://witness.dev/attestations/product/v0.1/file:.git/index",
"digest": {
"sha256": "8101a571fbb12a9712f44f697cd3200692e905331b15eee266b487ef13762fe2"
}
},
{
This file has been truncated, but you can view the full file.
{
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
"name": "git:14e53fc4a062c7db52a6e67c8f2c3803ec24d2e5",
"digest": {
"sha1": "14e53fc4a062c7db52a6e67c8f2c3803ec24d2e5"
}
},
{
➜  hello-world-c git:(master) openssl genpkey -algorithm ed25519 -outform PEM -out testkey.pem
➜  hello-world-c git:(master) ✗ witness run -s build -o attestation.json -k testkey.pem --trace -- gcc main.c
➜  hello-world-c git:(master) ✗ cat attestation.json | jq -r .payload | base64 -d | jq > parsed.json
➜  hello-world-c git:(master) ✗ cat parsed.json 
{
  "_type": "https://in-toto.io/Statement/v0.1",
  "subject": [
# Apply the metallb manifests to Kubernetes
kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml
# Apply a metallb configuration to Kubernetes
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
@colek42
colek42 / 1_README.md
Created July 16, 2019 19:10 — forked from superseb/1_README.md
Generate Rancher 2 cluster/node agent definitions

Generate Rancher 2 cluster/node agents definitions

This is not official documentation/tooling, use with caution

This generate the Kubernetes definitions of the cattle-cluster-agent Deployment and cattle-node-agent DaemonSet, in case it's accidentally removed/server-url was changed/certficates were changed. It is supposed to run on every cluster Rancher manages. If you have custom clusters created in Rancher, see Kubeconfig for Custom clusters created in Rancher how to obtain the kubeconfig to directly talk to the Kubernetes API (as usually it doesn't work via Rancher anymore). For other clusters, use the tools provided by the provider to get the kubeconfig.

IMPORTANT: You get the cluster/node agents definitions from Rancher, and you apply them to the cluster that is created/managed so you need to switch kubeconfig to point to that cluster before applying them.

Running it

Keybase proof

I hereby claim:

  • I am colek42 on github.
  • I am colek42 (https://keybase.io/colek42) on keybase.
  • I have a public key ASAJ10QTsUhKlns5e9k9yABl2GCOeuShmPluC7zqImzb9Qo

To claim this, I am signing this object:

@colek42
colek42 / csvfolder2shp.py
Created January 10, 2017 02:31
This script converts a folder of CSV to SHP files
#Script to take directory of csv files and turn them into a shp file using ArcGIS 10 arcpy
import os
import csv
from datetime import datetime
DIRECTORY = 'DIRECTORYHERE'
OUTSHP = 'OUTPUTHERE'
OUTDIR = 'OUTDIR'
LATFIELD = 'LATFIELD'
.leaflet-div-icon.extend-icon {
width: 20px !important;
height: 20px !important;
margin-left: -10px !important;
margin-top: -10px !important;
padding: 10 10 10 10;
}
.leaflet-div-icon.extend-icon-medium {
width: 12px !important;
var child_process = require('child_process'),
http = require('http');
url = require('url'),
ffmpeg = null;
var livestream = function (req, resp) {
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var input = 'udp://225.1.1.1:8208';