Skip to content

Instantly share code, notes, and snippets.

View soldni's full-sized avatar
🏳️‍🌈
vibing!

Luca Soldaini soldni

🏳️‍🌈
vibing!
View GitHub Profile
@dirkgr
dirkgr / logs.py
Last active March 5, 2025 19:57
This submits server logs to Google Gemini and lets Gemini analyze them.
#
# Run like this:
# beaker experiment logs <experiment id> | python logs.py
#
import sys
import re
from collections import defaultdict, Counter
from typing import List, Dict
import asyncio
import os
import random
from collections import deque
import ssl
from urllib.parse import urlparse
import aiohttp
import polars as pl
import aiofiles
@padeoe
padeoe / README_hfd.md
Last active May 1, 2025 14:29
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.
@ibeauregard
ibeauregard / exhaustive-ballot.ipynb
Created October 31, 2020 17:27
Exhaustive Ballot.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lizthegrey
lizthegrey / attributes.rb
Last active March 27, 2025 02:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@dirkgr
dirkgr / logging_tqdm.py
Last active December 19, 2024 20:39
A drop-in replacement for TQDM which writes log messages instead of progress bars
from typing import *
import time
import logging
def logging_tqdm(
i,
*,
logger: Optional[logging.Logger] = None,
desc: str = "Working",
total: Optional[int] = None,
import json
from twitter import *
# Twitter app credentials
token = "..."
token_secret = "..."
consumer_key = "..."
consumer_secret = "..."
# Twitter client
@xiaom
xiaom / install_mosh_locally.sh
Last active April 2, 2024 16:48
install mosh locally
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, [email protected]
mkdir mosh
cd mosh