Using All-in-One WP Migration Plug-in

You MUST use these two settings for things to work.

  • You can use this plug-in to export your site; however, test it first with Docker and YOU CANNOT export the plug-ins. It wil break the site!
  • Also, YOU MUST go into your settings and make your permalinks

All-in-One WP Settings

You should install the plug-in to upload large files too, on your target WordPress - all-in-one-wp-migration-file-extension.zip

You can also use "Traktor-1.1.exe" to extract the files, but it might be easier to just import using Docker and WordPress itself.

Compress a PDF in Ubuntu using GhostScript

View Solution Article
How_to_Compress_PDF_in_Linux.pdf

Refer: compress-pdf-linux

Synopsis / Example

$ sudo apt install ghostscript
$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed_PDF_file.pdf input_PDF_file.pdf
dPDFSETTINGS   Description
/prepress    (default) Higher quality output (300 dpi) but bigger size
/ebook         Medium quality output (150 dpi) with moderate output file size
/screen        Lower quality output (72 dpi) but smallest possible output file size

Upgrade Single Package in Ubuntu

Refer: upgrade-single-package

As usual you need to fetch an updated index from the Internet:

sudo apt-get update

Now upgrade a package, where Package is whatever you want.

sudo apt-get --only-upgrade install Package
sudo apt-get install Package

Bonus, see list of packages available for upgrade

sudo apt-get update
sudo apt list --upgradable

Using Dolphin Browser

The Dolphin browser has a nice integration with the terminal, but you need to install the addtional plug-in.

sudo apt-get install dolphin
sudo apt-get install dolphin konsole
sudo apt-get install ark

Simple Example to Avoid Writing as Root to Host System

Simple way to write to host as current user

Refer: docker-shared-permissions

docker create --name ubuntu1804 \
  --net=host \
  -v ${PWD}:/home \
  --user "$(id -u):$(id -g)" \
  -it mruckman/ubuntu1804:201001

docker start ubuntu1804
docker exec -it ubuntu1804 /bin/bash
docker stop ubuntu1804
docker rm ubuntu1804

Or you can build you container where you pass in the credentials on the host machine.

Build the right image
Now it gets more interesting. Here is how you can build, configure and run your Docker containers correctly, so you don’t have to fight permission errors and access your files easily.

As you should create a non-root user in your Dockerfile in any case, this is a nice thing to do. While we’re at it, we might as well set the user id and group id explicitly.

Here is a minimal Dockerfile which expects to receive build-time arguments, and creates a new user called “user”:

FROM ubuntu

ARG USER_ID
ARG GROUP_ID

RUN addgroup --gid $GROUP_ID user
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user
USER user

Refer: add-user-to-docker-container for more info on adduser

We can use this Dockerfile, to build a fresh image with the host uid and gid. This image, needs to be built specifically for each machine it will run on to make sure everything is in order.

Then, we can run use this image for our command. The user id and group id are correct without having to specify them when running the container.

docker build -t myimage \
  --build-arg USER_ID=$(id -u) \
  --build-arg GROUP_ID=$(id -g) .

docker run -it --rm \
  --mount "type=bind,src=$(pwd)/shared,dst=/opt/shared" \
  --workdir /opt/shared \
  myimage bash

No need to use “chown”, and no annoying permission errors anymore!