Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
yannbertrand / nr-auto-node-run.sh
Last active March 21, 2025 13:13
`nr` bash function to use `node --run` when possible
nr() {
node_version=$(node -v)
major=$(echo $node_version | cut -c 2-3)
if [[ $(($major)) -gt 21 ]]
then
echo "node $node_version, using node --run $@ ⚡\n"
node --run $@
else
echo "node $node_version, using npm run $@\n"
npm run $@
@padeoe
padeoe / README_hfd.md
Last active April 21, 2025 08:47
CLI-Tool for download Huggingface models and datasets with aria2/wget: hfd

🤗Huggingface Model Downloader

Note

(2025-01-08) Add feature for 🏷️Tag(Revision) Selection, contributed by @Bamboo-D.
(2024-12-17) Add feature for ⚡Quick Startup and ⏭️Fast Resume, enabling skipping of downloaded files, while removing the git clone dependency to accelerate file list retrieval.

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 leverages curl and aria2c for fast and robust downloading of models and datasets.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
@mal1kc
mal1kc / system_hardware_info.py
Last active July 11, 2022 15:24
system hardware info with python3 ;psutil module and builtin platform,datetime modules
import psutil
import platform
from datetime import datetime
def get_size(bytes, suffix="B"):
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
@pythoninthegrass
pythoninthegrass / starship.toml
Last active April 25, 2025 18:55
Starship prompt setup
# SOURCES
# https://starship.rs/config
# https://starship.rs/presets/nerd-font.html#configuration
# DEBUG via:
# starship explain
# STARSHIP_LOG=trace
"$schema" = 'https://starship.rs/config-schema.json'
@dims
dims / README.md
Last active March 30, 2025 21:48
Kubernetes Resources
@SimonLeeGit
SimonLeeGit / check_system_info.py
Created May 8, 2021 06:07
check linux system info when necessary
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os, sys
import json
import logging
import traceback
import psutil
import time
import preprocess_error
@ArgonQQ
ArgonQQ / README.md
Last active December 2, 2024 13:53
Brew install specific version / Locally freeze version

Brew install specific version / Locally freeze version

# Please define variables
packageName=<packageName>
packageVersion=<packageVersion>

# Create a new tab
brew tap-new local/$packageName
@waja
waja / .gitlab-ci.yml
Last active November 17, 2023 16:10
Ansible molecule Gitlab CI
# See https://gitlab.com/richardskumat/ansible-role-client-debian-role/-/blob/master/.gitlab-ci.yml
image: qwe1/dind-ansible-molecule:latest
variables:
# DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# https://gitlab.com/gitlab-org/gitlab-ce/issues/64959
# 19.03 had some breaking changes compared to 18.09
DOCKER_TLS_CERTDIR: ""
services:
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'
@minorsecond
minorsecond / sysinfo.py
Created January 30, 2021 23:50
System Info for BPQ32 Reporting
#!/bin/python
# Get sysinfo and print for BPQ reporting
import os
import time
import platform
import distro
import cpuinfo
import psutil
import uptime