Skip to content

Instantly share code, notes, and snippets.

View josy1024's full-sized avatar

josef lahmer josy1024

View GitHub Profile
@josy1024
josy1024 / downsize fat32 32gb sd card.ps1
Last active December 20, 2023 19:39
downsize big sd card to 32gb sd card
# DISKPART>
list disk
list volume
select volume X
delete volume
list volume
@josy1024
josy1024 / webmtogif.ps1
Last active November 12, 2023 20:09
webmotion video files to animated gif file
$webmDirectory = Get-Location
# Get all *.webm files in the current directory
$webmFiles = Get-ChildItem -Path $webmDirectory -Filter *.webm
# Loop through each *.webm file and convert it to *.gif
foreach ($webmFile in $webmFiles) {
# Build the ffmpeg command
$ffmpegCommand = "ffmpeg.exe -i `"$($webmFile.FullName)`" -vf `"fps=15,scale=498:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse`" -loop 1 `"$($webmFile.FullName).gif`""
@josy1024
josy1024 / Get-ConfigurationfromJSON.ps1
Created November 8, 2023 23:25
simple get-configuration from json array (file)
function Get-ConfigurationfromJSON {
<#
.SYNOPSIS
json array config file
.DESCRIPTION
use a json config file
.EXAMPLE
# $config = Get-Configuration -match "2" -config .\mandant.json
# $config.ConfigValue
#>
@josy1024
josy1024 / rename-leading-zeros.ps1
Created July 7, 2023 04:08
rename files to leading zeros recurse current path
# rename files recurse to leading 2 digit zeros:
# from "1 - name.mp3"
# to 01 - name.mp3
$path = Get-Location
$files = Get-ChildItem -Path $path -Filter "*.mp3" -recurse | Sort-Object
foreach ($file in $files) {
@josy1024
josy1024 / rika paro ofen firmware.md
Last active February 23, 2024 10:55
rika paro firmwae update auf 2.29

Firmwaredateien:

  RIKA_a_017_229_Application_PARO_V2.29.585.12.bin
  RIKA_d_017_229_001_TOUCH_PARO.BIN
  RIKA_g_ImageVersion202.bin
  RIKA_r_017_229_ComponentTest_PARO_V2.29.243.02.bin
 RIKA_t_TouchApplication_V2.29.534.04.bin
# CREDIT:
# CODE SAMPLE FROM: https://github.com/EsOsO/RRDTool
# GERMAN Get-Counter Values
# Database
$DataSource1 = New-RRDDataSource -Name cpu_kernel -DataSourceType GAUGE -Heartbeat 120 -Min 0 -Max 100
$DataSource2 = New-RRDDataSource -Name cpu_user -DataSourceType GAUGE -Heartbeat 120 -Min 0 -Max 100
$DataSource3 = New-RRDDataSource -Name cpu_queue -DataSourceType GAUGE -Heartbeat 120 -Min 0
@josy1024
josy1024 / otrs-menu-search-config.pm
Last active August 17, 2020 10:29
OTRS Menu: Waitto, Bing, Azure Devops Tickets Features
$Self->{'Frontend::Navigation'}->{'AgentTicketSearch'}->{'003-Warten'} = [
{
'AccessKey' => '',
'Block' => '',
'Description' => 'Tickets mit Wecker status',
'Group' => [],
'GroupRo' => [],
'Link' => 'Action=AgentTicketSearch',
'LinkOption' => 'onclick="top.location.href=\'https://otrs.example.com/otrs/index.pl?Action=AgentTicketSearch&Subaction=Search&EmptySearch=1&ResultForm=Normal&StateIDs=10\'"; returen false;',
@josy1024
josy1024 / azureadenv.pl
Created August 11, 2020 13:15
print all ENV variables listet ind perl (OIDC_CLAIM_upn)
#!/usr/bin/perl
#
# place in /opt/otrs/bin/cgi-bin/azureadenv.pl
# call https://otrs.example.com/otrs/azureadenv.pl
# tested in #otrs6 #centos7
# reference: https://gist.github.com/josy1024/84853e1a72f5631f697ee324b93264fe
###
### printenv -- demo CGI program which just prints its environment
###
@josy1024
josy1024 / AzureADAuth.pm
Last active April 5, 2022 14:44
use Apache Auth (mod_auth_openidc) for Otrs Agent Login
# --
# Copyright (C) 2001-2020 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
# $Self->{'AuthModule'} = 'Kernel::System::Auth::AzureADAuth';
# SOURCE: copy from HTTPBasicAuth.pm from OTRS6
# Place FILE IN: /opt/otrs/Kernel/System/Auth
@josy1024
josy1024 / envvars.ps1
Created June 1, 2020 19:34
list all env enviroment variables
#list all env enviroment variables
get-childitem env:
$env:USERPROFILE