Skip to content

Instantly share code, notes, and snippets.

View zjlww's full-sized avatar

Zhijun Liu zjlww

View GitHub Profile
@zjlww
zjlww / recovery-ssh-v6.sh
Created September 17, 2026 18:12
macOS Recovery SSH starter v6 (Apple Silicon): quoted -h path, space-free key dir
#!/bin/sh
# recovery-ssh.sh (v6) — start an SSH server inside macOS Recovery / the
# installer environment on Apple Silicon so a remote operator can get a shell.
#
# Run it in Recovery: Utilities -> Terminal, then
#
# curl -fsSL <url> | sh
#
# It authorises exactly one public key, obtains a host key, and runs sshd in
# the foreground so authentication attempts are visible in the Terminal.
@zjlww
zjlww / recovery-ssh-v5.sh
Created September 17, 2026 18:11
macOS Recovery SSH starter v5 (Apple Silicon): clears stale sshd, space-free key path
#!/bin/sh
# recovery-ssh.sh — start an SSH server inside macOS Recovery / the installer
# environment on Apple Silicon so a remote operator can get a shell.
#
# Run it in Recovery: Utilities -> Terminal, then
#
# curl -fsSL <url> | sh
#
# It authorises exactly one public key, generates host keys, and runs sshd in
# the foreground so authentication attempts are visible in the Terminal.
@zjlww
zjlww / recovery-ssh-v4.sh
Created September 17, 2026 18:11
macOS Recovery SSH starter v4 (Apple Silicon): space-free authorised-keys path
#!/bin/sh
# recovery-ssh.sh — start an SSH server inside macOS Recovery / the installer
# environment on Apple Silicon so a remote operator can get a shell.
#
# Run it in Recovery: Utilities -> Terminal, then
#
# curl -fsSL <url> | sh
#
# It authorises exactly one public key, generates host keys, and runs sshd in
# the foreground so authentication attempts are visible in the Terminal.
@zjlww
zjlww / recovery-ssh-v2.sh
Created September 17, 2026 18:09
macOS Recovery SSH starter v2 (Apple Silicon): no ssh-keygen dependency, self-diagnosing
#!/bin/sh
# recovery-ssh.sh — start an SSH server inside macOS Recovery / the installer
# environment on Apple Silicon so a remote operator can get a shell.
#
# Run it in Recovery: Utilities -> Terminal, then
#
# curl -fsSL <url> | sh
#
# It authorises exactly one public key, generates host keys, and runs sshd in
# the foreground so authentication attempts are visible in the Terminal.
@zjlww
zjlww / recovery-ssh.gist.sh
Last active September 17, 2026 18:09
macOS Recovery SSH starter (Apple Silicon): authorise one key and run sshd in the recovery environment
#!/bin/sh
# recovery-ssh.sh — start an SSH server inside macOS Recovery / the installer
# environment on Apple Silicon so a remote operator can get a shell.
#
# Run it in Recovery: Utilities -> Terminal, then
#
# curl -fsSL <url> | sh
#
# It authorises exactly one public key, generates host keys, and runs sshd in
# the foreground so authentication attempts are visible in the Terminal.
@zjlww
zjlww / model.py
Created December 7, 2024 01:39
Stripped AudioCodecModel from NeMo @ bde672e
from typing import Tuple
import torch
from torch import nn, Tensor
import torch.nn.functional as F
from einops import rearrange
from .modules import HiFiGANEncoder, HiFiGANDecoder, GroupFiniteScalarQuantizer
class AudioCodecModel(nn.Module):