Skip to content

Instantly share code, notes, and snippets.

View kiasaki's full-sized avatar
🚧
Building many things

kiasaki kiasaki

🚧
Building many things
View GitHub Profile
@kiasaki
kiasaki / styles.css
Created May 17, 2022 18:39
Bearblog.dev Styles
body {
margin: auto;
padding: 32px;
max-width: 640px;
text-align: left;
word-wrap: break-word;
overflow-wrap: break-word;
line-height: 1.5;
font-size: 18px;
font-family: monospace;
@kiasaki
kiasaki / indexes.js
Last active January 29, 2020 16:25
FaunaDB role
CreateCollection({name: "users"})
CreateCollection({name: "accounts"})
CreateCollection({name: "items"})
CreateIndex({
name: "allUsers",
source: Collection("users"),
permissions: {read: null},
})
CreateIndex({
name: "allAccounts",
@kiasaki
kiasaki / base32.js
Created January 27, 2020 16:48
Base32 encode/decode in Javascript
// From https://technote.fyi/code/javascript/base32-encoding-and-decoding-in-javascript/
(function(exports) {
var base32 = {
a: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
pad: "=",
encode: function (s) {
var a = this.a;
var pad = this.pad;
var len = s.length;
var o = "";
@kiasaki
kiasaki / introspect.gql
Created January 21, 2019 19:35
Graphql Introspection Query
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
@kiasaki
kiasaki / config
Last active December 12, 2018 12:54
wsltty / mintty config
BackgroundColour=255,255,255
ForegroundColour=55,59,65
CursorColour=38,38,38
Black=29,31,33
BoldBlack=150,152,150
Red=204,102,102
BoldRed=204,102,102
Green=181,189,104
BoldGreen=181,188,104
Yellow=240,198,116
@kiasaki
kiasaki / main.go
Created January 8, 2018 06:07 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@kiasaki
kiasaki / Elo.java
Created June 17, 2017 05:08
Java Elo
import java.lang.Math;
public class Elo {
public int k;
public Elo(int k) {
this.k = k;
}
public double expectedScoreForDifference(int difference) {
@kiasaki
kiasaki / s3-public-website-policy.txt
Created November 13, 2016 19:27
S3 public website policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:GetObject"
],
/*!
*
* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@kiasaki
kiasaki / readme.md
Last active September 6, 2022 11:13
ubuntu: vboxdrv module signing for secureboot to load it

Since kernel version 4.4.0-20, it was enforced that unsigned kernel modules will not be allowed to run with Secure Boot enabled. Because you want to keep Secure Boot, then the next logical step is to sign those modules.

So let's try it.

Create signing keys

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/"