Fresh Raspberry Pi 400, but package-manager ‘dead’
It’s never early enough to inspire, so my firstborn got two days ago her first own computer. I don’t want that she grows comfortable with touching a smartphone, but not knowing what happens in the “back”, so she got a Raspberry Pi 400.
I did not expect that the red-white color-combination of the keyboard-like module with it’s raspberry-button will spark so much joy!
The first evening we unwrapped everything and she put all cables in and we booted it right from the preconfigured sd-card. Nice, very comfortable.
Problem:
Then I wanted to run ‘apt-get’ to fix the updates and maybe install a paint-like program ..
Error
Repository ‘http://deb.debian.org/debian buster-updates InRelease’ changed its ‘Suite’ value from ‘stable-updates’ to ‘oldstable-updates’
So neither apt-get update
or any of the first tips I checked, worked. Until I found this:
sudo apt-get update --allow-releaseinfo-change
Problem solved, but – would a newcomer or young person be able to fix this?
I doubt it. This isn’t really user-friendly ..
edit:
Anyway: Since update of the distribution from ‘buster’ to ‘bullseye’ by editing two package lists did not really go well, I’ve deployed a ‘real’ bullseye-image onto the sd-card and we fixed the rest of the configuration in minutes 🙂
external backups pt. II
The worst archivist?
Of course, I know him.
It’s me.
So, some month ago I was writing about how to create and maintain some external backup [link] from data stored on the NAS.
I’ve also put some fancy commands, but when I wanted to do the scheduled refresh of the backup, I noticed, that my ‘documentation’ is without any value.
And this is due to continued iterations of the setup and the used commands, but not updating the documentation.
- Setup
* activate the rsync-access on the DS213 via UI (else ‘permission denied’ is reported even when you can SSH in and check the rsync-version and then wonder what fails ..)
* plug the external HDD to the Raspberry Pi 3B
* run via VNC-remote-login in a bash on the RPi
rsync -avrh admin@ds213:/volume1/Photoshare_privat/ /media/pi/1.42.6-25556/Photoshare_privat/ && rsync -avrh admin@ds213:/volume1/homes/Marcel/ /media/pi/1.42.6-25556/homes/Marcel/ && rsync -avrh admin@ds213:/volume1/homes/ruzica/ /media/pi/1.42.6-25556/homes/ruzica/ && rsync -avrh admin@ds213:/volume1/homes/admin/ /media/pi/1.42.6-25556/homes/admin/ && rsync -avrh admin@ds213:/volume1/Camera/ /media/pi/1.42.6-25556/Camera/ && rsync -avrh admin@ds213:/volume1/photo/ /media/pi/1.42.6-25556/photo/ && rsync -avrh admin@ds213:/volume1/Musik/ /media/pi/1.42.6-25556/Musik/
to copy all relevant partitions
qmake: shared libs without versioning and symlinks
By default share libraries have a symlink and versioning. To avoid this, add to respective *.pro:
1 2 |
# disable symlinks & versioning CONFIG += plugin |
iwyu: fatal error: ‘stddef.h’ file not found
Include-what-you-use and Qt are not friends. iwyu-support in QtCreator is requested for a while, nobody cares.
So I installed it via apt; set an override to make and reran the build-process on a cleaned project:
1 |
`-k CXX=/usr/bin/iwyu |
Result: more than fifty errors like “fatal error: ‘stddef.h’ file not found”.
Some said that clang is missing (because that header is part of the installed package, my clang was 12 – iwyu was built against 11).
So the solution is:
1 |
sudo apt-get install libclang-common-11-dev |
‘Kein Backup, kein Mitleid.’
A common German saying meaning “no backup, no pity”. Five weeks ago when another ransomware-wave became public and I saw the disaster with the Western Digital network-drives, I realized that despite using a NAS and regularly backing up data from different devices to this RAID level 1-device, I have no real “hard” backup. In my definition: a 1:1 mirror of the NAS-content which is NOT connected to any network at all and also stored physically in a different room or even different flat. Disconnected because of: are you sure everything is secured? Also no hidden bugs? Physically distant because of: what if the NAS catches fire and the backup is also affected?
So I did a quick review of the current state (NAS is a DS213 with latest updates; offers also USB 3.0-interface; has 2 4 TB drives insides, which are filled to 3.5 TB).
Decided to buy a 6 TB external 3.5″-harddrive (not SSD, because of possible loss of data while powered down over years) for 122 € (compared to the price of losing just a fraction of the photos – Forget it!).
Formatted it to EXT4 with some Linux. Attached then to the Synology DS213. And it was not detected, despite saying it supports EXT4. So we let the DS213 format it again (don’t ask me ..).
Let’s say it outright: I don’t want to use their proprietary backup-solutions. I also don’t want any kind of encryption.
SSH’ed into the DS213 (activated before, because off by default). Then I checked which partitions have to be copied. Puzzled together a chained rsync-command (sorted by priorities) and let it run. Detaching the session via ‘nohup’ Wasn’t working.
1 2 3 4 5 6 7 |
rsync -avrh /volume1/Photoshare_privat/ /volumeUSB1/usbshare/Photoshare_privat/ && \ rsync -avrh /volume1/homes/Marcel/ /volumeUSB1/usbshare/homes/Marcel/ && \ rsync -avrh /volume1/homes/ruzica/ /volumeUSB1/usbshare/homes/ruzica/ && \ rsync -avrh /volume1/homes/admin/ /volumeUSB1/usbshare/homes/admin/ && \ rsync -avrh /volume1/Camera/ /volumeUSB1/usbshare/Camera/ && \ rsync -avrh /volume1/photo/ /volumeUSB1/usbshare/photo/ && \ rsync -avrh /volume1/Musik/ /volumeUSB1/usbshare/Musik/ |
Turns out quite quickly that the one core-cpu of the DS213 is the bottleneck, because it runs at 100% and therefore mere writing speeds of 8-9 MB/s are achieved despite the HDD being capable of writing up to 120 MB/s. My back of the napkin-estimation is 4-5 days for all data. Next backups should run faster, because incremental. And most of the data is written once, changed almost never.
Quick summary: I was baffled that despite having some experience in IT did not have a _real_ backup before. And out of discussions with peers I know almost none of those working in IT have either.
The proposed solution will save my family and me from any 100% losses.
edit 20210801: ideas need some time to mature. Now one of the Raspberry Pi 3B takes care of the rsync-calls to relieve the real PC (host RocketChat anyway, therefore is online 24/7) and rsync runs now without compression; the resulting writing speed is now in the range of 11-15 MiByte/s.
grip: render Markdown as PDF
.. and other things, where you assumed it should be quite easy. ..
Wrote a short guide how to verify some information in Markdown. Local rendering works (most of the time via PyCharm or online at Github).
Now: how export it as PDF, because I realized that the receiver might not be able to display it properly.
* printing from PyCharm: failed
* VisualStudio-Plugin: no VS, no plugin
* any of the *nix-ways: not possible at that moment
* using a web-renderer: not allowed, because confidental data
UFF!
Python to the rescue!
1 2 |
pip install grip grip file.md |
Grip prepares a local flask server, where you receive a localhost:<randomport> url and just open it with the browser of your choice and then print as PDF.
žžžžžž
Two family members names sport a nice z with Caron: ž.
Win 10: ALT+0158 (number pad with numlock on)
Linux (unicode): CTRL+SHIFT+U+017E
Scrum: PSPO I certification
With the power of the mega-fluff I’ve succeeded in the test and can call myself now ‘Professional Scrum Product Owner‘.
Of course, it is just a small step. But a series of small steps will carry over long distances.
Sincere thanks go to Glenn Lamming & Boris Steiner for their interactive way to teach the fundamentals 👍
64 GiB USB 3.1 stick and VM problems
Got a new 64 GiB USB3.1 stick (Samsung) and that’s where the problems started..
It was formatted with exFAT, one partition, which was not mountable for an embedded Linux.
So I tried to to use Windows standard tools (neither via explorer nor via powershell) to create a FAT32-partition of smaller than 32 GiB size. Did not work.
Second thought: let’s do this inside the Kubuntu-VM!
* media was not shown -> fixable by installing the extension pack (else just USB 1.1), then adding in the VM-settings a USB3.0-filter for the respective device, then fire up the VM and activate it in the “virtualbox-bar > devices”.
* check with ‘lsblk’ if there is a new block based device
* format with ‘gparted’ if necessary: one primary partition of 20 GiB FAT32 and the rest ext4 worked like a charm for me (of course, windows can’t handle ext4 ..). Gparted is really a lifesaver, been using this for a decade now.
* mount with ‘sudo mount /dev/sbd1 ~/Desktop/usbsticky’ if OS does not support some auto-mount on plugging-in
Cheap wifi repeater
Long time ago (see: https://marcelpetrick.bplaced.net/wp_solutionsnotcode/?p=1266 ) I announced the plan to set up one/some ESP8266 as wifi-repeater and after some tinkering I did.
The device was running during Summer 2020 until now in different locations.
Code comes from martin-ger – kudos to him. Flash the binary and you’re done. Used the ESP-download-tool, as far as I can remember.
The wrapping is quite makeshift, but works. The blinking LED is a bit annoying if used on the balcony at night. will fix the hole for the cable with hot glue. Can run from battery pack or via usb-charger. Ah, yes, the price for the full package is around 3 €.
Performance: throughput is 5 Mbps down and 2 Mbps upstream. Not really much, but better than the local 4G ..
If the ESP8266 is connected via USB to serial terminal (115.200 baud), the output at boot looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
WiFi Repeater V1.2 starting Config found and loaded Starting Console TCP Server on 7777 port mode : sta(3c:71:bf:3a:a2:74) + softAP(3e:71:bf:3a:a2:74) add if0 add if1 dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1) bcn 100 shoscandone state: 0 -> 2 (b0) STA: SSID:Katzengast24 PW: removed;) [AutoConnect:1] AP: SSID:newGreen PW: removed;) IP:192.168.4.1/24 Clock speed: 80 CMD>state: 2 -> 3 (0) state: 3 -> 5 (10) add 0 aid 1 cnt connected with Katzengast24, channel 10 dhcp client start... connect to ssid Katzengast24, channel 10 CMD> CMD> CMD> STA: SSID:Katzengast24 PW: ;) [AutoConnect:1] AP: SSID:newGreen PW: ;) IP:192.168.4.1/24 Clock speed: 80 CMD>ip:192.168.178.126,mask:255.255.255.0,gw:192.168.178.1 ip:192.168.178.126,mask:255.255.255.0,gw:192.168.178.1,dns:192.168.178.1 add 1 aid 1 station: a4:9b:4f:05:55:be join, AID = 1 station: a4:9b:4f:05:55:bejoin, AID = 1 LmacRxBlk:1 LmacRxBlk:1 LmacRxBlk:1 LmacRxBlk:1 |
Configure via serial by doing:
1 2 3 4 5 |
set ssid Katzengast24 set password removed;) set ap_ssid newGreen set ap_password removed;) save |