Skip to content

Instantly share code, notes, and snippets.

View josy1024's full-sized avatar

josef lahmer josy1024

View GitHub Profile
@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 / rdcmanprofilepasswd.ps1
Created October 25, 2019 06:30
Decrypting Remote Desktop Connection Manager Passwords from settings file with PowerShell
# author: josef lahmer
# thanks to https://smsagent.blog/2017/01/26/decrypting-remote-desktop-connection-manager-passwords-with-powershell/
# Path to RDCMan.exe
$RDCMan = "C:\Program Files (x86)\Microsoft\Remote Desktop Connection Manager\RDCMan.exe"
# Path to RDG file
# $RDGFile = "$env:USERPROFILE\Documents\RDPConnections.rdg"
$RDGFile = "$env:LOCALAPPDATA\Microsoft\Remote Desktop Connection Manager\RDCMan.settings"
@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 / 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 / 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 / shell.startup.quicklinks.cmd
Created November 3, 2017 17:23
die autostart autorun startup ordner
@josy1024
josy1024 / flipflop-mouse-scrolling.ps1
Last active November 11, 2022 07:28
natural maus scrolling (flipflop mouse wheel scrolling)
# author: josef lahmer
# http://josy1024.blogspot.co.at/2013/11/touch-scrolling-for-windows-reverse.html
# natural scrolling
# natürliche scroll-richtung für die maus
#setup:
# @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/josy1024/f2cca5e49ec60ae7ed3c514bb2159051/raw/d66997f73296f7f66fc027e940d84dbcf0f86f73/flipflop-mouse-scrolling.ps1'))"
Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Enum\HID\ -recurse -ErrorAction SilentlyContinue |
Get-ItemProperty |
@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 / httpcheck_curl.sh
Created May 24, 2017 14:26
linux check http status code with curl
#!/bin/bash
httphost=10.0.0.138
#http status code
var=`/usr/bin/curl -I http://$httphost --connect-timeout 5 2>/dev/null | /usr/bin/head -n 1 | /bin/awk -F" " '{print $2}'`
if [ "$var" = "200" ] ; then
echo "allfine ;-)"
else
echo repairscript
@josy1024
josy1024 / linux_disk_on_hyperv.ps1
Last active March 16, 2017 15:14
optimal vhdx grow for linux file partitions
# BlockSizeBytes 1MB!!
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/a4194749-6c3e-4700-ab13-b6c43aaaceb3/vhdx-file-size-after-formatting?forum=linuxintegrationservices
PS>
New-VHD -Path vm701_appdisk.vhdx -SizeBytes 64GB -Dynamic -BlockSizeBytes 1MB
#xfs:
# create filesystem with high number of allocation groups (dynamic vh's don't grow that fast!)
mkfs.xfs -d agcount=4096 /dev/sdb
# > (ALLOCATES 4GB ON VHDX DATA AFTER mkfs)