PTPTS website

My Raspberry

Content

  1. Content
  2. Installation with NOOBS
  3. ToDos after restart
  4. Backup SD card
  5. Backup Raspberry
  6. Session with screen
  7. Installation lighttpd on Raspbian Stretch
  8. Scanner Server saned
  9. Web interfaces
  10. Links
  11. ToDos
  12. Linux mint
    1. Backup Linux
    2. Backup Windows
    3. Mount an image file
    4. Windows Linux time problem
    5. Generate ssl certifikat with certbot for internet pages

Installation with NOOBS

  1. Downloade NOOBS from https://www.raspberry.org/downloads/noobs/
  2. Extract donwload in a folder
  3. Format SD card with Gparted as fat32
  4. Open terminal and copy NOOBS with sudo cp -r [source] [destination] to the SD card
  5. Put SD card into the Raspberry, connect it to a mouse, a keyboard, a monitor and at last to the power supply
  6. After start up select Raspbian full
  7. After installation make settings and search for updates like suggested
  8. Type raspi-config in terminal and enable ssh-Server
  9. Static IP: Fill in the IP in /etc/dhcpcd.config and reboot (192.168.2.4)

ToDos after restart

  1. Mount Music: sudo mount -B /media/usb1/Backups/Laptop_Linux/steppers/Music /Music
  2. Start Mediatomb: sudo /etc/init.d/mediatomb start

Backup SD card

  1. Proof with lsblk, which disks are available
  2. Restore image with Dd: sudo dd bs=512k if=/media/usb1/Backups/Raspberry/imagesd.img of=/dev/mmcblk0 status=progress conv=fsync
    sync

Backup Raspberry

  1. Change to /bin
  2. Run sudo ./backup.sh

Session with screen

Installation lighttpd on Raspbian Stretch

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo apt-get install lighttpd
  4. sudo apt-get install php7.0-fpm php-cgi
  5. sudo lighttpd-enable-mod fastcgi-php
  6. sudo service lightppd force-reload

Adding user and passwords for internal pages

The password file is /etc/lighttpd/.htpasswd.
To create file with a first user and password: sudo htpasswd -c /etc/lighttpd/.htpasswd benutzername
To change the password or add new user: sudo htpasswd /etc/lighttpd/.htpasswd benutzername

Scanner Server saned

Sane and saned are installed and activate on the Raspbery as scanner server.
For testing, if everything is working correct use sane-find-scanner and scanimage -L
Attention, following settings are importent in the ufw firewall:
  • In file /etc/default/ufw, DEFAULT_OUTPUT_POLICY="ACCEPT"
  • In the same file, DEFAULT_INPUT_POLICY="ACCEPT"
  • Also in that file, add nf_conntrack_sane to list IPT_MODULES
  • Add ports 10000 to 10100 as allowed for tcp and udp

Web interfaces

Mediatomb

  • Port: 49152
  • Name: Mediatomb
  • Password: Mediatomb
  • Mediatomb

Cups

  • Port: 631
  • Name: pi
  • Password: sudo PW from raspberry
  • Cups

Links

ToDos

  • Log output of /etc/init.d/own_startup.sh with date/time in /var/log/own_startup.log

Linux mint

Backup Linux

  1. sudo mount_raspberry
  2. backup_add

To create a *.7z from the folder LaptopLinux to be able to make a new backu_add:

  1. goto raspberry
  2. change directory: cd /media/pi/RaspExt1/Backups
  3. create 7z: 7z a 20201122_LaptopLinux.7z Laptop_Linux
  4. detelte content (not folder) of Laptop_Linux

Backup Windows

  1. sudo mount_raspberry
  2. backup_win_add

Mount an image file

  1. go to path with *.img
  2. Find block size and start bloc of image to calculate offset: fdisk -l /path/to/*.img
  3. offset=blocksize*startblock of linux image
  4. mount -o loop,offset=offset *.img /mnt/temp
    example: sudo mount -o loop,offset=67108864 RaspSD_20181223.img test

Windows Linux time problem

The time differences between Linux occures because Windows stores the time as local time and Linux in UTC time. The easyest way to fix the problem is to store the time also as local time.
Type in terminal: timedatectl set-local-rtc 1 --adjust-system-clock
To undo the change, use the same command but with 0 instead of 1.

Generate ssl certifikat with certbot for internet pages

  1. cd /etc/letsencrypt
  2. sudo su
  3. sudo certbot certonly --manual --preferred-challenges dns -d stepper-obersteinbach.duckdns.org
  4. https://www.duckdns.org/update?domains=stepper-obersteinbach.duckdns.org&token=de47845e-9dd2-409a-99b5-d25e54f1277d&txt={YOURVALUE}&verbose=true
home.png