[pastacode lang=”python” manual=”sudo%20apt-get%20update%0Asudo%20apt-get%20-y%20upgrade%0Asudo%20apt-get%20install%20ubuntu-desktop%20-y%0Asudo%20apt%20install%20gnome-software%20-y%0Asudo%20apt-get%20install%20xrdp%20htop%20-y%0Asudo%20rm%20%2Fusr%2Fshare%2Fpolkit-1%2Factions%2Forg.freedesktop.color.policy%0Asudo%20adduser%20mmdrza%0Asudo%20usermod%20-aG%20sudo%2Cadm%20mmdrza%0Asudo%20reboot%0A%0A%0Asudo%20apt%20install%20-y%20python3-pip%0Asudo%20apt%20install%20-y%20build-essential%20libssl-dev%20libffi-dev%20python3-dev%0Asudo%20apt%20install%20postgresql%0Asudo%20-u%20postgres%20psql%0AALTER%20USER%20postgres%20with%20encrypted%20password%20’YourPassword’%3B%0ACREATE%20USER%20btchunt%20WITH%20CREATEDB%20LOGIN%20ENCRYPTED%20PASSWORD%20’YourPassword’%3B%0ACREATE%20DATABASE%20btchunt%3B%0AGRANT%20ALL%20PRIVILEGES%20ON%20DATABASE%20btchunt%20TO%20btchunt%3B%0A%0Apsql%20-U%20btchuntx%20-h%20localhost%0A%0ACREATE%20TABLE%20BTCHUNT(%0Aaddress%20VARCHAR(80)%20not%20null%2C%0Abalance%20VARCHAR(30)%20not%20null%0A)%3B%0A%0Asudo%20apt%20install%20curl%0Acurl%20https%3A%2F%2Fwww.pgadmin.org%2Fstatic%2Fpackages_pgadmin_org.pub%20%7C%20sudo%20apt-key%20add%0Asudo%20sh%20-c%20’echo%20%22deb%20https%3A%2F%2Fftp.postgresql.org%2Fpub%2Fpgadmin%2Fpgadmin4%2Fapt%2F%24(lsb_release%20-cs)%20pgadmin4%20main%22%20%3E%20%2Fetc%2Fapt%2Fsources.list.d%2Fpgadmin4.list%20%26%26%20apt%20update’%0Asudo%20apt%20install%20pgadmin4%20-y%0Asudo%20%2Fusr%2Fpgadmin4%2Fbin%2Fsetup-web.sh%0Asudo%20systemctl%20start%20postgresql.service%0A%0Asudo%20nano%20%2Fetc%2Fpostgresql%2F12%2Fmain%2Fpostgresql.conf%0Asudo%20bash%20-c%20%22echo%20host%20%20%20%20all%20%20%20%20%20%20%20%20%20%20all%20%20%20%20%20%20%20%20%20%20%20%200.0.0.0%2F0%20%20md5%20%3E%3E%20%2Fetc%2Fpostgresql%2F14%2Fmain%2Fpg_hba.conf%22%20%0Asudo%20ufw%20allow%205432%2Ftcp%0Asudo%20ufw%20allow%203333%2Ftcp%0Asudo%20systemctl%20restart%20postgresql%0Asudo%20apt%20install%20python3-venv%20-y%0Apython3%20-m%20venv%20btchunt%0Asource%20btchunt%2Fbin%2Factivate%0Apip%20install%20flask%0Apip%20install%20psycopg2-binary%0Apip%20install%20waitress%0A%0ACREATE%20INDEX%20index_btchunt%20ON%20BTCHUNT%20(address%2C%20balance)%3B%0Aset%20FLASK_APP%3Dapp.py%0Aexport%20FLASK_APP%3Dapp.py%0Aexport%20FLASK_ENV%3Ddevelopment%0Anano%20templates%2Fbase.html%0Asudo%20nano%20postgresql.conf%0Aflask%20run%20–host%3D0.0.0.0%0A%0A%0A%23%20URL%20Example%3A%0Ahttp%3A%2F%2Flocalhost%3A5000%2Fbalance%3Factive%3D%0A” message=”” highlight=”” provider=”manual”/]