Skip to content

Instantly share code, notes, and snippets.

View nhtlongcs's full-sized avatar
😾

Thang-Long Nguyen-Ho nhtlongcs

😾
View GitHub Profile
@nhtlongcs
nhtlongcs / copy.sh
Last active December 12, 2024 01:16
Parallel File Copying
#!/bin/bash
START=00000
END=99999
SRC="/mnt/keyframes"
DST="/home/nhtlong/keyframes"
USR="nhtlong"
N=16
copy_file() {
local i=$1
@nhtlongcs
nhtlongcs / git-lfs-install.md
Created October 14, 2024 20:13 — forked from pourmand1376/git-lfs-install.md
Single User Installation of Git-LFS without sudo

I wanted to install GIT-Lfs on my user account without access to server root account. I write this to my future self.

  1. Download tar.gz file from git-lfs website.
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz

2.Untar it

tar xvf git-lfs-linux-amd64-v3.2.0.tar.gz
@nhtlongcs
nhtlongcs / README_hfd.md
Last active October 9, 2024 19:59 — 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 or *.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.
@nhtlongcs
nhtlongcs / .ssh_config
Created October 2, 2024 18:37
slurm vscode ssh
Host root
HostName rootnode.com
User tnguyenho
ProxyJump gateway
Host rootx
ProxyCommand ssh root 'nc $(squeue -u tnguyenho --name=tunnel --states=R -h -O NodeList,Comment)'
StrictHostKeyChecking no
User tnguyenho
@nhtlongcs
nhtlongcs / readme.md
Created March 12, 2024 13:26
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
sudo chmod 666 /var/run/docker.sock

Solution came from Olshansk

@nhtlongcs
nhtlongcs / Readme.md
Created February 27, 2024 16:20
A SIMPLE CLEANING GUIDE

A SIMPLE CLEANING GUIDE

FOLDER_ARG=$1
if [ -z "$FOLDER_ARG" ]; then
    FOLDER_ARG="~/"
fi
sudo du -lh --max-depth 1 $FOLDER_ARG | sort -h -r
@nhtlongcs
nhtlongcs / PowerlineForTerminal.md
Created January 6, 2022 15:31 — forked from DucNgn/PowerlineForTerminal.md
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

# Download Ngrok to tunnel the tensorboard port to an external port
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
!unzip ngrok-stable-linux-amd64.zip
# Run tensorboard as well as Ngrox (for tunneling as non-blocking processes)
import os
import multiprocessing
pool = multiprocessing.Pool(processes = 10)
@nhtlongcs
nhtlongcs / run.py
Created January 25, 2021 16:52
3dcapture
import os
import sys
import bpy
import time
import glob
import math
import mathutils
import numpy as np
from mathutils import Vector
import argparse
import os
import sys
sys.path.append("../libs/")
import csv
import glob
from PIL import Image
from tqdm import tqdm
from pathlib import Path