Posts

OpenWRT: Bouncing Back from a Failed SSL Library Crossgrade

Image
In the event of a failed crossgrade between SSL libraries (e.g. OpenSSL to Mbed TLS ) on an OpenWRT installation, it's likely that poor opkg will be left in a Catch 22 situation: How can it install an SSL library when it needs an SSL library to install one? Well… Instructions: This will temporarily weaken your OpenWRT device's security. Connect to the OpenWRT device in question over SSH from another device which is on the same local area network. Open the file /etc/opkg.conf in a text editor and change option check_signature 1 to option check_signature 0 . Open the file /etc/opkg/distfeeds.conf in a text editor and change the scheme of each URL from https to http If it was the installation or upgrade of a specific package that caused the failed crossgrade e.g. luci-ssl , resume that process by running the relevant command e.g. opkg install luci-ssl or opkg upgrade luci-ssl . Otherwise, ensure that the packages ca-bundle , ca-certificates , and either libustream-mbedtls*...

PowerShell Script/Cmdlet: Get-UserAccountControlPolicy

Image
A PowerShell function that returns detailed information regarding how User Account Control is configured on the current system in a human-readable format. Installation Instructions: Determine where your local scripts directory is with the following command: ([IO.DirectoryInfo](Join-Path $Profile.CurrentUserCurrentHost ".." "Scripts")).FullName Create a new file within that directory and name it Get-UserAccountControlPolicy.ps1 . Copy and paste the contents below into that file and save it. function Get-UserAccountControlPolicy { [CmdletBinding( ConfirmImpact = 'Low', DefaultParameterSetName = 'HideStatusParameterSet', PositionalBinding = $false, SupportsPaging = $false, SupportsShouldProcess = $false )] [OutputType([Object[]])] [Alias('Get-UACPolicy')] param ( [Parameter(ParameterSetName = 'HideStatusParameterSet')] [Alias('AccountScope',...

PowerShell Script/Cmdlet: Get-NthRoot

Image
A PowerShell function that computes the principal nth root n^A of positive real number A. Installation Instructions: Determine where your local scripts directory is with the following command: ([IO.DirectoryInfo](Join-Path $Profile.CurrentUserCurrentHost ".." "Scripts")).FullName Create a new file within that directory and name it Get-NthRoot.ps1 . Copy and paste the contents below into that file and save it. function Get-NthRoot { $Phi 1.6180339887498948482045868384 Creates the variable $Phi within the Global scope for convenient access to the golden ratio whenever and wherever desired. .EXAMPLE $semitone = Get-NthRoot -Radicand 2 -Degree 12 -Precision 5 PS > $noteFreq = @{ 'C' = 16.35160; 'C#' = 17.32391; 'D' = 18.35405 >> 'D#' = 19.44544; 'E' = 20.60172; 'F' = 21.82676 >> 'F#' = 23.12465; 'G' = 24....

Microsoft 2019 Ergonomic Keyboard: Reassigning the “Office 365” Key

Image
Microsoft's successor to the Natural Ergonomic Desktop 4000 , the Microsoft Ergonomic Keyboard (model/part designation LXM-00013 ) has a variety of special keys, many of which are difficult to reassign (and even merely assign under non-Windows operating systems). One in particular is the “Office 365” key that is positioned where either a Win or Menu key would typically be found. Assigning a Different Action to the Key One option is to override the default command triggered by pressing the key. The alternative command of your choosing can be something as simple as a built-in Windows utility or tool application such as the Character Map ( charmap ) or On-Screen Keyboard ( osk ), or something more complex like a PowerShell or AutoHotKey script. Substituting foo with the executable or command you've decided that you fancy the most, run the following command in a PowerShell prompt with administrative privileges: New-ItemProperty -Path 'HKCU:\SOFTWARE\Classes\ms-...

Resolving NTUSER.DAT Preventing Removal of a Deleted User's Home Directory

Image
Here's the scenario you're likely in: After having backed up any relevant content inside their home directory, you delete a user's local account in Windows via the control panel. You then navigate to C:\Users and attempt to delete their home directory only to find that their NTUSER.DAT file is still in use by the system, and rebooting - even in safe mode - has no effect. The job is left half-finished, and leaving jobs half-finished is simply unbecoming of a fine professional assassin such as yourself. Unacceptable! Removing the Profile Entry This guide assumes that you have, at the very least, already backed up the contents of HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList within the registry to a file. Press Win + R , copy and paste ms-settings:recovery , and press Enter to open the Recovery page within the Windows control panel. Under Advanced startup , select Restart now . Navigate to Troubleshoot → Advanced options → Startup Se...

Installing the "GuideGuide" Extension on Photoshop CS6

Create a registry key that will allow the Adobe Extension Manager to accept improperly signed extentions: Open a Run dialog with Win + R . Copy and paste the following: pwsh.exe -NoExit -NoProfile -NoLogo -Command "New-ItemProperty -Path 'HKCU:\SOFTWARE\Adobe\CSXS.3\' -Name 'PlayerDebugMode' -PropertyType String -Value '1' -Force" Press Ctrl + Shift + Enter Download the GuideGuide extension. Navigate to %CommonProgramFiles(x86)%\Adobe\CS6ServiceManager\extensions . Create a new directory entitled GuideGuide . Open 3.2.3-guideguide.zxp with your preferred file archive utility, such as 7zip (yes, .zxp files really are nothing more than glorified .zip archives). Extract its contents as-is into the aforementioned directory. Magic Spearmint

Managing PSStyle's File Extension Dictionary

Image
Documentation on PowerShell's experimental PSANSIRenderingFileInfo feature is understandably limited at the moment. This experiment was added in PowerShell 7.2. This feature adds the $PSStyle.FileInfo member and enables coloring of specific file types. $PSStyle.FileInfo.Directory - Built-in member to specify color for directories $PSStyle.FileInfo.SymbolicLink - Built-in member to specify color for symbolic links $PSStyle.FileInfo.Executable - Built-in member to specify color for executables. $PSStyle.FileInfo.Extension - Use this member to define colors for different file extensions. The Extension member pre-includes extensions for archive and PowerShell files. Using Experimental Features in PowerShell | Microsoft Docs Methods After some trial-and-error in a console, I found several methods offered by [System.Management.Automation.PSStyle+FileExtensionDictionary] that stand out: Add() Creates an extension with an associated decoration and appends it to the dic...