Skip to content

Instantly share code, notes, and snippets.

View seventyeight's full-sized avatar

Frank Tributh seventyeight

  • Potsdam, Germany
View GitHub Profile
@seventyeight
seventyeight / index.js
Last active January 25, 2023 16:50
Validate JWS/JWT in nodejs/node
import { createPublicKey, createVerify } from 'node:crypto'
const [header, payload, signature] = token.split('.').map((tokenPart, index) => {
const decoded = Buffer.from(tokenPart, 'base64url').toString();
return index < 2 ? JSON.parse(decoded) : decoded;
})
const key = (await fetch(`${payload.iss}/.well-known/openid-configuration`)
.then((res) => res.json())
.then((config) => fetch(`${config['jwks_uri']}`))
@seventyeight
seventyeight / mattermost_solarized_light.json
Created December 4, 2017 07:50
Mattermost theme solarized light
{
"awayIndicator": "#e0b333",
"buttonBg": "#859900",
"buttonColor": "#586e75",
"centerChannelBg": "#fdf6e3",
"centerChannelColor": "#839496",
"codeTheme": "solarized-light",
"linkColor": "#268bd2",
"mentionBj": "#dc322f",
"mentionColor": "#ffffff",

How to change password of encrypted volume on OSX MacOS

diskutil cs list To get the UUID of the desired volume.

diskutil cs passwd UUIDUUID-UUID-UUID-UUID-UUIDUUIDUUID

@seventyeight
seventyeight / tmux.conf
Last active August 29, 2015 14:11 — forked from anonymous/tmux.conf
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal