Skip to content

Instantly share code, notes, and snippets.

View jsnfwlr's full-sized avatar
👨‍💻
Writing code for all the things.

Jason Fowler jsnfwlr

👨‍💻
Writing code for all the things.
View GitHub Profile
esphome:
name: garage
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret wifi
password: !secret wifi_pw
# Enable logging
@jsnfwlr
jsnfwlr / esphome_neopixel_clock_effect.yaml
Created August 30, 2021 21:48 — forked from markusressel/esphome_neopixel_clock_effect.yaml
ESPHome configuration example to create an animated clock using the Neopixel 60 LED ring
esphome:
# [...]
on_boot:
priority: -10
then:
# enable clock effect after boot
- light.turn_on:
id: light_ring
brightness: 100%
effect: Clock
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@0.6.5/lit-element.js?module';
const styles = html`
<style>
:host {
display: flex;
flex: 1;
flex-direction: column;
}
ha-card {
# How To Install Go on Any Version of Ubuntu
### Introduction
[Go](https://golang.org) is a modern programming language developed at Google. It is increasingly popular for many applications ([docker](https://github.com/docker/docker-ce), [kubernetes](https://github.com/kubernetes/kubernetes), and more) and at many companies, and offers a robust set of libraries. This tutorial will walk you through downloading and installing the latest version of Go (Go 1.15 at the time of this article’s publication).
## Prerequisites
This tutorial assumes that you have access to an Ubuntu system later than 16.04, configured with a non-root user with sudo privileges as described in [Initial Server Setup with Ubuntu 20.04.](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04)
@jsnfwlr
jsnfwlr / prepare.sh
Created September 14, 2020 21:29
Fix UEFI Boot on lenovo
#!/bin/bash
mkdir -p /mnt/system/boot
mount /dev/sda2 /mnt/system
mount /dev/sda1 /mnt/system/boot
mount proc -t proc /mnt/system/proc
mount -o bind /dev /mnt/system/dev
mount -o bind /run /mnt/system/run
apt install efibootmgr
<div id="bar">
<div id="wave"/><div/>
</div>
<style>
#bar {
background: #00F;
height: 120px;
position: relative;
overflow: hidden;
}
:root {
--page-bg-image: url('https://images.pexels.com/photos/2417863/pexels-photo-2417863.jpeg');
--page-bg-tint: hsla(248, 10%, 16%, 0.5);
--folder-header-bg: hsla(248, 10%, 16%, 0.7);
--folder-header-text: #FFFFFF;
--folder-body-bg: hsla(248, 10%, 16%, 0.5);
--folder-body-text: #FFFFFF;
--folder-icon-hover-bg: hsla(1, 100%, 100%, 0.5);
--folder-item-hover-bg: #2c292d;
--folder-child-hover-bg: #918c8e;
body { background-color: #2c292d; }
#main { margin-top: 2.5vw !important; display: flex; width: 95vw !important; left: 0%; }
#main .column { max-width: calc(16.6% - 20px); margin: 10px; }
#main .column > ul > li + li { margin-top: 1em; }
#main .column > ul > li > .folder { display: inline-flex; background: #ffffff33; width: 100%;font-weight: bold; border-radius: 0.2em; }
#main .column > ul > li > .folder .icon { display: none; }
#main .column > ul > li > .folder.open { margin-bottom: 1em; }
#main .column:first-child { margin-right: auto !important; max-width: calc(14.285% - 20px) !important; }
#main .column:first-child > ul > li > div { padding: 0 !important; }
#main .column:first-child > ul > li > div > ul { display: flex; flex-wrap: wrap; }
@jsnfwlr
jsnfwlr / Vault-ssh-ca-README.md
Created February 20, 2020 01:52 — forked from kawsark/Vault-ssh-ca-README.md
A guide for configuring Vault's SSH-CA

SSH CA use-case with Vault

In this scenario we are going to set up Vault to sign SSH keys using an internal CA. We will configure the SSH secrets engine and create a CA within Vault. We will then configure an SSH server to trust the CA key we just created. Finally we will attempt to SSH using a private key, and a public key signed by Vault SSH CA.

Prerequisites

  • This guide assumes you have already provisioned a Vault server, SSH host using OpenSSH server, and a SSH client machine.
  • The client system must be able to reach the Vault server and the OpenSSH server.
  • We will refer to these systems respectively as:
  • VAULT_SERVER
# show the size of folders in current (non-recursive)
ls -1 | sed 's/ /\\ /g' | xargs du -sh
# show the size all folders below the current (recursive)
ls -1 | sed 's/ /\\ /g' | xargs du -h
# Remove empty folders - must be run a few times to work up the tree
ls -1 | sed 's/ /\\ /g' | xargs du -h | grep '4.0K' | awk '{$1=""; print $0}' | sed 's/^ //g; s/ /\\ /g' | xargs rm -rf