<commit_before># !/bin/bash
# This file installs necessary dependencies on rPI

# Start by checking python version
echo $(python -V)

## TODO: Check PYTHONPATH and other environment variables

# Then upgrade and update apt-get
echo "Updating and upgrading repositories (Will require permissions)..."
sudo apt-get update
sudo apt-get upgrade

# Upgrade rPI
echo "Updating rpi..."
sudo rpi-update

# Check if pip is installed
echo "Checking pip..."
sudo apt-get install python-pip

# Check python modules are installed: Checking using pip list | grep -F package-name
echo "Checking python modules..."
## 		pigpio
## 		picamera
## 		flask
## 		numpy
## 		cv2

# pigpio
if pip list | grep -F pigpio >/dev/null; then
	echo "pigpio is already installed"
else
	echo "pigpio not installed, installing ..."
	echo "Fetching latest version and unzipping..."
	wget abyz.co.uk/rpi/pigpio/pigpio.zip
	unzip pigpio.zip
	cd PIGPIO 
	make
	make install
fi

# picamera
echo "Checking picamera..."
sudo pip install --upgrade picamera

# flask
echo "Checking Flask..."
sudo pip install --upgrade flask

# numpy
echo "Checking numpy..."
sudo pip install --upgrade numpy

# Start with cv2
if pip list | grep -F cv2 >/dev/null; then
	echo "openCV is installed"
	## TODO: Check version
	# If it is not proper, then sudo apt-get autoremove libopencv-dev python-opencv
else
	echo "cv2 not installed, will proceed to install. This will take upto 4 hours!"
	# Download the installer from Manuel's website
	echo "Fetching installer: built by <NAME> - thanks a lot!"
	wget https://raw.githubusercontent.com/milq/scripts-ubuntu-debian/master/install-opencv.sh
	bash install-opencv.sh
fi

## TODO: Add installer and builder for extra functions!<commit_msg>Flask and kiosk auto setup options added to install.sh<commit_after># !/bin/bash
# This file installs necessary dependencies on rPI

# Start by checking python version
echo $(python -V)

## TODO: Check PYTHONPATH and other environment variables

# Then upgrade and update apt-get
echo "Updating and upgrading repositories (Will require permissions)..."
sudo apt-get update
sudo apt-get upgrade

# Upgrade rPI
echo "Updating rpi..."
sudo rpi-update

# Check if pip is installed
echo "Checking pip..."
sudo apt-get install python-pip

# Check python modules are installed: Checking using pip list | grep -F package-name
echo "Checking python modules..."
## 		pigpio
## 		picamera
## 		flask
## 		numpy
## 		cv2

# pigpio
if pip list | grep -F pigpio >/dev/null; then
	echo "pigpio is already installed"
else
	echo "pigpio not installed, installing ..."
	echo "Fetching latest version and unzipping..."
	wget abyz.co.uk/rpi/pigpio/pigpio.zip
	unzip pigpio.zip
	cd PIGPIO 
	make
	make install
fi

# picamera
echo "Checking picamera..."
sudo pip install --upgrade picamera

# flask
echo "Checking Flask..."
sudo pip install --upgrade flask

# numpy
echo "Checking numpy..."
sudo pip install --upgrade numpy

# Start with cv2
if pip list | grep -F cv2 >/dev/null; then
	echo "openCV is installed"
	## TODO: Check version
	# If it is not proper, then sudo apt-get autoremove libopencv-dev python-opencv
else
	echo "cv2 not installed, will proceed to install. This will take upto 4 hours!"
	# Download the installer from Manuel's website
	echo "Fetching installer: built by <NAME> - thanks a lot!"
	wget https://raw.githubusercontent.com/milq/scripts-ubuntu-debian/master/install-opencv.sh
	bash install-opencv.sh
fi

## TODO: Add installer and builder for extra functions!

#For installing flask setting for pi so that the server starts on boot

echo "export FLASK_APP=/home/pi/openDR/fundus_mod3.py" >> ~/.bashrc
echo "flask run" >> ~/.bashrc

#For installing chromium browser
wget -qO - http://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
echo "deb http://dl.bintray.com/kusti8/chromium-rpi jessie main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install chromium-browser


#For running kiosk mode 

cat <<EOT >> ~/.config/lxsession/LXDE-pi/autostart
@xset s off
@xset -dpms
@xsetsnoblank

@sed­ -i's/"exited_cleanly":false/"exited_cleanly": true/'~/.config/chromium/Default/Preferences
@chromium­-browser --­­noerrdialogs --­­kiosk 127.0.0.1:8000 --incognito

EOT

{'fraction_non_alphanumeric': 0.1022379269729093, 'fraction_numerical': 0.005182567726737338, 'mean_word_length': 3.8748564867967854, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4168527', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1398, 'n_words': 512}