From 7b811b6ddf27f5f76cd6a7968372bf9bdbe4fc71 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Mon, 22 Jan 2024 21:03:58 -0600 Subject: [PATCH] Added chroot development environment How-To --- src/Python/Scripts/video-mouse.py | 19 +++-- src/TXTs/Chroot Distro Build (Depricated).txt | 4 +- src/TXTs/chroot-dev-env-setup.txt | 82 +++++++++++++++++++ 3 files changed, 95 insertions(+), 10 deletions(-) create mode 100644 src/TXTs/chroot-dev-env-setup.txt diff --git a/src/Python/Scripts/video-mouse.py b/src/Python/Scripts/video-mouse.py index 3599a46..7b20561 100644 --- a/src/Python/Scripts/video-mouse.py +++ b/src/Python/Scripts/video-mouse.py @@ -47,6 +47,7 @@ def generate_slice_info(): slices.append([start_pos, end_pos]) + def draw_square_on_linear_arry(pixels): global slices if not slices: @@ -92,6 +93,7 @@ def draw_square_on_linear_arry(pixels): i += 1 + def draw_square_on_2d_arry(pixels): # draw top i = start_x @@ -139,6 +141,7 @@ def flatten_colors_in_change_region(pixels): i += 1 + def detect_change_region(pixels): i = start_y j = start_y + view_rect_height @@ -149,20 +152,17 @@ def detect_change_region(pixels): while k < l: b, g, r = pixels[i][k] - if (r > 140 and r < 210) and ((b > 60 and g > 60) and (b < 80 and g < 80)): + + if b > 150 and (r < 100 and g < 100): pixels[i][k] = 255, 255, 255 else: pixels[i][k] = 0, 0, 0 - # if r > 100 and (b < 160 and g < 160): - # pixels[i][k] = 255, 255, 255 - # else: - # pixels[i][k] = 0, 0, 0 - k += 1 i += 1 + def bgr_separated_output_displays(pixels): b = pixels.copy() b[:, :, 1] = 0 @@ -179,13 +179,15 @@ def bgr_separated_output_displays(pixels): r[:, :, 1] = 0 cv2.imshow('Red Channel', r) + def process_frame(pixels): - flatten_colors_in_change_region(pixels) - # detect_change_region(pixels) + # flatten_colors_in_change_region(pixels) + detect_change_region(pixels) # draw_square_on_linear_arry(pixels) draw_square_on_2d_arry(pixels) cv2.imshow('Track Motion', pixels) + def capture_video(camera): while(True): captured, data = camera.read() @@ -202,6 +204,7 @@ def capture_video(camera): # gray_frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) process_frame(frame) + def process_video(): camera = cv2.VideoCapture(1) camera.set(cv2.CAP_PROP_FRAME_WIDTH, image_width) diff --git a/src/TXTs/Chroot Distro Build (Depricated).txt b/src/TXTs/Chroot Distro Build (Depricated).txt index 48bea21..b9e2f81 100644 --- a/src/TXTs/Chroot Distro Build (Depricated).txt +++ b/src/TXTs/Chroot Distro Build (Depricated).txt @@ -99,7 +99,7 @@ export LC_ALL=C export DISPLAY=:10 ## GET sourcelist from source list generator [link above] -nano it to /etc/apt/sources.list +## nano it to /etc/apt/sources.list apt-get upgrade ## INSTALL AND MOD STUFF @@ -210,4 +210,4 @@ sudo mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot- OPTION 2:: ## Hasn't worked for me.... -sudo mkisofs -r -no-emul-boot -boot-load-size 4 -o ../ubu-mini.iso -b isolinux/isolinux.bin -c isolinux/boot.cat ./ +sudo mkisofs -r -no-emul-boot -boot-load-size 4 -o ../ubu-mini.iso -b isolinux/isolinux.bin -c isolinux/boot.cat ./ \ No newline at end of file diff --git a/src/TXTs/chroot-dev-env-setup.txt b/src/TXTs/chroot-dev-env-setup.txt new file mode 100644 index 0000000..2170280 --- /dev/null +++ b/src/TXTs/chroot-dev-env-setup.txt @@ -0,0 +1,82 @@ +## Make Chroot Env ## +mkdir general-brew/ +sudo debootstrap stable ./general-brew http://deb.debian.org/debian/ + + +## Load Chroot ## +cd general-brew/ +sudo mount -t proc proc proc/ +sudo mount -t sysfs sys sys/ +# sudo mount -o bind /dev dev/ +sudo mount --rbind /dev dev/ + +sudo cp /etc/resolv.conf etc/ +sudo cp /etc/hosts etc/hosts + +sudo chroot . bash + + +## FOR GUI CHROOT LIKE ENVIRONMENT +**** In a seperate terminal from chrooted terminal **** +Xnest -ac :10 -geometry 1920x1080 ## Monitor resolution + OR +Xephyr -resizeable -screen 1920x1080 :10 + + +## IN Chroot ## +**** Add to respective user .bashrc (or respective rc shell file) **** +export HOME=/root + OR +export HOME=/home/developer +export LC_ALL=C +export DISPLAY=:10 # Used to bind output UI to Xnest or Xephyr + +apt-get update +apt-get install sudo curl wget + + +## Add developer user ## +adduser developer +usermod -aG sudo developer +passwd developer + + +## Brew Deps ## +**** Debian **** +apt-get install build-essential procps curl file git + +**** Arch **** +pacman -S base-devel procps-ng curl file git + + +## Install Brew ## +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + +## Post Brew Install ## +brew analytics off +brew install gcc openjdk maven + + +## Node Version Manager ## +mkdir ~/.nvm +brew install nvm + +nvm install node # Gets latest version of node + +nvm use node # Sets latest node as active node version to be used + +npm install -g pnpm + +pnpm setup # Add output to given bashrc + + +## Install NX Workspaces ## +**** Creates different project setups **** +pnpm -g i nx + + +## Create Workspace ## +npx create-nx-workspace@latest + +