Skip to content

Instantly share code, notes, and snippets.

@wasimosmanhome
Last active January 3, 2024 15:07
Show Gist options
  • Save wasimosmanhome/6b536383b679795a7266be5b5398eedc to your computer and use it in GitHub Desktop.
Save wasimosmanhome/6b536383b679795a7266be5b5398eedc to your computer and use it in GitHub Desktop.
Raspberry pi Origin
Raspberry PI
sudo nano=gedit visudo
After this line
[ %sudo ALL=(ALL:ALL) ALL ]- add
Add
pi ALL=(ALL) NOPASSWD: ALL
SUDO APT- GET UPGRADE
sudo apt update --allow-releaseinfo-change && sudo apt-get update -y && sudo apt-get upgrade -y --allow-unauthenticated && sudo apt-get dist-upgrade -y
Clean Apt-get
sudo rm -rf /var/lib/apt/lists/*
UNRAR
http://ftp.us.debian.org/debian/pool/non-free/u/unrar-nonfree/unrar_5.3.2-1+deb9u1_armhf.deb
Stop automatic updates
sudo apt-get remove unattended-upgrades
Login without password
sudo mkdir /home/pi/.ssh
sudo chown -R pi:pi /home/pi/.ssh
From local
Adding line to the end of a file
echo "some text" >> somefile.txt
STEP 1
FIX LOCALE
first:
sudo apt-get purge locales
then:
sudo aptitude install locales -y
and the famous:
sudo dpkg-reconfigure locales
https://serverfault.com/questions/301896/how-to-fix-locale-settings-in-debian-squeeze
-
sudo apt-get autoclean -y && sudo apt-get autoremove -y && sudo apt-get clean -y
Raspberry Pi Ubuntu Mate (and other linux distros for SBCs)
https://ubuntu-pi-flavour-maker.org/download/
OrangePi Distros https://mega.nz/#F!Re4nmDLS!rK22NifiOJpd_nkNpjkrAQ!kXZiEQZT
Name All Users
wasim
Install etherwake
Install powerwake
Install Dataplicity
-
Fix Apt-Get
This works ( https://unix.stackexchange.com/questions/410833/i-am-not-able-to-start-dnsmasq-on-boot ) (Ubuntu Mate)
sudo nano /etc/dhcpcd.conf
interface wlan0
static ip_address=10.0.20.1/24
static routers=10.0.20.0
https://askubuntu.com/questions/157154/how-do-i-include-lines-in-resolv-conf-that-wont-get-lost-on-reboot
(works on ubuntu server)
nano /etc/resolvconf/resolv.conf.d/base
nameserver 8.8.8.8
sudo resolvconf -u
optional , check :
sudo nano /etc/resolv.conf
-
Install Realvnc
cd Downloads
cd /home/pi/Downloads/
wget https://www.realvnc.com/download/file/vnc.files/VNC-Server-6.3.0-Linux-ARM.deb
sudo dpkg -i /home/pi/Downloads/VNC-Server-6.3.0-Linux-ARM.deb
sudo apt-get install -f
sudo systemctl enable vncserver-x11-serviced.service
Set realvnc on startup https://www.realvnc.com/en/connect/docs/unix-start-stop.html
sudo systemctl enable vncserver-x11-serviced.service
Check Status
sudo systemctl status vncserver-x11-serviced.service
SMOKEPING
install
sudo apt-get install smokeping
Use
'sudo apt autoremove'
to remove them.
Raspberry pi sleep
sudo nano /etc/rc.local
after
exit 0
add
setterm -blank 0 -powerdown 0 -powersave off
Scheduled reboot 6am
sudo nano /etc/crontab
0 6 * * * root reboot
Install Chromium
sudo apt-get update && sudo apt-get install chromium-browser --yes
Reboot on Internet failure
SSH KEY Setup
Generate a SSH Key pair
Time Zone (https://stackoverflow.com/questions/21181231/server-certificate-verification-failed-cafile-etc-ssl-certs-ca-certificates-c)
Packages can fail if timezone is not set right, run the following to sort things out automatically
apt-get install ntp
Unable to lock the administration directory Problem
Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?
You can delete the lock file with the following command:
sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
After that, try opening Synaptic again.

FIX GPG Error
https://www.blackmoreops.com/2014/12/13/fixing-error-package-packagename-not-available-referred-another-package-may-mean-package-missing-obsoleted-available-another-source-e-pa/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment