Skip to content

Instantly share code, notes, and snippets.

@borcean
borcean / t480-fedora-fingerprint.md
Last active May 7, 2024 08:11
ThinkPad T480 fingerprint reader on Fedora Linux

ThinkPad T480 fingerprint reader on Fedora Linux

Background

The Synaptics fingerprint sensor (06cb:009a) present on my T480 is not supported by libfprint and fprintd as it requires a non-free binary blob. uunicorn created open-fprintd, a replacement for fprintd, that allows for loading of binary blobs. In conjunction with their python-validity driver we are able to make use of the inbuilt fingerprint reader. The following instructions were tested against Fedora Linux 35.

Installing open-fprintd and python-validity

sudo dnf copr enable tigro/python-validity
sudo dnf install open-fprintd fprintd-clients fprintd-clients-pam python3-validity
@enginefeeder101
enginefeeder101 / auth_provider.py
Last active May 7, 2024 08:10 — forked from sidoh/auth_provider.py
Custom HomeAssistant auth provider
import logging
import jwt
from urllib.parse import urlparse
import urllib.request
from collections import OrderedDict
from typing import Any, Dict, Optional, cast
import voluptuous as vol
@R0GGER
R0GGER / _hsts.conf
Last active May 7, 2024 08:09
Workaround - Security Headers @ NGINX Proxy Manager
{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
{% if hsts_enabled == 1 or hsts_enabled == true %}
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;
@Tapanhaz
Tapanhaz / abcd.py
Last active May 7, 2024 08:08
Custom logging formatter with colored console outputs and logging to file.
import logging
logger = logging.getLogger(__name__)
def func1():
logger.warning("This is a warning message")
logger.info("This is a info message")
@spali
spali / 10-wancarp
Last active May 7, 2024 08:07
Disable WAN Interface on CARP Backup
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
@kmobs
kmobs / DampingRatio.md
Last active May 7, 2024 08:07
Calculating the damping ratio for your hardware:

Prerequisite - Outdated. I don't use the resonance testing branch or pulses method anymore.

I recommend running Dmitry’s latest resonance testing branch and using the pulses method outlined below:

https://github.com/Klipper3d/klipper/issues/4560
https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

I would only go down this path if you're getting ghosting with really high speed prints. On the Annex Engineering K3 for example, no matter how perfect the graphs looked, I was still getting some ghosting. That prompted me to go down this path. I'm now able to print at 20-30k acceleration, 250-350mm/s, and 15scv with perfect quality that can usually only be seen at significantly slower speeds.

The default settings in Klipper have the damping ratio set to .1. This should be fine for most people with sane settings. I like to go for the insane.

@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active May 7, 2024 08:06
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@liuran001
liuran001 / config.yaml
Last active May 7, 2024 08:04
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.5-240507
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@yunho0130
yunho0130 / guide.md
Created February 23, 2021 13:13 — forked from rishubil/guide.md
SCE-TTS: 내 목소리로 TTS 만들기

📗 문서 주소가 https://sce-tts.github.io/ 으로 변경되었습니다.

SCE-TTS와 관련한 최신 정보는 위 주소를 참고해주세요!

아래의 내용은 이전 문서 내용입니다.


SCE-TTS: 내 목소리로 TTS 만들기

@shamil
shamil / mount_qcow2.md
Last active May 7, 2024 08:02
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8