Skip to content

Instantly share code, notes, and snippets.

Avatar
🐺
....

Purinda Gunasekara purinda

🐺
....
View GitHub Profile
View slack-file-delete-truncate.sh
#!/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 Dec 15, 2015
PHP Spelling suggester function
View spell-suggester.php
<?php
function get_suggestions($user_input)
{
$pspell_link = pspell_new("en");
$suggestions = pspell_suggest($pspell_link, $user_input);
$lowest_distance = null;
$most_relevant_words = [];
View Raspberry Pi Launch System Parts List
1 x Missile Switch
2 x Push button PSTD switches
1 x 2-Line LCD (http://www.farnell.com/datasheets/1765332.pdf)
View DOD Checklist
- [ ] Work reflects requirements
- [ ] Docs
- [ ] Tests
- [ ] Product sign off
- [ ] Dev approval 1
- [ ] Dev approval 2
@purinda
purinda / centralised-logging.md
Last active Aug 2, 2019
Centralised logging with Kibana, Logstash, Elasticsearch and Log-courier
View centralised-logging.md

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

You can’t perform that action at this time.