diff --git a/src/Images/Using AWK and R to parse 25tb.png b/src/Images/Using AWK and R to parse 25tb.png new file mode 100644 index 0000000..496d847 Binary files /dev/null and b/src/Images/Using AWK and R to parse 25tb.png differ diff --git a/src/Images/shell-key-combos.png b/src/Images/shell-key-combos.png new file mode 100644 index 0000000..af8613b Binary files /dev/null and b/src/Images/shell-key-combos.png differ diff --git a/src/Java/Examples/Helper_Classes/SelectDir.java b/src/Java/Examples/Helper_Classes/SelectDir.java index 5d5a812..1e9fbe7 100644 --- a/src/Java/Examples/Helper_Classes/SelectDir.java +++ b/src/Java/Examples/Helper_Classes/SelectDir.java @@ -4,8 +4,8 @@ import java.io.File; public class SelectDir { - private final Stage dirOpenerStage = new Stage(); - private DirectoryChooser folderChooser = new DirectoryChooser(); + private final Stage dirOpenerStage = new Stage(); + private DirectoryChooser folderChooser = new DirectoryChooser(); private File selectedDir; diff --git a/src/Java/Examples/Helper_Classes/SelectFile.java b/src/Java/Examples/Helper_Classes/SelectFile.java index 5be2b59..a3578b3 100644 --- a/src/Java/Examples/Helper_Classes/SelectFile.java +++ b/src/Java/Examples/Helper_Classes/SelectFile.java @@ -6,7 +6,7 @@ import java.io.File; public class SelectFile { private final Stage fileOpenerStage = new Stage(); - private FileChooser fileChooser = new FileChooser(); + private FileChooser fileChooser = new FileChooser(); private File selectedFile; diff --git a/src/PDFs/Behind the 6-digit code: Building HOTP and TOTP from Scratch.pdf b/src/PDFs/Behind the 6-digit code: Building HOTP and TOTP from Scratch.pdf new file mode 100644 index 0000000..6dfb1e7 Binary files /dev/null and b/src/PDFs/Behind the 6-digit code: Building HOTP and TOTP from Scratch.pdf differ diff --git a/src/PDFs/Efficient Triangulation-Based Pathfinding.pdf b/src/PDFs/Efficient Triangulation-Based Pathfinding.pdf new file mode 100644 index 0000000..009f865 Binary files /dev/null and b/src/PDFs/Efficient Triangulation-Based Pathfinding.pdf differ diff --git a/src/PDFs/Using Nginx as a Reverse Proxy in Dockerized Environments.pdf b/src/PDFs/Using Nginx as a Reverse Proxy in Dockerized Environments.pdf new file mode 100644 index 0000000..0794209 Binary files /dev/null and b/src/PDFs/Using Nginx as a Reverse Proxy in Dockerized Environments.pdf differ diff --git a/src/PDFs/Writing a GIMP 3.0 Plugin - Resources and Notes.pdf b/src/PDFs/Writing a GIMP 3.0 Plugin - Resources and Notes.pdf new file mode 100644 index 0000000..bc6150c Binary files /dev/null and b/src/PDFs/Writing a GIMP 3.0 Plugin - Resources and Notes.pdf differ diff --git a/src/Python/Scripts/py-virtcam/README.md b/src/Python/Scripts/py-virtcam/README.md new file mode 100644 index 0000000..21084c6 --- /dev/null +++ b/src/Python/Scripts/py-virtcam/README.md @@ -0,0 +1,38 @@ +Dependencies: + sudo pacman -S linux linux-headers + sudo pacman -S v4l2loopback-dkms v4l-utils ffmpeg python python-pip + # linux-headers needed for dkms build + + pip install opencv-python + + sudo dkms autoinstall + + +Load Module: + sudo modprobe v4l2loopback \ + video_nr=10 \ + card_label="Python Virtual Camera" \ + exclusive_caps=1 + + +Verify: + v4l2-ctl --list-devices + or + v4l2-ctl --list-formats-ext -d /dev/video10 + or + mpv av://v4l2:/dev/video10 + or + ffplay /dev/video10 + + +Streaming to Device: + ffmpeg -re -loop 1 -i ~/ \ + -vf "format=yuv420p" \ + -f v4l2 /dev/video10 + + or + + + + + diff --git a/src/Python/Scripts/py-virtcam/feed-frames.py b/src/Python/Scripts/py-virtcam/feed-frames.py new file mode 100644 index 0000000..de2b2a0 --- /dev/null +++ b/src/Python/Scripts/py-virtcam/feed-frames.py @@ -0,0 +1,114 @@ +#!/usr/bin/python3 + + +# Python imports +import time +import subprocess +import cv2 + +# Lib imports + +# Application imports + + + +DEVICE = "/dev/video10" +WIDTH = 1280 +HEIGHT = 720 +FPS = 30 +RESOLUTION = (WIDTH, HEIGHT) + + + +def show_stream(): + cap = cv2.VideoCapture(0) + + cap.set(cv2.CAP_PROP_FRAME_WIDTH, WIDTH) + cap.set(cv2.CAP_PROP_FRAME_HEIGHT, HEIGHT) + cap.set(cv2.CAP_PROP_FPS, FPS) + + while True: + ok, frame = cap.read() + + if not ok: break + + frame = cv2.resize(frame, RESOLUTION) + + cv2.imshow("source", frame) + if cv2.waitKey(1) == 27: + break + + cap.release() + cv2.destroyAllWindows() + + +def run_stream_ffmpeg(): + image = cv2.imread("89538.jpg") + + if image is None: + raise RuntimeError("Could not open image") + + cmd = [ + "ffmpeg", + "-loglevel", "error", + "-re", + "-f", "rawvideo", + "-pix_fmt", "bgr24", + "-s", f"{WIDTH}x{HEIGHT}", + "-r", f"{FPS}", + "-i", "-", + "-f", "v4l2", + "-pix_fmt", "yuv420p", + DEVICE, + ] + + # Match the desired virtual-camera resolution + image = cv2.resize(image, RESOLUTION) + proc = subprocess.Popen(cmd, stdin = subprocess.PIPE) + + try: + while True: + proc.stdin.write( image.tobytes() ) + time.sleep(1 / FPS) + except KeyboardInterrupt: + ... + + finally: + proc.stdin.close() + proc.wait() + + +def run_stream_opencv(): + image = cv2.imread("89538.jpg") + + if image is None: + raise RuntimeError("Could not open image") + + # Match the desired virtual-camera resolution + image = cv2.resize(image, RESOLUTION) + writer = cv2.VideoWriter( + DEVICE, + cv2.VideoWriter_fourcc(*"YUYV"), + FPS, + RESOLUTION, + ) + + if not writer.isOpened(): + raise RuntimeError(f"Could not open {DEVICE}") + + while True: + writer.write(image) + + time.sleep(1 / 30) + + writer.release() + + +def main(): + # show_stream() + # run_stream_opencv() + run_stream_ffmpeg() + + +if __name__ == "__main__": + main() diff --git a/src/Python/Scripts/py-virtcam/penguins.jpg b/src/Python/Scripts/py-virtcam/penguins.jpg new file mode 100644 index 0000000..8a41ef5 Binary files /dev/null and b/src/Python/Scripts/py-virtcam/penguins.jpg differ diff --git a/src/Shell/android-app-activity-launcher.sh b/src/Shell/android-app-activity-launcher.sh new file mode 100644 index 0000000..796435e --- /dev/null +++ b/src/Shell/android-app-activity-launcher.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +###################################################################### +#Copyright (C) 2025 Kris Occhipinti +#https://filmsbykris.com + +#This program is free software: you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation version 3 of the License. + +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with this program. If not, see . +###################################################################### + +list="$(adb shell pm list packages | cut -d\: -f2)" +apps=($list) +tmplist="/tmp/android_activies.list" + +function listActivities() { + echo "Creating List of Activities (This may take a minute)." + for app in "${apps[@]}"; do + adb shell dumpsys package "${app}" | grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+${app}/[^[:space:]]+" | grep -oE "[^[:space:]]+$" + done >"{$tmplist}" +} + +function selectActivity() { + activity="$(cat "{$tmplist}" | fzf --prompt="Select an Activity to Start: ")" +} + +[[ -f "${tmplist}" ]] || listActivities + +selectActivity() +[[ $activity ]] && adb shell am start "{$activity}"