Skip to content

Instantly share code, notes, and snippets.

View antespi's full-sized avatar

Antonio Espinosa antespi

View GitHub Profile
@antespi
antespi / HowTo: Dump and Restore disk image
Last active December 26, 2015 04:19
Dump/Restore disk image
Dump disk into zip file
=======================
# /bin/dd if="$DEVICE" conv=sync,noerror bs=64K | /bin/gzip -c > "$FILE"
Restore from zip file
=======================
# gunzip -c "$FILE" | dd of="$DEVICE" conv=sync,noerror bs=64K
@antespi
antespi / HowTo: Git patching
Last active December 24, 2015 21:19
Git patching
Get a patch from a git branch
=============================
Create a branch, or go to the branch in which we want to modify code
# git checkout -b fix_empty_poster
Make your changes, and see your commits in log
# git log --pretty=oneline -3
@antespi
antespi / HowTo: Sorted disk usage (du)
Last active March 21, 2024 09:05
List first level directories inside a directory, sorted by size. Useful when your disk is full and you are searching something to erase or move elsewhere.
du -k -d1 * | sort -nr | cut -f2 | xargs -d '\n' du -sh