Skip to content

Instantly share code, notes, and snippets.

View Git-on-my-level's full-sized avatar

David Zhang Git-on-my-level

View GitHub Profile
@Git-on-my-level
Git-on-my-level / remote-headless-mac-setup.md
Created January 28, 2026 10:38
Set up a new Mac to with SSH/Mosh, Tailscale, and minimal sane tmux setup

Mac-to-Mac Remote Shell Stack (Tailscale + SSH + Mosh + tmux) — Low-Lag, High-Reliability Setup

This gist documents a reproducible setup for a “remote shell that feels local” between a laptop and one or more headless Macs (e.g., Mac minis). It is optimized for:

  • High latency / packet loss links (SSH typing lag, key repeats, “rubber band” echo)
  • Roaming networks (Wi-Fi drops, IP changes)
  • Long-lived sessions (detach/reattach, crash tolerance)

Core design decisions:

  • Tailscale provides a private, encrypted, stable network plane (no port forwarding/NAT complexity).
  • OpenSSH (Remote Login) is used for authentication, key management, and compatibility.
@Git-on-my-level
Git-on-my-level / update_git_repos.sh
Last active August 14, 2025 11:40
Update `main` for multiple git repositories in the current directory
#!/bin/bash
# Initialize arrays to store results
successful_updates=()
failed_updates=()
skipped_repos=()
no_git_repos=()
@Git-on-my-level
Git-on-my-level / fix-git-filename-case.sh
Created May 14, 2025 13:29
Bash script to fix Git file case mismatches on case-sensitive filesystems (e.g., macOS APFS). Solves the problem of when you rename a file, but git doesn't recognize the filename as changed.
#!/bin/bash
# Set IFS to prevent word splitting issues with spaces in paths
IFS=''
# Use git ls-files -z and a while loop with null delimiter
# The '-d $'\0'' tells read to use null character as delimiter
# The '-r' prevents backslash escapes from being interpreted
git ls-files -z | while IFS= read -r -d $'\0' file_path; do
pragma solidity ^0.8.10;
import "./interfaces/IBalanceChecker.sol";
import "../lending/core/interfaces/IAToken.sol";
import "../lending/core/interfaces/IVariableDebtToken.sol";
import "../lending/core/interfaces/IPool.sol";
/// @notice Error thrown when trying to get balances for an external token that isn't mapped to a dToken
error ExternalTokenNotMapped(address externalToken);
@Git-on-my-level
Git-on-my-level / lambda_function.py
Created October 18, 2019 19:41
Harmony Node Earning Cloudwatch Metric Lambda Function
import json
from botocore.vendored import requests
import boto3
import datetime
HARMONY_NODE_1H_STATUS_URL = 'https://harmony.one/1h'
ADDRESS_TO_MONITOR = 'one17ffl9csu7ln3jw07fcvlmh2h8e5pv3ddk9p5sv'
cloudwatch_client = boto3.client('cloudwatch')

Keybase proof

I hereby claim:

  • I am git-on-my-level on github.
  • I am david_z (https://keybase.io/david_z) on keybase.
  • I have a public key ASB3TqtHvEtXQ9fVmsHehXVbaprG7_CSSbQ5TwQ1evo7kAo

To claim this, I am signing this object: