Skip to content

Instantly share code, notes, and snippets.

View yanfali's full-sized avatar
😃

Yan-Fa Li yanfali

😃
  • Bellevue, WA
  • 15:48 (UTC -07:00)
View GitHub Profile
@yanfali
yanfali / zfs scrub service systemd.md
Last active July 16, 2023 00:31
zfs scrub scripts

zfs-scrub.service

[Unit]
Description=Scrub ZFS tank pool

[Service]
Type=oneshot
ExecStart=/usr/sbin/zpool scrub tank

zfs-scrub.timer

@yanfali
yanfali / post-display-manager.service
Created July 14, 2023 02:47
nvidia fan speed settings
root@steambox:/home/steam# cat /etc/systemd/system/post-display-manager.service
[Unit]
Description=Set up 3060Ti Fan
Documentation=man:lightdm(1)
After=display-manager.service
[Service]
Type=oneshot
ExecStart=/usr/bin/nvidia-settings --display :0 -a GPUFanControlState=1 -a GPUTargetFanSpeed=65
RemainAfterExit=true
esphome:
name: temp_sensor
platform: ESP8266
board: nodemcuv2
wifi:
ssid: "myssd"
password: "myssdpass"
captive_portal:
@yanfali
yanfali / gist:82c1ccf864042cb5047a4b1636037cd5
Last active May 9, 2021 17:25
Peace By Hampton ESPHome Smort Plug configuration example
# the first four pins on the top of the ESP controller are
# 1 - 3.3v
# 2 - GND
# 3 - TX
# 4 - RX
# I soldered wires and hooked them to a raspberry pi 4 with the serial port enabled.
# 3.3v, gnd, tx and rx. Warning you will need a beefy PSU, as the parasitic power draw
# of the ESP can brown out the pi, even at 15w.
#
# ` sudo esptool.py --port /dev/ttyS0 write_flash -fm dout 0x0 hampton.bin`
@yanfali
yanfali / aws_glacier_delete_vault.md
Created February 4, 2021 00:47 — forked from veuncent/aws_glacier_delete_vault.md
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@yanfali
yanfali / machine.js
Last active November 14, 2019 17:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@yanfali
yanfali / KLEFC660.json
Created October 22, 2019 01:43
KLEFC660
["~\n`","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=","Del","BS",{x:0.5},"1"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\",{x:0.5},"1"],
[{w:1.75},"Ctrl\nEsc","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.25},"Shift","up"],
[{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6},"6u",{a:4,w:1.25},"Alt",{w:1.25},"Win",{w:1.25},"Ctrl","left","down","right"]
Process: QMK Toolbox [9374]
Path: /Applications/QMK Toolbox.app/Contents/MacOS/QMK Toolbox
Identifier: fm.qmk.toolbox
Version: 0.0.10 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: QMK Toolbox [9374]
User ID: 1546932539
Date/Time: 2019-05-30 20:51:17.763 -0700
-- Reboot --
Apr 16 12:00:22 ptah kernel: microcode: microcode updated early to revision 0x2e, date = 2018-04-10
Apr 16 12:00:22 ptah kernel: Linux version 5.0.7-arch1-1-ARCH (builduser@heftig-20167) (gcc version 8.2.1 20181127 (GCC)) #1 SMP PREEMPT Mon Apr 8 10:37:08 UTC 2019
Apr 16 12:00:22 ptah kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=d7b2be9f-7dd7-4cd0-95b8-5208af2d3441 rw quiet elevator=noop i915.enable_fbc=0
Apr 16 12:00:22 ptah kernel: KERNEL supported cpus:
Apr 16 12:00:22 ptah kernel: Intel GenuineIntel
Apr 16 12:00:22 ptah kernel: AMD AuthenticAMD
Apr 16 12:00:22 ptah kernel: Hygon HygonGenuine
Apr 16 12:00:22 ptah kernel: Centaur CentaurHauls
Apr 16 12:00:22 ptah kernel: Disabled fast string operations
@yanfali
yanfali / convert_colors.go
Created February 1, 2019 20:22
Takes KLE colorway JSON information and writes out a SCSS version of it.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
)
type color struct {