Skip to content

Instantly share code, notes, and snippets.

@Bouni
Bouni / nc-transfer.sh
Last active March 19, 2024 13:12
Transfer Nextcloud data to new server
#!/bin/sh
NEW_HOST=new_server
TARGET_FOLDER=/opt/docker/cloud/transfer/
MYSQL_USER=nextcloud
MYSQL_PW=my_secure_db_pw
DATE=`date +"%Y%m%d"`
@Bouni
Bouni / svg2pdf.ps1
Last active November 6, 2023 09:17
Batch convert SVG files to PDF on Windows 11
$files = Get-ChildItem -Name ./*.svg
for ($i=0; $i -lt $files.Count; $i++) {
$newname = ([String]$files[$i]).Replace("svg","pdf")
& "C:\Program Files\Inkscape\bin\inkscape.exe" --actions="export-type:pdf;export-do" --export-filename=$newname $files[$i]
}
@Bouni
Bouni / rainbow.py
Created November 1, 2023 10:35
Generate a list of rainbow colors with n entries
def rainbow_color_stops(n=10, end=2 / 3):
rgb = [hls_to_rgb(end * i / (n - 1), 0.5, 1) for i in range(n)]
hex = [f"#{int(255.0*r):02x}{int(255.0*g):02x}{int(255.0*b):02x}" for r, g, b in rgb]
return hex
@Bouni
Bouni / nc_last_seen.py
Created October 26, 2023 15:13
Hacky python script to get a list uf all Nextcloud users ordered by their last login (for use with docker-compose)
from subprocess import Popen, PIPE
from datetime import datetime as dt
import json
occ = ["docker-compose", "exec", "-u", "www-data", "app", "/var/www/html/occ"]
list_users_cmd = occ + ["user:list", "--output=json"]
with Popen(list_users_cmd, stdout=PIPE) as proc:
users = json.loads(proc.stdout.read().decode("UTF-8"))
@Bouni
Bouni / doco.sh
Created July 25, 2023 13:31
A shell script to handle mutiple docker-compose files easily
#!/bin/sh
case $1 in
"update" )
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') pull --ignore-pull-failures && \
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') up -d;;
"status" )
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') ps -a;;
"lf" )
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') logs -f ${@:2};;
@Bouni
Bouni / blocky-dashboard.json
Created June 29, 2023 15:17
Blocky Grafana Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@Bouni
Bouni / PKGBUILD
Created June 20, 2023 07:34
Arch Linux package for Kicad nightly bin
# Maintainer: Andy Makovec <andymakovec[at]gmail[dot]com>
# Contributor: Rachel Mant <dx-mon[at]users[dot]sourceforge[dot]net>
# Contributor: Bouni <bouni-aur[at]owee[dot]de>
pkgname=kicad-nightly-bin
_pkgname=kicad-nightly
provides=('kicad-nightly')
conflicts=('kicad-nightly')
pkgdesc='Electronic schematic and printed circuit board (PCB) design tools'
arch=('x86_64')
@Bouni
Bouni / print256colours.sh
Created June 9, 2023 08:58 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@Bouni
Bouni / .p10k.zsh
Created May 30, 2023 09:05
Custom Powerlevel10K color scheme
# Generated by Powerlevel10k configuration wizard on 2023-05-30 at 10:41 CEST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 09432.
# Wizard options: nerdfont-complete + powerline, large icons, classic, unicode, dark,
# 24h time, angled separators, sharp heads, flat tails, 1 line, compact, many icons,
# fluent, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#

List of all supported devices

Currently 355 devies are supported.

Manufacturer Device Implemented Tested
Beckhoff AX5101-0000-0003
Beckhoff AX5101-0000-0004
Beckhoff AX5101-0000-0005
Beckhoff AX5101-0000-0006