Skip to content

Instantly share code, notes, and snippets.

View cljoly's full-sized avatar
If I’m not answering within 7 days, please ping me again!

Clément Joly cljoly

If I’m not answering within 7 days, please ping me again!
View GitHub Profile
@cljoly
cljoly / arch-secure-install.md
Created May 2, 2022 09:25 — forked from umbernhard/arch-secure-install.md
Building a Secure Arch Linux Device

Building a Secure Arch Linux Device

Locking down a linux machine is getting easier by the day. Recent advancements in systemd-boot have enabled a host of features to help users ensure that their machines have not been tampered with. This guide provides a walkthrough of how to turn on many of these features during installation, as well as reasoning for why certain features help improve security.

The steps laid out below draw on a wide variety of existing resources, and in places I'll point to them rather than attempt to regurgitate full explanations of the various security components. The most significant one, which I highly encourage everyone to read, is Rod Smith's site about secure boot, which is the most comprehensive and cogent explanation of UEFI, boot managers and boot loaders, and secure boot. Another incredibly useful resources is Safeboot, which encapsulates many of the setup steps below in a Debian application.

@cljoly
cljoly / lua.lua
Created February 28, 2022 07:03 — forked from iagoleal/lua.lua
Properly open lua and fennel required files via gf
local fmt = string.format
-- Iterator that splits a string o a given delimiter
local function split(str, delim)
delim = delim or "%s"
return string.gmatch(str, fmt('[^%s]+', delim))
end
-- Find the proper directory separator depending
-- on lua installation or OS.
@cljoly
cljoly / fan-out_with_context.go
Created August 23, 2021 07:07 — forked from Jguer/fan-out_with_context.go
Fan-Out with Context in Go
package main
import (
"context"
"errors"
"fmt"
"math/rand"
"os"
"os/exec"
"os/signal"
@cljoly
cljoly / semantic-commit-messages.md
Created January 28, 2021 23:36 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@cljoly
cljoly / hugofastsearch.md
Created January 14, 2021 21:55 — forked from cmod/hugofastsearch.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

Editing remote files in Vim with SSH

  1. Configure SSH

    In ~/.ssh/config, include the lines:

    Host *
    ControlPath ~/.ssh/sockets/%r@%h-%p
    

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@cljoly
cljoly / buttondown.css
Created April 30, 2019 19:00 — forked from ryangray/buttondown.css
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC
@cljoly
cljoly / IndexedPrivilege.md
Last active April 4, 2017 04:08 — forked from pthariensflame/IndexedPrivilege.md
An introduction to the indexed privilege monad in Haskell, Scala and C#.

The Indexed Privilege Monad in Haskell, Scala, and C# (and OCaml at some point?)

We've already looked at two different indexed monads in our tour so far, so let's go for a third whose regular counterpart isn't as well known: the privilege monad.

Motivation

The regular privilege monad allows you to express constraints on which operations a given component is allowed to perform. This lets the developers of seperate interacting components be statically assured that other components can't access their private state, and it gives you a compile-time guarantee that any code that doesn't have appropriate permissions cannot do things that would require those permissions. Unfortunately, you cannot easily, and sometimes cannot at all, build code in the privilege monad that gains or loses permissions as the code runs; in other words, you cannot (in general) raise or lower your own privilege level, not even w

@cljoly
cljoly / golo.plugin.zsh
Created August 21, 2016 09:58 — forked from danielpetisme/golo.plugin.zsh
Golo ZSH integration It relies on the existing golo-bash-completion (it actyually sources it) Source of the idea: http://stackoverflow.com/a/8492043
###################################################################################
# Copyright 2012-2013 Institut National des Sciences Appliquées de Lyon (INSA-Lyon)
#
# 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
#
# Unless required by applicable law or agreed to in writing, software