Added chroot development environment How-To
This commit is contained in:
parent
1f97599eb3
commit
7b811b6ddf
@ -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)
|
||||
|
@ -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 ./
|
82
src/TXTs/chroot-dev-env-setup.txt
Normal file
82
src/TXTs/chroot-dev-env-setup.txt
Normal 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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user