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
MinderKeyboardShortcutsOutliner_cropped.pdf
27.3 KB
MinderKeyboardShortcuts Outliner cropped
Two Color Palette apps (free) install as flatpaks within Software Manager. First one on the left is Palette and one on the right is Color Palette.
All the color palettes from the Palette app

Can any of these beat the extensive palettes of color-hex.com nah
really wanna learn how to use sed more. Will go through some online tutorials

tldr sed

sed

Edit text in a scriptable manner.
More information: https://man.archlinux.org/man/sed.1.

- Replace the first occurrence of a regular expression in each line of a file, and print the result:
    sed 's/regular_expression/replace/' filename

- Replace all occurrences of an extended regular expression in a file, and print the result:
    sed -r 's/regular_expression/replace/g' filename

- Replace all occurrences of a string in a file, overwriting the file (i.e. in-place):
    sed -i 's/find/replace/g' filename

- Replace only on lines matching the line pattern:
    sed '/line_pattern/s/find/replace/' filename

- Delete lines matching the line pattern:
    sed '/line_pattern/d' filename

- Print the first 11 lines of a file:
    sed 11q filename

- Apply multiple find-replace expressions to a file:
    sed -e 's/find/replace/' -e 's/find/replace/' filename

- Replace separator / by any other character not used in the find or replace patterns, e.g. #:
sed 's#find#replace#' filename
Gaupol is a subtitle editor and has a great interface. Sadly it is to hard for me to manually add subtitles (that's easy actually) but getting the timing just right is quite the ordeal especially compared to Subtitle Composer (KDE app).

edit: perhaps I spoke too soon Stretch seems to adjust timing by .050 seconds so I'll give it another try

Q Start Earlier
W Start Later
E End Earlier
R End Later

O play current line + 1 second
P play/pause
K set end time
U set beginning time
Just looking at Unbuntu Christian distro I downloaded a bunch of bible stuff but only xiphos seemed like a keeper.

sudo apt install xiphos

Xiphos is a great app for studying and researching the Bible. Recommend installing

Dictionaries -
StrongsGreek and StrongsHebrew

KJVA: King James Version (1769) inclding Aprocrypha, with Strongs Numbers and Morphology

Glossary
Latina - Latin to English Glossary

General Books
English - Finney: Sermons on Gospel Themes
AuthPass https://t.iss.one/geektips/5 is the free (GPL) password manager that I mainly use cuz it has a free iphone and android app. But eventually I'm slowly migrating away from iOS. So if you just need a free (GPL) app that works on Windows, Mac and Linux (no android or iphone) then KeepPassXC is the one you want.

sudo add-apt-repository ppa:phoerious/keepassxc
sudo apt update
sudo apt install keepassxc
Ffmpeg or in Videomass to combine two vf filters just put a comma between them. Upscale to 720p and add subrip SRT subtitles.

-c:v hevc -crf 28 -c:a libopus -b:a 32k -strict -2 -vf scale="-2:720",subtitles="/home/GeekTips/video.srt"
sudo add-apt-repository ppa:alex-p/tesseract-ocr-devel
sudo apt update
sudo apt install tesseract-ocr

Installed Tesseract 5.0 which in my testing was 15% faster than 4.1

ocrmypdf —optimize 3 input.pdf output_optimized.pdf

PDF/A. You may wish to examine the output PDF's XMP metadata.
JPEGs: 100%|███████████████████████████████| 180/180 [00:22<00:00, 6.97image/s]
PNGs: 0image [00:00, ?image/s]
JBIG2: 0item [00:00, ?item/s]
INFO - Optimize ratio: 1.64 savings: 38.9%
INFO - Output file is a PDF/A-2B (as expected)

It optimized the PDF from 165MB —> 101MB.

Noticed gImagereader three weeks ago released a package that's compatible with tesseract 5. Probably have to wait 6 to 12 months till it gets released as a deb file though.
NormCap is a app that lets you capture and OCR any part of your screen you select that is an image and extract text copied to your clipboard which can then be pasted into a text editor.

I tried installing the python norm NormCap cap app but it failed. Just download the appimage.

In Applications | Settings | Keyboard under Application Shorcuts
add Ctrl+Print and for the command navigate to the NormCap-unstable-x86_64.AppImage
MinderKBShortcuts(Outliner).pdf
27.8 KB
Minder Keyboard Shortcuts made with Outliner
Also use Flatseal (Flatpak) to grant home home file permissions for apps where you see /run/user/1000/doc/ as the Flatpak is sandboxed.

Need to do for Annotator, Minder, Outliner
First paragraph – Example text copied from a PDF which contains
unwanted line breaks and
the text doesn’t flow.

Second paragraph – To fix this in LibreOffice you
need to Edit | Search and Replace three
times to fix it.

Third paragraph – now if you have tabs in
your existing document this won’t work. Always wanted an
offline solution not those websites to do this.

Fourth paragraph - So you should see four paragraphs nicely formatted
and the text flowing
so it looks like it should.

You want it to look like so:

First paragraph – Example text copied from a PDF which contains unwanted line breaks and the text doesn’t flow.

Second paragraph – To fix this in LibreOffice you need to Edit | Search and Replace three times to fix it.

Third paragraph – now if you have tabs in your existing document this won’t work. Always wanted an offline solution not those websites to do this.

Fourth paragraph - So you should see four paragraphs nicely formatted and the text flowing so it looks like it should.

Search and Replace and do a Replace ALL four times

1) Find: ^$ (finding only Line Breaks by themselves and not all)
Replace: \t (replaces with a tab)

