JWWeatherman / how_to_store_bitcoin

A step by step guide to storing bitcoin
6 stars 2 forks source link

Flask file hosting #6

Open JWWeatherman opened 4 years ago

JWWeatherman commented 4 years ago

using this issue to store the flask file for download.

JWWeatherman commented 4 years ago

flaskapp.zip

JWWeatherman commented 4 years ago

yeti.txt

JWWeatherman commented 4 years ago

https://www.pyimagesearch.com/2018/05/21/an-opencv-barcode-and-qr-code-scanner-with-zbar/

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, September 26, 2019 4:26 PM, willweatherman notifications@github.com wrote:

flaskapp.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

willweatherman commented 4 years ago

bitcoin.py.zip

willweatherman commented 4 years ago

import cv2 print(cv2) video_capture = cv2.VideoCapture(0)

Check success

if not video_capture.isOpened(): raise Exception("Could not open video device")

Read picture. ret === True on success

ret, frame = video_capture.read()

Close device

video_capture.release()

willweatherman commented 4 years ago

import cv2 print(cv2) video_capture = cv2.VideoCapture(0) if not video_capture.isOpened(): raise Exception("Could not open video device") ret, frame = video_capture.read() video_capture.release()

willweatherman commented 4 years ago

import cv2 from PIL import Image i = 0 while True: i = i + 1 video_capture = cv2.VideoCapture(0) if not video_capture.isOpened(): raise Exception("Could not open video device") ret, frame = video_capture.read() print(ret) print(frame) img.save('ret.jpg') img.save('frame.jpg') if (i == 10000): break video_capture.release()

willweatherman commented 4 years ago

test.txt

JWWeatherman commented 4 years ago

Download, extract bitcoind

wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz cp bitcoin-0.18.1-x86_64-linux-gnu.tar.gz ~ cd ~ tar xvzf bitcoin-0.18.1-x86_64-linux-gnu.tar.gz

JWWeatherman commented 4 years ago

os.getenv("HOME") home/bob/ os.path.exists("home/bob/.bitcoin")

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

