A Place to Find Hints for working with the Raspberry Pi
Overclocking the Raspberry Pi 4
- sudo apt update
- sudo apt dist-upgrade
- sudo reboot
- sudo nano /boot/config.txt
- Save file after making one of the following changes
- Add at the end:
- arm_freq_min=1000 (improves the overall performance)
- for overclocking to 1.75
- over_voltage=4
- arm_freq=1750
- for overclocking to 2.0
- over_voltage=6
- arm_freq=2000
- gpu_freq=750
Pi Considerations
- Monitor setting of 1920×1080
- h264ify options set to block 60 FPS for better video on Pi
- check ventz blog for updates
- pikiss for easy setting of many Pi programs and settings
- neofetch for computer stats (sudo apt install neofetch) and just neofetch as the command
- you can search the web for wallpaper with search “1920×1080 wallpaper”
- good tutorials on <https://core-electronics.com.au>
- YouTube audio library for public domain background music
- for interesting older files <internet archive>
- for use with a USB webcam consider “cheese” (sudo apt install cheese) or VLC
- TerraPi Case appears to be a simple inexpensive case to consider using to attach an SSD drive to the Pi
- Consider adding ‘nemo’ file manager for additional features <sudo apt install nemo>
- Possible video editors are OpenShot and kdenlive (can be installed with sudo apt install)
- Fyde OS for Chrome OS 0sing a chromium image
- In the Raspberry Pi Terminal, use ‘pinout’ to see the GPIO layout
- If this doesn’t work try installing with ‘sudo install python3-gpiozero’
Raspberry Pi OS – Shrink, Copy, Backup and Restore
- Gnome-disk-utility, G-parted, Raspberry Pi Imager, Pi-Apps to install Pi-Power-Tools
- Link to full video = https://www.youtube.com/watch?v=00ck25k_lgw
Raspberry Pi OS Installation Instructions for Zero 2
https://qengineering.eu/install-64-os-on-raspberry-pi-zero-2.html
To keep wear and startup time at a minimum, we suggest replacing the dphys-swapfile with the traditional Linux swap mechanism. It works just as good as dphys-swapfile, but your startup time is much shorter.
Setting Up Appearance and Theme on Raspberry Pi OS
- Main Menu Editor
- Preferences, more Optionshttps://www.raspberrypi.org/documentation/usage/camera/raspicam/timelapse.md
- Add Appearance and Themes to appear in the menu
- Use lxde themes
Commander Pi
https://github.com/Jack477/CommanderPi
(first make install executable! sudo chmod +x install.sh
)
Then install it with ./install.sh
Installing Torguard on Pi (openvpn)
https://forums.torguard.net/index.php?/topic/1632-trouble-with-openvpn-on-raspberry-pi/
# remove all previous config sudo rm -rf /etc/openvpn/*.ovpn # download and unzip files to openvpn folder cd /etc/openvpn/ sudo wget https://torguard.net/downloads/OpenVPN-TCP-Linux.zip sudo unzip OpenVPN-TCP-Linux.zip sudo cp -a ./OpenVPN-TCP/. /etc/openvpn/ # change permissions for openvpn script sudo chmod 777 update-resolv-conf # add torguard vpn username/password to existing user.txt file sudo nano ./user.txt # add vpn connection username first line, password second line # add auth-user-pass command to all *.ovpn files echo 'auth-user-pass user.txt' | sudo tee -a $(ls -1 *.ovpn) # kill any openvpn process and restart with random config sudo killall -9 openvpn && cd /etc/openvpn && sudo openvpn --daemon --cd /etc/openvpn --config `ls -1 *.ovpn | sort -R | head -1` # check your ip and crack open a beer curl http://checkip.dyndns.org
You can use this simple code to pull in the user interface (ui) window from PyQt5 Designer with button and label included to manipulate and add additional code to make something fun happen:
- label is the name of a label in the ui
- pushButton and B2 are names of buttons in the ui
- the bold text is the actual minimal code to bring in the ui file
- in this case “SimplePyQt5Box.ui”
- located in the same folder as the Python code file.
Python UI application with Qt designer 4 Widget List YouTube
- def printSomething():
- print(“Will this ever really work?”)
- MainWindow.label.setText(“will this work?”)
- def changeL2():
- print(“This is from the second buttton”)
- MainWindow.L2.setText(“This actually changed!”)
- app = QtWidgets.QApplication([])
- MainWindow = uic.loadUi(“SimplePyQt5Box.ui”)
- MainWindow.pushButton.clicked.connect(printSomething)
- MainWindow.B2.clicked.connect(changeL2)
- MainWindow.show()
- app.exec()
Raspberry Pi Camera Mount (From explaining computers video)
- Link to Video (explainingcomputers.com)
- Enable Camera in Raspian Preferences
- In Terminal try the following line to see if the camera is working:
- raspistill – o /home/pi/Pictures/test.jpg
- raspistill -vf -hf -o /home/pi/Pictures/test.jpg (to flip picture if it is upside down)
- To Record Video
- raspivid -o Desktop/video.h264
- To Create timelapse photos
- raspistill -t 30000 -tl 2000 -o image%04.jpeg
- This statement creates a picture every 2 seconds for 30 minutes
- On github find “motioneyesos” image to flash to a SD card
- To see camera preview when using VNC
- Open RealVNC Server on the host computer (computer with the camera)
- Go to ‘Options’ and then to ‘Troubleshooting
- Enable ‘experimental direct capture mode’
Raspberry Pi Camera App
- Bill Williams 1952
- https://github.com/Billwilliams1952
Tasksel to install multiple operating system GUI on the Pi.
Time Lapse Photography with Terminal
https://www.raspberrypi.org/documentation/usage/camera/raspicam/timelapse.md
Using raspistill’s inbuilt time-lapse mode
The raspistill application has a built in time-lapse mode, using the –timelapse (or -tl) command line switch. The value that follows the switch is the time between shots in milliseconds:
raspistill -t 30000 -tl 2000 -o image%04d.jpg
Note the %04d in the output filename: this indicates the point in the filename where you want a frame count number to appear.
Stitching Images Together
On another Linux computer
sudo apt install mencoder
Now run the following command:
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o timelapse.avi -mf type=jpeg:fps=24 mf://@stills.txt
Once that’s completed, you should have a video file called timelapse.avi containing a time-lapse from your images.
Learn How to Use SQLite Databases With Python
https://www.freecodecamp.org/news/using-sqlite-databases-with-python/
Over Clocking the Raspberry Pi
Make sure you have adequate cooling for the system!!
Statements for Raspberry Pi 4
- For CPU Overclocking to 1700
- over_voltage=2
- arm_freq=1700
- For GPU Overclock to 600
- gpu_freq=600
- over_voltage=4
- For CPU Overclock to 1750
- over_voltage=2
- arm_freq=1750
- For GPU Overclock to 620
- gpu_freq=620
- over_voltage=4
For Raspberry Pi 3B+ from Explaining Computers
- sudo idle
- from the boot folder open config.txt
- arm_freq = 1500
- over_voltage =6
- gpu_freq = 500
Balena Sound
- Build a single or multi-room streamer for an existing audio device using a Raspberry Pi! Supports Bluetooth, Airplay and Spotify Connect
- Getting started with balenaSound is as simple as deploying it to a balenaCloud application.
- https://sound.balenalabs.io/
Raspberry Pi Imager v1.6
Added new settings feature for flashing an OS
- Ctrl+shift+x
- Brings up new settings options
- Can set SSH settings
- Can pre-set wifi password
SSH Guard – consider installing on Pi
sudo apt install sshguard
Synchronizing Files on your Raspberry Pi with Syncthing
https://pimylifeup.com/raspberry-pi-syncthing/
Raspberry Pi as a Hotspot
- HotSpot Tools by KM4ACK
- collection of tools for managing autohotspot
Tips on Using ssh
- Activate ssh in Raspberry Pi Config
- On another computer in the terminal:
- ssh pi@ipaddress
- Consider trying “Virtual Here” app
Terminal Commands to Install Open CV
https://www.youtube.com/watch?v=Qf55aUgfLfQ&list=TLPQMDExMTIwMjEeA1jPcxS6iw&index=2
- sudo apt-get update
- sudo apt-get install python3-opencv
- sudo apt-get install libqt4-test python3-sip python3-pyqt5 libqtgui4 libjasper-dev libatlas-base-dev -y
- pip3 install opencv-contrib-python==4.1.0.25
- sudo modprobe bcm2835-v4l2 ——————————————————————————————————————————————————-
fswebcam
- sudo install fswebcam
- sudo usermod -a -G video root
- sudo usermod -a -G pi
- fswebcam image.jpg
Ram Disk for Swap file
- zram pi
- logzram
Chromium OS on the Pi
- Expanding the Partition after installation
- https://faq.fydeos.com/en/recipes/expand-stateful-partition/
- First, bring up a shell prompt (ctrl + alt + F2 for tty shell; or ctrl + alt + t for crosh shell then enter
shell
for bash), login withchronos
- Execute the
lsblk
command and verify your stateful partition label name, it’s likely to bemmcblk0p1
. Make sure it’s listed in the output. - Execute the expansion script:
sudo /usr/sbin/expand-partition.sh --dst /dev/mmcblk0p1
- Once the script finish running without error, your stateful partition should be expanded to occupy the rest of your SD card free space
- Instructions for Installing VS Code in Chromium OS on the Pi
- code.visualstudio.com/blogs/2020/12/03/chromebook-get-started
- install Linux subsystem on Chromium OS
- sudo apt-get update
- sudo apt-get install -y gnome-keyring
- Go to the Visual Studio Code Download page. From there, you need to pick the right package for your Chromebook:
- the pi runs on an ARM64 chip so pick the .deb package in the variant ARM64
- find the package in your Downloads folder. Double-click on the package to launch the installer.
- you’ll find Visual Studio Code inside a folder called Linux apps (along with the Linux terminal)
Using Exfat Drives on Raspberry Pi
- sudo apt install exfat-fuse exfat-utils
Setting Up Shares / Shared Drives on the Pi
- Setting up Syncthing
- Mounting an external drive to share
- Setting up Samba share
- Finding the shared folder from another computer
- Go to the file explorer
- Find the Network tab
- If not automatically found, use:
- smb://ipaddressofsharedcomputer/nameofsharedfolder
Setting the Clock in Rasp PI OS Taskbar/Menu
- For a 12 hour clock that includes seconds
- change %R to %r
- For a 12 hour clock without seconds
- change to %I:%M %p (first letter is a capital i (I))
Energy Use Raspberry Pi 4
- Pi uses 2.5 W at idle
- SMUD Summer Rate Cost
- Per day $0.01, per month $0.35, per year $4.20 (approximate using 3W for calculation)
- SMUD Summer Rate Cost
- Pi uses 6.6 W at CPU maximum
- SMUD Summer Rate Cost
- Per day $0.03, per month $0.81, per year $9.80 (approximate using 7W for calculation)
- SMUD Summer Rate Cost
Timed Auto-Shutdown Using Crontab
- https://smarthomepursuits.com/how-to-reboot-raspberry-pi-on-a-schedule/
- Open a terminal and type this command:
- sudo crontab -e
- If you haven’t edited anything in the crontab before, select your editor.
- Press #1 to choose the nano file editor.
- Then press the down arrow to scroll to the very bottom.
- Add Scheduled Reboot Time
- Enter this command to schedule a reboot.
- This command will schedule a daily reboot at 6am.
- 0 6 * * * /sbin/shutdown -r now
- If you want to automatically reboot your raspberry pi at a certain interval using minutes and hours (for example, 1:03pm),
the command you’d enter would look like this:- 03 13 * * * /sbin/shutdown -r now
- Now you have to decide when you want your Pi to turn off.
- https://jarrodstech.net/how-to-shut-down-raspberry-pi-automatically-with-cron/
- The best thing I have found is the crontab.guru website. It allows you to test and get the syntax correct. It also adds a text representation of when the job will run.
- I will add 2 commands as I want my Pi to turn off at 10:20Pm every day and at 9:00AM every weekday respectively.
- 20 22 * * * root shutdown -h now
- 00 09 * * 1-5 root shutdown -h now
- Options for shutting down using the terminal shutdown command
- shutdown hour:minute (using 24 hour clock)
- shutdown +minutes (number of minutes later to shutdown)
Fix Boot Issues with Rasp Pi USB Drive Enclosers
- Cheaper Jmicron adapter does not work with 64 bit OS.
- In the cmdline.txt file enter the following line at the beginning of the file and leave a space before the rest of the lines already present
- cmdline.txt file is located in the /boot folder
- Add the following statement at the beginning of the text, add a space, DO NOT press enter or put it on a separate line
- usb-storage.quirks=152d:0578:u
- Nice, cheap, FAST solution, when combined with a $20 120GB SSD
- Link for details
- https://github.com/raspberrypi/linux/…
- How to migrate Raspberry Pi SD card to a USB SSD + SpeedTest and fix USB Case Boot Issues
Raspberry Pi as WiFi Ethernet Bridge
- Video Instruction: https://www.youtube.com/watch?v=qhe6KUw3D78&list=TLPQMDYwMzIwMjP46OLDbTNafA&index=3
- Written Instruction: https://www.willhaley.com/blog/raspberry-pi-wifi-ethernet-bridge/
Bootloader Update
- To update the bootloader use:
- sudo rpi-update
Raspberry Pi Boot Control and Eeprom Update
- rpi-eeprom-update -a
- sudo rpi-eeprom-update
- sudo raspi-config
- Go to Advanced Options
- Select the Network install UI option
- Pick always display UI
- Re-boot
- When booting the Pi keep tapping the spacebar to get to the boot menu
- Select the device you would like to boot from.
https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/booteeprom.md
Updating the bootloader
We recommend setting up your Pi so that it automatically updates the bootloader: this means you will get new features and bug fixes as they are released. Bootloader updates are performed by the rpi-eeprom package, which installs a service that runs at boot-time to check for critical updates.
sudo apt update
sudo apt full-upgrade
sudo apt install rpi-eeprom
If you wish to control when the updates are applied you can disable the systemd service from running automatically and run rpi-eeprom-update manually.
# Prevent the service from running, this can be run before the
# package is installed to prevent it ever running automatically.
sudo systemctl mask rpi-eeprom-update
# Enable it again
sudo systemctl unmask rpi-eeprom-update
The FREEZE_VERSION option in the EEPROM config file may be used to indicate that the EEPROM should not be updated on this board.
Checking if an update is available
Running the rpi-eeprom-update command with no parameters indicates whether an update is required. An update is required if the timestamp of the most recent file in the firmware directory (normally /lib/firmware/raspberrypi/bootloader/critical) is newer than that reported by the current bootloader. The images under /lib/firmware/raspberrypi/bootloader are part of the rpi-eeprom package and are only updated via apt update.
sudo rpi-eeprom-update
Unlikely to be needed and use with great caution. Consider not using and just going to the stable upgrade for the new USB boot.
Updating Raspberry Pi 4 to USB Boot, Official Stable Version
Updated Method to Get Official USB Boot
https://www.youtube.com/watch?v=suU09BMMFts&list=TLPQMzAxMjIwMjB4CfzXQZLQag&index=2
Basically use the Raspberry Pi Configuration Tool at
sudo raspi-config
Update the eeprom from here and set the default to USB boot
https://www.youtube.com/watch?v=SfxFS2mK6ok
How to update your Raspberry Pi 4 to boot from SSD,Hard drive or USB stick
Raspberry Pi 4
supports all models 1GB, 2GB, 4GB and the new 8GB model
Instructions Perform at your own risk
Running Raspberry Pi OS from an sd card
Open a terminal
sudo apt update && sudo apt full-upgrade
Reboot
sudo nano /etc/default/rpi-eeprom-update
Check you are on stable, change it if not
sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-06-15.bin
Reboot
After rebooting write your chosen os to usb or sd card with Raspberry imager or balena etcher
Simple screen recorder
https://www.youtube.com/watch?v=V5iwNPGkCSE
sudo apt-add-repository ppa:maarten-baert/simplescreenrecorder
sudo apt-get update
sudo apt-get install simplescreenrecorder
Pi Camera Commands”
raspistill -t 15000 -o newpic.jpg
The -t option changes the delay before the picture is taken, from the default five seconds to whatever time you give it in milliseconds – in this case, you have a full 15 seconds to get your shot arranged perfectly after you press ENTER.
Capture video
For shooting video, raspivid is what you need. Try it out with this Terminal command:
raspivid -t 10000 -o testvideo.h264
This records a ten-second video (10,000 milliseconds) at the default 1920 × 1080 resolution.
You can also shoot slow-mo video at 640 × 480 by using:
raspivid -w 640 -h 480 -fps 90 -t 10000 -o test90fps.h264
Tip! Using VNC
By default, you won’t be able to view the camera preview window when accessing your Raspberry Pi remotely from another computer via VNC. However, there is a setting to make the window appear. Open the VNC Server menu on Raspberry Pi and go to Options > Troubleshooting, then select ‘Enable direct capture mode’.
Download Barrier to Raspberry Pi
https://magpi.raspberrypi.org/articles/share-your-keyboard-and-mouse-with-barrier?mc_cid=2d5d987580&mc_eid=da2e6c4637
Barrier is used to share a keyboard between Raspberry Pi and other computers: Windows PC, Mac, or Linux (even a second Raspberry Pi).
First, install Barrier on Raspberry Pi using APT. Open a Terminal and enter:
sudo apt update
sudo apt install barrier -y
Install Barrier on the client
Now download Barrier to your client computer (in our case the Windows PC) from the Barrier GitHub page.
Open the BarrierSetup-2.3.2.exe program (you may have a later version number). Use the corresponding DMG file for macOS – or APT for a Linux, as shown in the previous step.
Make sure all of your computers are connected to the same network before going any further.
Client and server
Now that Barrier is installed on both computers, you need to decide which one is going to be in control. This is the one you will have your keyboard and mouse connected to. This will be the ‘server’ and the other computer will be the ‘client’.
Because we use our Raspberry Pi so much, we’re going to connect our keyboard and mouse to it and have it control the secondary Windows PC. But it could easily be the other way around.
Set up the server
Barrier is installed on Raspberry OS, and is opened by choosing Menu > Accessories > Barrier. The Barrier window will appear (below).
The Barrier server configuration running on Raspberry Pi
Ensure that Server is ticked and make a note of the IP address (on our Raspberry Pi this is 192.168.0.41; on your network the IP address may be different).
Set up the client
Now open the Barrier app on your client machine (in our case a Windows 10 computer).
Deselect the Server checkbox and select Client instead. Enter the IP address for Raspberry Pi into the Server IP text box. On our setup, Raspberry Pi is located at 192.168.0.41 (below). Your IP address may vary – it is displayed in Barrier on Raspberry Pi. Make a note of the screen name for your client computer. Ours is ‘lucyhattersley-dell’.
Barrier on the Windows PC and is set up in client mode. Here is our server configuration
Configure server
Head back to Barrier on Raspberry Pi and click Configure Server. This will open the Server Configuration window (below).
The Server Configuration window is used to set up the position of both monitors correctly (so the mouse flows from one screen to another)
The Server Configuration window is used to set up the position of both monitors correctly (so the mouse flows from one screen to another)
Now you need to add, and position, the client computer using the Screen Name. Drag the monitor icon from the top-right of the Server Configuration window and place it next to the monitor icon marked ‘raspberrypi’. Ours is positioned to the left of our Raspberry Pi (to match the monitor layout).
The monitor icon will be called ‘Unnamed’. Double-click it to open the Screen Settings window and change the Screen Name to match the client computer – for example in our case, ‘lucyhattersley-dell’ (below). Click OK to close the window.
It is important to use the correct screen name of your computer in the Screen Settings window
Start it up
Click Start on Barrier on your server computer (in our case, Raspberry Pi). Wait until the lock icon in the bottom left of the Barrier window displays ‘Barrier is running’.
Now click Start on Barrier on the client computer (our Windows PC). Again, wait for the ‘Barrier is running’ message.
Mouse and keyboard
Move the mouse pointer on your Raspberry Pi over to the left of display and it will flow to the client machine. Now you can use Raspberry Pi’s mouse and keyboard to control the Windows interface. Open an app and click on a text box (such as a web browser and URL box). Now you can use Raspberry Pi’s keyboard to enter text into your Windows computer. It’s now safe to disconnect any keyboard and mouse from the client computer. You’ll be able to use the server keyboard and mouse moving forward.
RPI4 & Ubuntu MATE – How to enable video acceleration Updated: June 27, 2020
https://www.dedoimedo.com/computers/rpi4-ubuntu-mate-hw-video-acceleration.html
Let’s fix another problem. This is a big one, and technically speaking, the most important one. Because if you intend to use Raspberry Pi 4 as a desktop system, like I do, then hardware acceleration is a critical component of the overall experience.
Motion activated camera on your raspberry pi, using Motion
https://www.youtube.com/watch?v=AejagSlRHQU
Step 5:
open terminal and type in these commands followed by the enter key.
‘sudo apt-get update’
‘sudo apt-get install motion’
Step 6:
once step 4 is complete, run these commands.
‘cd /etc/motion/
‘sudo nano motion.conf’
Step 7:
Scroll down in the document to find the line ‘stream_localhost on’ and change it to
‘stream_localhost off’
Then press ‘CTRL+X’, then ‘y’, then ‘ENTER’
Then type ‘sudo reboot’ and wait.
Step 8:
Once on again, in the terminal type ‘ifconfig’ followed by enter
Look for your internet connection (wlan for wifi, or eth for ethernet)
On the 2nd line of your interface, you should see ‘inet addr:(your ip)’
Step 9:
Back on your raspberry pi, type in ‘sudo motion -n’
You should see the program starting up and see it saving pictures when you make motion on your camera.
To end motion, press ‘CTRL+C’
Step 10:
Go to your other device that is on the same network and type in that ip that you found in step 7 followed by ‘:8081’. EXAMPLE: 192.168.0.15:8081
To stop motion press ‘CTRL+C’
You can type ‘sudo nano /etc/motion/motion.conf’ to control the camera options.
https://www.youtube.com/watch?v=K9RixHaScHc&t=16s
https://www.raspberrypi.org/forums/viewtopic.php?t=252115
cat /sys/class/thermal/thermal_zone0/temp
Returns a number like 53069 which means that the CPU temperature is 53.069 Centigrade
Commands for your Raspberry Pi
1. ip addr
2. cat /etc/hostname
3. df -h
4. free -h
5. /opt/vc/bin/vcgencmd measure_temp
6. cat /etc/os-release
7. uptime -p
8. lsusb -t (gives information on attached USB drives)
PiKiss The Ultimate Simple Categorized Installer For The Raspberry Pi 4
Link to ETA Prime Video: https://www.youtube.com/watch?v=JhOGAkV3ves
Link to Developer Git Hub: https://github.com/jmcerrejon/PiKISS
Recording Audio on the Raspberry Pi with Python and a USB Microphone
https://makersportal.com/blog/2018/8/23/recording-audio-on-the-raspberry-pi-with-python-and-a-usb-microphone#:~:text=The%20Raspberry%20Pi%20is%20capable,playback%20fairly%20good%20quality%20audio.
Working with File Permissions on Your Raspberry Pi
https://www.dummies.com/computers/raspberry-pi/working-with-file-permissions-on-your-raspberry-pi/
sudo chmod a+rwx filename-or-full-filepath
Letter Read r
r Read permission
w Write permission
x Execute permission
X Special magic execute permission for folders
Camera Hints
– enable camera in preferences
– raspistill
—-> -vf (rotate vertical)
—-> -hf(rotate horizontal)
—-> -o /home/pi/Pictures/photoname. jpg
– raspivid -o /home/pi/Pictures/videoname.h264
– Timelapse
—-> raspistill -t3000 -tl2000 -o/image%004d.jpeg (takes a series of pictures)
MagPi Issue 95 Camera Python Files:
https://github.com/themagpimag/magpi-issue95/tree/master/HQ%20camera%20part%203
Déjà Dup
This automates rsync and gives it a user-friendly interface. Backup your Raspberry Pi using Amazon S3, SSH, FTP, or by copying the files directly to a flash drive.
You can pick directories to include and exclude, and it’s easy to restore backups. Déjà Dup is installed by default on Ubuntu, and is easy to install in Raspbian:
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install deja-dup
Now you’ll find a new program called Backups in Menu > Accessories.
Click on Folders to save and check that Home (pi) is listed. Folders to ignore should include Rubbish Bin.
Now click on Storage Location and change Amazon S3 to your flash drive.
Go back to Overview and click Back Up Now. Déjà Dup will start the first backup.
NAME
cryfs – cryptographic filesystem for the cloud
SYNOPSIS
cryfs [-c file] [-f] [options] basedir mountpoint [– fuse-options]
cryfs –help|–version|–show-ciphers
DESCRIPTION
CryFS encrypts your files, so you can safely store them anywhere.
The goal of CryFS is not only to keep file contents, but also file sizes, metadata and directory structure confidential. CryFS uses encrypted same-size blocks to store both the files themselves and the block’s relations to another. These blocks are stored as individual files in the base directory, which can then be synchronized with cloud services such as Dropbox.
The blocks are encrypted using a random key, which is stored in a configuration file encrypted by the user’s passphrase. By default, it will be stored together with the data in the base directory, but you can choose a different location if you do not want it in your cloud or when using a weak passphrase.
USING CRYFS
Selecting base and mount directories
While you can access your files through your mount directory, CryFS actually places them in your base directory after encrypting. CryFS will encrypt and decrypt your files ‘on the fly’ as they are accessed, so files will never be stored on the disk in unencrypted form.
You can choose any empty directory as your base, but your mount directory should be outside of any cloud storage, as your cloud may try to sync your (temporarily mounted) unencrypted files as well.
Setup and usage of your encrypted directory
Creating and mounting your encrypted storage use the same command-line syntax:
cryfs basedir mountpoint
If CryFS detects an encrypted storage in the given base directory, you will be asked for the passphrase to unlock and mount it. Otherwise, CryFS will help you with creating one, just follow the on-screen instructions.
After you are done working with your encrypted files, unmount your storage with the command
fusermount -u mountpoint
Changing your passphrase
As the encryption key to your CryFS storage is stored in your configuration file, it would be possible to re-encrypt it using a different passphrase (although this feature has not been implemented yet).
However, this does not change the actual encryption key of your storage, so someone with access to the old passphrase and configuration file (for example through the file history of your cloud or your file system) could still access your files, even those created after the password change.
For this reason, the recommended way to change your passphrase is to create a new CryFS storage with the new passphrase and move your files from the old to the new one.
OPTIONS
Getting help
-h, –help
Show a help message containing short descriptions for all options.
–show-ciphers
Show a list of all supported encryption ciphers.
–version
Show the CryFS version number.
Encryption parameters
–blocksize arg
Set the block size to arg bytes. Defaults to 32768.
A higher block size may help reducing the file count in your base directory (especially when storing large files), but will also waste more space when storing smaller files.
–cipher arg
Use arg as the cipher for the encryption. Defaults to aes-256-gcm.
-c file, –config file
Use file as configuration file for this CryFS storage instead of basedir/cryfs.config
General options
-f, –foreground
Run CryFS in the foreground. Stop using CTRL-C.
–allow-filesystem-upgrade
Allow upgrading the file system if it was created with an old CryFS version. After the upgrade, older CryFS versions might not be able to use the file system anymore.
–allow-integrity-violations
By default, CryFS checks for integrity violations, i.e. will notice if an adversary modified or rolled back the file system. Using this flag, you can disable the integrity checks. This can for example be helpful for loading an old snapshot of your file system without CryFS thinking an adversary rolled it back.
–allow-replaced-filesystem
By default, CryFS remembers file systems it has seen in this base directory and checks that it didn’t get replaced by an attacker with an entirely different file system since the last time it was loaded. However, if you do want to replace the file system with an entirely new one, you can pass in this option to disable the check.
–missing-block-is-integrity-violation=true
When CryFS encounters a missing ciphertext block, it cannot cannot (yet) know if it was deleted by an unauthorized adversary or by a second authorized client. This is one of the restrictions of the integrity checks currently in place. You can enable this flag to treat missing ciphertext blocks as integrity violations, but then your file system will not be usable by multiple clients anymore. By default, this flag is disabled.
–logfile file
Write status information to file. If no logfile is given, CryFS will write them to syslog in background mode, or to stdout in foreground mode.
–unmount-idle arg
Unmount automatically after arg minutes of inactivity.
ENVIRONMENT
CRYFS_FRONTEND=noninteractive
With this option set, CryFS will only ask for the encryption passphrase once. Instead of asking the user for parameters not specified on the command line, it will just use the default values. CryFS will also not ask you to confirm your passphrase when creating a new CryFS storage.
Set this environment variable when automating CryFS using external tools or shell scripts.
CRYFS_NO_UPDATE_CHECK=true
By default, CryFS connects to the internet to check for known security vulnerabilities and new versions. This option disables this.
CRYFS_LOCAL_STATE_DIR=[path]
Sets the directory cryfs uses to store local state. This local state is used to recognize known file systems and run integrity checks (i.e. check that they haven’t been modified by an attacker. Default value: ${HOME}/.cryfs
SEE ALSO
mount.fuse(1), fusermount(1)
For more information about the design of CryFS, visit https://www.cryfs.org
Visit the development repository at https://github.com/cryfs/cryfs for the source code and the full list of contributors to CryFS.
Twister OS Patcher
An updater for Twister OS that automatically downloads, unzips, and runs the latest patch for Twister OS. It is fine if you run the patcher more than once as it auto-detects your version. You have to run the patcher when you can reboot your computer as it is required for patching.
https://github.com/FlameKat53/Twister-OS-Patcher
Install/Update
wget https://raw.githubusercontent.com/FlameKat53/Twister-OS-Patcher/master/install.sh && chmod +x ./install.sh && ./install.sh && rm install.sh
If you notice the repo has been changed, run twistpatch-update to update your current version of the patcher.
Commands
twistpatch: Runs the main patcher script to patch Twister OS
twistpatch-update: Removes and reinstalls TwistPatcher to get the latest code
twistpatch-remove: Uninstalls TwistPatcher from your system
Using Different Temperature Sensors with the Raspberry Pi
Includes information on several sensors including DHT22 and DS18B20
https://www.youtube.com/watch?v=sX9KCK2Z-I0
https://medium.com/initial-state/how-to-build-a-raspberry-pi-temperature-monitor-8c2f70acaea9
Raspberry Pi as a Network Attached Storage Device
https://www.pcmag.com/how-to/how-to-turn-a-raspberry-pi-into-a-nas-for-whole-home-file-sharing
https://www.howtogeek.com/139433/how-to-turn-a-raspberry-pi-into-a-low-power-network-storage-device/
https://www.windowscentral.com/how-build-raspberry-pi-powered-nas
https://www.youtube.com/watch?v=8fIeiZx4voU
https://www.youtube.com/watch?v=bpvlEbdA6qI
NumLock On When Booting (May or may not work??)
— Open up /etc/kbd/config with your favorite editor.
— Search for a line that says LEDS=+num. It should be on line 67 if I’m not mistaken.
Setting up and Running Torguard on Rasp Pi
https://torguard.net/knowledgebase.php?action=displayarticle&id=174
Botspot PiApps link on GitHub
Useful to install certain list of programs on the RaspPi
https://github.com/Botspot/pi-apps
Home Assistant OS for Raspberry Pi
https://www.home-assistant.io/blog/2017/07/25/introducing-hassio/
Hass.io is an operating system that will take care of installing and updating Home Assistant, is managed from the Home Assistant UI, allows creating/restoring snapshots of your configuration and can easily be extended using Hass.io add-ons including Google Assistant and Let’s Encrypt.
Pi-Apps
github.com/Botspot/pi-apps
Removing Headmelted Version of VS Code
https://www.raspberrypi.org/forums/viewtopic.php?t=285559
Possible Statement to Help USB Wireless on Pi
add the following line to the ‘/boot/cmdline.txt’
usbhid.mousepoll=0
Tried with Wisfox Mouse and Keyboard, Amazon order 9/16/2020
Pi-Safe for Backing Up and Compressing
https://github.com/richardmidnight/pi-safe
See Leepspvideo review on youtube: https://www.youtube.com/watch?v=XP6ycUR9Ih0
In a terminal window, type in
wget https://raw.githubusercontent.com/RichardMidnight/pi-safe/main/pisafe
bash pisafe
Then you can select ‘install’ from the menu to install it in your Raspberry Pi menu
PiSafe – Raspberry Pi imaging app by Richard Midnight
https://github.com/richardmidnight/pi-safe
wget https://raw.githubusercontent.com/RichardMidnight/pi-safe/main/pisafe
bash pisafe
Then you can select ‘install’ from the menu to install it in your Raspberry Pi menu
MacOSBigSurThemeConverter
https://github.com/techcoder20/MacOSBigSurThemeConverter
RaspController
appt to use to control the pi from your phone
https://www.gallinaettore.com/android_apps/raspcontroller/