Schrauben / Zylinderschrauben / Innensechskant / Innensechsrund / INOX

83.1345 – Metallschrauben, Edelstahl rostfrei A2, Zylinderkopf nieder, mit Antrieb Torx TX, ohne Schaft, ISO 14580, BN 15857, FN 1952
83.1340 – Metallschrauben, Stahl blau verzinkt, Zylinderkopf nieder, mit Antrieb Torx TX, Festigkeitsklasse 8.8, ohne Schaft, ISO 14580, BN 4850, FN 361
83.1215 – Metallschrauben, Edelstahl rostfrei A2, Zylinderkopf, mit Antrieb Innensechskant SW, ohne Schaft, DIN 912, ISO 4762, BN 610, FN 123
83.1210 – Metallschrauben, Stahl blau verzinkt, Zylinderkopf, mit Antrieb Innensechskant SW, Festigkeitsklasse 8.8, ohne Schaft, DIN 912, ISO 4762, BN 3, FN 120

BN 15857 – ISO 14580 – Zylinderschrauben, Edelstahl rostfrei
BN 272 – DIN 912 – ISO 4762 – Zylinderschrauben, schwarz

Raspberry Pi 3, Notizen

dd bs=4M if=2018-04-18-raspbian-stretch.img of=/dev/sdX conv=fsync
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=20586949-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

enable_uart=1
start_x=1
gpu_mem=128

#dtoverlay=spi-bcm2835
dtoverlay=spi0-hw-cs
pi@raspberrypi:~$ sudo useradd andreas

pi@raspberrypi:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openssh-server is already the newest version (1:7.4p1-10+deb9u3).
openssh-server set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

pi@raspberrypi:~$ sudo systemctl enable ssh
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.

pi@raspberrypi:~$ sudo systemctl start ssh

