Skip to content

Instantly share code, notes, and snippets.

@devna13
devna13 / gist:c9333d02320445ad43d1e9ce13f34e5b
Created September 12, 2023 15:35
Azure DevOps Harvest plugin expand height vis tampermonkey script
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://dev.azure.com/currance-inc/Currance/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=azure.com
// @grant none
// ==/UserScript==
@devna13
devna13 / gist:12e4fc1df87016c6cab2013ac66d1170
Last active September 12, 2023 15:41
Activate https://portal.azure.com/ PIM via TamperMonkey script
// ==UserScript==
// @name Role activate
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://portal.azure.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=azure.com
// @grant none
// ==/UserScript==
@devna13
devna13 / Enable-PIMGraph.ps1
Created September 7, 2023 15:38 — forked from arjancornelissen/Enable-PIMGraph.ps1
Enable PIM role via the Graph PowerShell Modules
# Connect via deviceauthentication and get the TenantID and User ObjectID
Connect-MgGraph -UseDeviceAuthentication
$context = Get-MgContext
$currentUser = (Get-MgUser -UserId $context.Account).Id
# Get all available roles
$myRoles = Get-MgRoleManagementDirectoryRoleEligibilitySchedule -ExpandProperty RoleDefinition -All -Filter "principalId eq '$currentuser'"
# Get SharePoint admin role info
$myRole = $myroles | Where-Object {$_.RoleDefinition.DisplayName -eq "SharePoint Service Administrator"}
@devna13
devna13 / PostmanDecodeJWT.js
Created June 22, 2023 19:52 — forked from jeff-heienickle/PostmanDecodeJWT.js
Decode, reuse, and visualize a JWT in Postman
var jsonData = pm.response.json();
pm.environment.set("jwt", jsonData.access_token);
function parseJwt (token,part) {
var base64Url = token.split('.')[part];
var words = CryptoJS.enc.Base64.parse(base64Url);
var jsonPayload = CryptoJS.enc.Utf8.stringify(words);
return JSON.parse(jsonPayload);
};
@devna13
devna13 / postman-pre-request.js
Created June 21, 2023 14:45 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@devna13
devna13 / git-branches-by-commit-date.sh
Created January 3, 2023 16:23 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@devna13
devna13 / wifi-passwords.ps1
Created November 16, 2022 15:47 — forked from willjobs/wifi-passwords.ps1
PowerShell script to show all wifi passwords saved in Windows
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
@devna13
devna13 / insomnia-azure.json
Created October 3, 2022 22:10 — forked from liyangau/insomnia-azure.json
This is a Insomnia collections for Azure AD authentication flows
{
"_type": "export",
"__export_format": 4,
"__export_date": "2022-03-01T01:35:30.864Z",
"__export_source": "insomnia.desktop.app:v2021.7.2",
"resources": [
{
"_id": "req_8d53c5e0a3b3487b9ae3b9b2e121a491",
"parentId": "wrk_aba5d4b0da6e46298cec551c288da364",
"modified": 1646098507189,
@devna13
devna13 / Program.cs
Created May 27, 2022 20:48 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@devna13
devna13 / handbrake_cli.md
Created September 9, 2019 22:14 — forked from zulhfreelancer/handbrake_cli.md
How to compress video using Handbrake CLI?

Step 1

Download HandBrake CLI for your OS here.

Step 2

cd into the folder where you have the HandBrakeCLI file and run this inside it:

./HandBrakeCLI -i /path/to/input.mov -o /path/to/output.mp4 -e x264 -q 28 -r 15 -B 64 -X 1280 -O