Also see: AWS CLI Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function DisableAntiDebugging (){ | |
Object.defineProperty(document, 'hidden', { value: false, configurable: false }); | |
console.clear = function() {}; | |
window.setTimeout = function() { console.log("setTimeout blocked"); }; | |
console.log("Anti-debugging measures disabled!"); | |
location.reload = function() {console.log("Not reloading>>>")} | |
} | |
DisableAntiDebugging() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function manipulateFilter(filter) { | |
if (filter && Array.isArray(filter.values)) { | |
filter.values.forEach(function(value) { | |
// Add a new property to each object in filter.values | |
value.newVar = "Some Value"; | |
}); | |
} | |
return filter; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install pyenv | |
# Any modern version python should do. I don't think Python 2 is required any more. | |
pyenv install 3.10.3 | |
pyenv global 3.10.3 | |
# Add pyenv to your PATH so that you can reference python (not python3) | |
echo "export PATH=\"\${HOME}/.pyenv/shims:\${PATH}\"" >> ~/.zshrc | |
source ~/.zshrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Updates ZeroTier | |
.DESCRIPTION | |
Install latest version of ZeroTier if ZeroTier is already installed. | |
.EXAMPLE | |
./UpdateZeroTier.ps1 | |
./UpdateZeroTier.ps1 -Headless | |
.NOTES | |
A UAC prompt may appear during install if -Headless is not used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Installs ZeroTier | |
.DESCRIPTION | |
Install ZeroTier and join/configure ZeroTier network | |
.EXAMPLE | |
./InstallZeroTier.ps1 -NetworkID [Network ID] | |
./InstallZeroTier.ps1 -NetworkID [Network ID] -Token [API Token] -Headless | |
.NOTES | |
Requires PowerShell 7 or higher (installed if missing) when using the $Token parameter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$applicationId = "<your application ID goes here>"; | |
$securePassword = "<your password goes here>" | ConvertTo-SecureString -AsPlainText -Force | |
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword | |
Connect-AzureRmAccount -ServicePrincipal -Credential $credential -TenantId "tenantId" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# store your App Password in Windows Credential Manager. | |
Add-PnPStoredCredential -Name mycredential -Username [email protected] -Password (ConvertTo-SecureString -String "mycontosopass" -AsPlainText -Force) | |
# use the saved App Password credentials whenever you try to login to pnp | |
Connect-PnPOnline -Url https://contoso.sharepoint.com -Credentials mycredential | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code snippet from this Stackoverflow answer https://stackoverflow.com/a/33574883 | |
Function Test-IfAlreadyRunning { | |
<# | |
.SYNOPSIS | |
Kills CURRENT instance if this script already running. | |
.DESCRIPTION | |
Kills CURRENT instance if this script already running. | |
Call this function VERY early in your script. | |
If it sees itself already running, it exits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON(_spPageContextInfo.webAbsoluteUrl + "/_api/sphomeservice/context?$expand=Token,Payload").then( context => { | |
$.ajax({ | |
url: context.Urls[0] + "/api/v1/sites/feed?start=0&count=3&acronyms=true", | |
headers: { | |
"Authorization": "Bearer " + context.Token.access_token, | |
"sphome-apicontext": context.Payload | |
} | |
}) | |
}) |
NewerOlder