Skip to content

Instantly share code, notes, and snippets.

View icelander's full-sized avatar

Paul Rothrock icelander

View GitHub Profile
@icelander
icelander / gist:6996949
Created October 15, 2013 19:05
This how you disable address bar tracking
<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Keybase proof

I hereby claim:

  • I am icelander on github.
  • I am icelander (https://keybase.io/icelander) on keybase.
  • I have a public key ASD0x2htCk4gHTLkQ_yig3KDhm0nRpyBBrq7Ln6Q7vDnkgo

To claim this, I am signing this object:

@icelander
icelander / mattermost_logviewer.rb
Created June 26, 2018 17:24
A log viewer script for Mattermost logs with error highlighting and an easier to read format
#!/usr/bin/ruby
require 'colorize'
require 'json'
require 'time'
require 'erb'
require 'ostruct'
file_path = ARGV[0]
def process_json_line(line)
@icelander
icelander / autopgsqlbackup
Created July 7, 2018 02:11 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@icelander
icelander / json_to_env.rb
Last active August 3, 2018 17:35
Converts JSON configuration to environment variable configuration
#!/usr/bin/env ruby
require 'json'
=begin
This converts a Mattermost JSON configuration file to environment variables
More information available here: https://docs.mattermost.com/administration/config-settings.html
To use, download this script and then pipe the config.json file into it, like this:
@icelander
icelander / pingme.rb
Created April 21, 2019 04:21
pingme - A simple way to ping a Mattermost webhook from the command line and send STDIN
#!/usr/bin/env ruby
# Sends a ping to a Mattermost webhook and can include stdin as a code block
#
#
# Options
# -c, --channel <channel_name> - Name of channel to post to. Use @username to send a DM
# -u, --username <username> - username to post as, if the webhook allows it
# -i, --icon_url <icon_url> - URL of user icon to use
#!/bin/bash
# Mattermost File Processor Script
#
# This script allows you to run a Mattermost command against a list of IDs stored in a text file
# How to use it
#
# 1. Get a list of the identifiers for the items you want to process in a text file. More details on the
# 2. Get the mattermost command you want to run from https://docs.mattermost.com/administration/command-line-tools.html
@icelander
icelander / deploy_plugin.sh
Created February 1, 2020 04:01
A simple script to deploy a Mattermost plugin using mmctl after building it
#!/bin/bash
### How to Use
#
# - Verify you have both jq and mmctl installed
# - Set up at least one set of authentication credentials in mmctl
# - Configure your Mattermost server to accept plugin file uploads
# - Place in the root directory of your Mattermost Plugin Project
# - Run `make` to create the plugin file in `dist/`
# - Run this script to deploy the plugin
@icelander
icelander / jira.update.json
Created March 22, 2020 17:17
Example Jira Ticket Update Webhook Payload
{
"timestamp":1536083559131,
"webhookEvent":"jira:issue_updated",
"issue_event_type_name":"issue_generic",
"user":{
"self":"https://paulrothrock.atlassian.net/rest/api/2/user?username=admin",
"name":"admin",
"key":"admin",
"accountId":"557058:c9ebf848-dfac-4c49-9408-dc34bd0e2d85",
"emailAddress":"paul@mattermost.com",
@icelander
icelander / users_to_csv.rb
Last active July 23, 2020 15:34
Generate Okta Import CSV from Mattermost Users
#!/bin/ruby
require 'csv'
require 'yaml'
require 'httparty'
require 'uri'
### users_to_csv.rb
#
## About