Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.0
info:
title: Hashicups
description: Products API allows access to HashiCoffee Coffees and Ingredients
version: 1.0.0
servers:
- url: http://{{baseurl}}
components:
securitySchemes:
noauthAuth:
#!/bin/bash
sudo apt-get remove --purge $(grep -A 3 "$1" /var/log/apt/history.log | tail -1 | sed 's/Install: //' | tr ',' '\n' | sed '/automatic)/d' | awk '{ print $1}' | sed 's/:amd64//')
@mlesaout
mlesaout / jwt-decode.sh
Created July 2, 2021 16:19 — forked from stokito/README.md
OpenWrt specific shell (ash) script to decode JWT token and verify it's signature. Based on https://gist.github.com/stokito/f2d7ea0b300f14638a9063559384ec89
#!/bin/ash
# Usage: cat /id_token.txt | jwt-decode.sh --no-verify-sig" > jwt_payload.json
. /usr/share/libubox/jshn.sh
base64_padding()
{
local len=$(( ${#1} % 4 ))
local padded_b64=''
if [ ${len} = 2 ]; then
padded_b64="${1}=="
@mlesaout
mlesaout / jwt-decode.sh
Created July 2, 2021 16:17 — forked from stokito/jwt-decode.sh
A shell (ash, dash, Bash) script to decode JWT token. Version ported to OpenWrt here https://gist.github.com/stokito/43afca84fc34d1d362bf210cd941a366
#!/bin/sh
# Decode a JWT from stdin and verify it's signature with the JWT issuer public key
# Only RS256 keys are supported for signature check
#
# Put OAuth server public key in PEM format to /var/cache/oauth/$JWT_KID.key.pub.pem
# You must create the folder first
# $ sudo mkdir -p /var/cache/oauth/
# To converted key from JWK to PEM use https://8gwifi.org/jwkconvertfunctions.jsp or https://keytool.online/
# NOTE: For Google you can get the keys in PEM format via https://www.googleapis.com/oauth2/v1/certs
# Decode the keys with decodeURIComponent()
{
"openapi": "3.0.0",
"tags": [
{
"name": "Open Service Broker API Specification"
}
],
"info": {
"title": "Open Service Broker API",
"description": "The Open Service Broker API defines an HTTP(S) interface between Platforms and Service Brokers.",
@mlesaout
mlesaout / squid.conf
Created May 21, 2021 10:10 — forked from salrashid123/squid.conf
Minimal squid.conf to deny destination host
1) create a file squid.conf
```
acl denydomain dstdomain .bbc.com
http_access deny denydomain
acl allowdomain dstdomain .yahoo.com
http_access allow allowdomain
http_access deny all
@mlesaout
mlesaout / promtail_docker_logs.md
Created May 19, 2021 14:03 — forked from ruanbekker/promtail_docker_logs.md
Docker Container Logging using Promtail
---
- hosts: legacyservers
gather_facts: yes
become: yes
tasks:
# Use a block to perform tasks conditionally—only if running Ubuntu 18.04.
- block:
@mlesaout
mlesaout / wait_unattended_upgrades.sh
Created April 4, 2019 08:55 — forked from gretel/wait_unattended_upgrades.sh
`vagrant` on `ubuntu-16.04` can get in conflict with *unattended-upgrade* running and locking the `dpkg` subsystem. this script waits gracefully
#!/usr/bin/env bash
# https://gist.github.com/gretel/34008d667a8a243a9682e5207619ad95
# 2016 tom hensel <github@jitter.eu>
# `vagrant` on `ubuntu-16.04` can get in conflict with *unattended-upgrade* running and locking the `dpkg` subsystem. this script waits gracefully
# in `Vagrantfile`:
# config.vm.provision 'Wait for unattended-upgrades', type: 'shell', path: './provisioning/wait_unattended_upgrades.sh', args: %w( dpkg apt unattended-upgrade )
#
function wait_procnames {
while true; do