You will need:
- Ubuntu (or other Linux distribution) computer
- TWRP image for your tablet model. Search for it on https://twrp.me/Devices/
- latest firmware for the Android tablet. For example download it from sammobile.
- The heimdall command. Download it with
sudo apt-get install heimdall-flash
- Binaries for manipulating Android images: ext2simg and sgs4ext4fs.