Skip to content

Instantly share code, notes, and snippets.

Matthew Richardson mrichar1

  • Edinburgh, Scotland
Block or report user

Report or block mrichar1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spotihosts.txt
127.0.0.1 adclick.g.doubleclick.net
127.0.0.1 adeventtracker.spotify.com
127.0.0.1 ads-fa.spotify.com
127.0.0.1 analytics.spotify.com
127.0.0.1 audio2.spotify.com
127.0.0.1 b.scorecardresearch.com
127.0.0.1 bounceexchange.com
127.0.0.1 bs.serving-sys.com
127.0.0.1 content.bitsontherun.com
127.0.0.1 core.insightexpressai.com
View next_free_workspace.py
"""Script to launch the specified command in the next available workspace."""
import i3ipc
import sys
# Potential workspaces to use
WORKSPACES = set((1, 2, 3, 4, 5, 6, 7, 8, 9, 10))
def main():
i3c = i3ipc.Connection()
@mrichar1
mrichar1 / split-size-toggle.py
Created Feb 10, 2017
Change i3 split based on current window dimensions
View split-size-toggle.py
import i3ipc
i3 = i3ipc.Connection()
def on_window_focus(i3, e):
cont = e.container
if cont.rect.width < cont.rect.height:
print("splitv")
i3.command("split vertical")
else:
View gist:79de61e9df3e03bc7a6ee638ed43fe4d
### Keybase proof
I hereby claim:
* I am mrichar1 on github.
* I am match (https://keybase.io/match) on keybase.
* I have a public key whose fingerprint is 129D 6F6D A317 AAA8 F492 A7E6 456A 62D5 6602 41D2
To claim this, I am signing this object:
@mrichar1
mrichar1 / logstash.conf
Last active Aug 29, 2015
logstash output to influxdb
View logstash.conf
output {
http {
url => "http://influxdb.example.com/db/<database>/series?u=<user>&p=<pass>"
http_method => "POST"
}
}
@mrichar1
mrichar1 / reveal-jump.js
Created Mar 11, 2015
reveal.js - hotkey to jump to/from a named slide
View reveal-jump.js
Reveal.initialize({
keyboard: {
// '0' key will jump between current slide and slide-X
48: function() {jumpSlide()},
}
});
function jumpSlide() {
// The id of the slide you wish to jump to/from
@mrichar1
mrichar1 / gist:a433240cbe142f101e69
Last active Sep 6, 2017
Logging events from sensu to logstash
View gist:a433240cbe142f101e69

To log checks from sensu into logstash, I use the following sensu config:

{
  "handlers": {
    "logstash": {
      "type": "tcp",
      "socket": {
        "host": "logstash.example.com",
        "port": 1234
@mrichar1
mrichar1 / gist:7416008
Created Nov 11, 2013
hacky script to generate fpm rpms from sensu-admin Gemfile, using ruby bundled with sensu and ignoring already existing gems
View gist:7416008
########################################################
# install sensu (epel rpms)
# you will also need some (all?) of sqlite-devel, mysql2-devel, rpm-build, libxslt-devel,libxml2-devel rpms
# use it's embedded gem to install bundler and fpm
mkdir /tmp/sensugems
/opt/sensu/embedded/bin/gem install --no-rdoc --no-ri -i /tmp/sensugems/ bundler
@mrichar1
mrichar1 / httpd.conf
Created Sep 20, 2013
Apache configuration to set Encryption and Authorisation for Kibana and Elasticsearch queries, with the option to restrict access to different indices.
View httpd.conf
#########################################################################################
# This configuration is based on that supplied here:
# https://github.com/elasticsearch/kibana/blob/master/sample/apache_ldap.conf
#
# The aim of this config is to set up encryption and authorisation on Kibana access.
# It also allows different authorisation rules for certain elasticsearch indexes.
#
# This config expects you to unpack kibana at /var/www/kibana/ and set config.js to be:
# https:// instead of http:// and 443 instead of 9200
#
You can’t perform that action at this time.