Convert TXT to PDF

unoconv -f pdf input.txt output.pdf

Solr setup full-text search in 5 minutes

  1. Download the latest version of solr (Solr 6.5.1)
  2. Unpack it and go into the bin directory
  3. Start it up by executing:
    ./solr start
  4. Initialize the configuration by executing:
    ./solr create -c files -d ../example/files/conf
  5. Index your files by executing:
    ./post -c files ~/Documents
  6. Open the web browser and start Searching

Convert EML to PDF

On git hub a project can be found that does exactly that: eml-to-pdf-convertere.

The program can be used as follows:

java -jar /home/patrick/data/Apps/eml-to-pdf-converter/emailconverter-2.0.1-all.jar --extract-attachments --extract-attachments-directory ./ 

PDF Document Editing the Table of Contents

This can easily be done with jpdfbookmarks.

Cutting a video without reencoding

ffmpeg -ss [start] -i in.mp4 --to [end] -c copy out.mp4
  • -ss specifies the start time, e. g. 00:01:10.000 or 70 (in seconds)
  • -to specifies the end time, e. g. 00:02:10.000 or 130 (in seconds)

Dealing with PST under linux

I prefer dealing with outlook archives (pst-files) by extracting the messages to a folder structure, saving each message as eml-file (Thunderbird mail-format). This can be achieved as follows:

readpst -o 'Archived Messages' -D -j 4 -r -tea -u -w -m ./some.pst

If the command cannot be found, you might need to install the package libpst first. The command creates msg and eml files with a increasing number as the filename.

Lossless optimization of JPEGs

Many digital cameras don't do a lot of processing when saving pictures. The jpegoptim command is able to save some space just by optimizing the Huffman tables. This doesn't have any impact on the quality and can save up to 40 percent of diskspace.

find -type f -name "*.jpg" -exec jpegoptim -p -P {} \;

Compare two excel files

There is a hidden tool if you are running a Professional Version of office. You find it here:

C:\Program Files (x86)\Microsoft Office\Office15\DCF\SPREADSHEETCOMPARE.EXE

Depending on the version of office that you are running the folder "Office15" can have another number. It allows you to select to files and visualize them side-by-side with a nice graphical overview of the differences

PDF OCR with Fedora 24 and Tesseract

Run the following commands:

sudo dnf install python3-pip python3-devel libffi-devel qpdf tesseract tesseract-langpack-deu tesseract-osd
sudo python3 -m pip install ocrmypdf 

Now you can convert a file like this:

ocrmypdf -l deu input.pdf output.pdf

If you don't install the tesseract-osd package, it will work but the following error message appears:

Mount Amazon S3 on Fedora 24

There is no package that is ready to be installed. You need to download and compile the code yourself. First you need to install some development libraries. Execute the following commands:

sudo dnf install fuse-devel libcurl-devel libxml2-devel
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
sudo make install

Then you need to create the directory where you want to mount your bucket:

Tags:

Pages

Subscribe to uhlme.ch RSS