This file contains 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
#!/usr/bin/env python3 | |
# Copyright © 2023 Justin McGettigan | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
# and associated documentation files (the “Software”), to deal in the Software without | |
# restriction, including without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
# Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or |
This file contains 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
# https://docs.microsoft.com/en-us/azure/governance/resource-graph/first-query-powershell#run-your-first-resource-graph-query | |
# Install-Module -Name Az.ResourceGraph # - installs the module; no need to run if you've previously installed this. | |
# Login-AzAccount # brings up a web browser to log you in to Azure (interactive) so PS can run under your credentials | |
# Set-AzContext -SubscriptionId '0000000-1111-etc' # use this to target the subscription your resources live in; amending the subscrcription id as needed | |
(Search-AzGraph -Query @' | |
Resources | |
| where type =~ 'Microsoft.Compute/virtualMachines' | |
| project name, nics = properties.networkProfile.networkInterfaces | |
| mvexpand nics |
This file contains 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
# | |
# Rough and ready script to clean up trailing spaces from tag names | |
# Loops through all resources and resource groups under all subscriptions to which you have access. | |
# If a resource isn't already tagged with the clean (same name with no trailing space) then the clean tag name is given the diry tag's value, and the dirty tag is removed. | |
# If a resource has both clean and dirty tags, this shows a warning (even if the values are the same... I was lazy / didn't add a check for that) and leaves to the caller to fix manually. | |
# If a resource doesn't have any dirty tags, it's not affected. | |
# | |
Clear-Host | |
Login-AzAccount # (interactive / opens web browser) |
This file contains 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
// ==UserScript== | |
// @name Show download counts of GitHub releases | |
// @description Displays the download count of GitHub's release. | |
// @version 0.3 | |
// @source https://gist.github.com/dscho/5d171ec286a52ca4c699477cceaebe20 | |
// @updateURL https://gist.github.com/dscho/5d171ec286a52ca4c699477cceaebe20/raw/github-release-download-counts.user.js | |
// @downloadURL https://gist.github.com/dscho/5d171ec286a52ca4c699477cceaebe20/raw/github-release-download-counts.user.js | |
// @namespace http://tampermonkey.net/ | |
// @author Kusaanko, Johannes Schindelin | |
// @match https://github.com/*/*/releases* |
This file contains 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
PARAM( | |
[string] [Parameter(Mandatory = $True, HelpMessage = "Choose subscription you want be inventored")] $SubscriptionName | |
) | |
#Variables | |
$ReportDate = (Get-Date).ToString("yyyy-MM-dd HH:mm") | |
#Login to Azure | |
Connect-AzAccount |
Idea from ShinyMarusu @ Reddit:
- https://www.reddit.com/r/Piracy/comments/auhyxk/how_do_i_download_from_panbaidu/eovyg8g/
- I just unintentionally discovered how to do it after searching how to create an account for day and a half. LOL hope it works for you too.
- First go to this link (baidu cloud app) to register. Use your phone number to get the verification code and enter. For the rest, use google to translate the page and put your email adress, name, etc. and you're good to go. This method logs you to the cloud directly so you just step over the problematic pan,baidu registration which rejects non-chinese phone numbers for some reason. After registering I refreshed the page of the file I was trying to download and it showed me as already logged in, then I FINALLY could download the mod. It's sad this method isn't listed anywhere, I really searched a lot... Anyways, good luck!
More notes:
- It's a pain in the rear. It took me an hour, but at least it worked.
- Get an Chinese email. You will use it as yo
This file contains 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
<# Convert a VM to a Spot VM | |
Based on sample script at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/change-availability-set | |
NOTE: Extensions will not be copied to new instance!! | |
#> | |
# Set variables to your specifics | |
$resourceGroup = "myRG" | |
$vmName = "myVM" | |
# Get the details of the VM to be moved to the Availability Set |
This file contains 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
@ECHO OFF | |
REM Uses the file name as the profile name | |
SET MSTEAMS_PROFILE=%~n0 | |
ECHO - Using profile "%MSTEAMS_PROFILE%" | |
SET "OLD_USERPROFILE=%USERPROFILE%" | |
SET "USERPROFILE=%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%" | |
REM Ensure there is a downloads folder to avoid error described at |
This file contains 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
param($token, $statusText, $emojiCode) | |
$baseUri = 'https://slack.com/api/users.profile.set' | |
$json = '{"status_text":"'+$statusText+'","status_emoji":"'+$emojiCode+'","status_expiration":0}' | |
$jsonEncoded = [uri]::EscapeDataString($json) | |
$uri = $baseUri + "?token=$token&profile=$jsonEncoded" | |
Invoke-WebRequest -Method Post -Uri $uri | Out-Null | |
param($statusText, $emojiCode) | |
$baseUri = 'https://slack.com/api/users.profile.set' |
NewerOlder