From 33c058d403cd156f20a4fa8cd462badbc501937f Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Sat, 19 Mar 2022 16:48:58 +0100 Subject: [PATCH] . --- document/cant_access_bus.txt | 4 ++++ document/dir-structure.txt | 38 -------------------------------- document/file_extentions.txt | 23 ------------------- document/makefile-issue | 21 ------------------ document/note.txt | 2 ++ document/sound.txt | 28 +++++++++++++++++++++++ document/usb.txt | 18 +++++++++++++++ document/video.txt | 6 +++++ executable/{ch_subu => subu_env} | 6 ++++- 9 files changed, 63 insertions(+), 83 deletions(-) create mode 100644 document/cant_access_bus.txt delete mode 100644 document/dir-structure.txt delete mode 100644 document/file_extentions.txt delete mode 100644 document/makefile-issue create mode 100644 document/sound.txt create mode 100644 document/usb.txt create mode 100644 document/video.txt rename executable/{ch_subu => subu_env} (92%) diff --git a/document/cant_access_bus.txt b/document/cant_access_bus.txt new file mode 100644 index 0000000..dfb250d --- /dev/null +++ b/document/cant_access_bus.txt @@ -0,0 +1,4 @@ + +after changing to the new user: + +> export NO_AT_BRIDGE=1 diff --git a/document/dir-structure.txt b/document/dir-structure.txt deleted file mode 100644 index b385074..0000000 --- a/document/dir-structure.txt +++ /dev/null @@ -1,38 +0,0 @@ - -~ 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. - --------------------------------------------------------------------------------- -~/ - - - - - diff --git a/document/file_extentions.txt b/document/file_extentions.txt deleted file mode 100644 index a9a2b21..0000000 --- a/document/file_extentions.txt +++ /dev/null @@ -1,23 +0,0 @@ - - -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 diff --git a/document/makefile-issue b/document/makefile-issue deleted file mode 100644 index 8916de0..0000000 --- a/document/makefile-issue +++ /dev/null @@ -1,21 +0,0 @@ -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) $@ diff --git a/document/note.txt b/document/note.txt index b9ed603..3cdd7d7 100644 --- a/document/note.txt +++ b/document/note.txt @@ -1,4 +1,6 @@ +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 diff --git a/document/sound.txt b/document/sound.txt new file mode 100644 index 0000000..0a02f87 --- /dev/null +++ b/document/sound.txt @@ -0,0 +1,28 @@ + +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 diff --git a/document/usb.txt b/document/usb.txt new file mode 100644 index 0000000..4e62275 --- /dev/null +++ b/document/usb.txt @@ -0,0 +1,18 @@ + + +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. diff --git a/document/video.txt b/document/video.txt new file mode 100644 index 0000000..e60e4f0 --- /dev/null +++ b/document/video.txt @@ -0,0 +1,6 @@ + +user must be in group video + +I added 666 permissions to udev for the USB camera but doubt this +is needed. + diff --git a/executable/ch_subu b/executable/subu_env similarity index 92% rename from executable/ch_subu rename to executable/subu_env index 8b8150b..b54968e 100755 --- a/executable/ch_subu +++ b/executable/subu_env @@ -45,6 +45,10 @@ read -r -d '' script0 <<-EOF ;gnome-terminal EOF -sudo su "$user_subu" -c "$script0" + +sudo su -l "$user_subu" -c "$script0" + +#just hangs +#sudo -u "$user_subu" sh -c "$script0" #set +x -- 2.20.1