Skip to content

Instantly share code, notes, and snippets.

View asheroto's full-sized avatar
:electron:
Calculating Universe

asheroto

:electron:
Calculating Universe
View GitHub Profile
@asheroto
asheroto / README.md
Last active December 24, 2024 22:24
Running Ubiquiti UniFi Controller as a Windows Service or on Startup (simply)

Running the UniFi Network Controller as a Windows Service or on Startup

The trick to all methods is to use the java.exe built into the UniFi software, NOT the Adoptium version recommended by Ubiquiti. They are confused. You don't need to install a separate software. You don't need to mess with the JAVA_HOME variable. As long as you specific the commands exactly as shown below, it should work. Tested and confirmed working on a new Windows 11 computer.


Method 1: Using a Traditional Windows Service

  1. Open PowerShell as Administrator.
@asheroto
asheroto / README.md
Last active December 11, 2024 09:52
How to restore an offline OneDrive file. Resolving Issues with Restoring OneDrive Files from Image-Based Backups or Offline Drives.

Resolving Issues with Restoring OneDrive Files from Image-Based Backups or Offline Drives

Restoring files from an image-based backup or offline drives of a OneDrive folder can result in files appearing corrupted or inaccessible. This issue is often due to OneDrive's Files On-Demand feature, which stores placeholder files instead of the actual data locally. Additionally, even when files are fully downloaded, they may retain reparse point attributes that can prevent the files from opening correctly.

Common Scenarios Affected

This problem can occur with image-based backup solutions or when restoring files from offline drives if the backup includes placeholders instead of the actual file data. The following software are examples of those which may be impacted.

  • Acronis True Image or Cyber Protect
  • Macrium Reflect
  • Veeam Backup & Replication
@asheroto
asheroto / README.md
Last active November 12, 2024 08:46
Remove and block Webroot Web Threat Shield extension from Chrome and Edge.

Remove and Block Webroot Web Threat Shield Extension from Chrome and Edge

This PowerShell script is designed to remove and block Webroot's Web Threat Shield browser extension from Chrome and Edge.

Note: This script does not support Firefox. It specifically targets only Chrome and Edge.

When you disable Web Threat Shield within Webroot, the extension may remain installed in users' browsers. Additionally, even if you manually remove the extension, Webroot may attempt to reinstall it.

This script uses simple and safe registry modifications to remove and block the installation of the extension without requiring a browser or system restart. The browser remains open during the process.

@asheroto
asheroto / README.md
Last active November 28, 2024 18:31
Bypass Windows 11 Upgrade Assistant / PC Health Check / TPM and CPU Settings. Ignore PC Health Check results.

Bypass Windows 11 Upgrade Assistant / PC Health Check / TPM and CPU Settings

To bypass the Windows 11 Upgrade Assistant and avoid the TPM and CPU requirement checks, you can modify specific registry values to trick the system into thinking your computer meets the necessary requirements. This method addresses common error messages, such as:

  • This PC doesn't currently meet Windows 11 system requirements.
  • TPM 2.0 must be supported and enabled on this PC.
  • The processor isn't currently supported for Windows 11.

The Upgrade Assistant checks the following registry key to determine eligibility:

@asheroto
asheroto / #Wait-ForKeyOrTimeout.ps1
Last active August 6, 2024 08:36
PowerShell script to wait for a key press or countdown from a specified timeout with in-place countdown display.
Function Wait-ForKeyOrTimeout {
param (
[int]$Timeout = 10
)
for ($i = $Timeout; $i -ge 0; $i--) {
Write-Host -NoNewline "`rPress any key to close... (Closing in $i seconds) "
if ([System.Console]::KeyAvailable) {
[void][System.Console]::ReadKey($true)
@asheroto
asheroto / Get-AdobeAcrobatReaderDCUrls.ps1
Last active December 22, 2024 01:33
Retrieve direct download URLs for Adobe Reader DC by parsing the release notes page.
[CmdletBinding()]
param ()
# Function to get the latest version and download URL of Adobe Acrobat Reader DC
function Get-AdobeAcrobatReaderDCUrls {
[CmdletBinding()]
param ()
# URL of the Adobe Acrobat Reader DC release notes page
$apiUrl = 'https://helpx.adobe.com/acrobat/release-note/release-notes-acrobat-reader.html'
@asheroto
asheroto / Open-GitHubRepo.ps1
Last active October 11, 2024 17:24
Use PowerShell or CMD to open the GitHub repository for the current folder in your default web browser. Use parameters to open issues, pull requests, and more.
function Open-GitHubRepo {
param (
[switch]$Issues,
[switch]$Branches,
[switch]$PullRequests,
[switch]$Actions,
[switch]$Projects,
[switch]$Releases,
[switch]$Debug
)
@asheroto
asheroto / Disable-WooCommerce-Payment-Method-Message.php
Last active April 18, 2024 06:26
Disable WooCommerce payment method using warning/alert message instead of removing. Show the payment method, just disable it with a warning/alert message.
/****************************************************************************************
* START - Disable a payment gateway and show a custom message in WooCommerce
****************************************************************************************/
/**
* Define constants at the top for easy configuration.
*/
define('DISABLE_GATEWAY_ID', 'plisio');
define('DISABLE_MESSAGE', '<div class="woocommerce-error">Cryptocurrency payments are temporarily unavailable while we improve the payment process.</div>');
@asheroto
asheroto / README.md
Last active August 23, 2024 14:05
Strip PowerShell output that contains spinner, progress bar, or more than one empty line.

Strip-Progress

Strip PowerShell output that contains spinner, progress bar, or more than one empty line. Fixes download progress formatting by effectively removing extra space after the slash, often seen in winget (example 269 MB / 305 MB).

When to use

This function can be beneficial when you're capturing the output stream of a command, but don't want the extra characters in the text. See examples. Works great with winget.

Usage