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
from codecs import encode, decode | |
import hashlib | |
import hmac | |
import json | |
# https://github.com/FlorianPicca/JWT-Key-Recovery | |
with open('pub.pem', 'rb') as f: | |
key = f.read() | |
header = b'{"typ":"JWT","alg":"HS256"}' |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="$HOME/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
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( | |
[Parameter(Mandatory=$true)] | |
[string]$KeyVaultName, | |
[Parameter(Mandatory=$true)] | |
[string]$SubscriptionName | |
) | |
az account set -s "$SubscriptionName" |
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
import base64 | |
def base64_decode(encoded_str, url_safe=True): | |
hexadecimal_hash = '' | |
padding = 4 - (len(encoded_str) % 4) | |
if padding and padding != 4: # Padding can be 1, 2, or 3 | |
encoded_str += '=' * padding | |
print(encoded_str) | |
if url_safe: |
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
/* | |
SQL to batch delete specific rows wrapped wrapped in transaction. | |
*/ | |
DECLARE @BatchSize INT = 1000; | |
DECLARE @RowsAffected INT = 1; | |
DECLARE @Batches INT = 10; | |
DECLARE @BatchCount INT = 0; | |
WHILE @RowsAffected > 0 AND @BatchCount < @Batches |
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
CREATE OR ALTER PROCEDURE sp_GenerateDateRangeSelectQuery | |
@TimeInterval NVARCHAR(10), -- 'HOUR', 'DAY', 'WEEK', 'MONTH' | |
@StartDate DATETIME, | |
@EndDate DATETIME, | |
@SchemaName NVARCHAR(128), | |
@TableName NVARCHAR(128), | |
@DateColumnName NVARCHAR(128) | |
AS | |
BEGIN | |
DECLARE @SQL NVARCHAR(MAX) |
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
from datetime import datetime | |
from typing import Any, List, Tuple | |
from pyspark.sql import DataFrame, SparkSession | |
from jdbc_configuration import JdbcConfiguration | |
# https://www.youtube.com/watch?v=_p73PZIDQuA | |
NOT_PREPARED: str = "The prepared_statement param is None!" | |
SQL_FORMAT: str = '%Y-%m-%d %H:%M:%S' |
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
#!/bin/bash | |
set -e | |
# Endpoint URL | |
#endpoint="" | |
final_expected_response='{"profile":{"error":"invalid user id"}}' | |
# Default values | |
ids_to_enumerate=1 |
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
. . | |
++xx++;++++xxxxx+x+++;+++++++;++++++;++++;;;;;x+++++++x+++++++++++++++++x++xxxxXxxxxXXx+xxxxxxxxxxxx+xxxxxx++x+xXXXXXXxxXXxxXXxx+x++xxXxXXXXXXxxxxxXXXXXXXXxxxXXXXXXx+$X+XXXXXX$XXXXXXXxXXXxxX$xxX$$$$ | |
++++++;:;+++++xx++++;+++++++++++++++++;;+++;+++;+++++++x+++xxxx+xx++xxxx+++xXxxXxXXXx+++++xxxxxxxx+xxxxxxXxxXxxXXxxxxxxXXxXXxxXXXXXXxxxxXXXXXxxxXXXXXXXx+xxXXXXXXXXxXXxxXXX$$$XXXXXXXX$$$XxXXXX&$$$XX$ | |
xx;:::;;+++;++;+++++xx+x+++++++++++;;;+x++xxxxxx+++xx+xxxx++++;+x+++++++xxxXXXxxx+++++xxxXXxxXXx++xXxXXXXXxxx++xxXXxxxx+xXxXXXxXxxxxXXxxxXxxxxXXXxxXxxX$XxxXXXXXXxxXxxXXXXXXXXXxxXXXXXX+xXXXX$$$XxXXXX | |
;:;;;++++++++xx+xxxxx;;;;;++x+++++;;++++;+++;;;+++++++x++++++++++++++++++++++x++++xxxXXXxxx++xxXXXXXxxx++x+xX$$XX+xxxXXXXXXXXXx+xxXXxxX$xXXxxxXXXXXXXXxxXXXxxXXXXxxxxXXXXXxxXx+$XXXXXXxXXxX$$XXXXXXXXx | |
++++;;;+++;;+++++; |
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
. =. | |
*-=*+**:**:* | |
=:= .%-. *+ | |
@% +:- *+ | |
:**= :%%:= *+ #+ | |
#:-=*#%%*%=*::%+..*+ .@*%: | |
* ..:::--=+#= | |
- % .% | |
:: =+***+=: % %- | |
-: :%.#*::=%::*:#. % * *: |