Skip to content

Instantly share code, notes, and snippets.

View brean's full-sized avatar
🤖

Andreas Bresser brean

🤖
  • Bremen, Germany
  • 08:25 (UTC +02:00)
View GitHub Profile
@brean
brean / _party.py
Last active July 21, 2023 22:33
Home-Assistant Party Light configuration
#!/usr/bin/env python3
import asyncio
import json
import random
from websockets import connect
import yaml
entities = [
"light.office_light",
@brean
brean / MyGameInstance.cpp
Last active June 16, 2023 13:17
Unreal Engine 5.2 ROS Integration PointCoud Visualisation using LidarPointCloud.
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyGameInstance.h"
void UMyGameInstance::Init()
{
this->bSimulateTime = false;
Super::Init();
if (!this->hasPointCloud) {
PointCloudActor = GetWorld()->SpawnActor<ALidarPointCloudActor>();
@brean
brean / MyGameInstance.cpp
Created June 15, 2023 13:14
Create a Point Cloud using Unreal Engine 5
#include "MyGameInstance.h"
#include "LidarPointCloud.h"
#include "LidarPointCloudShared.h"
#include "LidarPointCloudActor.h"
#include "LidarPointCloudComponent.h"
#include "Math/Color.h"
void UMyGameInstance::Init()
{
@brean
brean / semi_circle.py
Last active December 31, 2022 12:24
Create a semi-circle in Blender using Python
import bpy
import math
# Set the number of vertices, radius, and depth of the semi-circle
num_vertices = 16
radius = 1.0
depth = 0.5
# thickness between inner and outer part of the shell
@brean
brean / yaml_to_jsonschema.py
Created April 19, 2022 11:19
Easy YAML to JSON-Schema using genson
# generate JSONSchema to validate YAML files as CLI
import os
from pathlib import Path
import yaml
import json
import argparse
from genson import SchemaBuilder
@brean
brean / fix_alt_tab.bash
Last active December 8, 2021 12:47
gnome 41.1 cycle through windows on alt+tab (not applications)
#!/bin/bash
# see comment by Florian Müllner on https://fedoramagazine.org/alt-tab-gnome-shell-extension/
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
@brean
brean / gen_map.py
Created July 8, 2021 08:00
Create a diamond-shape, can be used as input matrix for python-pathfinding.
def xmas_tree(inverted=False, radius=6):
tree_map = []
in_order = range(radius+1)
if inverted:
in_order = range(radius+1, 0, -1)
for y in in_order:
y_list = []
tree_map.append(y_list)
for x in range(radius*2+1):
sign = 1
@brean
brean / docker-purge-all.bash
Created June 22, 2021 08:03
purge all docker stuff: delete all images, container, networks, volumes...
#!/bin/bash
docker system prune -fa
docker images purge
docker rmi $(docker images -a -q)
docker volume prune -f
@brean
brean / all.m3u
Last active May 16, 2021 07:52
merged m3u file from local fritz.box for radio and cable tv streaming
#EXTM3U
#EXTINF:0,ZDF HD
#EXTVLCOPT:network-caching=1000
rtsp://192.168.178.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,6100,6110,6120,6121,6123,6130,6131,6170
#EXTINF:0,rbb Berlin HD
#EXTVLCOPT:network-caching=1000
rtsp://192.168.178.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,5310,5311,677,2171,2176,5312,5313,5314,5315
#EXTINF:0,ZDFinfo HD
#EXTVLCOPT:network-caching=1000
rtsp://192.168.178.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,6700,6710,6720,6721,6723,6730,6731,6770
@brean
brean / Dockerfile
Last active April 20, 2021 10:53
Bagel docker installation
FROM ubuntu:20.04
RUN apt-get update -y \
&& apt-get install -y git python3-yaml git wget python-is-python3 \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://raw.githubusercontent.com/dfki-ric/bagel_wiki/master/bootstrap_magic.sh \
&& bash bootstrap_magic.sh