Skip to content

Instantly share code, notes, and snippets.

View deaduncledave's full-sized avatar

David Taggart deaduncledave

View GitHub Profile
@CoreyMSchafer
CoreyMSchafer / YouTube-OAuth-Snippets
Created September 10, 2020 02:06
YouTube-OAuth-Snippets
# token.pickle stores the user's credentials from previously successful logins
if os.path.exists('token.pickle'):
print('Loading Credentials From File...')
with open('token.pickle', 'rb') as token:
credentials = pickle.load(token)
# Google's Request
from google.auth.transport.requests import Request
@jmassardo
jmassardo / Invoke-WebRequest_Ignore_SSL.ps1
Created February 26, 2019 15:19
PowerShell hack to ignore ssl certificates when using Invoke-WebRequest
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@Tasumin
Tasumin / restart_execution_plans_truesight.ps1
Created August 23, 2018 13:30
Disable Execution Plans in Truesight
param (
[string]$appid=1,
[string]$tspshost="tsps.bmc.com"
)
function get_login_headers() {
$loginuri = "https://$tspshost/tsws/10.0/api/authenticate/login"
$method = "POST"
$postParams = @{username='user';password='password';tenantName='bmcrealm'}
@bcnzer
bcnzer / postman-pre-request.js
Last active July 22, 2024 10:59
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>',