Skip to content

Instantly share code, notes, and snippets.

@paulgrav
paulgrav / kibana_azuread.md
Last active September 10, 2023 08:54
Setting up Azure AD OpenID Connect with Kibana

Enabled Azure AD with Kibana

1. Configure Elasticsearch

As a pre-requisite we need to register a new app in Azure AD, note down some properties, and generate a Client Secret.

  1. Register an app in Azure Active Directory.
  2. Note its Application (client) ID
  3. Note the Directory (tenant) ID
  4. Generate a New Client Secret.
@paulgrav
paulgrav / hydra-links.markdown
Last active April 29, 2019 15:45
Links for the Hydra Presentation
import http from "k6/http";
import { check, group } from "k6";
import { Rate } from "k6/metrics";
import { sleep } from "k6";
export let errorRate = new Rate("errors");
export let options = {
stages: [
{ duration: "5m", target: 1 },
Error: Error running plan: 1 error(s) occurred:
* provider.influxdb: error pinging server: Get ping: unsupported protocol scheme ""

Keybase proof

I hereby claim:

  • I am paulgrav on github.
  • I am paulgrav (https://keybase.io/paulgrav) on keybase.
  • I have a public key whose fingerprint is 04B1 E03D 2DBC F8EA 8194 7FA2 AC4B 0BF0 A485 758A

To claim this, I am signing this object:

@paulgrav
paulgrav / gist:4064930
Created November 13, 2012 09:46
Swap ul/li for select/option
$(".v5-select").each(function(i,o) {
var first_o = $('h3.select-head',o).text();
console.log(first_o);
$('.select-body', o).replaceWith(function() {
form = $("<form/>");
select = $("<select/>");
form.append(select);
select.attr('style', $(this).attr('style'));
var opt = $("<option selected='selected'/>").text(first_o);
@paulgrav
paulgrav / gist:3302796
Created August 9, 2012 09:54
Reduced node_redis issue
var redis = require('redis');
var client = redis.createClient(6379,’localhost');
client.subscribe("football.match.event");
client.on("error", function (err) {
console.log("error event - " + client.host + ":" + client.port + " - " + err);
console.log('connected: ' + client.connected);
});
client.on("end", function (err) {
@paulgrav
paulgrav / gist:3293884
Created August 8, 2012 09:54
socket.io problem
var io = require('socket.io').listen(8090,{"destroy upgrade": false})
, fs = require('fs')
, redis = require('redis');
var client = redis.createClient(6379,'localhost');
redis.debug_mode = true;
client.subscribe("football.match.event");
io.enable('browser client minification');
client.on("error", function (err) {
console.log("error event - " + client.host + ":" + client.port + " - " + err);
@paulgrav
paulgrav / gist:3043676
Created July 3, 2012 22:02
Gametrailers
diff --git a/ClickToPlugin.safariextension/killers/MTVNetworks.js b/ClickToPlugin.safariextension/killers/MTVNetworks.js
index ad46ef8..082f967 100644
--- a/ClickToPlugin.safariextension/killers/MTVNetworks.js
+++ b/ClickToPlugin.safariextension/killers/MTVNetworks.js
@@ -53,7 +53,7 @@ addKiller("MTVNetworks", {
"cms:episode:thedailyshow.com:": "context5",
"cms:episode:colbertnation.com:": "context7",
"cms:video:colbertnation.com:": "context8",
- "moses:video:gametrailers.com:": "context1",
+ "arc:video:gametrailers.com:": "context1",
@paulgrav
paulgrav / gist:9393738
Last active August 29, 2015 13:57
Rankings
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import operator
import pprint
matches = [
{ "h": {"name": "PG", "score": 2}, "a": {"name": "MK", "score": 2} },
{ "h": {"name": "PG", "score": 1}, "a": {"name": "MK", "score": 2} },
{ "h": {"name": "MK", "score": 1}, "a": {"name": "PG", "score": 0} },