Skip to content

Instantly share code, notes, and snippets.

View vinhais's full-sized avatar
🏠
Working from home

Gabriel vinhais

🏠
Working from home
View GitHub Profile
@vinhais
vinhais / dd-examples.md
Created April 20, 2023 19:01 — forked from JonathanPorta/dd-examples.md
DD Backup, Compress, and Restore

Backup/Image

Make sure the if value is correct! If doing this over SSH then open a TMUX session first... or else...

dd if=/dev/YOUR-DEVICE conv=sync,noerror bs=64K | gzip -c  > /home/portaj/macbook.img.gz

NOTE: You might not want to compress the image. It just means you have to uncompress it later to mount it. If you're planning to access the data soon, or frequently, don't compress it.

Saving a copy of the drive geometry

Save it in the same directory as the compressed image so later on if you decide you want to mount or extract data from the image you can see the partition structure without having to decompress the whole image. There might be some other ways to mount a compressed image.

@vinhais
vinhais / Caddyfile
Created November 8, 2022 16:53
Caddyfile for phpMyAdmin + php-fpm
# Caddyfile to serve phpMyAdmin with PHP 8.0.
#
# apt install php8.0 php8.0-{mysqli,mbstring,fpm,zip} phpmyadmin
# systemctl start php8.0-fpm
# ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin
#
https://phpmyadmin.domain {
root * /var/www/phpmyadmin