pi@raspberrypi:~$ sudo adduser andreas
Adding user `andreas' ...
Adding new group `andreas' (1001) ...
Adding new user `andreas' (1001) with group `andreas' ...
Creating home directory `/home/andreas' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for andreas
Enter the new value, or press ENTER for the default
	Full Name [Andreas Bachman]: bachman0
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] y

pi@raspberrypi:~$ sudo vi /etc/sudoers
andreas ALL=(ALL) NOPASSWD: ALL


pi@raspberrypi:~$ sudo apt-get install samba
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  attr libaio1 libavahi-client3 libcups2 libfile-copy-recursive-perl
  libgpgme11 libldb1 libpython2.7 libtdb1 libtevent0 python-crypto
  python-dnspython python-ldb python-samba python-talloc python-tdb
  samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools
  update-inetd
Suggested packages:
  cups-common gpgsm python-crypto-dbg python-crypto-doc python-gpgme bind9
  bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind ufw
  heimdal-clients
The following NEW packages will be installed:
  attr libaio1 libavahi-client3 libcups2 libfile-copy-recursive-perl
  libgpgme11 libldb1 libpython2.7 libtdb1 libtevent0 python-crypto
  python-dnspython python-ldb python-samba python-talloc python-tdb samba
  samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools
  update-inetd
0 upgraded, 23 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,643 kB of archives.
After this operation, 49.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-dnspython all 1.15.0-1 [102 kB]
Get:2 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-crypto armhf 2.6.1-7 [253 kB]
Get:3 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libtdb1 armhf 1.3.11-2 [38.0 kB]
Get:4 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libtevent0 armhf 0.9.31-1 [24.7 kB]
Get:5 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libldb1 armhf 2:1.1.27-1 [92.1 kB]
Get:6 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libpython2.7 armhf 2.7.13-2+deb9u2 [914 kB]
Get:7 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-ldb armhf 2:1.1.27-1 [30.0 kB]
Get:8 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-tdb armhf 1.3.11-2 [15.3 kB]
Get:9 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-talloc armhf 2.1.8-1 [11.3 kB]
Get:10 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libavahi-client3 armhf 0.6.32-2 [51.3 kB]
Get:11 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libcups2 armhf 2.2.1-8 [272 kB]
Get:12 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf samba-libs armhf 2:4.5.12+dfsg-2+deb9u2 [4,377 kB]
Get:13 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf python-samba armhf 2:4.5.12+dfsg-2+deb9u2 [1,143 kB]
Get:14 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf samba-common-bin armhf 2:4.5.12+dfsg-2+deb9u2 [555 kB]
Get:15 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf tdb-tools armhf 1.3.11-2 [25.7 kB]
Get:16 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libfile-copy-recursive-perl all 0.38-1 [20.6 kB]
Get:17 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf update-inetd all 4.44 [20.8 kB]
Get:18 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf samba armhf 2:4.5.12+dfsg-2+deb9u2 [869 kB]
Get:19 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf attr armhf 1:2.4.47-2 [41.3 kB]
Get:20 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libaio1 armhf 0.3.110-3 [9,366 B]
Get:21 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf libgpgme11 armhf 1.8.0-3 [141 kB]
Get:22 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf samba-dsdb-modules armhf 2:4.5.12+dfsg-2+deb9u2 [304 kB]
Get:23 http://mirror.switch.ch/ftp/mirror/raspbian/raspbian stretch/main armhf samba-vfs-modules armhf 2:4.5.12+dfsg-2+deb9u2 [334 kB]
Fetched 9,643 kB in 7s (1,259 kB/s)                                            
Preconfiguring packages ...
Selecting previously unselected package python-dnspython.
(Reading database ... 35265 files and directories currently installed.)
Preparing to unpack .../00-python-dnspython_1.15.0-1_all.deb ...
Unpacking python-dnspython (1.15.0-1) ...
Selecting previously unselected package python-crypto.
Preparing to unpack .../01-python-crypto_2.6.1-7_armhf.deb ...
Unpacking python-crypto (2.6.1-7) ...
Selecting previously unselected package libtdb1:armhf.
Preparing to unpack .../02-libtdb1_1.3.11-2_armhf.deb ...
Unpacking libtdb1:armhf (1.3.11-2) ...
Selecting previously unselected package libtevent0:armhf.
Preparing to unpack .../03-libtevent0_0.9.31-1_armhf.deb ...
Unpacking libtevent0:armhf (0.9.31-1) ...
Selecting previously unselected package libldb1:armhf.
Preparing to unpack .../04-libldb1_2%3a1.1.27-1_armhf.deb ...
Unpacking libldb1:armhf (2:1.1.27-1) ...
Selecting previously unselected package libpython2.7:armhf.
Preparing to unpack .../05-libpython2.7_2.7.13-2+deb9u2_armhf.deb ...
Unpacking libpython2.7:armhf (2.7.13-2+deb9u2) ...
Selecting previously unselected package python-ldb.
Preparing to unpack .../06-python-ldb_2%3a1.1.27-1_armhf.deb ...
Unpacking python-ldb (2:1.1.27-1) ...
Selecting previously unselected package python-tdb.
Preparing to unpack .../07-python-tdb_1.3.11-2_armhf.deb ...
Unpacking python-tdb (1.3.11-2) ...
Selecting previously unselected package python-talloc.
Preparing to unpack .../08-python-talloc_2.1.8-1_armhf.deb ...
Unpacking python-talloc (2.1.8-1) ...
Selecting previously unselected package libavahi-client3:armhf.
Preparing to unpack .../09-libavahi-client3_0.6.32-2_armhf.deb ...
Unpacking libavahi-client3:armhf (0.6.32-2) ...
Selecting previously unselected package libcups2:armhf.
Preparing to unpack .../10-libcups2_2.2.1-8_armhf.deb ...
Unpacking libcups2:armhf (2.2.1-8) ...
Selecting previously unselected package samba-libs:armhf.
Preparing to unpack .../11-samba-libs_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking samba-libs:armhf (2:4.5.12+dfsg-2+deb9u2) ...
Selecting previously unselected package python-samba.
Preparing to unpack .../12-python-samba_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking python-samba (2:4.5.12+dfsg-2+deb9u2) ...
Selecting previously unselected package samba-common-bin.
Preparing to unpack .../13-samba-common-bin_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking samba-common-bin (2:4.5.12+dfsg-2+deb9u2) ...
Selecting previously unselected package tdb-tools.
Preparing to unpack .../14-tdb-tools_1.3.11-2_armhf.deb ...
Unpacking tdb-tools (1.3.11-2) ...
Selecting previously unselected package libfile-copy-recursive-perl.
Preparing to unpack .../15-libfile-copy-recursive-perl_0.38-1_all.deb ...
Unpacking libfile-copy-recursive-perl (0.38-1) ...
Selecting previously unselected package update-inetd.
Preparing to unpack .../16-update-inetd_4.44_all.deb ...
Unpacking update-inetd (4.44) ...
Selecting previously unselected package samba.
Preparing to unpack .../17-samba_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking samba (2:4.5.12+dfsg-2+deb9u2) ...
[  615.677679] Under-voltage detected! (0x00050005)
Selecting previously unselected package attr.
Preparing to unpack .../18-attr_1%3a2.4.47-2_armhf.deb ...
Unpacking attr (1:2.4.47-2) ...
Selecting previously unselected package libaio1:armhf.
Preparing to unpack .../19-libaio1_0.3.110-3_armhf.deb ...
Unpacking libaio1:armhf (0.3.110-3) ...
Selecting previously unselected package libgpgme11:armhf.
Preparing to unpack .../20-libgpgme11_1.8.0-3_armhf.deb ...
Unpacking libgpgme11:armhf (1.8.0-3) ...
Selecting previously unselected package samba-dsdb-modules.
Preparing to unpack .../21-samba-dsdb-modules_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking samba-dsdb-modules (2:4.5.12+dfsg-2+deb9u2) ...
Selecting previously unselected package samba-vfs-modules.
Preparing to unpack .../22-samba-vfs-modules_2%3a4.5.12+dfsg-2+deb9u2_armhf.deb ...
Unpacking samba-vfs-modules (2:4.5.12+dfsg-2+deb9u2) ...
Setting up python-dnspython (1.15.0-1) ...
Setting up libtdb1:armhf (1.3.11-2) ...
Setting up python-crypto (2.6.1-7) ...
Setting up libgpgme11:armhf (1.8.0-3) ...
Setting up libtevent0:armhf (0.9.31-1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libaio1:armhf (0.3.110-3) ...
Processing triggers for systemd (232-25+deb9u2) ...
Setting up libpython2.7:armhf (2.7.13-2+deb9u2) ...
Setting up tdb-tools (1.3.11-2) ...
update-alternatives: using /usr/bin/tdbbackup.tdbtools to provide /usr/bin/tdbbackup (tdbbackup) in auto mode
Processing triggers for man-db (2.7.6.1-2) ...
[  626.077803] Under-voltage detected! (0x00050005)
Setting up libavahi-client3:armhf (0.6.32-2) ...
Setting up attr (1:2.4.47-2) ...
Setting up libfile-copy-recursive-perl (0.38-1) ...
Setting up libcups2:armhf (2.2.1-8) ...
Setting up python-talloc (2.1.8-1) ...
Setting up update-inetd (4.44) ...
Setting up python-tdb (1.3.11-2) ...
Setting up libldb1:armhf (2:1.1.27-1) ...
Setting up python-ldb (2:1.1.27-1) ...
Setting up samba-libs:armhf (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba-vfs-modules (2:4.5.12+dfsg-2+deb9u2) ...
Setting up python-samba (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba-common-bin (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba-dsdb-modules (2:4.5.12+dfsg-2+deb9u2) ...
Setting up samba (2:4.5.12+dfsg-2+deb9u2) ...
Adding group `sambashare' (GID 113) ...
Done.
Samba is not being run as an AD Domain Controller, masking samba-ad-dc-service.
Please ignore the following error about deb-systemd-helper not finding samba-ad-dc-service.
Created symlink /etc/systemd/system/multi-user.target.wants/nmbd.service → /lib/systemd/system/nmbd.service.
[  642.717966] Under-voltage detected! (0x00050005)
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Created symlink /etc/systemd/system/multi-user.target.wants/smbd.service → /lib/systemd/system/smbd.service.
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u2) ...

