Skip to content

Instantly share code, notes, and snippets.

View kore's full-sized avatar

Kore Nordmann kore

View GitHub Profile
@kore
kore / handlers-main.yml
Created August 8, 2019 13:26
Ansible Grafana Setup (HACK!)
---
- name: Restart Prometheus
service: name=prometheus state=restarted enabled=yes
- name: Restart Grafana
service: name=grafana-server state=restarted enabled=yes
@kore
kore / slack-status
Created January 31, 2019 08:58
cp /home/kore/Environment/bin/slack-status /etc/NetworkManager/dispatcher.d/slack-status
#!/usr/bin/env php
<?php
// Test using `slack-status <networkDevice> up`
//
// Get Slack tokens at https://api.slack.com/custom-integrations/legacy-tokens
$workspaces = [
'Tideways' => '-',
'FRONTASTIC' => '-',
'PHPUGDO & Friends' => '-',
@kore
kore / slack-status.php
Last active March 27, 2018 05:49
Sets the slack status according to your network connection; MUST be owned by root; Put in /etc/NetworkManager/dispatcher.d/slack-status
#!/usr/bin/env php
<?php
// Test using `slack-status <networkDevice> up`
//
// Get Slack tokens at https://api.slack.com/custom-integrations/legacy-tokens
$workspaces = [
'Tideways' => '<token>',
'FRONTASTIC' => '<token>',
];
- name: Create Grafana Prometheus data source
uri:
method: PUT
url: http://localhost:3030/api/datasources/1
body: '{"name": "Prometheus", "type": "prometheus", "url": "http://localhost:9090", "access": "proxy", "basicAuth": false}'
headers:
Content-Type: "application/json"
force_basic_auth: yes
user: "{{ grafana_user }}"
password: "{{ grafana_password }}"
@kore
kore / jsonpretty
Created June 20, 2017 15:06
jsonpretty
#!/usr/bin/env php
<?php
require dirname( __FILE__ ) . '/../../lib/php/arguments.php';
// Define options array for this tool
$options = array(
'General' => array(
'color' => array(
'short' => 'c',
#!/usr/bin/env php
<?php
$user = '<user>';
$userId = '<userId>';
$secret = '<secret>';
// Fetch text and meta-data from blog software…
class Post {
@kore
kore / f.fish
Created June 10, 2016 10:45
Find in fish
# ~/.config/fish/functions/f.fish
function f
find ./ -iname '*'$argv[1]'*'
end
@kore
kore / syncFolder
Created November 18, 2014 10:22
Sync folder
#!/bin/bash
if [ -z "$1" ] ; then
echo "usage: $0 <host:path/>"
exit 64
fi
TARGET="$1"
echo "Set up synchronization with $TARGET"
@kore
kore / gist:82ad5d2cfe167c73a549
Created September 8, 2014 11:57
Sync folder
#!/bin/bash
if [ -z "$1" ] ; then
echo "usage: $0 <host:path/>"
exit 64
fi
TARGET="$1"
echo "Set up synchronization with $TARGET"