Skip to content

Instantly share code, notes, and snippets.

@mkol5222
mkol5222 / push-gh-pages.sh
Created April 26, 2022 05:52 — forked from motemen/push-gh-pages.sh
Shell script to setup/push GitHub pages
#!/bin/sh
# usage: push-gh-pages DIRECTORY # DIRECTORY is where GitHub pages contents are in (eg. build)
# LICENSE: Public Domain
set -e
remote=$(git config remote.origin.url)
described_rev=$(git rev-parse HEAD | git name-rev --stdin)
@mkol5222
mkol5222 / slack-notification.sh
Created May 4, 2022 13:57 — forked from julia-mareike/slack-notification.sh
Send slack message via curl
#!/bin/bash
MESSAGE="Message"
SLACK_CHANNEL="#slack-channel"
SLACK_TOKEN=xoxb-1234-000000000000
curl -X POST \
-H "Authorization: Bearer $SLACK_TOKEN" \
-H "Content-type: application/json; charset=utf-8" \
--data '{"channel":"'$SLACK_CHANNEL'","text":"'"$MESSAGE"'"}' \
@mkol5222
mkol5222 / bash_strict_mode.md
Created June 14, 2022 21:29 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@mkol5222
mkol5222 / Get-AzureADPSPermissionGrants.ps1
Created June 16, 2022 09:53 — forked from psignoret/Get-AzureADPSPermissionGrants.ps1
Get all permissions granted to an app in Azure AD
<#
.SYNOPSIS
Lists delegated permission grants (OAuth2PermissionGrants) and application permissions grants (AppRoleAssignments) granted to an app.
.PARAMETER ObjectId
The ObjectId of the ServicePrincipal object for the app in question.
.PARAMETER AppId
The AppId of the ServicePrincipal object for the app in question.
# Source: https://gist.github.com/vfarcic/42d96b7a284a5435a2d1eca0156644b5
#######################################################################
# Secrets Made My Life Miserable - Consume Secrets Easily With Teller #
# https://youtu.be/Vcjz-YM3uLQ #
#######################################################################
# Additional Info:
# - Teller: https://tlr.dev
# - Manage Kubernetes Secrets With External Secrets Operator (ESO): https://youtu.be/SyRZe5YVCVk
@mkol5222
mkol5222 / git lol.md
Created September 9, 2023 10:29 — forked from Omerr/git lol.md
git lol - an alias to Git that shows the commit graph in a pretty format

log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To configure as an alias git lol:

git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit"

var client_id = pm.environment.get("client_id");
var client_secret = pm.environment.get("client_secret");
var tenant = pm.environment.get("tenant")
pm.sendRequest({
url: 'https://login.microsoftonline.com/' + tenant + '/oauth2/token',
method: 'POST',
header: {
'Content-Type': 'multipart/form-data',
@mkol5222
mkol5222 / sync_credentials.sh
Created November 14, 2023 13:43 — forked from cburgmer/sync_credentials.sh
Sync gopass to Keypass using kpcli
#!/usr/bin/env bash
set -Eeuo pipefail
readonly gopass_prefix=""
generate_empty_store() {
local target_file="$1"
local master_password=""
{