1

sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install ubuntu-desktop -y
sudo apt install gnome-software -y
sudo apt-get install xrdp htop -y
sudo rm /usr/share/polkit-1/actions/org.freedesktop.color.policy
sudo adduser mmdrza
sudo usermod -aG sudo,adm mmdrza
sudo reboot


sudo apt install -y python3-pip
sudo apt install -y build-essential libssl-dev libffi-dev python3-dev
sudo apt install postgresql
sudo -u postgres psql
ALTER USER postgres with encrypted password 'YourPassword';
CREATE USER btchunt WITH CREATEDB LOGIN ENCRYPTED PASSWORD 'YourPassword';
CREATE DATABASE btchunt;
GRANT ALL PRIVILEGES ON DATABASE btchunt TO btchunt;

psql -U btchuntx -h localhost

CREATE TABLE BTCHUNT(
address VARCHAR(80) not null,
balance VARCHAR(30) not null
);

sudo apt install curl
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4 -y
sudo /usr/pgadmin4/bin/setup-web.sh
sudo systemctl start postgresql.service

sudo nano /etc/postgresql/12/main/postgresql.conf
sudo bash -c "echo host    all          all            0.0.0.0/0  md5 >> /etc/postgresql/14/main/pg_hba.conf" 
sudo ufw allow 5432/tcp
sudo ufw allow 3333/tcp
sudo systemctl restart postgresql
sudo apt install python3-venv -y
python3 -m venv btchunt
source btchunt/bin/activate
pip install flask
pip install psycopg2-binary
pip install waitress

CREATE INDEX index_btchunt ON BTCHUNT (address, balance);
set FLASK_APP=app.py
export FLASK_APP=app.py
export FLASK_ENV=development
nano templates/base.html
sudo nano postgresql.conf
flask run --host=0.0.0.0


# URL Example:
http://localhost:5000/balance?active=
%%footer%%