Skip to content

Instantly share code, notes, and snippets.

View obsti8383's full-sized avatar

obsti8383 obsti8383

View GitHub Profile
@obsti8383
obsti8383 / udp_nat_dos.ps1
Last active April 2, 2023 12:44
Sends many UDP packets to different target IPs. Tries to overhelm the NAT translation tables of NAT routers
# Sends many UDP packets to different target IPs. Tries to overhelm the NAT translation tables of
# NAT routers
#
# Example calls:
# Linux with installed Powershell: pwsh udp_nat_dos.ps1
# Windows .\udp_nat_dos.ps1
#
# Code adapted from https://www.msxfaq.de/code/powershell/psudp.htm
# Original source seems to be: http://pshscripts.blogspot.de/2008/12/send-udpdatagramps1.html
#
<#
.SYNOPSIS
Merges two CSV files with common attribute set
.EXAMPLE
./mergeCompareCsv.ps1 ./users1.csv ./users2.csv -outfile merged.csv -Delimiter ';'
#>
[CmdletBinding()]
Param (
##
## deletes all link files on Desktop and Common Desktop Directories, that link to Program Files.
##
# Get the desktop folder path
$desktopPath = [Environment]::GetFolderPath("Desktop")
$desktopPathPublic = [Environment]::GetFolderPath("CommonDesktopDirectory")
$ErrorActionPreference = "Stop"
@obsti8383
obsti8383 / renamePictures.ps1
Created September 3, 2022 18:43
renamePictures PowerShell Script using exiftool
# Example calls:
# ./renamePictures.ps1
# ./renamePictures.ps1 -defaultDescription Holland2022
# ./renamePictures.ps1 -fixedDescription Hallo123
# ./renamePictures.ps1 -folder hallo\. -defaultDescription Holland2022
param(
[string]$folder=".",
[switch]$simulate,
[switch]$removeExistingDates,
@obsti8383
obsti8383 / bookmarklet_youtube_rss_feed.js
Created January 22, 2022 10:06
Extracts the RSS Feed URL from a Youtube Channel page and show it in an alert() dialog.
javascript:(()=>{alert(ytInitialData.metadata.channelMetadataRenderer.rssUrl);})();
@obsti8383
obsti8383 / download_pdfs.js
Last active January 23, 2023 17:06 — forked from vdsabev/download.js
Bookmarklet - download all PDFs in links on a page
javascript:(() => {
const items = document.querySelectorAll('a');
let delay = 0;
for (let index = 0; index < items.length; index++) {
const item = items[index];
if (item.getAttribute('href') != null && item.getAttribute('href').endsWith('.pdf')){
/* only write last part of link to download element (filename) */
var downloadUri = item.getAttribute('href');
var n = downloadUri.lastIndexOf('/');
var result = downloadUri.substring(n + 1);
@obsti8383
obsti8383 / Get_Auth_Factors.ps1
Last active April 10, 2021 07:10
Okta REST API Script to get a CSV that show the MFA factors that are assigned to all users (requires powershell core 7.0)
#Requires -Version 7.0
$ErrorActionPreference = "Stop"
########## helper functions ######
function iterateActiveUsers($users){
foreach($user in $users){
$userId = $user.id # 00u4rruv8mIU5CvRz4234
if(!$userId){
# something is wrong. exit.
Write-Host "No field 'id' found - exiting."
@obsti8383
obsti8383 / Check_Uniqueness.ps1
Last active April 10, 2021 07:12
Okta Mini Helper Script to iterate all users and find out which have the same attribute content (here employeeNumber) and list them. Can be used to find out if there are double entries for attributes that should be unique (but not configured as such in Okta)
# Okta: Check Uniqeness of employeeNumber
#Requires -Version 7.0
$ErrorActionPreference = "Stop"
########## helper functions ######
function iterateUsers($users){
$employeeNumberMap = @{}
foreach($user in $users){
$userId = $user.id # example: 00u4rruv8mIU5CvRz4234
if(!$userId){
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@obsti8383
obsti8383 / REST_GET_to_CSV.ps1
Last active December 17, 2023 02:17
Generic Powershell Script for getting JSON output from a REST API
# examples:
# .\REST_GET_to_CSV_ps7.ps1 https://api.github.com/repos/powershell/powershell/issues x x
$ErrorActionPreference = "Stop"
$url = $Args[0]
$headerName = $Args[1]
$headerContent = $Args[2]
$maxRelLink = $Args[3]
$dataname = $Args[4]