Skip to content

Instantly share code, notes, and snippets.

@Squazz
Squazz / MoveToFolders.ps1
Last active January 10, 2024 15:42
Script to move all video-files and their meta-files to named folders
# Get the current script directory
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition
# Define a list of valid extensions
$validExtensions = @('.mp4', '.mkv')
# Get all files and folders in the script directory
$items = Get-ChildItem -Path $scriptDirectory
# Filter files with valid extensions and folders
@Squazz
Squazz / winget-install.ps1
Last active December 26, 2023 10:25
My typical .net work install
# Set-ExecutionPolicy RemoteSigned # Needs to be executed before you can run this script
winget install postman
winget install Microsoft.WindowsTerminal
winget install Docker.DockerDesktop -s winget
winget install Microsoft.PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux # Enable WSL - Restart might be needed to get WSL running
winget install Microsoft.VisualStudioCode --override '/SILENT /mergetasks="!runcode,addcontextmenufiles,addcontextmenufolders"'
winget install Microsoft.VisualStudio.2022.Professional
@Squazz
Squazz / pull-all.ps1
Last active July 4, 2024 12:06
Pull All
function Update-GitRepos {
param (
[string]$Path
)
Get-ChildItem -Directory -Path $Path | ForEach-Object {
if (Test-Path "$($_.FullName)\.git") {
Write-Host "Pulling latest from " $_.FullName
Set-Location $_.FullName
@Squazz
Squazz / boostAudio.ps1
Created April 1, 2023 09:42
Boost audio with ffmpeg
#This script needs ffmpeg.exe to be located in the same folder as the powershell script
param ($originFolder)
$testFile = Read-Host -Prompt 'Input your testFile'
.\ffmpeg.exe -vn -af "volumedetect" -f null /dev/null -i "$originFolder\$testFile" # Analyze the audio
# Based on max_volume and the histograms, one can decide how much the want to boost
$dbBoost = Read-Host -Prompt 'Input your dbBoost eg "10dB" - typically based on max_volume'
$Files = Get-ChildItem -path $originFolder -filter *.mp4 -file -ErrorAction silentlycontinue
winget install 7zip.7zip
winget install Balena.Etcher
winget install Battle.net
winget install CrystalDewWorld.CrystalDiskInfo
winget install KDE.digikam
winget install Discord.Discord
winget install Docker.DockerDesktop
winget install JGraph.Draw
winget install Dropbox.Dropbox
@Squazz
Squazz / SAST.yml
Created December 14, 2022 08:31
SAST
trigger:
- none
pool:
vmImage: ubuntu-latest
steps:
- script: |
curl -fsSL https://raw.githubusercontent.com/ZupIT/horusec/main/deployments/scripts/install.sh | bash -s latest
horusec start -p ./ --return-error=true
@Squazz
Squazz / DAST.yml
Created December 14, 2022 08:31
DAST
trigger: none
pool:
vmImage: ubuntu-latest
steps:
# - bash: |
# chmod -R 777 ./
# docker run --rm -v $(pwd):/zap/wrk/:rw -t owasp/zap2docker-stable zap-full-scan.py -t https://website/ -x xml_report.xml
@Squazz
Squazz / Boxstarter.ps1
Last active July 22, 2021 11:33
The Big Boxstarter
#Requires -RunAsAdministrator
# Run the following in powershell (as admin):
Import-module Microsoft.PowerShell.Security
Set-ExecutionPolicy RemoteSigned -Force # Might be needed to be executed before running this script
. { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
@Squazz
Squazz / Windows configuration
Last active December 26, 2023 10:27
Windows configuration
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
#Boxstarter handles
Enable-MicrosoftUpdate
Disable-GameBarTips
Disable-InternetExplorerESC
Disable-BingSearch
/*
* Start by creating a few image sizes for us to use
*/
add_image_size('smallest', 479, 9999);
add_image_size('small', 768, 9999);
add_image_size('largest', 1800, 9999);
/*
* Enqueue our Picturefill Javascript