Skip to content

Instantly share code, notes, and snippets.

View Mqxx's full-sized avatar
:atom:
Always remember

Mqx Mqxx

:atom:
Always remember
  • Loat.dev
  • Somewhere in Germany
View GitHub Profile
@Mqxx
Mqxx / Arduino IDE
Last active August 22, 2025 08:03
VS-Code Profile to make it look like Arduino IDE
{"name":"Arduino IDE","icon":"settings-view-bar-icon","settings":"{\"settings\":\"{\\r\\n \\\"terminal.integrated.fontFamily\\\": \\\"Cascadia Code\\\",\\r\\n \\\"terminal.integrated.gpuAcceleration\\\": \\\"off\\\",\\r\\n \\\"editor.fontFamily\\\": \\\"Consolas, 'Courier New', sans-serif\\\",\\r\\n \\\"editor.formatOnPaste\\\": false,\\r\\n \\\"editor.autoClosingBrackets\\\": \\\"languageDefined\\\",\\r\\n \\\"workbench.startupEditor\\\": \\\"none\\\",\\r\\n \\\"C_Cpp.autocompleteAddParentheses\\\": true,\\r\\n \\\"terminal.integrated.cursorStyle\\\": \\\"line\\\",\\r\\n \\\"editor.bracketPairColorization.enabled\\\": false,\\r\\n \\\"editor.mouseWheelZoom\\\": true,\\r\\n \\\"[python]\\\": {\\r\\n \\\"editor.indentSize\\\": 4\\r\\n },\\r\\n \\\"vscode-serial-monitor.customBaudRates\\\": [\\r\\n 921600,\\r\\n 9600\\r\\n ],\\r\\n \\\"typescript.suggest.paths\\\": false,\\r\\n \\\"javascript.suggest.paths\\\": false,\\r\\n \\\"terminal.int
sudo apt update
# Add repository
sudo add-apt-repository ppa:ubuntu-tegra/updates -y
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
@Mqxx
Mqxx / remove_cloud_init.sh
Last active August 19, 2025 17:15
This script removes cloud-init.
#!/bin/bash
set -e
echo "Disabling cloud init services..."
echo "cloud-init cloud-init/datasources multiselect None -NoCloud -ConfigDrive -OpenNebula -DigitalOcean -Azure -AltCloud -OVF -MAAS -GCE -OpenStack -CloudSigma -SmartOS -Bigstep -Scaleway -AliYun -Ec2 -CloudStack -Hetzner -IBMCloud -Oracle -Exoscale -RbxCloud -UpCloud -VMware -Vultr -LXD -NWCS -Akamai" | sudo debconf-set-selections
echo "Purging cloud init package..."
sudo apt-get purge -y cloud-init
#!/bin/bash
set -e
# === Konfiguration ===
BSP_TARBALL=$(ls Jetson_Linux_R*.tbz2 | head -n1)
ROOTFS_TARBALL=$(ls Tegra_Linux_Sample-Root-Filesystem_R*.tbz2 | head -n1)
WORKDIR=$(pwd)/Linux_for_Tegra
echo "[1/6] Starte Vorbereitung..."
echo "Gefundenes BSP: $BSP_TARBALL"
@Mqxx
Mqxx / 188_segment_percentage_display.ino
Last active July 30, 2025 19:14
ATtiny85 (Arduino) code to power a 188 (2,5 digit) segment display based on a analog input.
/*
ATtiny 85
RESET -- [1 8] -- 5V
A3 3 -- [2 7] -- 2 A1
A2 4 -- [3 6] -- 1 (PWM)
GND -- [4 5] -- 0 (PWM)
@Mqxx
Mqxx / write_header.ps1
Created July 15, 2025 07:09
Header Menu in powershell using "Tab" and "Shift+Tab"
function Write-Header {
param (
[Parameter(Mandatory = $true)] [array] $Items,
[Parameter(Mandatory = $true)] [int] $Selected,
[Parameter(Mandatory = $false)] [int] $StartX = 0,
[Parameter(Mandatory = $false)] [int] $StartY = 0,
[Parameter(Mandatory = $false)] [int] $Width = $Host.UI.RawUI.WindowSize.Width
)
[Console]::SetCursorPosition($StartX, $StartY)
@Mqxx
Mqxx / select_menu.ps1
Last active July 7, 2025 13:19
Selection Menu in powershell using arrow keys
function Select-Menu {
param (
[Parameter(Mandatory = $true)]
[string]$Title,
[Parameter(Mandatory = $true)]
[System.Collections.Hashtable]$Options,
[Parameter(Mandatory = $false)]
[bool]$Back = $false,
[Parameter(Mandatory = $false)]
[string]$DefaultSelection = ""
@Mqxx
Mqxx / select_menu.bat
Last active July 7, 2025 11:23
Selection Menu in batch using arrow keys
@echo off
setlocal EnableDelayedExpansion
goto :start
:: Poll key press and run callback function
::
:: < %1 = Label of function to call on key press UpArrow
:: < %2 = Label of function to call on key press DownArrow
:get_key
@Mqxx
Mqxx / key_press_poll.bat
Last active July 4, 2025 08:54
This batch function provides a way of polling Up and Down Arrow keys and calling the provided label function. This can be used for custom menus.
@echo off
setlocal EnableDelayedExpansion
goto :start
:: Poll key press and run callback function
::
:: < %1 = Label of function to call on key press UpArrow
:: < %2 = Label of function to call on key press DownArrow
:get_key
set get_key_up_action=%1
blueprint:
name: 'Rotary Smart Knob Light Control'
description: |
Controls Brightness and Color Temperature of a Lamp using a Rotary Smart Knob.
domain: automation
input:
rotary_smart_knob:
name: 'Rotary Smart Knob'
description: 'The Rotary Smart Knob for control.'