Skip to content

Instantly share code, notes, and snippets.

View purinda's full-sized avatar
🐺
....

Purinda Gunasekara purinda

🐺
....
View GitHub Profile
#!/usr/bin/env bash
# Slack files prune script for clearing up space for free slack accounts.
# Config
TOKEN="<your token>"
URL_BASE="https://slack.com/api/"
# API endpoints
URL_LIST="${URL_BASE}files.list"
URL_FILE_DELETE="${URL_BASE}files.delete"
@purinda
purinda / spell-suggester.php
Created December 15, 2015 01:43
PHP Spelling suggester function
<?php
function get_suggestions($user_input)
{
$pspell_link = pspell_new("en");
$suggestions = pspell_suggest($pspell_link, $user_input);
$lowest_distance = null;
$most_relevant_words = [];
1 x Missile Switch
2 x Push button PSTD switches
1 x 2-Line LCD (http://www.farnell.com/datasheets/1765332.pdf)
@purinda
purinda / DOD Checklist
Created September 21, 2015 03:16
DOD Checklist
- [ ] Work reflects requirements
- [ ] Docs
- [ ] Tests
- [ ] Product sign off
- [ ] Dev approval 1
- [ ] Dev approval 2
@purinda
purinda / centralised-logging.md
Last active August 2, 2019 06:39
Centralised logging with Kibana, Logstash, Elasticsearch and Log-courier

Centralised and Scalable log-server implementation on Ubuntu 15.04

The goal of this article is to explain how to implement a very simple log server which can accept application logs coming from one or more servers. For simplicity I will be implementing the log server and log forwarder (explained in Components section) on the same computer.

In order to keep the article easy to understand and to keep the implementation simple as possible I have excluded the security of the logs that get transmitted from application servers to the log-server and considered outside the scope of this article. Therefore if you implement the exact solution make sure you consider security of log data as some logs may contain sensitive information about the applications.

Components