Skip to content

Instantly share code, notes, and snippets.

View SandiyosDev's full-sized avatar

(Moai Emoji) SandiyosDev

View GitHub Profile
@SandiyosDev
SandiyosDev / group-caching-demo.php
Created July 5, 2024 05:55 — forked from villesiltala/group-caching-demo.php
WP Redis Group Cache usage example - see the comment section for description
---- page.php ---
<?php
/**
* This is a demo for using the WP Redis Group Cache.
*/
/**
* A demo DustPress model class.
*/
class Page extends \DustPress\Model {
@SandiyosDev
SandiyosDev / winget-installation-script.ps1
Last active June 4, 2024 15:30
This PowerShell script lets you install Winget on Windows editions (Mainly LTSC) without Microsoft Store prepackaged. To run this script, execute the following one-liner in PowerShell: "irm https://gist.githubusercontent.com/SandiyosDev/16ce2a887ac2935dc006f5979d98d206/raw/winget-installation-script.ps1/ | iex"
# This script automates the installation of Winget on Windows (Tested on Windows 10 IoT Enterprise LTSC 2021) and was last updated on 8/24/2023.
# It was designed according to the article: https://learn.microsoft.com/zh-tw/windows/iot/iot-enterprise/deployment/install-winget-windows-iot
# To run this script, execute the following one-liner in PowerShell:
# irm https://gist.githubusercontent.com/SandiyosDev/16ce2a887ac2935dc006f5979d98d206/raw/winget-installation-script.ps1/ | iex
# Greeting Message
Write-Host "Running script from https://gist.githubusercontent.com/SandiyosDev/16ce2a887ac2935dc006f5979d98d206/raw/winget-installation-script.ps1/ by SandiyosDev"
# Check if running as Administrator
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
@SandiyosDev
SandiyosDev / Explorer Freezing Fix.txt
Created July 15, 2023 10:00
Windows Explorer Freezing due to Unreachable Network File Associations
In certain Windows environments, Windows Explorer slows down significantly. This includes all operations, from opening a program to merely highlighting a file. Long delay times are experienced consistently across the system.
# Cause of the Problem
This issue can be traced back to the file associations on Windows. Here is a brief explanation: When you attempt to open a file type that has no associated default program, Windows prompts you to pick a program. If you select a program that is located on a network disk, and that disk becomes inaccessible or unreachable, Windows Explorer freezes. This behavior occurs not just when you are trying to open a file, but also when you are simply highlighting a file or even when you are at the root directory of a disk.
# Diagnosis and Troubleshooting
The issue can be diagnosed using a utility called FileTypesMan from NirSoft. This tool can help identify file association records that point to unreachable network disks.
# Further Work
I'll be working on creating a script
@SandiyosDev
SandiyosDev / Ping_Notification_with_FFmpeg_on_Windows.ps1
Last active April 29, 2023 04:20
Ping Notification_with FFmpeg on Windows
# Ping_Notification_with_FFmpeg_on_Windows.ps1
# Play a sound when a specific IP address responds to a ping
# Requires FFmpeg's ffplay (https://www.gyan.dev/ffmpeg/builds/)
#
# Instructions:
# 1. Download FFmpeg's ffplay binary from the link above and extract it to a folder (e.g., C:/Program Files (x86)/Ffmpeg6.0/)
# 2. Replace the $ipAddress variable's value with the IP address you want to ping
# 3. (Optional) Change the $soundFile variable's value to the path of your desired sound file
# 4. Save the script with a .ps1 file extension or copy the entire block to run directly in PowerShell
# 5. Run the script with administrative privileges in PowerShell