|
|
|
@ -1,6 +1,7 @@ |
|
|
|
# CLI Cheatsheet |
|
|
|
# CLI Cheatsheet |
|
|
|
|
|
|
|
|
|
|
|
## Contents |
|
|
|
## Contents |
|
|
|
|
|
|
|
|
|
|
|
- [Drupal / Drush](#drupal--drush) |
|
|
|
- [Drupal / Drush](#drupal--drush) |
|
|
|
- [Text Processing](#text-processing) |
|
|
|
- [Text Processing](#text-processing) |
|
|
|
- [Torrents](#torrents) |
|
|
|
- [Torrents](#torrents) |
|
|
|
@ -43,8 +44,7 @@ |
|
|
|
# Rename files matching a pattern, verbose output shows what changed |
|
|
|
# Rename files matching a pattern, verbose output shows what changed |
|
|
|
rename 's/livero/lives/g' **/*.* -v |
|
|
|
rename 's/livero/lives/g' **/*.* -v |
|
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD |
|
|
|
## <<<<<<< HEAD |
|
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Torrents |
|
|
|
## Torrents |
|
|
|
|
|
|
|
|
|
|
|
@ -124,23 +124,32 @@ |
|
|
|
--audio-channels 1 \ |
|
|
|
--audio-channels 1 \ |
|
|
|
--output-dir "/data/split" |
|
|
|
--output-dir "/data/split" |
|
|
|
-vv |
|
|
|
-vv |
|
|
|
======= |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
ffmpeg -i Chaos.m4b -map 0:a -f segment -segment_times $(ffprobe -i Chaos.m4b -show_chapters -loglevel error | grep end_time | cut -d= -f2 | tr '\n' ',' | sed 's/,$//') -c:a libmp3lame -q:a 2 chapter_%03d.mp3 |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
# check current dpi |
|
|
|
# check current dpi |
|
|
|
for f in *.pdf *.PDF; do |
|
|
|
|
|
|
|
|
|
|
|
for f in _.pdf_.PDF; do |
|
|
|
echo "=== Images in: $f ===" |
|
|
|
echo "=== Images in: $f ===" |
|
|
|
pdfimages -list "$f" |
|
|
|
pdfimages -list "$f" |
|
|
|
echo "" |
|
|
|
echo "" |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# Creates (or overwrites) images_list.txt in the current directory |
|
|
|
# Creates (or overwrites) images_list.txt in the current directory |
|
|
|
for f in *.pdf *.PDF; do |
|
|
|
|
|
|
|
|
|
|
|
for f in _.pdf_.PDF; do |
|
|
|
if [ -f "$f" ]; then |
|
|
|
if [ -f "$f" ]; then |
|
|
|
echo "=== Images in: $f ===" >> images_list.txt |
|
|
|
echo "=== Images in: $f ===" >> images_list.txt |
|
|
|
pdfimages -list "$f" >> images_list.txt |
|
|
|
pdfimages -list "$f" >> images_list.txt |
|
|
|
echo "" >> images_list.txt |
|
|
|
echo "" >> images_list.txt |
|
|
|
fi |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# scan for ccitt encoding |
|
|
|
# scan for ccitt encoding |
|
|
|
for f in *.pdf *.PDF; do |
|
|
|
|
|
|
|
|
|
|
|
for f in _.pdf_.PDF; do |
|
|
|
[ -f "$f" ] || continue |
|
|
|
[ -f "$f" ] || continue |
|
|
|
if pdfimages -list "$f" 2>/dev/null | grep -q " ccitt "; then |
|
|
|
if pdfimages -list "$f" 2>/dev/null | grep -q " ccitt "; then |
|
|
|
echo "$f uses CCITT" |
|
|
|
echo "$f uses CCITT" |
|
|
|
@ -148,6 +157,7 @@ for f in *.pdf *.PDF; do |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# Large file transfer to gdrive |
|
|
|
# Large file transfer to gdrive |
|
|
|
|
|
|
|
|
|
|
|
rclone copy file_location file_destination \ |
|
|
|
rclone copy file_location file_destination \ |
|
|
|
--progress \ |
|
|
|
--progress \ |
|
|
|
--transfers 4 \ |
|
|
|
--transfers 4 \ |
|
|
|
@ -157,4 +167,5 @@ rclone copy file_location file_destination \ |
|
|
|
--drive-chunk-size 64M \ |
|
|
|
--drive-chunk-size 64M \ |
|
|
|
--log-file rclone.log \ |
|
|
|
--log-file rclone.log \ |
|
|
|
--log-level INFO |
|
|
|
--log-level INFO |
|
|
|
|
|
|
|
|
|
|
|
> > > > > > > f99d1ed ([nb] Edit: cli_commands.md) |
|
|
|
> > > > > > > f99d1ed ([nb] Edit: cli_commands.md) |
|
|
|
|