Skip to content

Instantly share code, notes, and snippets.

View EranStockdale's full-sized avatar

Eran Stockdale EranStockdale

View GitHub Profile
@yanqd0
yanqd0 / dl_requests_tqdm.py
Last active February 4, 2025 23:10
Python requests download file with a tqdm progress bar
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,
@itzg
itzg / Add more physical space to an LVM volume.md
Last active September 6, 2023 22:22
Add more physical space to an LVM volume

Find and create a partition with free space:

# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: ATA Crucial_CT240M50 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/4096B