Purpose | Command | Remarks |
---|---|---|
Fix SSH issue | ssh-keygen -f "/etc/ssh/ssh_known_hosts" -R "lenovopve" ssh -o 'HostKeyAlias=lenovopve' root@172.16.16.20 ssh-keygen -f "/root/.ssh/known_hosts" -R "beelinkpve" |
|
Install Pixel | sudo apt-get install raspberrypi-ui-mods xinit xserver-xorg | |
Root Access | sudo -i | |
Folder Size | sudo du -h --max-depth=1 /var | sudo du -sh docker/ |
GPIO Pinout | pinout | |
List USB Drives: | lsblk | |
SSH Access to pi | sudo adduser pi ssh | |
Get GID UID | id username | id pi64 |
OS Distro | uname -a | |
Partition | df -h | |
CPU Temp | vcgencmd measure_temp | |
To Install Update | sudo apt-get update && sudo apt-get upgrade -y | |
Virtual Keyboard | sudo apt-get install matchbox-keyboard | |
RDP | sudo apt get install xrdp | |
DHCP Config | sudo nano /etc/dhcpcd.conf | |
Swap-Off | sudo dphys-swapfile swapoff sudo dphys-swapfile uninstall sudo update-rc.d dphys-swapfile remove |
|
Swap-Disable | sudo systemctl disable dphys-swapfile.service | |
Install Minidlna | sudo apt install minidlna | sudo nano /etc/minidlna.conf sudo systemctl restart minidlna |
Install bluetooth | sudo apt install bluetooth pi-bluetooth bluez blueman | Reboot |
Block Wifi and blutooth | sudo apt install rfkill sudo rfkill block wifi sudo rfkill block bluetooth sudo rfkill unblock wifi |
|
Clear RAM | echo 3 | sudo tee /proc/sys/vm/drop_caches |
sudo docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
sudo docker run --device=/dev/vchiq --volume=/opt/vc:/opt/vc --volume=/boot:/boot --volume=/sys:/dockerhost/sys:ro --volume=/etc:/dockerhost/etc:ro --volume=/proc:/dockerhost/proc:ro --volume=/usr/lib:/dockerhost/usr/lib:ro -p=8888:8888 --name="rpi-monitor" -d michaelmiklis/rpi-monitor:latest
sudo docker network create --driver bridge nextcloud-net
sudo docker run --name postgres -v /home/pi64/docker/nextcloud-db:/var/lib/postgresql/data -e POSTGRES_PASSWORD=xxxxx --network nextcloud-net -d postgres
sudo docker run --name nextcloud -d -p 8080:80 -v /home/pi64/docker/nextcloud:/var/www/html --network nextcloud-net nextcloud
sudo docker run --name=duplicati -v duplicati-data:/data duplicati/duplicati
sudo docker run --name="motioneye" -p 8765:8765 -p 8081:8081 --hostname="motioneye" -v /etc/localtime:/etc/localtime:ro -v /home/pi64/docker/MotionEye/etc:/etc/motioneye -v /home/pi64/docker/MotionEye/Media:/var/lib/motioneye --restart="always" --detach=true --device=/dev/video0 ccrisan/motioneye:master-armhf
sudo docker run --name adguardhome --restart unless-stopped --network host -d adguard/adguardhome
cat /etc/resolv.conf
nameserver 8.8.8.8
sudo mkdir /etc/systemd/resolved.conf.d
sudo nano /etc/systemd/resolved.conf.d/adguardhome.conf
[Resolve]
DNS=127.0.0.1
DNSStubListener=no
sudo mv /etc/resolv.conf /etc/resolv.conf.backup
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl reload-or-restart systemd-resolved
sudo systemctl daemon-reload
https://www.wundertech.net/how-to-setup-home-assistant-on-a-raspberry-pi-using-docker/
https://www.wundertech.net/how-to-self-host-bitwarden-on-a-raspberry-pi/
mkdir -p /home/pi/docker/plex/{config,data}
sudo chmod 777 /home/pi/docker/plex/config
sudo docker run -d --name plex --net host -p 32400:32400 --restart always --volume /home/pi/docker/plex/config:/config --volume /home/pi/docker/plex/data:/data greensheep/plex-server-docker-rpi:latest
sudo docker run -d --net=host -v /home/pi64/pi64-media:/media -e MINIDLNA_MEDIA_DIR=/media -e MINIDLNA_PORT=8200 -e MINIDLNA_FRIENDLY_NAME=media-box cytomich/rpi-docker-minidlna
version: "2.1"
services:
heimdall:
image: ghcr.io/linuxserver/heimdall
container_name: heimdall
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_york
volumes:
- /home/pi64/docker/heimdall:/config
ports:
- 89:80
restart: unless-stopped
sudo docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest
sudo nano docker-compose.yml
sudo docker-compose up -d
version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# Public HTTP Port:
- '80:80'
# Public HTTPS Port:
- '443:443'
# Admin Web Port:
- '81:81'
environment:
# These are the settings to access your db
# DB_MYSQL_HOST: "db"
# DB_MYSQL_PORT: 3306
# DB_MYSQL_USER: "changeuser"
# DB_MYSQL_PASSWORD: "changepass"
# DB_MYSQL_NAME: "npm"
# If you would rather use Sqlite uncomment this
# and remove all DB_MYSQL_* lines above
DB_SQLITE_FILE: "/data/database.sqlite"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- /home/pi64/docker/nginx-proxy-manager:/data
- /home/pi/docker/letsencrypt:/etc/letsencrypt
sudo docker run --name dozzle -d --volume=/var/run/docker.sock:/var/run/docker.sock -p 8888:8080 amir20/dozzle:latest
sudo docker run -p 8081:8080 -v /home/pi/guacamole:/config oznu/guacamole:armhf
Environment variable:EXTENSIONS: auth-totp
Default pass: guacadmin:guacadmin
Reference:
https://www.wundertech.net/how-to-setup-apache-guacamole-on-a-raspberry-pi/
https://hub.docker.com/r/oznu/guacamole/
sudo docker run -d --name photoprism --security-opt seccomp=unconfined --security-opt apparmor=unconfined -p 2342:2342 -e PHOTOPRISM_UPLOAD_NSFW="true" -e PHOTOPRISM_ADMIN_PASSWORD="xxxxx" -v /home/pi/docker/photoprism/storage:/photoprism/storage -v /srv/media/photos:/photoprism/originals photoprism/photoprism
sudo docker run -d -p 3000:3000 --name grafana grafana/grafana-oss
Default pass: admin:admin
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
environment:
TZ: 'America/New_York'
WEBPASSWORD: 'xxxxx'
# Volumes store your data between container upgrades
volumes:
- '/home/pi64/pihole/etc-pihole/:/etc/pihole/'
- '/home/pi64/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/'
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
restart: unless-stopped
version: "2.1"
services:
mstream:
image: lscr.io/linuxserver/mstream
container_name: mstream
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- /home/pi64/docker/mstream/config:/config
- /srv/dev-disk-by-uuid-18265F6C265F4A40/WD-Media/Songs:/music
ports:
- 3000:3000
restart: unless-stopped
sudo docker run -d --name=netdata -p 19999:19999 -v netdataconfig:/etc/netdata -v netdatalib:/var/lib/netdata -v netdatacache:/var/cache/netdata -v /etc/passwd:/host/etc/passwd:ro -v /etc/group:/host/etc/group:ro -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /etc/os-release:/host/etc/os-release:ro --restart unless-stopped --cap-add SYS_PTRACE --security-opt apparmor=unconfined netdata/netdata
version: "2.1"
services:
wireguard:
image: lscr.io/linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- SERVERURL=auto
- SERVERPORT=51820
- PEERS=5 #change to match how many devies you want to use Wireguard on
- PEERDNS=auto
- INTERNAL_SUBNET=172.16.16.0 #optional
volumes:
- /home/pi64/docker/wireguard/config:/config
- /lib/modules:/lib/modules #do not change
ports:
- 51820:51820/udp
restart: unless-stopped
To get QR code: sudo docker exec -it wireguard /app/show-peer 1"
For laptop: scan QR code on phone camera, send to gmail, add 172.16.16.0/24 on allowed IP list
Device Name | MAC Address |
---|---|
HS103 | D8:07:B6:E6:30:83 |
HS103 | D8:07:B6:E6:37:B8 |
HS103 | D8:07:B6:E6:42:5D |
Google-Home-Mini | 44:07:0B:58:E5:E2 |
Alienware-5G | 8C:1D:96:09:64:DD |
Chromecast | 3C:8D:20:5A:2E:9D |
LGwebOSTV | 38:8C:50:D4:2C:85 |
Deva-Iphone-5G | 26:53:8D:09:26:7C |