Skip to content

Instantly share code, notes, and snippets.

View wjz1095's full-sized avatar

Wally wjz1095

  • New Jersey
View GitHub Profile
@wjz1095
wjz1095 / Fix_Windows_V2.ps1
Created August 2, 2022 15:12
Fix Windows - Powershell (Admin)
#Run this script as admin, auto-elevate if not ran as admin
Write-Host "[INFO] Elevating script to admin..."
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Pause
Write-Host "[INFO] Start time:" -ForegroundColor Yellow
$StartTime = Get-Date
Write-Host $StartTime
@wjz1095
wjz1095 / One Line
Created October 19, 2021 17:33
Windows 10 DISM Tools
DISM /Online /Cleanup-Image /CheckHealth; DISM /Online /Cleanup-Image /ScanHealth; DISM /Online /Cleanup-Image /RestoreHealth; SFC /scannow; cleanmgr.exe; dfrgui; chkdsk /f /r c:
@wjz1095
wjz1095 / New_Way_NoRotation.sh
Last active September 28, 2021 16:11
Bash Logging
LOGLOCATION="/var/log/example.log"
DATE=$(date)
MESSAGE="Your message here"
echo $DATE $MESSAGE >> $LOGLOCATION
echo "----------------------------" >> $LOGLOCATION
@wjz1095
wjz1095 / APT_Updater_Docker.sh
Last active September 13, 2023 16:07
Linux Updater Scripts
#This script will automatically restart the docker containers held within
#It is customized to my docker configuration but can easily be modified to work with any other docker setup
echo "" >> /var/log/apt_updates.log
date >> /var/log/apt_updates.log
echo "-----APT UPDATES RAN-----" >> /var/log/apt_updates.log
echo ""
echo "-----UPDATE-----"
apt update
echo ""