Skip to content

Instantly share code, notes, and snippets.

@RobertHue
RobertHue / video2images.py
Created July 30, 2024 16:11
Extracts the images from a video and filters them for photogrammetry
# Python module index
import argparse
import logging
import os
import shutil
from pathlib import Path
# 3rd party
import cv2
@RobertHue
RobertHue / rename_detected_songs.py
Last active January 6, 2022 19:17
Renames detected sound files to the corresponding songs in it.
'''
Renames detected sound files to the corresponding songs in it.
note: all sound files in current directory and all subdirectories are renamed
note: does not rename when the song could not be detected
note: new sound file name will be consisting of the following
author - title
Pre-requisites:
- Install Python3
@RobertHue
RobertHue / backup.sh
Last active July 29, 2024 10:23
Linux dash script to perform incremental backups using rsync
#!/bin/dash
# A script to perform incremental backups using rsync and a backup device
#
# Usage:
# - Place this script into /usr/local/sbin/
# - Adapt BACKUP_DEVICE variable to your backup device
# - Setup backup.sh as a automated job/task:
# - If you have a desktop that is not turned on all the time
# it is recommended to use anacron instead of cron.
@RobertHue
RobertHue / pihole_task.sh
Last active March 12, 2021 12:45
bash-script that updates the pi, pihole and sends a status via email
#!/bin/bash
# Description: This bash-script updates the pi, pihole and sends a status via email
# Author: RobHue
# Pre-Requisites:
# - install pihole (see https://docs.pi-hole.net/main/basic-install/)
# - "sudo apt install sendEmail libio-socket-ssl-perl libnet-ssleay-perl"
# - create a gmail account for your PI
# So this file can be executed: "sudo -i && chmod u+x pihole_task.sh"
# So no others can read the password: "chmod og-rwx pihole_task.sh"
# Usage: Add this script to the root's cron-jobs via "crontab -e"
@RobertHue
RobertHue / CustomNodeGroup.py
Last active November 3, 2022 12:36
This is a simple blender python script adds a button inside the UI of the ShadingEditor. The functionality of the button will add a simple node group defined by create_test_group.
import bpy
class NODE_PT_MAINPANEL(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Custom Node Group"
bl_idname = "NODE_PT_MAINPANEL"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
@RobertHue
RobertHue / buffer.cpp
Created May 3, 2019 10:47
Create and initialize a buffer
// Type used for names in OpenGL is GLuint
GLuint buffer;
// Create a buffer
glCreateBuffer( sizeof(buffer)/sizeof(GLuint), &buffer);
// Specify the data store parameters for the buffer
glNamedBufferStorage(
buffer, // Name of the buffer
1024 * 1024, // 1 MiB of space
@RobertHue
RobertHue / Shader.hpp
Last active April 3, 2018 07:04
OpenGL - glsl Shader loader class
#ifndef SHADER_H
#define SHADER_H
#include <GL/glew.h>
#include <iostream> // std::cout std::cin
#include <fstream> // std::ifstream
#include <string> // std::string
#include <sstream> // std::stringstream
@RobertHue
RobertHue / glsl_loader.cpp
Last active April 3, 2018 06:22
OpenGL - GLSL source loader
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream> // std::cout std::cin
#include <fstream> // std::ifstream
#include <string> // std::string
#include <sstream> // std::stringstream
/// @brief reads the file give by its path filePath
/// @return a copy of the content of the file
@RobertHue
RobertHue / Custom_Archive.hpp
Last active September 12, 2017 10:12
Custom_Archive.hpp (boost::serialization) deriving from common_archive
/*
* Custom_Archive.hpp
*
* Created on: Sep 8, 2017
* Author: robert
*/
#ifndef Custom_ARCHIVE_HPP_
#define Custom_ARCHIVE_HPP_