# https://de.wikipedia.org/wiki/Zeroconf#Multicast_DNS - DNS: Servers 192.168.30.1 (for own local domain) Dynamic Servers (from DHCP WAN config) Allow Remote Request: Yes - DHCP: Address 192.168.30.0/24 Gateway: 192.168.30.1 Netmask 24 DNS Servers 192.168.30.1 Domain family.home.arpa - Tools/RoMON enabled
Step 2: Setup Raspberry Pi Zero with DietPi
prepare sd-card from another system ... $ sudo fdisk -l $ sudo fdisk /dev/sdX # delete all partitions and create empty dos partition # update kernel with disk partition changes
$ dd if=DietPi_RPi-ARMv6-Bullseye.img of=/dev/sdX bs=100M # update kernel with disk partition changes$ sudo partprobe /dev/sdX # remove sd-card
start over on RPi-Zero - connect keyboard, monitor, network, etc. - set passords - install, setup and config system and software
Step 3: Adapt RPi to USB-OTG RNDIS/Ethernet Gadget
connect with serial console cable to RPi - USB-TTL adapter /-RxD---\/---RxD------GPIO14-Pin6 \ PC USB2TTL====--TxD---/\---TxD------GPIO15-Pin8-- RPi Zero (Serial UART) \-GND--------GND------Ground-Pin10/ - Speed 115200 8N1
now USB-Port is free for OTG-Configurtion
# https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README - add dtoverlay settings in config.txt dtoverlay=disable-bt dtoverlay=dwc2 - add settings in cmdline.txt modules-load=dwc2,g_ether create file $ sudo nano /etc/modprobe.d/g_ether.conf # with the following content (a single line of text) options g_ether idVendor=0x05ac idProduct=0x1402 iProduct=Pi0 iManufacturer=Raspberry # NOTE: This is required for RPi to show up as LTE interface on Mikrotik! now reboot and check the new usb0 network device $ sudo config -a # now create and edit $ sudo nano /etc/network/interfaces.d/usb0 # and set new IP address # ---------------------------------------- # Location: /etc/network/interfaces.d/usb0 # # usb0 drop-in config # # USB0 allow-hotplug usb0 iface usb0 inet static address 192.168.31.2 netmask 255.255.255.0 gateway 192.168.31.1 # # ---------------------------------------- # reboot, verify all settings and shutdown # # https://forum.mikrotik.com/viewtopic.php?t=131188
Step 4: Plug RPi USB into Router USB
after plugin in, open Winbox and connect to router - "Interface" has now a new interface lte1 to add a new IP address for lte1 goto - IP/Addresses + (and choose lte1 interface) RPi has 192.168.31.2 with gateway 192.168.31.1 (gateway is lte1 on Mikrotik router)
ssh into RPi is now again possible
Step 5: Install and configure PiHole
ssh dietpi@192.168.31.2
sudo dietpi-launcher ... PiHole is part of apt (browse software)
config PiHole, etc.
Sub project: Raspi Zero NAS
Parts: Version 0-- Raspberry Zero--- USB Hub---- USB Network Adapter---- USB Memory-- Casing-- Powering OS: tinycorelinuxhttp://tinycorelinux.net/corebook.pdf http://tinycorelinux.net/install.html # chose memory drive$ sudo lsblk# umount if necessary$ sudo umount ... # prepare drive$ sudo fdisk /dev/sdx# p (print partition table)# d (delete a partition)# o (create a new empty DOS partition table# w (write changes) # update kernel with disk partition changes$ sudo partprobe /dev/sdX # download # 64bit# http://tinycorelinux.net/13.x/aarch64/releases/RPi/piCore64-13.1.zip# or$ sudo wget http://tinycorelinux.net/13.x/armv6/releases/RPi/piCore-13.1.0.zip$ sudo unzip piCore-13.1.0.zip # dd to disk$ sudo dd if=piCore-13.1.0.img of=/dev/sdX bs=100M status=progress# and sync$ sudo sync # update kernel with disk partition changes$ sudo partprobe /dev/sdX # (re)-partition memory drive (expand 2nd partitions size)# with gparted or fdisk $ sudo fdisk -u /dev/sdX# p (print partitions and and write down starting sector of 2nd partition)# d (for delete and then enter "2" to delete 2nd partition)# n (now re-create create new primary (p) partition# with starting sector as deleted one# choose ending sector default (all available space)# w (write changing)# and sync$ sudo sync # again update kernel with disk partition changes$ sudo partprobe /dev/sdX # check filesystem$ sudo e2fsck -f /dev/sdX2# and resize$ sudo resize2fs /dev/sdX2 # now disk is ready # use and reboot in new system # after first boot run$ filetool.sh -b# to save unique SSH keys # configure ip for 1st use (because dhcp ist not yet available)$ sudo ifconfig eth0 x.x.x.x netmask x.x.x.x $ route add default gw x.x.x.x eth0 # add nameserver for dns to# hint: # start INSERT mode with 'i'# type text# leave mode with ESC# save with ':wq'$ vi /etc/resolf.confi~ nameserver 8.8.8.8esc:wq $ sudo ifconfig eth0 dynamic$ sudo ifconfig up # ok tinycore uses udhcpc :-)$ sudo udhcpc # check with$ ping www.google.com
# NOW we can load and start the GUI$ tce-load -iw TC$ startx
# https://github.com/mxmxmx/terminal_tedium/wiki/piCore# # install some things we need# (the -wi flag meaning the app will be available "onboot")# # alsa# tce-load -wi alsa.tcz # more things for alsa# tce-load -wi alsa-utils.tcz# also install using tce-load -wi# git.tcz, make.tcz, gcc.tcz, compiletc.tcz, # wget.tcz, tar.tcz, acl.tcz, # wiringpi.tcz, wiringpi-dev.tcz, # libunistring.tcz # and nano.tcz (or whichever editor you prefer)## if you intend to use wifi, you'll also need # wireless_tools.tcz and wpa_supplicant.tcz## edit /mnt/sda1/config.txt ## https://iotbytes.wordpress.com/tiny-core-persistance-notes/#
...
Add new partition
# n (add a new partition)# p (primary)# 1 (partition number 1-4)# . (first sector)# +128M (... size) # t (type)# L (... L to list all ...)# c (W95 FAT32 LBA)# w (write changes)$ sudo sync
# format and write fs$ sudo mkfs.vfat /dev/sdx1 # download berryboot from# https://www.berryterminal.com/doku.php/berryboot$ wget https://downloads.sourceforge.net/project/berryboot/berryboot-20210701-pi4.zip # unzip to new formated disk$ mkdir mntpoint$ mount /dev/sdx1 mntpoint$ cd mntpoint$ sudo unzip /downloadllocation/berryboot-date-version-zip # eject sdcard / stick and put into raspi# boot and have fun
How to ...
... launch desktop application with root privileges?
$ apt install nautilus# launch a new terminal and enter $ sudo -i nautilus# the resulting window falls now under the sudo umbrella# any files launched and accessed have now sudo-root privileges # in this terminal until it closes# this comes in handy for transitory situations as a quick solution
... beautify powershell
# from https://christitus.com/pretty-powershell/$ irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex
... upload a disk over ssh
from lokal disk to remote system
dd if=/home/archive/linode.img | ssh root@192.0.2.9 "dd of=/dev/sda"ordd bs=100M if=/home/archive/linode.img status=progress | ssh root@192.0.2.9 "dd of=/dev/sda" # check status? -> add "&" at end of line ...dd if=/home/archive/linode.img | ssh root@192.0.2.9 "dd of=/dev/sda" &# and now execute ...sudo pkill -usr1 dd
# https://sourceforge.net/projects/vcxsrv/ PS: $env:DISPLAY="127.0.0.1:0.0"PS: echo $env:DISPLAY # permanently add the DISPLAY environment variable to Windows Powershell with setx commandPS: setx DISPLAY "127.0.0.1:0.0" # Start the built-in SSH client with # -X Enables X11 forwarding# -Y Enables trusted X11 forwardingPS: ssh -X <your_user_id>@<server_address> # now check DISPLAY environment variable$ echo $DISPLAY # should show localhost:10.0 or similar# and is automatically set by the SSH server# No need to be the same as in Windows $ xcalck$ xclock# or whatever X app
... find files..
$ ...
... speed up RDP
# https://taoofmac.com/space/blog/2022/10/23/1700 # SERVER-SIDE GPU ACCELERATION IN LINUX# ss it happens, both xrdp and Remmina already support GFX AVC:444 encoding out of the box (more on that later). $
#To perform a trace route in Linux # open Terminal and type in $ traceroute domain.com# replacing domain.com with your domain name or IP address. # If you do not have trace route installed you may need to install it. # For example in Ubuntu the command to install trace route is $ sudo apt-get install traceroute