Skip to content

Instantly share code, notes, and snippets.

View mark05e's full-sized avatar

mark05E mark05e

View GitHub Profile
@mark05e
mark05e / http_server.ps1
Last active July 10, 2022 20:39 — forked from nobodyguy/http_server.ps1
Powershell HTTP server in background thread (could be easily killed)
$listenerPort = "8007"
$ServerThreadCode = {
$listenerPort = $args[0]
$listener = New-Object System.Net.HttpListener
$listenerString = "http://+:$listenerPort/"
$listener.Prefixes.Add($listenerString)
$listener.Start()
while ($listener.IsListening) {
@mark05e
mark05e / hnl.mobileConsole.js
Created January 19, 2022 15:45 — forked from c-kick/hnl.mobileConsole.js
hnl.mobileConsole.js - extends JavaScript's console to display a visual console inside the webpage. Very usefull for debugging JS on mobile devices with no real console. Info and demo: http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/
/*!
* hnl.mobileConsole - javascript mobile console - v1.3.8 - 04/01/2021
* Adds html console to webpage. Especially useful for debugging JS on mobile devices.
* Supports 'log', 'trace', 'info', 'warn', 'error', 'group', 'groupEnd', 'table', 'assert', 'clear'
* Inspired by code by Jakub Fiala (https://gist.github.com/jakubfiala/8fe3461ab6508f46003d)
* Licensed under the MIT license
*
* Changelog:
* 1.3.8
* - fixed bug when logging numbers
@mark05e
mark05e / RemoveWebroot.ps1
Last active May 3, 2024 23:09
PowerShell script to forcefully remove Webroot SecureAnywhere. It is recommended to run the script twice, with a reboot after the first run.
# Removes Webroot SecureAnywhere by force
# Run the script once, reboot, then run again
# Webroot SecureAnywhere registry keys
$RegKeys = @(
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\WRUNINST",
"HKLM:\SOFTWARE\WOW6432Node\WRData",
"HKLM:\SOFTWARE\WOW6432Node\WRCore",
"HKLM:\SOFTWARE\WOW6432Node\WRMIDData",
function Get-InstalledSoftware
{
<#
.SYNOPSIS
Reads installed software from registry
.PARAMETER DisplayName
Name or part of name of the software you are looking for
.EXAMPLE
@mark05e
mark05e / grabRegistryUninstallStrings.ps1
Created July 17, 2021 17:42 — forked from brianfgonzalez/grabRegistryUninstallStrings.ps1
Quick snippet to output a grid of all uninstall strings from the registry.
$ColRegUinst = @()
(Get-Item -Path 'HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall').GetSubKeyNames() |
%{
if ( (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName") -ne $null)
{
$ObjRegUinst = New-Object System.Object
$ObjRegUinst | Add-Member -Type NoteProperty -Name Publisher -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("Publisher")
$ObjRegUinst | Add-Member -Type NoteProperty -Name Name -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("DisplayName")
$ObjRegUinst | Add-Member -Type NoteProperty -Name Uninstall -Value (Get-Item -Path "HKLM:\software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$_").GetValue("UninstallString")
$ColRegUinst += $ObjRegUinst
@mark05e
mark05e / Get-InstalledApp.ps1
Created July 7, 2021 02:14 — forked from Bill-Stewart/Get-InstalledApp.ps1
Get-InstalledApp.ps1
# Get-InstalledApp.ps1
# Written by Bill Stewart (bstewart@iname.com)
#
# Outputs installed applications on one or more computers that match one or
# more criteria.
#
# Version history:
#
# Version 1
# * Written for PowerShell 1.0. Lost in the mists of time.
# no longer works Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://api.cacher.io/raw/0fcd76d0761e565a8c4e/e62a66f046a5c4645ad5/start-cleanup'))
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://api.cacher.io/raw/0fcd76d0761e565a8c4e/61fb2ad04da370ab61c9/start-cleanup'))
Function Start-Cleanup {
<#
.SYNOPSIS
Automate cleaning up a C:\ drive with low disk space
.DESCRIPTION
Cleans the C: drive's Window Temperary files, Windows SoftwareDistribution folder,
the local users Temperary folder, IIS logs(if applicable) and empties the recycling bin.
@mark05e
mark05e / DriveClean.ps1
Last active March 13, 2024 19:04 — forked from pmsmith/DriveClean.ps1
Simple script to clear temp files and browser cache/history
#------------------------------------------------------------------#
#- Clear-GlobalWindowsCache #
#------------------------------------------------------------------#
Function Clear-GlobalWindowsCache {
Remove-CacheFiles 'C:\Windows\Temp'
Remove-CacheFiles "C:\`$Recycle.Bin"
Remove-CacheFiles "C:\Windows\Prefetch"
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 255
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 4351
}
#!/bin/bash
apt update
apt install -y vim mlocate wget curl net-tools zip
FILE=/usr/share/javascript/proxmox-backup/js/proxmox-backup-gui.js
cp $FILE $FILE.$(date +%d_%m_%Y_%Hhr_%Mm_%Ss).original
# Change Logo, Favicon, Bios Image
mkdir /usr/share/custom/backup
cp /usr/share/javascript/proxmox-backup/images/{logo-128.png,proxmox_logo.png} /usr/share/custom/backup/
@mark05e
mark05e / Install-MicrosoftTeams.ps1
Created March 24, 2021 17:13
Installs the latest copy of Microsoft Teams.
<#
.Synopsis Downloads and installs the latest version of Microsoft Teams.
.NOTES
TODO: Prevent Teams Firewall Popup
https://thoor.tech/2018/11/microsoft-teams-firewall-prompt/
#>
$LogPath = "$env:WINDIR\Temp\Install-Teams.ps1.log"
Start-Transcript -Path $LogPath
$ec = 1