#!/bin/bash
# - bof - #



<<'comment'

# - Configured - #


rm -rf ~/.bashrc;
vim ~/.bashrc;

rm -rf ~/.zshrc;
vim ~/.zshrc;

ssh-keygen -R 192.168.1.1

# - On client - #
cd ~/.ssh;
ssh-keygen -t rsa;

cat ~/.ssh/id_rsa.pub;

# - On server - #
vim ~/.ssh/authorized_keys;



xdg-user-dirs-update;
sudo apt install dialog duf curl figlet git lolcat neovim pv webapp-manager -y;
sudo apt install dialog duf curl figlet git htop inxi lolcat net-tools neovim pv webapp-manager -y;

# -  - #
# - Timezone setting - #
sudo timedatectl set-timezone America/New_York;
timedatectl;



cd ~/; rm -rf ~/bEtcher.sh; vim ~/bEtcher.sh;
Copy & paste this content
chmod +x ~/bEtcher.sh; ~/./bEtcher.sh;

comment



# -  - #
# - uServer(LXC) container - #
Create an uServer(LXC) container on ProxmoxVEServer

# -  - #
# - Documentation - #
https://www.youtube.com/watch?v=h8qEXBp--WU
https://www.wundertech.net/how-to-set-up-docker-containers-in-proxmox/



# :a
# -  - #
# - Download templates in ProxmoxVEServer - #
sshP;
ssh root@10.0.0.50

pveam update;
pveam available;

# - Download from the website or - #
pveam download ISOs ubuntu-23.04-standard_23.04-1_amd64.tar.zst;


# :c
# -  - #
# - Create LXC Container - #

 General:
    Node: proxmox
   CT ID: 107
Hostname: uServerLXC-Docker
Hostname: uServerLXC-WebServer

Password: xx
Confirm
Password: xx

Templete:
 Storage: ISOs
Templete: Ubuntu 23.10

Disks:
      Storage: OSs
Dis size(GiB): 30

CPU:
Cores: 4

Memory:
Memory (MiB): 1024
  Swap (MiB):  512

Network:
          Name: eth0
          iPv4: Static
     IPv4/CIDR: 10.0.0.200/24
Gateway (iPv4): 10.0.0.1

DNS:
 DNS domain: 10.0.0.1
DNS servers: 1.1.1.1,8.8.8.8,8.8.4.4



# :d
# -  - #
# - uServer login - #
root
Admin2



# :e
# -  - #
# - Update system - #
sudo apt update && sudo apt upgrade -y;
sudo apt autoremove -y;

sudo apt install ca-certificates curl gnupg htop inxi lsb-release ncdu \
                 neofetch net-tools ntp screenfetch unzip vim zip -y;



# :f
# -  - #
# - Create administrator user (is_derayo) - #
sudo adduser is_derayo;
sudo usermod -aG sudo is_derayo;
cat /etc/passwd;
cat /etc/group;



# :g
# -  - #
# - Install software - #
ssh is_derayo@10.0.0.200;



# :h
# -  - #
# - Root password - #
sudo passwd root;

sudo vim /etc/ssh/sshd_config;

/PermitRoot
PermitRootLogin yes
PasswordAuthentication yes

:wq

sudo systemctl restart sshd;



# :i
# -  - #
# - Configure .bashrc & authorized_keys - #

cd ~/.ssh;
vim authorized_keys;

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDopoGALJZXDoWKpjBBQqkjgCnzkTtzR9QihguMY8oO2H+tTXTDHUypjXs3wb91HyMkaax/qcE/LdRZWbW0IkUcGL0YkhQwM45Yv+TWkmhnFPz+im1pal73QfnhDeJ2hlGhYLAz09yGgQ6SVo3z+Nswtsdx5b/T3TWdY3njIZ17o9Iu3tKsaUtoKTp/cAhZ+V2+7+Wq8yS6DjL3LQMlRPhgSVH/derZeXViNHLyzkBRiR4uE6ama5EyaC3KzI6kEVDmuCE4pAOCvspMatbAtim0UXFBHe7fzwfg0JYlW3reL49Rz9Cn6G/04xCUIhr1eZCyhBJyh8YclEN8wkATPBULKD+qJS+eVX+rMLCMYvjBMBidNbkNfAKci/q7FR4My3KIl4TgWUVG8JodsNLkL7LtoFq/l5moqZCDczKMS/Q8SPnC7RQ27hNEg6IbSAkK8FmPH7BEkY2qNdF3uKMpxm8DGwI8XCeTPccKcQAyUPHFl8vhEuiIKA0FJdd5uAntDdc= is_derayo@HPDesktopZorin



# :j
# -  - #
# - Create Data folder - #

ssh is_derayo@10.0.0.200;
sudo mkdir /Data;
sudo chown -R is_derayo:is_derayo /Data;
sudo chmod -R 775 /Data;



# :k
# -  - #
# - Network configuration - #

cd /etc/systemd/network;

╭── # is_derayo@uServerLXC /etc/systemd/network :
╰─▷ $ la
total 14K
drwxr-xr-x 2 root root   3 Apr 26 23:08 ./
drwxr-xr-x 6 root root  15 Apr 26 23:15 ../
-rw-r--r-- 1 root root 156 Apr 26 23:08 eth0.network



sudo vim /etc/systemd/network/eth0.network;

[Match]
Name = eth0

[Network]
Description = Interface eth0 autoconfigured by PVE
Address = 10.0.0.200/24
Gateway = 10.0.0.1
DHCP = no
IPv6AcceptRA = false



# :l
# -  - #
# - uServer Tweaks - #
sudo vim /etc/sysctl.conf;

vm.swappiness = 10
vm.vfs_cache_pressure = 50
fs.inotify.max_user_watches = 262144



# :m
# -  - #
# - To test - #
# - Enable ufw firewall - #

#sudo ufw default deny incoming;
#sudo ufw default allow outgoing;
#sudo ufw allow from 10.0.0.0/24

#sudo ufw enable;

sudo ufw status;
sudo ufw status numbered;



# - eof - #