Skip to content

Instantly share code, notes, and snippets.

View Razuuu's full-sized avatar
🏠
Working from home

Joshua Samenfink Razuuu

🏠
Working from home
View GitHub Profile
test
@Razuuu
Razuuu / install-rspamd-stable.sh
Last active August 28, 2023 19:32
Install rspamd stable - Debian
#!/bin/bash
# See https://rspamd.com/downloads.html
apt update
apt-get install sudo
sudo apt-get install -y lsb-release wget gpg
CODENAME=`lsb_release -c -s`
if [ $CODENAME = "trixie" ]; then
CODENAME="bookworm"
fi
@Razuuu
Razuuu / nginx-sites-enabler.sh
Last active August 28, 2023 19:33
Nginx sites enabler / linker - Domain needs a custom folder: /etc/nginx/<domain>/<file>
#!/bin/bash
# ------------------------------------------------------
# Functions - Common
# ------------------------------------------------------
domain=$1
domainpath0="/etc/nginx/sites-available/${domain,,}"
domainpath1="/etc/nginx/sites-enabled/${domain,,}"
logpath="/var/log/nginx/${domain,,}"
@Razuuu
Razuuu / certbot-rfc2136.sh
Last active August 28, 2023 19:34
Create wildcard letsencrypt certificate with rfc2136 - Custom nameservers
#!/bin/bash
# ------------------------------------------------------
# Functions - Common
# ------------------------------------------------------
DOMAIN=$1
SUBDOMAIN=$2
# See https://certbot-dns-rfc2136.readthedocs.io/en/stable/ for certbot.ini
COMMAND="certbot certonly --dns-rfc2136 --dns-rfc2136-credentials /root/.secrets/certbot.ini"
@Razuuu
Razuuu / stockrom_mounter.sh
Last active September 12, 2023 15:45
Mounts stock rom (system,vendor) to /mnt/stock/. Can also unmount
#!/bin/bash
DEVICE="$1"
UMOUNT="$2"
if [ -z "$DEVICE" ]; then
echo "Usage: $0 <DEVICE> [optional: --unmount]"
exit 1
fi
@Razuuu
Razuuu / install_PreMiD.txt
Last active October 17, 2023 21:01
Install PreMiD on debian based systems
See: https://github.com/PreMiD/Linux/blob/master/README.md#packagecloud
$ curl -s https://packagecloud.io/install/repositories/PreMiD/Linux/script.deb.sh | sudo bash
$ sudo apt install premid
if you're using debian buster and up like trixie, edit your sources.list.d file to buster instead of trixie
https://premid.app/downloads
Select your browser
@Razuuu
Razuuu / discord-install-update.sh
Last active October 20, 2023 23:29
Install or (default: update) discord via tar.gz file
#!/bin/bash
echo "$([ "$1" == "install" ] && echo "Install" || echo "Update") Discord"
# Download Discord
cd /tmp
curl -o discord.tar.gz -J --location-trusted --max-redirs 10 "https://discord.com/api/download/stable?platform=linux&format=tar.gz"
# Unzip
tar -xzf discord.tar.gz
@Razuuu
Razuuu / deb-sury-org-php.sh
Last active November 7, 2023 15:06
Add php repository from sury.org
#!/bin/bash
# Debian Repository not available for trixie (yet)
DISTRO=$(dpkg --status tzdata|grep Provides|cut -f2 -d'-')
if [ "${DISTRO}" == "trixie" ]; then DISTRO="bookworm"; fi
# Install dependencies
apt update
apt install apt-transport-https ca-certificates curl -y
@Razuuu
Razuuu / aptall.sh
Last active November 7, 2023 15:08
apt all commands -> /usr/bin/aptall
#!/bin/bash
for i in update upgrade dist-upgrade full-upgrade autoremove; do
repeat(){ for j in {1..25}; do echo -n "#"; done }
repeat; echo -e "\n\nexecuting command: apt -y ${i}\n"; repeat; echo
apt -y ${i}
done
@Razuuu
Razuuu / lineage_setup.sh
Last active November 14, 2023 16:14
Sync LineageOS on a freshly installed Debian 12+ server
#!/bin/bash
#
# Script by Razuuu
#
# Variables
CONFIGFILE=$1
# Access to usershell via function