Uploaded by Michael Zheng

RPI Useful Commands

advertisement
lurk
Credits goes to Botspot#6825 for making this :)
WoR OC
arm_freq=2300
gpu_freq=500
gpu_mem=32
over_voltage=14
force_turbo=1
hdmi_group=2
hdmi_mode=82
Pi OS OC
arm_freq=2350
gpu_freq=750
gpu_mem=512
over_voltage=14
force_turbo=1
No sudo password
yourusername ALL=(ALL) NOPASSWD: ALL
Create shortcut (symlink)
ln -s /usr/share/applications /home/pi/Desktop
To find symlink's target file:
readlink -f
Create file shortcut
1. Create blank .txt file
2. past this into it
[Desktop Entry]
Name=My Name
Comment=My application which does this
Icon=/usr/share/pixmaps/openbox.xpm
Exec=/usr/bin/leafpad
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;
3. save file as .desktop To create a backup of both partitions as img file
sudo dd if=/dev/mmcblk0 of=~/backup.img
Lxpanel clock
http://strftime.net/
%l:%M:%S%n %m/%d
To force a program to automatically open maximized:
Openbox settings are stored in /home/pi/.config/openbox/lxde-pi-rc.xml
Put this in your lxde-rc.xml in between <applications> tags:
<application class="Chromium-browser" name="chromium-browser">
<maximized>yes</maximized>
</application>
To get specific class or name for your applications, use this:
obxprop | grep '^_OB_APP'
and then click with your cursor inside the app window.
list largest files and directories
sudo du -a / | sort -n -r | head -n 50
Change swappiness
sudo sysctl vm.swappiness=100
Change swap size
sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile #change CONF_SWAPSIZE in MB
sudo dphys-swapfile swapon
remove residual configuration files
sudo apt autoremove -y && sudo apt clean && sudo apt-get purge -y $(dpkg -l | grep '^rc' | awk '{print $2}')
Add keys to all unsigned repositories
sudo apt update 2>&1 1>/dev/null | sed -ne 's/.*NO_PUBKEY //p' | while read key; do if ! [[ ${keys[*]} =~ "$key" ]]; then sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys "$key"; keys+=("$key"); fi; done
To turn off screen
vcgencmd display_power 0
To turn on screen
vcgencmd display_power 1
To backup file system to cloud
rclone sync /home/pi "DMA Google Drive:filesystem" -L --bwlimit 100k -v --exclude "Web drives/**" --exclude ".cache/**" --exclude ".config/chromium/**"
Autoreconfigure networking
cd /etc/network && sudo dhclient && cd
When runniung backup, configure backup program to ignore these directories:
/proc/*
/sys/*
/dev/*
/tmp/*
/run/*
/mnt/*
~/.cache/*
/media/*
Kernel drivers for most popular wifi adapters/chips:
sudo wget https://web.archive.org/web/20210224134444/http://downloads.fars-robotics.net/wifi-drivers/install-wifi -O /usr/bin/install-wifi
sudo chmod +x /usr/bin/install-wifi
#List if there is driver for plugged in usb wifi adapter
sudo install-wifi -c
#Install driver
sudo install-wifi
To shutdown computer if desktop environment is frozen:
R E I S U B (while holding Alt AND SysReq keys)
kill a window with the mouse pointer:
xkill
remove write protection from removable storage
sudo hdparm -r0 /dev/sda2
The way to "double-click" on a file from the command line is xdg-open.
Keyboard Shortcuts:
System menu: ctrl + esc
Open program menu: alt + space
Switch programms: alt + tab
Access dropdown: alt + [letter-with-underline] e.g. alt + f
Close window: ctrl + q
Back to CLI: ctrl + alt + backspace
To console: ctrl + alt + f2
Go back: ctrl + alt + f7
mcpi buster:
wget -qO- https://raw.githubusercontent.com/mobilegmYT/mcpi-packages-buster/main/install.sh | bash
sudo apt remove minecraft-pi-reborn-client -y
sudo apt install minecraft-pi-reborn-client -y
wget https://archive.org/download/libminecraftpe0.6.1/libminecraftpe06%2B08.so
mkdir -p ~/.minecraft-pi/overrides
mv libminecraftpe06+08.so ~/.minecraft-pi/overrides/libminecraftpe.so
video: https://youtu.be/BRvNWhbBxOw
roblox-player:+launchmode:app+robloxLocale:en_us+gameLocale:en_us+LaunchExp:InApp
Download