import subprocess subprocess.Popen(['sudo unattended-upgrade'],shell=True,start_new_session=True) subprocess.Popen(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True,start_new_session=True) subprocess.Popen(['cp bitcoin-0.18.1-x86_64-linux-gnu.tar.gz /~'],shell=True,start_new_session=True) subprocess.Popen(['tar xvzf ~/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt install apt-transport-https curl'],shell=True,start_new_session=True) subprocess.Popen(['sudo echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True,start_new_session=True) subprocess.Popen(['sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True,start_new_session=True) subprocess.Popen(['sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt update'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True,start_new_session=True) subprocess.Popen(['python3 hello.py'],shell=True,start_new_session=True)

willweatherman commented 4 years ago

import subprocess subprocess.Popen(['sudo unattended-upgrade'],shell=True,start_new_session=True) subprocess.Popen(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True,start_new_session=True) subprocess.Popen(['cp bitcoin-0.18.1-x86_64-linux-gnu.tar.gz /~'],shell=True,start_new_session=True) subprocess.Popen(['tar xvzf ~/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt install apt-transport-https curl'],shell=True,start_new_session=True) subprocess.Popen(['sudo echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True,start_new_session=True) subprocess.Popen(['sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True,start_new_session=True) subprocess.Popen(['sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt update'],shell=True,start_new_session=True) subprocess.Popen(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True,start_new_session=True) subprocess.Popen(['~/Downloads/bitcoin-0.18.1/bin/bitcoind -proxy=127.0.0.1:9050'],shell=True,start_new_session=True)

willweatherman commented 4 years ago

import subprocess subprocess.Popen(['sudo unattended-upgrade'],shell=True) subprocess.Popen(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.Popen(['cp bitcoin-0.18.1-x86_64-linux-gnu.tar.gz /~'],shell=True) subprocess.Popen(['tar xvzf ~/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.Popen(['sudo apt install apt-transport-https curl'],shell=True) subprocess.Popen(['sudo echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True) subprocess.Popen(['sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True) subprocess.Popen(['sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True) subprocess.Popen(['sudo apt update'],shell=True) subprocess.Popen(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True) subprocess.Popen(['~/Downloads/bitcoin-0.18.1/bin/bitcoind -proxy=127.0.0.1:9050'],shell=True,start_new_session=True)

willweatherman commented 4 years ago

import subprocess subprocess.call(['sudo unattended-upgrade'],shell=True) subprocess.call(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.call(['cp bitcoin-0.18.1-x86_64-linux-gnu.tar.gz /~'],shell=True) subprocess.call(['tar xvzf ~/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.call(['sudo apt install apt-transport-https curl'],shell=True) subprocess.call(['sudo echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True) subprocess.call(['sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True) subprocess.call(['sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True) subprocess.call(['sudo apt update'],shell=True) subprocess.call(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True)

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

JWWeatherman commented 4 years ago

import subprocess

subprocess.call(['sudo unattended-upgrade'],shell=True)

subprocess.call(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True)

subprocess.call(['tar xvzf ~/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.call(['sudo apt install apt-transport-https curl'],shell=True) subprocess.call(['sudo echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True) subprocess.call(['sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True) subprocess.call(['sudo -i gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True) subprocess.call(['sudo apt update'],shell=True) subprocess.call(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True) subprocess.call(['~/bitcoin-0.18.1/bin/bitcoind -proxy=127.0.0.1:9050'],shell=True)

willweatherman commented 4 years ago

flaskapp.zip

JWWeatherman commented 4 years ago

import subprocess

subprocess.call(['sudo unattended-upgrade'],shell=True)

subprocess.call(['wget https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True)

subprocess.call(['tar xvzf ~/flaskapp/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz'],shell=True) subprocess.call(['sudo apt install apt-transport-https curl'],shell=True) subprocess.call(['sudo -i echo "deb https://deb.torproject.org/torproject.org/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/tor.list'],shell=True) subprocess.call(['sudo -i curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import'],shell=True) subprocess.call(['sudo -i gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -'],shell=True) subprocess.call(['sudo apt update'],shell=True) subprocess.call(['sudo apt install tor tor-geoipdb torsocks deb.torproject.org-keyring'],shell=True)

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

bitcoindprogress = subprocess.call(['~/flaskapp/bitcoin-0.18.1/bin/bitcoin-cli getblockchaininfo'],shell=True)

JWWeatherman commented 4 years ago

import subprocess import json

bitcoind = subprocess.Popen(['~/flaskapp/bitcoin-0.18.1/bin/bitcoin-cli getblockchaininfo'],shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()

json.loads(bitcoind[0])['verificationprogress']

willweatherman commented 4 years ago

flaskapp.zip

JWWeatherman commented 4 years ago

Move to home directory

cd ~

Download and install yeti flask app

wget https://github.com/JWWeatherman/how_to_store_bitcoin/files/3672255/flaskapp.zip unzip flaskapp.zip cd flaskapp

Download and install flask

sudo apt-get update sudo apt-get install python3-venv sudo apt-get install python3-pip sudo pip3 install python-bitcoinrpc sudo pip3 install flask

start up the flask app and open in a browser

~/flaskapp/startserver.sh xdg-open http://localhost:5000

willweatherman commented 4 years ago

startup.py.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

JWWeatherman commented 4 years ago

if not (len(bitcoind[0]) == 0): bitcoindprogress = json.loads(bitcoind[0])['verificationprogress'] bitcoindprogress = bitcoindprogress * 100 bitcoindprogress = round(bitcoindprogress, 3) else: bitcoindprogress = 0

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

import subprocess

subprocess.call(['sudo apt-get install dpkg-repack fakeroot'],shell=True) subprocess.call(['mkdir ~/dpkg-repack'],shell=True) subprocess.call(['fakeroot -u ~/dpkg-repack dpkg --get-selections | grep install | cut -f1'],shell=True)

willweatherman commented 4 years ago

subprocess.Popen("ls", cwd=os.path.expanduser('~/'))

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

import os import subprocess home = os.getenv("HOME") if (os.path.exists(home + "/flaskapp")): subprocess.call(['wget https://github.com/JWWeatherman/how_to_store_bitcoin/files/3672255/flaskapp.zip -P ~/'],shell=True) subprocess.call(['unzip ~/flaskapp.zip'],shell=True)

subprocess.call(['sudo apt-get update'],shell=True) subprocess.call(['sudo apt-get install python3-venv'],shell=True) subprocess.call(['sudo apt-get install python3-pip'],shell=True) subprocess.call(['sudo pip3 install python-bitcoinrpc'],shell=True) subprocess.call(['sudo pip3 install flask'],shell=True)

subprocess.Popen('python3 ~/flaskapp/hello.py',shell=True,start_new_session=True) subprocess.call(['xdg-open http://localhost:5000'],shell=True)

willweatherman commented 4 years ago

os.system("sudo apt-get install libzbar-dev")

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip

willweatherman commented 4 years ago

flaskapp.zip