Skip to content

Instantly share code, notes, and snippets.

View NotYusta's full-sized avatar

Yusta NotYusta

View GitHub Profile
@NotYusta
NotYusta / rc-local.sh
Last active March 2, 2024 09:26
RC Local
#!/bin/sh
if ! grep -q "bash /root/firewall.sh" "/etc/rc.local"; then
echo 'bash /root/firewall.sh' | sudo tee -a /etc/rc.local
fi
chmod +x /etc/rc.d/rc.local
systemctl enable rc-local --now
@NotYusta
NotYusta / install_certificate.sh
Last active February 17, 2024 05:58
Install certificate and replace all certificate subdomains with domain's one.
#!/bin/sh
DOMAIN_NAME=""
CERTIFICATE_PATH="/etc/letsencrypt/live"
# MAKE SURE USE \ TO PREVENT TRAILING SPACES.
PRIVATE_KEY=""
PUBLIC_CERT=""
rm -rfv "$CERTIFICATE_PATH/$DOMAIN_NAME"
mkdir -pv "$CERTIFICATE_PATH/$DOMAIN_NAME"
echo "$PUBLIC_CERT" | sudo tee -a "$CERTIFICATE_PATH/$DOMAIN_NAME/fullchain.pem"
@NotYusta
NotYusta / test.sh
Last active March 2, 2024 07:57
Test bash
#!/bin/sh
mkdir test
echo "You successfully did it"
echo "$TOKEN"
@NotYusta
NotYusta / install_wings_full.sh
Last active April 6, 2024 10:17
Add swap, Install Firewall, Wings & Docker
#!/bin/sh
INSTALL_FIREWALL_URL="https://gist.githubusercontent.com/NotYusta/d1e227f6dbd27323b8c475586fe6d43d/raw/2c5db4b105d51ed77ba3ec2c5caeafcf2f9fd0c9/firewall.sh"
INSTALL_WINGS_URL="https://gist.githubusercontent.com/NotYusta/77c998832676310b53761adb0c3546c7/raw/e895f9309591ca807025732e1832838322bb6b09/install_wings.sh"
ADD_SWAP_URL="https://gist.githubusercontent.com/NotYusta/bc86b388b0661604bbab70a987c88bd2/raw/027e964bea0ab132204f83ae8a7ee413edef229e/add_swap.sh"
RC_LOCAL_URL="https://gist.githubusercontent.com/NotYusta/0d669bd57bfc67a56c8f1f18941a2b9a/raw/e5cce8b0b6c5ee5e1ce1e4dced9532a2b468dd5d/rc-local.sh"
dnf update -y
dnf install curl -y
curl -s "$ADD_SWAP_URL" | bash
@NotYusta
NotYusta / install_wings.sh
Last active March 2, 2024 09:44
Install Pterodactyl Wings & Docker
#!/bin/sh
WINGS_SYSTEMD_FILE="/etc/systemd/system/wings.service"
WINGS_SYSTEMD="\
[Unit]
Description=Pterodactyl Wings Daemon
After=docker.service
Requires=docker.service
PartOf=docker.service
[Service]
@NotYusta
NotYusta / add_swap.sh
Created February 8, 2024 08:02
Swapfile installation script (1G) - Enterprise Linux
#!/bin/sh
dnf update -y
dnf install grep -y
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
cp -rv /etc/fstab /etc/fstab.bak
if ! grep -q "/swapfile none swap sw 0 0" "/swapfile"; then
@NotYusta
NotYusta / firewall.sh
Last active April 3, 2024 14:39
Firewall Cloudflare & SSH
#!/bin/sh
dnf update -y
dnf install iptables ipset -y
ipset create cloudflare-v4 hash:net family inet
ipset add cloudflare-v4 173.245.48.0/20
ipset add cloudflare-v4 103.21.244.0/22
ipset add cloudflare-v4 103.22.200.0/22
ipset add cloudflare-v4 103.31.4.0/22
ipset add cloudflare-v4 141.101.64.0/18
@NotYusta
NotYusta / minecraft_forge.sh
Last active February 8, 2024 12:01
Minecraft Custom Startup for forge
DEFAULT_ARGUMENT="-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:G1NewSizePercent=30 \
-XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M \
-XX:G1ReservePercent=20 \
-XX:G1HeapWastePercent=5 \
@NotYusta
NotYusta / minecraft.sh
Last active February 8, 2024 12:00
Minecraft Custom Startup
DEFAULT_ARGUMENT="-Dterminal.jline=false \
-Dterminal.ansi=true \
-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:G1NewSizePercent=30 \
-XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M \
@NotYusta
NotYusta / BouncePearl.kt
Created August 24, 2020 14:36
Enderpearl yang bisa genjot genjot
package me.redepic.checkpearl
import net.milkbowl.vault.permission.Permission
import org.bukkit.Bukkit
import org.bukkit.entity.EnderPearl
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.entity.ProjectileHitEvent
import org.bukkit.event.entity.ProjectileLaunchEvent