Skip to content

Instantly share code, notes, and snippets.

View masip85's full-sized avatar

Vicente Masip masip85

View GitHub Profile
#!/bin/bash
set -e
##### CHECK PARAMETERS #####
PRODUCTION=0
while [[ "$#" -gt 0 ]]; do
case $1 in
-p|--production) PRODUCTION=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
@unitycoder
unitycoder / NeRF.md
Last active January 24, 2024 11:22
How to compile Nvidia NeRF (NVlabs / instant-ngp) on Windows 10 and VS 2019

NeRF

Repo: https://github.com/NVlabs/instant-ngp

Steps (see their readme also)

@utkonos
utkonos / edit_ubuntu_autoinstall.py
Last active January 10, 2024 03:21
Simple Python Script to Edit an Ubuntu ISO to Add Automated Server Install Capability
import io
import pathlib
import pycdlib
ubuntu = pathlib.Path('ubuntu-22.04.1-live-server-amd64.iso')
new_iso_path = pathlib.Path('ubuntu-22.04.1-live-server-amd64-auto.iso')
iso = pycdlib.PyCdlib()
iso.open(ubuntu)
@faisalthaheem
faisalthaheem / gist:3f90811d94813cc555b08ba4d5013adf
Last active April 11, 2022 22:33
GST RTSP pipelines collection
#from rtsp server android app
'rtspsrc location=rtsp://192.168.1.193:5554/camera latency=0 ! rtph264depay ! avdec_h264 ! videorate max-rate=1 ! decodebin ! videoconvert ! video/x-raw, format=BGR ! queue max-size-buffers=10 ! jpegenc quality=25 ! jpegparse ! appsink name=sink'
#big buck bunny
'rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov latency=0 ! rtph264depay ! avdec_h264 ! videorate max-rate=15 ! decodebin ! queue max-size-buffers=10 ! jpegenc quality=25 ! jpegparse ! appsink name=sink'
# example of mjpeg stream from a typical axis camera or esp32
# souphttpsrc location=http://x.y.z.a:8090/mjpg/video.mjpg?timestamp=1564650227443 ! multipartdemux single-stream=true ! image/jpeg,width=320,height=240,framerate=3/1 ! appsink name=sink
#Example of an RTSP source
@martin-niklasson
martin-niklasson / How-To.md
Last active December 25, 2023 19:20
How to make an up-to-date OpenWRT image for loading onto a Raspberry Pi Compute Module 4 with a DFRobot Router Carrier Board.

The background is that the default OpenWRT image for Raspberry Pi lacks drivers for the LAN port (RTL8111) on the DFRobot board. DFRobot provide an image, but that one is made from a quite old daily snapshot of OpenWRT which is not entirely stable. Also, it is better to know how to fish than be given a fish.

DFRobot's page about the router board:
https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767

OpenWRT main page:
https://openwrt.org/

You are expected to have some general knowledge on Linux and OpenWRT. The instructions for flashing the resulting firmware image are presented on DFRobot's page.

@nilesh0109
nilesh0109 / get_inverse_pespective
Last active December 13, 2022 11:54
Homography Matrix
import cv2
import numpy as np
def get_inverse_pespective(perspective_matrix: np.array)-> np.array:
"""
This method calculates the inverse of prespective matrix by homography.
- Takes 4 random points on the floor plane(destination_plane) and calculates the corresponding points
on the camera image plane(src_plane) using perspective matrix.
- Calculates the Homography matrix to map any point in image plane to floor plane.
Parameters
#!/bin/bash
RECDIR=/mnt/record/minisio/$(date +%Y-%m-%d)
RECTIME=$(date +-%H:%M:%S)
if [ ! -d "$RECDIR" ]; then
mkdir -p $RECDIR
fi
cd $RECDIR
for i in {0..6}; do
@gumdropsteve
gumdropsteve / draw_boxes_and_save.py
Last active April 6, 2022 11:09
Convert attribute columns from VGG Image Annotator CSV to lists, then to pandas DataFrame. Draw the bounding boxes on og images and save the new image.
# folder where the image is already saved (without bounding boxes)
data_dir = 'media/stable_numbers/number_crops/'
# folder where the new image with bounding boxes should be saved
out_dir = 'media/copy_labeled_number_crops/'
# go through the unique file names (because files can have more than 1 bounding box)
for file in new_df.filename.unique():
# load in the image and .loc[] the rows where it's referenced (each row represents 1 bounding box)
@Webreaper
Webreaper / docker-compose.yml
Last active April 13, 2024 12:45
Sample Docker-compose file which shows how to set up Sonarr, Radarr, Prowlarr, Lidarr, QBittorrent and a VPN container so that all all traffic from the containers is routed through the VPN. Also includes Plex and get_iplayer containers, which are not routed through the VPN.
# Docker compose to set up containers for all services you need:
# VPN
# Sonarr, Radarr, Lidarr, Qbittorrent
# Non-VPN
# Plex, get_iplayer
# Before running docker-compose, you should pre-create all of the following folders.
# Folders for Docker State:
# /volume1/dockerdata. - root where this docker-compose.yml should live
# /volume1/dockerdata/plex - Plex config and DB
# /volume1/dockerdata/sonarr - Sonarr config and DB