Skip to content

Instantly share code, notes, and snippets.

View josy1024's full-sized avatar

josef lahmer josy1024

View GitHub Profile
@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 / cli_setup_spfx_dev.cmd
Last active February 17, 2021 13:38
windows setup sharepoint spfx
:: https://docs.microsoft.com/de-de/sharepoint/dev/spfx/set-up-your-development-environment
:: https://docs.microsoft.com/de-de/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part
:: requirements: chocolatey installed (windows)
:: SETUP ENVIRONMENT (ADMIN) #spfx
choco install nodejs-lts --version 8.11.4
refreshenv
@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 / envvars.ps1
Created June 1, 2020 19:34
list all env enviroment variables
#list all env enviroment variables
get-childitem env:
$env:USERPROFILE
@josy1024
josy1024 / SYNC-Folders.ps1
Last active June 1, 2020 19:20
Sync - TOOL Library settings - Folders for Carbide Create
<#
.SYNOPSIS
Sync-Folders
.DESCRIPTION
sync settings folders to onedrive settings folders
.EXAMPLE
PS C:\> SYNC-Folders.ps1
.INPUTS
$source = "sourcefolder"
$Destination = "Onedrive-Destination-Folder"
@josy1024
josy1024 / airmonitor_setup.sh
Last active May 1, 2020 14:02
rehau usb airsensor monitoring raspberry pi
# Voltcraft-CO-20
# rehau raumluftsensor USB
# dmesg:
# hid-generic 0003:03EB:2013.0001: hiddev0,hidraw0: USB HID v1.11 Device [AppliedSensor iAQ Stick] on usb-20980000.usb-1.3.7/input0
# source: https://code.google.com/archive/p/usb-sensors-linux/wikis/Install_AirSensor_Linux.wiki
sudo apt-get install libusb-dev
sudo apt-get install build-essential
wget https://raw.githubusercontent.com/jschanz/usb-sensors-linux/master/airsensor/airsensor.c
@josy1024
josy1024 / clean-otrs-config-beforeupdate.sh
Last active February 14, 2020 10:10
otrs cleanup before otrs update
#!/bin/bash
# author: josef lahmer (https://about.me/josy1024)
# source: https://gist.github.com/josy1024/dae6bfe4db7e3a7ac361bd3037efaab0
# helper script for otrs update: http://doc.otrs.com/doc/manual/admin/5.0/en/html/upgrading.html
# otrs 6: https://doc.otrs.com/doc/manual/admin/6.0/en/html/updating.html
# Backup everything below /opt/otrs/
# tested on centos x64, otrs 4-5 update
# copy and paste!
# internal puppet hashtag: #otrsupdate
@josy1024
josy1024 / deployinator.ps1
Last active January 21, 2019 08:13
deployinator for powershell
# inspired deployinator for powershell
# http://blog.johngoulah.com/tag/deployinator/
# author: josy1024@gmail.com
Function Get-Code ([String]$REPODIR, [String]$REPO)
{
# controller deployinator
$host.ui.RawUI.WindowTitle = "git $REPO"
Write-Host git pull -ForegroundColor green
@josy1024
josy1024 / redirect.aspx
Last active May 18, 2018 08:32
redirect to otherurl aspx
<%@ Page Language="C#" %>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
Response.Redirect("/pathnew/otherurl.aspx");
//maybe useful as default.aspx for folder redirections
// variant and redirect with "q" parameter
// Response.Redirect("/pathnew/otherurl.aspx?q=" + Server.HtmlEncode(Request.QueryString["q"]) );
}
@josy1024
josy1024 / mirror.cmd
Last active April 24, 2018 15:22
robocopy mirror script best practice
:: Author: josef lahmer
:: http://josy1024.blogspot.co.at/2011/12/robocopy-mirror-script.html
mirror.cmd script (runas admin)
set log=syncjob_%date:~0,2%.log.log
set source=e:\
set target=h:\
set OPTSALL=/MIR /MT /R:2 /W:10 /XF "thumbs.db" /XF "._*" /XF ".DS_Store" /NP /NFL /NDL /XD "system volume information" "$recycle.bin" "recycler" "DfsrPrivate" ".Trashes" ".TemporaryItems"