$ sudo vi /etc/samba/smb.conf 

security = user
read only = no

$ sudo /etc/init.d/samba restart
Restarting nmbd (via systemctl): nmbd.service.
Restarting smbd (via systemctl): smbd.service.

$ sudo smbpasswd -a andreas
New SMB password:
Retype new SMB password:
Added user andreas.

Raspberry Pi 3, Firmware

/usr/bin/vcgencmd
$ vcgencmd get_config int
$ vcgencmd version
$ vcgencmd codec_enabled { H264, MPG2, WVC1, MPG4, MJPG, WMV9 }

RPI vcgencmd usage
Raspberry Pi: Systeminformationen ermitteln
Raspberry Pi: vcgencmd nachinstallieren

Freie Firmware für Raspberry Pi startet Linux-Kernel

“When the pi was release, we were playing around with buildroot distros, firmware was getting updated frequently and many changes were quite important. So we needed a way to upgrade the firmware. The way to do it was to update from the repo and then copy the firmware files, the kernel and the modules to the relevant folders. Hexxeh made rpi-update and it was pretty useful at the time. However, I am of the opinion that it is indeed a hack. It’s not “the right way” to do things, but it is better than having to do it manually or having each person use their own scripts. And since it allowed to downgrade the firmware and get an exact revision, it was awesome.

