Skip to content

Instantly share code, notes, and snippets.

{
"contact": "Black Company: discord.gg/4sKvzQJpNZ",
"templates": [
{
"name": "Black Company",
"sources": [
"https://i.imgur.com/WtS2DfE.png"
],
"x": 422,
"y": 490
@Szeraax
Szeraax / docker-compose.yml
Last active June 17, 2023 13:50
Lemmy docker-compose setup
version: '2'
services:
nginx_lemmy:
image: nginx:mainline-alpine
restart: always
ports:
# - <yourReverseProxyTargetPort>:80
- 80:80
depends_on:
@Szeraax
Szeraax / New-Shortcuts.ps1
Last active March 5, 2023 05:36
A script that you can extend to get shortcuts back!
#!ps
$links = [ordered]@{
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" =
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk"
"C:\Program Files\Microsoft\Edge\Application\msedge.exe" =
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk"
"C:\Program Files\Google\Chrome\Application\chrome.exe" =
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk"
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" =
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk"
@Szeraax
Szeraax / Invoke-HandbrakeEncoding.ps1
Created December 12, 2021 20:34
PowerShell function that lets you encode videos via handbrake and move completed files to destinations
function Invoke-HandbrakeEncoding {
<#
.SYNOPSIS
PowerShell function that lets you encode videos via handbrake and move completed files to destinations
.EXAMPLE
dir | Invoke-HandbrakeEncoding -Dest . -WhatIf
# Shows the commands that _would_ run if this were ran without the -WhatIf switch.
@Szeraax
Szeraax / colorize.ps1
Last active November 20, 2021 05:29
Colorize-Strings
function Colorize-Strings {
param(
[Alias("FullName", "Name")]
[parameter(
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
$InputObject,
$Delimeter,
$Colors,
[switch]$DisableSort
@Szeraax
Szeraax / Get-TimeStuff.ps1
Last active March 10, 2022 22:21
A easy way to work with time
function Get-TimeStuff {
<#
.SYNOPSIS
This function makes it easy to get relative dates and timespans.
.DESCRIPTION
Get-TimeStuff is a quick way to get "pretty good" relative dates and timespans. It generally is based on "now", but can work on any input time.
.PARAMETER Moment
If set, this parameter causes the function to output a specific time. If not, the functio outputs a timespan
function micro {
[CmdletBinding()]
param(
# The file you want to edit
[Parameter()]
[String]
$Path,
# The scriptblock to get proper folder on the server
[Parameter()]
function Invoke-SumSize {
# I don't wanna type out the full name every time... Add an alias for me.
[alias("iss")]
param (
[parameter(
ValueFromPipeline
)]
[Alias('Length')]
[ValidateNotNullorEmpty()]
# Removed type enforcement on the input object because there are several possible types they send in on
# The "i'm up late and shouldn't be writing code" method.
# License: Public Domain - use however you desire, no strings attached.
# Strings attached: There are none, but you can attribute me in your source code comment if you want to
function Test-PrivateIP {
param(
$IPAddress
)
$PrivateSubnetAddressList =
(([ipaddress]"10.0.0.0").address -band ([ipaddress]"255.0.0.0").address),
@Szeraax
Szeraax / Update-ExcelHyperlinksAddress.ps1
Created August 10, 2018 20:30
A script to update href links in excel xlsx files when you move files
[cmdletbinding()]
Param(
[switch]$CopyToNew,
$SearchString = "\\OLDSERVER\OLDSHARE\FOLDERNAME",
$ReplaceString = "\\NEWSERVER\NEWSHARE\NEWFOLDER",
$FolderToSearch = "\\server\share\folder\",
$LogResultsLocation = $PSScriptRoot
)
$Excel = New-Object -ComObject "Excel.Application"