2) Find: $ (finds all remaining line breaks)
Replace: space (just put a single space character and all the text flows together)

3) Find: \t (finds the tabs)
Replace: \n\n (puts a new line twice to create a paragraph break (on Windows does one need to put \r\n\r\n ?)

4) Find: spacespace (two spaces together " ")
Replace: space (one space)

Can be recorded as a macro. Tools | Options | Advanced | Enable macro recording (restart LibreOffice) if it wasn't already checked.

Ctrl-H to start Search and Replace. Tools | Options | Record Macro (a small dialog will popup showing Stop Recording). Perform actions 1 to 4 and when done click Stop Recording and Save Macro In click My Macros | Standard | New Module and name it RemoveLineBreaks.

Whenever you wish to run the macro do Tools | Macros | Run Macros select RemoveLineBreaks and click Run and line breaks are removed within document. Can also assign a keyboard shortcut to the macro. Tools | Customize | Keyboard
Under Shortcut Keys click on Shift+Ctrl+L (or any unassigned one)
Under Category | LibreOffice Macros | My Macros | Standard | RemoveLineBreaks | Under Function click RemoveLineBreaks then click Modify then Save and name your custom keyboard configuration file. All done.
1) choose keyboard shortcut (any unassigned one)

2) click RemoveLineBreaks

3) and again

4) click Modify

5) click Save and name your keyboard customization configuration file and save it
LMDE 5 beta I played around with under QEMU (like Virtualbox). Linux Mint Debian Edition I believe is the way forward. Canonical who does Ubuntu is evil with their Snap package management system. Flatpak and AppImage are way better.

Nemo (file manager) is better than Thunar (XFCE file manager) dual pane, search and search content within files. Thunar has better file renaming though like Numbering and better regrex in my testing. Still not sure if I’ll switch to Cinnamon or stick with XFCE. Getting off Ubuntu base is a huge step and it looks like Linux Mint can fully pull the plug if they wish to.
Palette Cam (free on iOS, no ads) is quick way to save colors and get hex color from an image. Save palettes without needing to create an online account
Translating services using google while protecting your privacy
https://lingva.ml/
https://simplytranslate.org/

DuckDuckGo many are going away from
https://www.qwant.com/
https://startpage.com/
you could use but at the end of the day they're all controlled. Even telegram CEO is WEF member.
Modified the way to OCR a PDF and only optimize PDFs using —skip-big instead of —tesseract-timeout=0
Forwarded from GeekTips
Only optimizing a PDF for file size and no need to OCR it so from 20.3MiB —> 10.7MiB.

-s is same as —skip-text (skips text if already OCR'd)
-O (that's a letter O not a 0 zero) - - optimize and 3 does aggressive lossy optimizations (including lossy JBIG2)
- - skip-big tells it to skip any page over 0.1 Megapixels (which would be every page)

ocrmypdf -s -O 3 --skip-big .1 some.pdf some_optimized.pdf
Scan: 100%|███████████████████████████████████████████| 399/399 [00:35<00:00, 11.28page/s]
INFO - Start processing 4 pages concurrently
Forwarded from GeekTips
ocrmypdf -O 3 input.pdf output_ocr.pdf

-O 3 (letter O not 0 zero) is - - optimize and 3 does aggressive lossy optimizations (including lossy JBIG2)

OCR: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 125.0/125.0 [06:56<00:00, 3.33s/page]
WARNING - Some input metadata could not be copied because it is not permitted in PDF/A. You may wish to examine the output PDF's XMP metadata.
JPEGs: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 125/125 [00:14<00:00, 8.29image/s]
PNGs: 0image [00:00, ?image/s]
JBIG2: 0item [00:00, ?item/s]
INFO - Optimize ratio: 1.74 savings: 42.5%
INFO - Output file is a PDF/A-2B (as expected)

PDF is 56MB reduced from 98MB. To use you need to install jbig2 encoder
which even after following the instructions I still had to install leptonica which was a pain but worth it in the end. If you don't install libtiff5-dev before you compile leptonica you'll get an error like
Error in pixReadMemTiff: function not present

sudo apt-get install libtiff5-dev

tar zxvf leoptonica-1.82.0.tar.gz
cd leptonica-1.82.0/
./autogen.sh
./configure
make
sudo make install

If you only want to optimize a PDF to reduce size by reducing images then see here https://t.iss.one/geektips/185