Skip to content

Instantly share code, notes, and snippets.

@pirate
pirate / asymptotic_progress_bar.py
Last active May 31, 2023 08:43
Animated CLI progress bar that fills up over N seconds, gracefully handling delays by filling slower and slower if the task exceeds the expected time. Good for when you don't know how long a task is going to take, but you still need it to A. feel fast in the avg case, and B. not freeze in the worst case (unknown total time).
#!/usr/bin/env python3
# asymptotic_progress_bar.py
# MIT License © 2021
#
# A pretty non-blocking python progress bar timer that fills up asymptotically until you stop it.
# Good for when you don't know how long a task is going to take (up to some max timeout),
# but you want it to feel fast and accurate / not stuck the whole time.
# ████████████████████ 0.9% (1/60sec)
# useful for animating e.g. file copy progress, download progress, package install progress, etc.
#
@r0mdau
r0mdau / HFS.md
Last active March 15, 2024 11:50
How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

How to recover pictures and files from failed MacOS / HFS+ hard drive with Linux

A couple months ago, a friend ask me to repair a failing macintosh.

It appears the hard drive has multiple failures from SMART anlysis.

Next reboot... Oh crap, the operating system does not start anymore. The drive contains 10 years of pictures to recover. A heart pinch :'(

Important thing to know, if (certainely) the disk is crypted and you don't know the principal user login password,