Skip to content

Instantly share code, notes, and snippets.

@hugohil
Last active February 1, 2023 13:54
Show Gist options
  • Save hugohil/3995983666f021bae8cbab95253ad95e to your computer and use it in GitHub Desktop.
Save hugohil/3995983666f021bae8cbab95253ad95e to your computer and use it in GitHub Desktop.
raspberry pi initial setup

update system

sudo apt update
sudo apt upgrade -y

install oh-my-zsh

sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

install basics

sudo apt install vim -y
sudo apt install git -y
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_basic_vimrc.sh
sudo apt install pigpio -y
sudo apt install rsync -y
sudo apt install mplayer -y
sudo apt install vlc -y

speed up ssh connexion

ssh-copy-id player@rasberry.local

make your pi a wifi access point

Follow this tutorial.

You can use wlan1 for keeping wifi access, and then replace wlan1 by wlan0 in those files :

sudo vim /etc/hostapd/hostapd.conf
sudo vim /etc/dnsmasq.conf
sudo vim /etc/dhcpcd.conf

Then reboot.

install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
exec zsh ### or `exec bash`
nvm install --lts

install nginx

sudo apt install nginx -y
sudo /etc/init.d/nginx start

create folders

mkdir -p sources/assets sources/playground

install zerotier

sudo apt update
sudo apt upgrade
curl https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/zerotierone-archive-keyring.gpg >/dev/null
RELEASE=$(lsb_release -cs)
echo "deb [signed-by=/usr/share/keyrings/zerotierone-archive-keyring.gpg] http://download.zerotier.com/debian/$RELEASE $RELEASE main" | sudo tee /etc/apt/sources.list.d/zerotier.list
sudo apt update
sudo apt install -y zerotier-one

# sudo reboot
# sudo zerotier-cli join [NETWORKID]
#!/bin/sh
echo '\n###\n updating system... \n###\n'
sudo apt update
sudo apt upgrade -y
echo '\n###\n adding the basics... \n###\n'
sudo apt install git -y
sudo apt install vim -y
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_basic_vimrc.sh
sudo apt install pigpio -y
sudo apt install rsync -y
sudo apt install nginx -y
sudo apt install mplayer -y
sudo apt install vlc -y
sudo /etc/init.d/nginx start
echo '\n###\n adding oh-my-zsh... \n###\n'
sudo apt install zsh -y
curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh
cat >> $HOME/.zshrc <<-EOF
export PROMPT='%(!.%{%F{yellow}%}.)\$USER@%{\$fg[white]%}%m %{\$fg_bold[red]%}➜ %{\$fg_bold[green]%}%p %{\$fg[cyan]%}%c %{\$fg_bold[blue]%}\$(git_prompt_info)%{\$fg_bold[blue]%} % %{\$reset_color%}'
EOF
echo '\n###\n adding nvm and installing node latest LTS version... \n###\n'
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
cat >> $HOME/.zshrc <<-EOF
export NVM_DIR="\$HOME/.nvm"
[ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh" # This loads nvm
EOF
export NVM_DIR="\$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
echo '\n###\n adding handy folders \n###\n'
mkdir -p sources/assets sources/playground
echo '\n###\n running ssh-keygen \n###\n'
ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N ""
echo '\n###\n
please manually run the following, with the correct parameters: \n
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
plase run:
chsh -s $(which zsh) && zsh
nvm install --lts
\n###\n'
echo '\n###\n enjoy! \n###\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment