Over Clock

echo "
# Overclocking
arm_freq=2147
gpu_freq=750
over_voltage=8
" | sudo tee -a /boot/config.txt

sudo reboot
echo "
# Overclocking
arm_freq=2147
gpu_freq=750
over_voltage=8
" | sudo tee -a /boot/firmware/config.txt
# Overclocking
arm_freq=2147
gpu_freq=750
over_voltage=8

Speed and Temp

clear && printf 'current\n' && sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq && printf '\nmin\n' && sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq && printf '\nmax\n' && sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq && printf '\ntemp\n' && cat /sys/class/thermal/thermal_zone0/temp && echo

jupter

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
export PATH=/home/pi/.local/bin:$PATH


sudo apt update


sudo apt install python3-pip -y
sudo apt install npm -y
sudo apt install libatlas-base-dev -y


pip3 install --upgrade pip
sudo -H pip3 install notebook jupyterhub


sudo npm install -g configurable-http-proxy


jupyterhub --generate-config
sudo mv jupyterhub_config.py /root


echo "[Unit]
Description=JupyterHub Service
After=multi-user.target

[Service]
User=root
ExecStart=/usr/local/bin/jupyterhub --config=/root/jupyterhub_config.py
Restart=on-failure

[Install]
WantedBy=multi-user.target
" | sudo tee /lib/systemd/system/jupyterhub.service


sudo systemctl daemon-reload
sudo systemctl start jupyterhub
sudo systemctl enable jupyterhub






ubuntu

sudo apt-add-repository -p proposed

sudo apt install linux-raspi

sudo apt-add-repository -r -p proposed

sudo reboot
sudo apt-add-repository -p proposed && sudo apt install linux-raspi && sudo apt-add-repository -r -p proposed && sudo reboot
sudo apt install openssh-server -y
sudo service gdm restart

New User

#!/bin/bash

# Clone a user and privileges. I got most of my information from
# https://unix.stackexchange.com/questions/204970/clone-linux-user-copy-user-based-on-another-one

# New user and password
NEW_USER=
NEW_PASS=

# user to be cloned, $USER is the current user. 
SRC_USER=$USER

# get the groups the source user belongs to
SRC_GROUPS=$(id -Gn ${SRC_USER} | sed "s/ /,/g" | sed -r 's/\<'${SRC_USER}'\>\b,?//g')

# get the shell of the source user
# SRC_SHELL=$(awk -F : -v name=${SRC_USER} '(name == $1) { print $7 }' /etc/passwd)
# Rasbian defaults to bash, Ubuntu to sh. I like bash better.
SRC_SHELL='/bin/bash'

# create user then add the password
sudo useradd --groups ${SRC_GROUPS} --shell ${SRC_SHELL}  --create-home ${NEW_USER}
echo "${NEW_USER}:${NEW_PASS}" | sudo chpasswd

# The new user will be asked their password and I don't like that. This stops it.
echo | sudo EDITOR='tee -a' visudo
echo '# Stop asking for my password' | sudo EDITOR='tee -a' visudo
echo "${NEW_USER} ALL=(ALL) NOPASSWD: ALL" | sudo EDITOR='tee -a' visudo




# change the timezone and here are the common US zones
#            America/New_York 
#            America/Chicago 
#            America/Denver 
#            America/Los_Angeles 
sudo timedatectl set-timezone America/Detroit




# Gotta always do this
sudo apt update
sudo apt upgrade -y
sudo apt clean

# Raspbian doesn't have git and Ubuntu doesn't have unzip.
sudo apt install git unzip -y




# # RPi4 overclocking
# sudo sed -i 's|^#arm_freq=800|arm_freq=2147|' /boot/config.txt
# sudo sed -i '/arm_freq=/ a gpu_freq=750' /boot/config.txt
# sudo sed -i '/arm_freq=/ a over_voltage=6' /boot/config.txt
# sudo sed -i '/arm_freq=/ a \\n# adding gpu_freq and over_voltage settings' /boot/config.txt