Skip to content

Instantly share code, notes, and snippets.

View fredr's full-sized avatar
:bowtie:
Hold my shovel

Fredrik Enestad fredr

:bowtie:
Hold my shovel
  • Stockholm, Sweden
View GitHub Profile
@djonsson
djonsson / install_elasticsearch_osx.md
Last active November 11, 2022 21:10
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This script will use the dns.lookup function, which is used by node internally when making http requests, to lookup an IP and a hostname 3 times. A healthy system should give output similar to:

lookup of 93.184.216.119: 0ms
lookup of 93.184.216.119: 0ms
lookup of 93.184.216.119: 0ms
lookup of example.com: 6ms
lookup of example.com: 1ms
lookup of example.com: 0ms

Note that the first hostname lookup took longer than the following because of caching in some DNS. An unhealthy system might give you output like this:

@fredr
fredr / bookmarklet-runner.js
Last active June 14, 2024 17:28
A bookmarklet that will inject an external script in the browser. (minify, uri encode and add to the href prefixed with "javascript:" in your bookmark)
(function() {
var script = document.createElement('script');
script.async = 1;
script.src = '<url to script>';
document.getElementsByTagName('body')[0].appendChild(script);
})();
@djonsson
djonsson / darcula.css
Created September 5, 2013 16:08
Darcula theme for jsonview (google chrome plugin)
body {
white-space: pre;
font-family: monospace;
background: #393939;
color: #b5c4d0;
}
.property {
}