Skip to content

Instantly share code, notes, and snippets.

View atomicsamurai's full-sized avatar
🔌
Wonder what this button does?

Sandeep Chaturvedi atomicsamurai

🔌
Wonder what this button does?
  • Great White North
View GitHub Profile
{
"request_parameter_supported": true,
"pushed_authorization_request_endpoint": "https://openam-yyc-dev.forgeblocks.com:443/am/oauth2/alpha/par",
"introspection_encryption_alg_values_supported": [
"ECDH-ES+A256KW",
"ECDH-ES+A192KW",
"RSA-OAEP",
"ECDH-ES+A128KW",
"RSA-OAEP-256",
"A128KW",
{
"data": [
{
"id": 6,
"name": "Andorra",
"iso3": "AND",
"iso2": "AD",
"numeric_code": "020",
"phone_code": "376",
"capital": "Andorra la Vella",
import java.security.*;
import java.io.*;
import javax.crypto.*;
import java.util.*;
KeyStore ks = KeyStore.getInstance("JCEKS");
Scanner in = new Scanner(System.in);
System.out.println("On prem keystore file (full path): ");
String filename = in.nextLine();
@atomicsamurai
atomicsamurai / readme.md
Last active April 25, 2022 15:08 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
    local len=$((${#1} % 4))
    local result="$1"
    if [ $len -eq 2 ]; then result="$1"'=='
    elif [ $len -eq 3 ]; then result="$1"'=' 
    fi
    echo "$result" | tr '_-' '/+' | openssl enc -d -base64
{
"given_name":"Demo First Name",
"family_name":"Demo Last Name",
"name":"demo",
"sub":"demo",
"subname":"id=demo,ou=user,o=root,ou=services,dc=openam,dc=forgerock,dc=org"
}
{
"issuer" : "https://platform.ringcentral.com",
"authorization_endpoint" : "https://api.ringcentral.com/restapi/oauth/authorize",
"token_endpoint" : "https://api.ringcentral.com/restapi/oauth/token",
"revocation_endpoint" : "https://api.ringcentral.com/restapi/oauth/revoke",
"userinfo_endpoint" : "https://api.ringcentral.com/restapi/oauth/userinfo",
"jwks_uri" : "https://api.ringcentral.com/restapi/oauth/jwks",
"scopes_supported" : [ "email", "openid", "profile" ],
"token_endpoint_auth_methods_supported" : [ "client_secret_basic", "client_secret_jwt", "private_key_jwt" ],
"response_types_supported" : [ "code" ],
#Manjaro
# kernel command line
## during install
nouveau.modeset=0 nogpumanager pcie_aspm=off acpi_backlight=none acpi_osi=Linux acpi_osi=!
## Post install
i915.edp_vswing=2 pcie_port_pm=off acpi_backlight=none acpi_osi=Linux acpi_osi=! acpi_osi='Windows 2009'
(below is from - https://bbs.archlinux.org/viewtopic.php?pid=1826641#p1826641)
@atomicsamurai
atomicsamurai / tomcat.sh
Last active May 7, 2019 21:24
Tomcat management script - can manage multiple tomcat instances under a common folder
#!/bin/bash
#
# Tomcat 7/8 start/stop/status script
# Forked from: https://gist.github.com/miglen/5590986
# @author: Sandeep Chaturvedi <[email protected]>
#
# Release updates:
# Updated to handle multiple tomcat instances under one directory
# 'status' argument without any other argument will print all instances' status
# any argument with the name of the tomcat instance (the subdirectory name under the common directory) will operate on that instance
on Button#Switch do
if [State#State]=0
gpio,15,1
else
gpio,15,0
endif
endon
On MQTT#Connected do
// **** switch on gpio 15 ****
@atomicsamurai
atomicsamurai / gist:a37c0430a428703e6daf1c5160cb0782
Created May 3, 2018 15:55
Cypher for querying driver's access to trunk
MATCH (driver:User {name: 'Cathy'})
WITH driver
// find the trunk from the drive and the package
// the package and the location are the key to open the trunk
OPTIONAL MATCH driver_item_path=(driver)-[:DRIVES|INCLUDES*]-(item:Item {name: 'Item'})-[:DELIVER_TO]->(trunk:Door)
WITH driver_item_path,trunk
OPTIONAL MATCH item_work_path=(trunk)<-[:INCLUDES*..5]-(intermediate:Collection)-[:INCLUDES*..5]->(:Location {name: 'Work'})
USING JOIN ON intermediate
RETURN CASE
WHEN driver_item_path IS NULL THEN { result: false, advice: "Driver not authorized on package."}