time mysqldump -u root -p database > /var/backups/restore_backup.sql
mv /var/lib/mysql /tmp/backups/mysql-lib.bak
cp /etc/mysql/my.cnf /tmp/backups/my.cnf.bak
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
sudo apt-get install mysql-server
cp /tmp/backups/my.cnf.bak /etc/mysql/my.cnf
sudo service mysql restart
mysql -u root -p
mysql> CREATE DATABASE database;
time mysql -u root -p database < /var/backups/restore_backup.sql
If you want to get data (in JPG) from your RAW file in Ubuntu/Linux, do next:
1) Install exiftool in your Linux system:
sudo apt install exiftool
2) not necessary step: view your RAW file data:
exiftool -s2 -all -b -X -fXMP:XMP foto.cr2
3) not necessary step: near the bottom, it will shows:
Composite:PreviewImage='(Binary data 1706501 bytes, use -b option to extract)'
Composite:ThumbnailImage='(Binary data 17031 bytes, use -b option to extract)'
4) Use the "-b" option to extract either or both:
exiftool -Composite:PreviewImage -b foto.cr2 >preview.jpg
exiftool -Composite:ThumbnailImage -b foto.cr2 >thumb.jpg
5) To extract data from all files in the folder, do next:
for i in *.CR2; do exiftool -Composite:PreviewImage -b $i > $i.jpg; done
6) Done. We did execute all JPG data from RAW files:
How to resize your photos from Ubuntu (Lunux) console with ImageMagick?
for i in *.JPG; do convert -quality 100 -resize 30% $i $i; done
Для каждого $i в формате JPG > конвертируем в качество 100% + ресайз 30% от оригинала, перезаписываем файл $i в $i;
Получаем вместо 8mb фото, фото 1.2mb.