Skip to content

Instantly share code, notes, and snippets.

View chenxinlong's full-sized avatar

triangle chenxinlong

  • Xiamen, China
  • 17:23 (UTC +08:00)
View GitHub Profile
# 所有 syscall 函数可以在 strace 源码中的 linux/<platform>/syscallent.h 里找到,比如 x86_64
https://github.com/strace/strace/blob/master/linux/x86_64/syscallent.h
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
package chainsaw
import (
"reflect"
"testing"
)
/*
goos: darwin
goarch: arm64
@chenxinlong
chenxinlong / ssh-tutorial.md
Created October 12, 2022 01:54 — forked from slowkow/ssh-tutorial.md
ssh to a server without typing your password

How to ssh to a remote server without typing your password

Save yourself a few keystrokes. Follow the steps below:

  1. Run this Bash script on your laptop:

    #!/usr/bin/env bash
    

The hostname of your remote server.

# install
```
brew install esolitos/ipa/sshpass
```
according to https://github.com/kevinburke/sshpass/issues/3
# use
@chenxinlong
chenxinlong / README_hfd.md
Created March 8, 2024 07:04 — forked from padeoe/README_hfd.md
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., .bin and .safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@chenxinlong
chenxinlong / iommu.sh
Created September 24, 2024 08:18 — forked from n1snt/iommu.sh
A simple bash script to get the list of iommu groups & the devices in those iommu groups.
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done