Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
off on another one!

planetWayne

💭
off on another one!
View GitHub Profile
@planetWayne
planetWayne / convertCase.ps1
Last active Mar 6, 2019
Convert case of string to have capital first letters.
View convertCase.ps1
(get-culture).TextInfo.ToTitleCase("fred bloggs was ere")
<#
Result:
Fred Bloggs Was Ere
#>
@planetWayne
planetWayne / Get-HVHost.ps1
Last active Apr 1, 2019
Get the Parent (host) name of a HyperV Guest
View Get-HVHost.ps1
(get-item "hklm:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters").getvalue("hostname")
# To return other info about the host / guest - leave off the .getvalue section
(get-item "hklm:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters")
@planetWayne
planetWayne / ReadMe.rst
Last active Apr 3, 2019
Windows Shell Folders
View ReadMe.rst

Windows Shell: Folders

I went searching, as I have done many times, to find the name of the common startup folder to add my own shortcuts to run programs at logon. This time, I decided to compile this list below and store it somewhere I'll remember for next time.

This is a copy of the 'meat' (read 'less the adverts') from a TechRadar site that had a reasonably comprehensive list of Windows Shell folder shortcuts. Each of these shell folders can be used in the Windows 'Run' window to open the contents or, if prefered, used as a destination to a custom shortcut.lnk to make it a clickable item. To use just simply copy the corresponding Shell Folder from the section you are after from the tables below.

A lot of these will also work on Windows Server OSs as well as the desktop OSs. At some point I'll update the 'applicable to' list to include newer OSs. I've not had an issue with Windows 10 and Server 2016 with the key ones but YMMV.

Hopefully this will help others, if theres is any o

@planetWayne
planetWayne / WebScrolling.rst
Last active Dec 11, 2019
Enable Web Page Scrolling when Disabled by a Popup Alert.
View WebScrolling.rst

In a browser like Chrome etc.:

  • Inspect the code (for e.g. in Chrome press ctrl + shift + c);
  • Set overflow: visible on body element (for e.g., <body style="overflow: visible">)
  • Find/Remove any JavaScripts that may routinely be checking for removal of the overflow property:
  • To find such JavaScript code, you could for example, go through the code, or click on different JavaScript code in the code debugger console and hit backspace on your keyboard to remove it.
  • If you're having trouble finding it, you can simply try removing a couple of JavaScripts (you can of course simply press ctrl + z to undo whatever code you delete, or hit refresh to start over).

https://stackoverflow.com/questions/39360138/how-to-enable-scrolling-on-website-that-disabled-scrolling

@planetWayne
planetWayne / ReadME.rst
Last active Apr 8, 2022
Quick and Dirty walkthrough for setting up Enterprise WiFi on Unifi on Windows domain
View ReadME.rst

Walk-through to setup Enterprise Wifi with Unifi on Windows Server

Why

Quite simply, you will have the ability to log on to your Company Wifi network using your Windows Domain Username and Password. No more remembering someone else's idea of a secure password. A Single Sign-on for all resources.

You will also be able to automatically authenticate when logging on with a Windows computer as is 'passes on' your username and password to authenticate. Any none windows / none domain joined devices will not be able to automatically sign on but WILL be able to use their network credentials.

@planetWayne
planetWayne / index.js
Created Nov 5, 2021
My Interpretation of Ania Kubów's YT - Build and sell your own API $$$ - https://youtu.be/GK4Pl-GmPHk
View index.js
/*
Please note, credit needs to go to Ania Kubów's YT - Build and sell your own API $$$ -
without such, this wouldnt have existed --> https://youtu.be/GK4Pl-GmPHk
My take addresses thoughts I had when watching the original that at what point does the scrapes get updated.
This version scrapes each time the /news page is called. It also carries on if there is a problem with a source
(example given with a 'bad source' entry, this is to show what happens if a scraped source goes off line or 'bad')
It also makes use of the URL() function to return the URL if a 'base' needs to be supplied. If a site doesnt need a base,
dont specify the emiment in the array. (another point raised in the comments)