Skip to content

Instantly share code, notes, and snippets.

@chinlung
chinlung / README.md
Created November 24, 2023 08:14 — forked from 756445638/README.md
Install Samba on Mac OS X

Install Samba 3 on OS X 10.7 Lion

Run the two commands below one at a time to get Samba 3 installed and to have it run on boot.

Install Samba with Homebrew

brew install samba

Set Samba up to launch on boot

@chinlung
chinlung / README-setup-tunnel-as-systemd-service.md
Created April 30, 2024 01:32 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@chinlung
chinlung / AuthyToOtherAuthenticator.md
Created April 30, 2024 14:49 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@chinlung
chinlung / gnupg_scdaemon.md
Created May 16, 2024 05:21 — forked from artizirk/gnupg_scdaemon.md
OpenPGP SSH access with Yubikey and GnuPG

NB: This document describles a 'Old-School' way of using Yubikey with SSH

Modern OpenSSH has native support for FIDO Authentication. Its much simpler and should also be more stable with less moving parts. OpenSSH also now has support for signing arbitary files witch can be used as replacement of gnupg. Git also supports signing commits/tags with ssh keys.

Pros of FIDO

  • Simpler stack / less moving parts
  • Works directly with ssh, ssh-add and ssh-keygen on most computers
  • Simpler
  • Private key can never leave the FIDO device

Cons of FIDO

@chinlung
chinlung / pullall.sh
Created March 13, 2025 00:53
這個腳本會自動處理所有本地分支的更新,並在遇到衝突時跳過該分支
#!/bin/bash
# 獲取遠端倉庫的最新數據
git fetch origin
# 記錄當前分支
current_branch=$(git rev-parse --abbrev-ref HEAD)
# 檢查是否有未提交的更改,並暫存
stashed=false