This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import sys | |
from subprocess import Popen | |
from PIL import Image | |
from pdf2image import convert_from_path | |
def pdfs_to_images(in_dir, out_dir): | |
for i, f in enumerate(os.listdir(in_dir)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We aim to be able to recover the whole Nextcloud install in case of failure, | |
# not just the files so we will backup the config too. | |
SAVE_FOLDER='/mnt/samba/nextcloud/' | |
NEXTCLOUD_FOLDER='/var/snap/nextcloud/common/nextcloud/' | |
ARCHIVE_TIMESTAMP=$(date +"%m_%d_%Y") | |
# Just in case | |
mkdir $SAVE_FOLDER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install goaccess | |
echo "deb https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list | |
wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install goaccess | |
# Update logrotate so it won't create tiny files | |
echo " | |
/var/log/nginx/*.log { | |
yearly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create user tunnel | |
sudo useradd -m tunnel | |
# Enter some easy password (we'll flush it afterwards) | |
sudo passwd tunnel | |
read -p "Run the client script on your client now. When you're done, press [ENTER]." | |
# Delete tunnel user password | |
sudo passwd -d tunnel | |
# Remove access to the shell for this user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First run setup_autossh_server.sh on your server THEN run this one | |
# Install autossh | |
sudo apt install autossh | |
# Create user tunnel | |
sudo useradd -m tunnel | |
sudo su tunnel | |
# Create key pair | |
ssh-keygen | |
# Copy it to the server | |
ssh-copy-id -i tunnel@[YOU IP/DOMAIN HERE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir gitea | |
cd gitea/ | |
# Replace this with whatever version is relevant now. | |
wget https://dl.gitea.io/gitea/1.4.1/gitea-1.4.1-linux-amd64 | |
# Same here | |
mv gitea-1.4.1-linux-amd64 gitea |