Now the firmware is a part of the raspberrypi-bootloader package, which also contains the kernel. There are libraspberrypi-* packages which contain some extra userspace stuff like the vc libs and binaries. These are not updated too often, but often enough to ensure that the standard apt-get update; apt-get dist-upgrade; commands will keep your firmware up to date.

However, you may be asked by Dom to upgrade your firmware to a specific revision or the latest version if there is an issue. That is to check if a recently pushed update has fixed the issue. Sometimes people think that they are having problems because of firmware updates, so they may feel like they need to downgrade in order to get a stable system. In other words, there are legitimate uses for rpi-update still.

The problem is that it overwrites files which should be and are typically managed by the distro’s package manager. It is possible to end up with a broken install or a version mismatch between the userspace libraries and the firmware. It’s a bit like installing a package using apt-get, the downloading a different version, compiling it and overwriting the system’s version. There are no ‘real’ problems with any of this, but for purists, it’s just not the right way to do things.

I would say, as a rule of thumbs, use rpi-update if you are helping test the firmware while investigating a potential bug, if you are working on a distro that doesn’t keep the firmware up to date (the important ones do), if the raspberrypi-bootloader package has not been updated in a long time and important updates have been released on github or if you just know what you’re doing and feel like it’s necessary. But I don’t think it’s good practice to just run it all the time without even checking the commits on github. A recent example where rpi-update was a good idea was when some SD corruption fixes were pushed but the raspberrypi-bootloader package was 3 months out of date.”

Raspberry Pi 3, MMAL / OpenMAX

What is MMAL?
Help learning MMAL/contributing to userland utils
Raspicam C++ API mmal linking
Multi-Media Abstraction Layer (MMAL). Draft Version 0.1

$ ldconfig -p | grep libmmal
    libmmal_vc_client.so (libc6,hard-float) => /opt/vc/lib/libmmal_vc_client.so
    libmmal_util.so (libc6,hard-float) => /opt/vc/lib/libmmal_util.so
    libmmal_core.so (libc6,hard-float) => /opt/vc/lib/libmmal_core.so
    libmmal_components.so (libc6,hard-float) => /opt/vc/lib/libmmal_components.so
    libmmal.so (libc6,hard-float) => /opt/vc/lib/libmmal.so

C++ Threads


#include <thread>
#include <mutex>
#include <atomic>

std::thread    t(thread_function);

std::thread::hardware_concurrency()
std::thread::get_id()
std::this_thread::get_id();

t.join();
t.detach();
t.joinable();
t.get_id();

static std::mutex               m;
std::lock_guard<std::mutex>     guard(m);
std::unique_lock<std::mutex>    l(m);
std::atomic<int>                result(0);
std::condition_variable         condvar;

m.lock();
m.unlock();
condvar.wait(...);
condvar.notify_one();

  • Function Pointer
  • Function Objects
  • Lambda functions

C++11 multithreading tutorial
C++11 multithreading tutorial – part 2
C++11 Multithreading – Part 1 : Three Different ways to Create Threads
C++11/C++14 Thread 1. Creating Threads

Posts about C++11 Concurrency Tutorial
C++11 Concurrency – Part 1 : Start Threads
C++11 Concurrency Tutorial – Part 2 : Protect shared data
C++11 Concurrency Tutorial – Part 3: Advanced locking and condition variables

C++ Copy Elision and Return Value Optimization

  • RVO = Return Value Optimization
  • NRVO = Named Return Value Optimization
  • Copy Constructor (ctor)
  • Copy Assignment Operator
  • Move Constructor (ctor): C::C(C&& other);
  • Move Assignment Operator: C& C::operator=(C&& other);
  • Move Semantics
  • Temporary
  • Lvalue: object that occupies some identifiable location in memory (i.e. has an address)
  • Rvalue: temporary register (i.e. has NOT address)
  • Rvalue References: std::string&& rrstr;
  • Lvalue references: std::string& ref;
  • Reference Variables

Understanding lvalues and rvalues in C and C++

Six User-Declared Special Member Functions

  • Default constructor
  • Copy constructor (ctor)
  • Copy assignment operator
  • Move Constructor (ctor)
  • Move Assignment Operator
  • Destructor

C++ declares its remaining special member functions implicitly, if there are no user-declared functions.

Vokabular

  • pilfer = stehlen, entwenden, klauen, stibitzen
  • elision = Weglassung, Auslassung

Hitherto, copying has been the only means for transferring a state from one object to another.
And yet, in many real-world scenarios, you don’t copy objects but move them.
Notwithstanding the conceptual difference between copying and moving, there’s a practical difference too: Move operations tend to be faster than copying because they transfer an existing resource to a new destination, whereas copying requires the creation of a new resource from scratch.

Bislang war das Kopieren das einzige Mittel, um einen Zustand von einem Objekt auf ein anderes zu übertragen.
Doch in vielen realen Szenarien kopiert man Objekte nicht, sondern verschiebt sie.
Ungeachtet des konzeptionellen Unterschieds zwischen Kopieren und Verschieben gibt es auch einen praktischen Unterschied: Verschiebeoperationen sind tendenziell schneller als Kopieren, weil sie eine bestehende Ressource an ein neues Ziel übertragen, während beim Kopieren eine neue Ressource von Grund auf neu erstellt werden muss.

Übersetzt mit www.DeepL.com/Translator (kostenlose Version)

Is there any gorgeous way for C++ to return an object without copying it in memory?
Returning a c++ std::vector without a copy?
What are copy elision and return value optimization?
Move or Named Return Value Optimization (NRVO)?
What Is RVO And NRVO In C++? (YouTube Video)

C++11 Tutorial: Introducing the Move Constructor and the Move Assignment Operator

cppreference.com

Copy elision
Move constructors