diff --git a/docs/2023-07-01-pastebin.html b/docs/2023-07-01-pastebin.html index 7c53a04..e6b2dd8 100644 --- a/docs/2023-07-01-pastebin.html +++ b/docs/2023-07-01-pastebin.html @@ -487,27 +487,11 @@

> -

Remove proto options:

-
sd -F 'import "validate/validate.proto";' '' api/raw/*.proto
+      
# Remove proto option
+sd -F 'import "validate/validate.proto";' '' api/raw/*.proto
 sd -F 'import "marshal-zap.proto";' '' api/raw/*.proto
-sd -f s '\s\[.*?];' ';' api/raw/*.proto
-
-
-

- fdupes -

- -
-

Remove duplicated files:

-
-
fdupes -rdN .
+sd -f s '\s\[\s*\(.*?];' ';' api/raw/*.proto

@@ -549,6 +533,46 @@

in src, useful to sync dst with src +
+

+ fclones +

+ +
+
+
fclones group . | fclones remove
+
+
+

+ F2 +

+ +
+
+
# If dry run, remove --exec
+f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{hash.md5}{ext}" --exec
+
+# Include ImageSize (require exiftool)
+f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}_{hash.md5}{ext}" --exec
+
+# Not include time
+f2 --exclude="\d+x\d+_[a-z\d]{32}" --sort=mtime --replace "{xt.ImageSize}_{hash.md5}{ext}" --exec
+
+# Remove space in directory
+f2 --find " " --replace "_" --string-mode --only-dir --exec
+

ffmpeg @@ -575,6 +599,21 @@

> +
+

+ yt-dlp +

+ +
+
+
yt-dlp -f - "https://www.youtube.com/watch?v=video_id"
+

libvips @@ -587,7 +626,6 @@

>

-

Convert:

# Add --vips-progress to show progress
 vips jxlsave filename.jpg filename.jxl --keep=none
@@ -605,45 +643,19 @@ 

- yt-dlp + qpdf

-

Download:

-
yt-dlp -f - "https://www.youtube.com/watch?v=video_id"
-
-
-

- F2 -

- -
-

Rename:

-
-
# If dry run, remove --exec
-f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{hash.md5}{ext}" --exec
-
-# Include ImageSize (require exiftool)
-f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}_{hash.md5}{ext}" --exec
-
-# Not include time
-f2 --exclude="\d+x\d+_[a-z\d]{32}" --sort=mtime --replace "{xt.ImageSize}_{hash.md5}{ext}" --exec
-
-# Remove space in directory
-f2 --find " " --replace "_" --string-mode --only-dir --exec
+
# Compress pdf
+qpdf input.pdf output.pdf --verbose --linearize --optimize-images
diff --git a/posts/2023-07-01-pastebin.md b/posts/2023-07-01-pastebin.md index 5c054e3..b41fdc4 100644 --- a/posts/2023-07-01-pastebin.md +++ b/posts/2023-07-01-pastebin.md @@ -224,20 +224,11 @@ fd -H '^\.DS_Store$' -tf -X rm ## [sd](https://github.com/chmln/sd) -Remove proto options: - ```sh +# Remove proto option sd -F 'import "validate/validate.proto";' '' api/raw/*.proto sd -F 'import "marshal-zap.proto";' '' api/raw/*.proto -sd -f s '\s\[.*?];' ';' api/raw/*.proto -``` - -## [fdupes](https://github.com/adrianlopezroche/fdupes) - -Remove duplicated files: - -```sh -fdupes -rdN . +sd -f s '\s\[\s*\(.*?];' ';' api/raw/*.proto ``` ## [rsync](https://github.com/WayneD/rsync) @@ -264,6 +255,28 @@ Be careful flags (need dry run if not sure): - `--delete`: delete files in **dst** if not exist in **src**, useful to sync dst with src +## [fclones](https://github.com/pkolaczk/fclones) + +```sh +fclones group . | fclones remove +``` + +## [F2](https://github.com/ayoisaiah/f2) + +```sh +# If dry run, remove --exec +f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{hash.md5}{ext}" --exec + +# Include ImageSize (require exiftool) +f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}_{hash.md5}{ext}" --exec + +# Not include time +f2 --exclude="\d+x\d+_[a-z\d]{32}" --sort=mtime --replace "{xt.ImageSize}_{hash.md5}{ext}" --exec + +# Remove space in directory +f2 --find " " --replace "_" --string-mode --only-dir --exec +``` + ## [ffmpeg](https://github.com/FFmpeg/FFmpeg) ```sh @@ -277,9 +290,13 @@ Links: - [H.265/HEVC Video Encoding Guide](https://trac.ffmpeg.org/wiki/Encode/H.265) -## [libvips](https://github.com/libvips/libvips) +## [yt-dlp](https://github.com/yt-dlp/yt-dlp) -Convert: +```sh +yt-dlp -f - "https://www.youtube.com/watch?v=video_id" +``` + +## [libvips](https://github.com/libvips/libvips) ```sh # Add --vips-progress to show progress @@ -297,28 +314,9 @@ fd "png|webp|gif" --exec-batch rm vips rot filename.jxl new_filename.jxl d90 ``` -## [yt-dlp](https://github.com/yt-dlp/yt-dlp) - -Download: - -```sh -yt-dlp -f - "https://www.youtube.com/watch?v=video_id" -``` - -## [F2](https://github.com/ayoisaiah/f2) - -Rename: +## [qpdf](https://github.com/qpdf/qpdf) ```sh -# If dry run, remove --exec -f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{hash.md5}{ext}" --exec - -# Include ImageSize (require exiftool) -f2 --replace "{mtime.YYYY}{mtime.MM}{mtime.DD}_{mtime.H}{mtime.mm}{mtime.ss}_{xt.ImageSize}_{hash.md5}{ext}" --exec - -# Not include time -f2 --exclude="\d+x\d+_[a-z\d]{32}" --sort=mtime --replace "{xt.ImageSize}_{hash.md5}{ext}" --exec - -# Remove space in directory -f2 --find " " --replace "_" --string-mode --only-dir --exec +# Compress pdf +qpdf input.pdf output.pdf --verbose --linearize --optimize-images ```