Skip to content

Instantly share code, notes, and snippets.

View RickCogley's full-sized avatar
👻
Slowly but surely implementing ISO 27001 ISMS

Rick Cogley RickCogley

👻
Slowly but surely implementing ISO 27001 ISMS
View GitHub Profile
@RickCogley
RickCogley / flowdock-flow-export.json
Created June 19, 2016 09:22
Flowdock flow export to json
[
{
"user": "85599",
"content": {
"type": "add_people",
"message": [
"Hideaki",
"Ena",
"Yoshi",
"Yori",
@RickCogley
RickCogley / Matrix.org from a Flowdock user perspective.md
Last active June 21, 2016 21:28
Notes about using Matrix.org from a Flowdock user's perspective

Introduction

I had been considering, off and on, moving our Flowdock chat rooms to an open source equivalent, because I'm generally against the idea of having years of information and group knowledge, in a system that I don't control. It's not just Flowdock, but also Slack, Hipchat and so on.

There are a few OSS systems out there, often billed as "slack alternatives", including Mattermost and Rocket Chat. As I was searching, I learned about matrix.org in a forum post about such systems, liked its philosophy of trying to break down information siloes, so I thought I'd try it.

Per the site, Matrix is:

an open standard for decentralised communication, providing simple HTTP APIs and open source reference implementations for securely distributing and persisting JSON over an open federation of servers.

@RickCogley
RickCogley / README.rst
Created June 26, 2016 11:13 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@RickCogley
RickCogley / Rocket Chat Regex Search Basics.md
Last active June 30, 2022 08:10
Rocket Chat Regex Search Basics

Rocket Chat Search Basics

Introduction

Rocket Chat search supports the use of "regular expressions", the benefits of which are great search flexibility and the ability to search chat entries in any language, even ones which are traditionally a challenge for search (e.g. "CJK" languages - Chinese, Japanese, Korean).

Basic Regex Examples

Regular expressions are a deep, but admittedly geeky topic. The flexibility of "regex" search increases as you learn more about how to write regex patterns, but if you learn just a couple of simple patterns, you can benefit right away.

Let's see a few simple examples that you can try.

[deoplete] File "<frozen importlib._bootstrap_external>", line 388, in _check_name_wrapper
[deoplete] File "<frozen importlib._bootstrap_external>", line 809, in load_module
[deoplete] File "<frozen importlib._bootstrap_external>", line 668, in load_module
[deoplete] File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
[deoplete] File "<frozen importlib._bootstrap>", line 693, in _load
[deoplete] File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
[deoplete] File "<frozen importlib._bootstrap_external>", line 665, in exec_module
[deoplete] File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
[deoplete] Traceback (most recent call last):
[deoplete] Traceback (most recent call last):
@RickCogley
RickCogley / !! Readme 1999 Mirroring with Lsyncd.md
Last active July 19, 2016 01:32
Setting up Rsync via the Lsyncd daemon, for mirroring a 1999 server's static output

Readme

This is a quick guide to setting up mirroring of your 1999 site, to other web servers to serve your static output files. It uses the lsyncd daemon. This works using the Ubuntu-based Amazon AMI image provided by Scripting as of 19 July 2016.

Forever

If you haven't already tried it, "forever" is easy to set up and use, and it daemonizes your 1999 storage.js script. Install via npm from your nodestorage folder:

 sudo npm install forever -g
@RickCogley
RickCogley / !readme.md
Last active November 17, 2022 07:21
Use jq to do date math

Current

I am using the fantastic jq to manipulate a REST API's json, into a csv for upsertting into another database system, via its API. Once in the target system, I'm doing some date math, including rounding time stamps to 30 min intervals to allow me to do group them, for standard deviation calculation. The problem is, there is a lot of data and the database chokes when it has to round every record and then do std dev calculations on each.

  • Sample.json shows a small sample of what the input data looks like, but actually it's just stdout from the curl command in the shell script.
  • example-initial.sh shows the important bit of the initial shell script, that uses curl to authenticate against the data location's API, and then use jq to add a couple of columns and export to csv. It works like a charm.
  • ACME-X1-A.csv is an example of the output CSV file, that's then upsertted into the target db.

Goal

@RickCogley
RickCogley / 00-about-search-api-examples.md
Created January 29, 2017 07:15 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@RickCogley
RickCogley / Git push deployment in 7 easy steps.md
Created January 29, 2017 22:15 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@RickCogley
RickCogley / create_labels.sh
Created February 1, 2017 09:58 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform