--- /dev/null
+
+after changing to the new user:
+
+> export NO_AT_BRIDGE=1
+++ /dev/null
-
-~ is the project directory
-
---------------------------------------------------------------------------------
-most subdirectories are source modules
-
-
---------------------------------------------------------------------------------
-~/tools
-
-Some tools are normally installed on the system. Others are local. Local tools
-are typically standard tools that have been customized for the project or are
-unusual to the project.
-
- ~/tools/bin is for the executables of locally used tools.
- ~/tools/lib is locally used libraries.
- ~/tools/doc is for collected docs on tools
-
-typically a developer will want ~/tools/bin in his search path
-
---------------------------------------------------------------------------------
-~/staged
-
-These are make file build targets. They represent either intermediate or
-finished executables and libraries. When a project has multiple src
-directories and they use each other's work product for the builds, the
-items in the staged area are those that are used by each src directory.
-
-Typically the install target copies material in the staging area to
-system locations.
-
---------------------------------------------------------------------------------
-~/<module>
-
-
-
-
-
+++ /dev/null
-
-
-filename.tag.extension
-
-extension:
- .c for C source
- .cc for C++ source
- .h for C header file
- .hh for C++ header file
- .o an object file
-
-tag:
- .lib. The resulting .o file to be placed in release library and is part of the
- programming interface.
- .aux. The resulting.o file not directly part of the programming interface, but
- it might be called by functions that are.
- .cli. The source file has a main call and is to be relased as part of the command line interface
- .loc. file has a main call to be made into a local uitlity function
-
-We carry the source file tag and extension to the .o file. We do not put tags
-nor extensions on command line executables.
-
-local_common.h should be included in all source files
+++ /dev/null
-1.
-
-For the following makefile, the .PHONY tag is ignored unless there
-is an explicit target with that name. The %:: target is not enough.
-So for expample, if there is an exec directory, the exec target
-caught through the %:: will never fire. The commented lines must
-be added that give an explicit exec target.
-
-
-.PHONY: all version deps lib exec
-all: version deps lib exec
-
-lib:
- $(MAKE) $@
- cp src/tranche.lib.h include/tranche.h
-
-#exec:
-# $(MAKE) $@
-
-%::
- $(MAKE) $@
+this does not apply to the current scripts, but rather the setuid code
+
subu-mk-0
1. We have to make the subu for step 2 so that we will have subu_uid and subu_gid
--- /dev/null
+
+before changing users:
+
+user must be in group audio
+
+> sudo dnf install pulseaudio-utils
+> pactl load-module module-native-protocol-tcp
+
+after changing users:
+
+> export PULSE_SERVER=localhost
+
+According to
+https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/CLI/#default.pa
+the module load command goes in /etc/pulse/default.pa and the pactl command is not needed,
+but this did not work:
+
+ /etc/pulse/default.pa
+ load-module module-native-protocol-tcp
+
+this did not work
+seems this must be run by the login user, not even root can do it:
+
+ pactl load-module module-native-protocol-tcp
+
+also requires restart of google-chrome etc.
+
+for now I will add this the .bashrc file for admin
--- /dev/null
+
+
+added file /etc/udev/rules/50-usb-scale.rules
+SUBSYSTEM=="usb" ,ATTR{idVendor}=="1d50" ,ATTR{idProduct}=="60fc" ,MODE="0666" ,OWNER="Thomas-Internet"
+
+SUBSYSTEM=="usb" \
+,ATTR{idVendor}=="1d50" \
+,ATTR{idProduct}=="60fc" \
+,MODE="0666" \
+,OWNER="Thomas-Internet"
+
+
+udevadm control --reload-rules
+udevadm control --reload-rules && udevadm trigger
+
+systemctl status systemd-udevd
+
+firefox can find the usb hardward key with these settings, google-chrome can not.
--- /dev/null
+
+user must be in group video
+
+I added 666 permissions to udev for the USB camera but doubt this
+is needed.
+
+++ /dev/null
-#!/bin/bash
-#
-
-# to make audio work will need to do this:
-# > sudo dnf install pulseaudio-utils
-# > pactl load-module module-native-protocol-tcp
-# To load a specific module to the PA server, you add it to /etc/pulse/default.pa:
-# I created the file because it was not there...
-
-#set -x
-
-subu=$1
-
-if [ ! -x "/usr/local/bin/user-stem" ]; then
- echo "no /usr/local/bin/user-stem program found (it is in the system repo)"
- exit 1
-fi
-
-if [ -z "$subu" ]; then
- echo "no subuser name supplied"
- exit 1
-fi
-
-machine="$(hostname)"
-xkey=$(xauth list | grep "$machine" | head -1 | awk '{print $3}')
-
-if [ -z "$xkey" ]; then
- echo "xauth key not found"
- exit 1
-fi
-
-stem=$(/usr/local/bin/user-stem)
-user_subu="$stem-$subu"
-home_subu="/home/$stem/$subu"
-bashrc="$home_subu/.bashrc"
-xauthority="$home_subu/.Xauthority"
-
-read -r -d '' script0 <<-EOF
- cd "$home_subu" \
- ;export DISPLAY=$DISPLAY \
- ;export NO_AT_BRIDGE=1 \
- ;export PULSE_SERVER=localhost \
- ;touch "$xauthority" \
- ;xauth add "$DISPLAY" . "$xkey" \
- ;gnome-terminal
-EOF
-
-sudo su "$user_subu" -c "$script0"
-
-#set +x
--- /dev/null
+#!/bin/bash
+#
+
+# to make audio work will need to do this:
+# > sudo dnf install pulseaudio-utils
+# > pactl load-module module-native-protocol-tcp
+# To load a specific module to the PA server, you add it to /etc/pulse/default.pa:
+# I created the file because it was not there...
+
+#set -x
+
+subu=$1
+
+if [ ! -x "/usr/local/bin/user-stem" ]; then
+ echo "no /usr/local/bin/user-stem program found (it is in the system repo)"
+ exit 1
+fi
+
+if [ -z "$subu" ]; then
+ echo "no subuser name supplied"
+ exit 1
+fi
+
+machine="$(hostname)"
+xkey=$(xauth list | grep "$machine" | head -1 | awk '{print $3}')
+
+if [ -z "$xkey" ]; then
+ echo "xauth key not found"
+ exit 1
+fi
+
+stem=$(/usr/local/bin/user-stem)
+user_subu="$stem-$subu"
+home_subu="/home/$stem/$subu"
+bashrc="$home_subu/.bashrc"
+xauthority="$home_subu/.Xauthority"
+
+read -r -d '' script0 <<-EOF
+ cd "$home_subu" \
+ ;export DISPLAY=$DISPLAY \
+ ;export NO_AT_BRIDGE=1 \
+ ;export PULSE_SERVER=localhost \
+ ;touch "$xauthority" \
+ ;xauth add "$DISPLAY" . "$xkey" \
+ ;gnome-terminal
+EOF
+
+
+sudo su -l "$user_subu" -c "$script0"
+
+#just hangs
+#sudo -u "$user_subu" sh -c "$script0"
+
+#set +x