Skip to content

Instantly share code, notes, and snippets.

felickz

Block or report user

Report or block felickz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felickz
felickz / postman-oauth-token-decode.js
Created Aug 8, 2019
Postman Test syntax to decode and validate an Application JWT token from Azure AD with Scopes(roles)
View postman-oauth-token-decode.js
function jwtDecode(t) {
let token = {};
token.raw = t;
token.header = JSON.parse(atob(t.toString().split('.')[0]));
token.payload = JSON.parse(atob(t.toString().split('.')[1]));
return (token);
}
console.log("JWT Decode");
var jwt = jwtDecode(pm.response.json().access_token);
@felickz
felickz / Get-TeslaApiToken.ps1
Last active Aug 8, 2019
PowerShell script to get an AT / RT from the Tesla authorization server
View Get-TeslaApiToken.ps1
$uri = 'https://owner-api.teslamotors.com/oauth/token'
$email = "a@b.com"
$pw = "pw123!"
$json = @{
grant_type = "password"
client_id = "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384"
client_secret = "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3"
email = "$email"
password = "$pw"
@felickz
felickz / SoftwareInventory.ps1
Created Feb 23, 2017
Software inventory for Windows
View SoftwareInventory.ps1
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | where { -not [str
ing]::IsNullOrEmpty($_.DisplayName) }
@felickz
felickz / JsonPointerPropertyExtractionRule.cs
Last active Oct 12, 2016 — forked from LockTar/JsonPropertyExtractionRule.cs
An RFC 6901 JSON Pointer extraction rule for Visual Studio webtest that extracts a value from a JSON response
View JsonPointerPropertyExtractionRule.cs
using Microsoft.VisualStudio.TestTools.WebTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.ComponentModel;
using Tavis;
namespace Extensions.ExtractionRules
{
/// <summary>
@felickz
felickz / RunAsDifferentUser.ps1
Last active Apr 4, 2016
Powershell command to open powershell as a different user
View RunAsDifferentUser.ps1
#http://powershell.com/cs/blogs/tips/archive/2010/10/28/running-programs-as-different-user.aspx
Start-Process powershell -LoadUserProfile -Credential (Get-Credential)
@felickz
felickz / IISLogsByUTCDateRange.LPS
Created Nov 3, 2015
LogParserStudio - IISLogsByUTCDateRange + AM/PM
View IISLogsByUTCDateRange.LPS
/* LogParserStudio - IISLogsByUTCDateRange + AM/PM */
SELECT TOP 1000 to_timestamp(date,time) as stamp-UTC, *
FROM '[LOGFILEPATH]'
WHERE to_timestamp(date,time) between timestamp('2015/10/23 07:46:00 AM', 'yyyy/MM/dd hh:mm:ss tt') and timestamp('2015/10/23 07:59:00 PM', 'yyyy/MM/dd hh:mm:ss tt')
ORDER BY time ASC
@felickz
felickz / Notepad.url
Created Sep 8, 2015
Notepad Bookmarklet
View Notepad.url
data:text/html,<html contenteditable ><head><title>Notepad +++</title></head></html>
@felickz
felickz / Stop-WebAppPoolSafely.ps1
Created Aug 7, 2015
Stops an appPool and waits until it has entered the stopped state. By default the poll period is 1 second. This commandlet may take an AppPool object from the pipeline.
View Stop-WebAppPoolSafely.ps1
Import-Module WebAdministration
function Stop-WebAppPoolSafely
{
<#
.SYNOPSIS
Stops an appPool and waits until it has entered the stopped state
.DESCRIPTION
Stops an appPool and waits until it has entered the stopped state. By default the poll period is 1 second. This commandlet may take an AppPool object from the pipeline.
.EXAMPLE
@felickz
felickz / GlimpseExpandMarklet.url
Last active Sep 8, 2015
Glimpse bookmarklet to expand all collapse-able elements
View GlimpseExpandMarklet.url
javascript:(function(){var expandElts = document.getElementsByClassName('glimpse-expand'); [].forEach.call(expandElts, function (elt) { if(elt.className.indexOf('glimpse-collapse') <= 0){ elt.click(); } }); })();
You can’t perform that action at this time.