Skip to content

Instantly share code, notes, and snippets.

View Luluno01's full-sized avatar

Untitled Luluno01

View GitHub Profile
@Luluno01
Luluno01 / apt-socks5.md
Created February 1, 2025 12:45
Use apt behind a socks5 proxy

Use apt behind a socks5 proxy

One time use

apt -o Acquire::socks::proxy="socks5://127.0.0.1:1080/" update

Permanent

@Luluno01
Luluno01 / clone-checkout-no-large-file.sh
Created November 16, 2023 15:51
Git partial clone & sparse checkout without knowing repo structure in advance
#!/bin/bash
# https://stackoverflow.com/questions/33104475/git-clone-and-pull-omitting-large-files
git clone --no-checkout --filter=blob:limit=10k <URL> --depth=1
cd <repo>
# https://stackoverflow.com/questions/77002971/can-i-force-git-to-stay-offline
git config --unset remote.origin.promisor
git config --unset remote.origin.partialclonefilter
git switch $(git rev-parse --abbrev-ref HEAD)
# The output of `git switch` may contain some errors due to missing large blobs