Added chroot development environment How-To

This commit is contained in:
itdominator 2024-01-22 21:03:58 -06:00
parent 1f97599eb3
commit 7b811b6ddf
3 changed files with 95 additions and 10 deletions

View File

@ -47,6 +47,7 @@ def generate_slice_info():
slices.append([start_pos, end_pos]) slices.append([start_pos, end_pos])
def draw_square_on_linear_arry(pixels): def draw_square_on_linear_arry(pixels):
global slices global slices
if not slices: if not slices:
@ -92,6 +93,7 @@ def draw_square_on_linear_arry(pixels):
i += 1 i += 1
def draw_square_on_2d_arry(pixels): def draw_square_on_2d_arry(pixels):
# draw top # draw top
i = start_x i = start_x
@ -139,6 +141,7 @@ def flatten_colors_in_change_region(pixels):
i += 1 i += 1
def detect_change_region(pixels): def detect_change_region(pixels):
i = start_y i = start_y
j = start_y + view_rect_height j = start_y + view_rect_height
@ -149,20 +152,17 @@ def detect_change_region(pixels):
while k < l: while k < l:
b, g, r = pixels[i][k] 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 pixels[i][k] = 255, 255, 255
else: else:
pixels[i][k] = 0, 0, 0 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 k += 1
i += 1 i += 1
def bgr_separated_output_displays(pixels): def bgr_separated_output_displays(pixels):
b = pixels.copy() b = pixels.copy()
b[:, :, 1] = 0 b[:, :, 1] = 0
@ -179,13 +179,15 @@ def bgr_separated_output_displays(pixels):
r[:, :, 1] = 0 r[:, :, 1] = 0
cv2.imshow('Red Channel', r) cv2.imshow('Red Channel', r)
def process_frame(pixels): def process_frame(pixels):
flatten_colors_in_change_region(pixels) # flatten_colors_in_change_region(pixels)
# detect_change_region(pixels) detect_change_region(pixels)
# draw_square_on_linear_arry(pixels) # draw_square_on_linear_arry(pixels)
draw_square_on_2d_arry(pixels) draw_square_on_2d_arry(pixels)
cv2.imshow('Track Motion', pixels) cv2.imshow('Track Motion', pixels)
def capture_video(camera): def capture_video(camera):
while(True): while(True):
captured, data = camera.read() captured, data = camera.read()
@ -202,6 +204,7 @@ def capture_video(camera):
# gray_frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) # gray_frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
process_frame(frame) process_frame(frame)
def process_video(): def process_video():
camera = cv2.VideoCapture(1) camera = cv2.VideoCapture(1)
camera.set(cv2.CAP_PROP_FRAME_WIDTH, image_width) camera.set(cv2.CAP_PROP_FRAME_WIDTH, image_width)

View File

@ -99,7 +99,7 @@ export LC_ALL=C
export DISPLAY=:10 export DISPLAY=:10
## GET sourcelist from source list generator [link above] ## 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 apt-get upgrade
## INSTALL AND MOD STUFF ## INSTALL AND MOD STUFF
@ -210,4 +210,4 @@ sudo mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-
OPTION 2:: OPTION 2::
## Hasn't worked for me.... ## 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 ./

View File

@ -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 <workspace name>