Skip to content

Instantly share code, notes, and snippets.

@paulgrav
paulgrav / kibana_azuread.md
Last active Jun 11, 2021
Setting up Azure AD OpenID Connect with Kibana
View kibana_azuread.md

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 Apr 29, 2019
Links for the Hydra Presentation
View hydra-links.markdown
View k6test.js
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 },
View gist:620793871695c4f8c6298beb36120730
Error: Error running plan: 1 error(s) occurred:
* provider.influxdb: error pinging server: Get ping: unsupported protocol scheme ""
View keybase.md

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 Nov 13, 2012
Swap ul/li for select/option
View gist:4064930
$(".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 Aug 9, 2012
Reduced node_redis issue
View gist:3302796
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 Aug 8, 2012
socket.io problem
View gist:3293884
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);
View gist:3043676
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",
View gist:9393738
#!/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} },