Skip to content

Instantly share code, notes, and snippets.

@d3-X-t3r
d3-X-t3r / LinuxNewSetupScript.sh
Created November 9, 2022 23:31
Linux / Fedora New Setup Notes and Tweaks
# Note: This is incomplete / WIP
# Last updated: 10/11/2022
# Disable ModemManager because a) it's buggy and b) modems in a laptop are crap and I'd rather hotspot from a phone
sudo systemctl disable ModemManager.service
sudo systemctl stop ModemManager.service
# ***TODO: Disable NetworkManager and replace with iwd
@d3-X-t3r
d3-X-t3r / Remove-MeteredConnections.ps1
Created November 2, 2022 04:55
[PowerShell][ConfigMgr] Metered Connection Scripts
function Write-Log($msg) { Write-Host $msg -ForegroundColor Yellow }
Write-Log "Checking for metered network connections..."
[int]$MeteredAdapterCount = 0
$UserCostEnum = @{
0 = "Metering Disabled"
2 = "Metering Enabled"
}
#region Data Usage Service
@d3-X-t3r
d3-X-t3r / Rebuild-WMI.ps1
Created March 28, 2022 22:26
WMI Rebuild Script [PowerShell]
# Not mine, found on the interwebs. Please don't ask me to make it pretty.
function DisableService([System.ServiceProcess.ServiceController]$svc)
{ Set-Service -Name $svc.Name -StartupType Disabled }
function EnableServiceAuto([System.ServiceProcess.ServiceController]$svc)
{ Set-Service -Name $svc.Name -StartupType Automatic }
function StopService([System.ServiceProcess.ServiceController]$svc)
{
@d3-X-t3r
d3-X-t3r / Get-FileSizeOnDisk.ps1
Last active October 10, 2021 00:15
[PowerShell] Get File Size on Disk
# Retrieves the size of a file on disk
#
# Adapted from Kim Doan's original script here:
# https://kimconnect.com/powershell-get-size-on-disk-of-files-in-windows/
#
# Note: This assumes that the filesystem type is NTFS
# and that the cluster size is 4KB
[cmdletbinding()]
param(