GeekTips
109 subscribers
586 photos
3 videos
77 files
231 links
Linux Mint, video encoding, ffmpeg, geek tips, regex, pdf manipulation, substitcher, mpv config
Download Telegram
Another way to remove line breaks besides a LibreOffice macro is using xed (Text Editor) in Linux.

Edit | Preferences | Draw whitespace | Trailing whitespace [x] | Newline character [x] which will show newlines (<—- looking symbol)
highlight a double newline and copy and paste it into search for field

Search for: newline newline
Replace with: %%

Ctrl-A to select all then Ctrl-J to join lines

Search for: %%
Replace with newline newline
Installed calibre which I haven't used for a couple of years now. https://calibre-ebook.com/download_linux
Tried using pandoc and it worked but couldn't get text to justify and it hyphenated which I despise.

These are the options I use to convert an epub to PDF

ebook-convert input.epub output.pdf --base-font-size=7 --change-justification=justify --embed-font-family=freesans
Switched to a different computer just a tad faster but main thing is hottest is around 50 degrees C and put LMDE 5.0 Elsie which stands for Linux Mint Debian Edition. Main difference I notice is no PPAs so having to build a few packages from source and many from python.

Kernel: 5.10.0-13-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: Cinnamon 5.2.7 tk: GTK 3.24.24 wm: muffin dm: LightDM Distro: LMDE 5 Elsie base: Debian 11.2 bullseye

installed Bulk-Renamer from Thunar XFCE file manager as it's superior to nemo
sudo apt install thunar
In nemo the file manager preferences under Behavior set
Bulk Rename command:
thunar -B
as it's superrior to nemo's Bulky

sudo apt-get install python-wxtools
sudo pip3 install videomass

sudo pip3 install ocrmypdf

downloaded source for tesseract-ocr 5.x
./autogen.sh
./configure
make
(took like 45 minutes)
sudo make install
sudo ldconfig

1 [tesseract] Error opening data file /usr/local/share/tessdata/eng.traineddata
1 [tesseract] Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.

Installed English, Japanese, Chinese Simplified
sudo apt install tesseract-ocr-eng tesseract-ocr-jpn tesseract-ocr-chi-sim

sudo cp /usr/share/tesseract-ocr/4.00/tessdata/*.traineddata /usr/local/share/tessdata

also had to install ffmpeg 5.0.1 from source
sudo apt install libopus-dev
./configure --disable-x86asm --enable-libopus
make
sudo make install
Couldn't login — after inputting password it would flash and I'd be stuck in a loop of re-entering user password. Ctrl-Alt-F2 (terminal)
sudo chown myuser:myuser /home/myuser/.Xauthority 
solved the issue then Ctrl-Alt-F7 to switch back to X11.
MusicBrainz Picard (free on Win, Linux, Mac) easy to edit a chaptered opus audiobook. Can change chapter names or even times.
After converting to mka with MKVToolnix which fixes most mp3 errors and then with videomass (ffmpeg) you convert to opus and you still get this error you must deleted these corrupt mp3s as it'll destroy chapter times in the entire opus audiobook. See here for more info
Notes from this excellent Regular Expression Article

grep -o -w "\w\{5\}" wordle-caps.txt > wordle-complete.txt

The regex string itself, \w\{5\} is equivalent to five continuous characters

shuf -n 5 wordle-complete.txt

grep '[^ED][A][T][^ED][^ED]' wordle1 > wordle2

The circumflex ( ^ ) means that the single statement should be inverted, similar to the -v switch. So the full regular expression [^ED][A][T] [^ED][^ED] searches for a string of five letters. The first must not be E or D, the second must be an A, the third must be a T, and so on

grep '[^WP][A][T][A][^WP]' wordle2 >

The A can occur in the second, fourth, or fifth position, and the O can occur in the second, third, or fourth position. L and R do not occur at any position in the target word. The regex for this is [C][^LR][^LR][^LR][^LR]
WordleREGREX.pdf
2.1 MB
Worlde Regrex article
To make text to speech audio with the 9,000 character limit at ttstool dot com. Copy the text into LibreOffice Writer and go through spell checking it. Any titles or heading text put a period ( . ) to pause otherwise it'll speak without pausing the next paragraph and it's really bad.

Replace any IV, XX, Roman numerals with 4, 20, numerals.

Set View to Zoom Factor to Variable 50% to make it easy to select under 9,000 characters.

Hold down Shift key to add more or subtract characters around 7,000 to 8,500 or so paying attention to character count near bottom left. If you don't see it go to View | Status Bar. Then repeat this process as many times as necessary. This document had 55,094 characters total so copied and pasted 7 times.
ttstool dot com Choose a language then a voice. Favorites are Microsoft David, Mark, James and Amazon Joey. Drag bottom right corner to get more text area. Copy and paste text keeping under the 9,000 character limit. Click download arrow to get the 32kbps mp3 file and name it narration01.mp3, narration02.mp3, narration03.mp3 and so on.
In Videomass (multiplatform, GPL, free, ffmpeg front-end GUI) choose Concatenate media files and drag your narrated mp3 files. Sidenote: LosslessCut (GPL) also works great concatenating audio/video files. This gives you one mp3 file which you encode with freac at opus 16kbps voice and be sure to change Title metadata in freac.
Split an audiobook into 60 min chapters

ffmpeg -i someaudiobook.mp3 -c copy -f segment -segment_time 1:00:00 -reset_timestamps 1 ch%02d.mp3
Generate a PDF TOC (Table of Contents) and bookmarks from filenames. I tried jpdftweak, jpdfbookmarks but PDFSAM (Basic Version free, Linux and Windoze) does the job perfectly.
It creates an clickable table of contents at the beginning and also bookmarks. Also it compressed the file from 916MB (874MiB) (pdftk *.pdf cat output combined.pdf) to 810MB (773MiB) with PDFSAM.
Showing Thumbnail of the top portion of the page for the clickable link in the Table of Contents.
Back to adding some Subtitles with Gaupol (flatpak).
Edit a few videos together and add soundtracks in Shotcut (Linux, Mac, Windoze GPL)
Using LosslessCut (Linux, Mac, Windoze GPL) to make quick editing cuts of mp3s. Trim off the first 22 seconds and last 20 seconds of each file before encoding into a opus chaptered audiobook with freac.
These are the options that I use for mp3s. But for videos I use SmartCut or keyframe cuts.
Queue up the files you wish to batch download in Videomass (Linux, Mac, Windoze GPL free) which uses yl-dlp to downlaod from youtube, bitchute, odysee, etc.
Download all the videos in Videomass