Skip to content

Instantly share code, notes, and snippets.

Christian Johannsen cjohannsen81

Block or report user

Report or block cjohannsen81

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View compliance_download.py
import requests
import csv
#Login using: curl -i -d '{"login_id":"EMAIL","password":"PASSWORD"}' https://mattermost-server.com/api/v4/users/login
#Copy the token
auth_token = raw_input("Please enter your auth token: ")
posts = raw_input("Please enter the filename to parse: ")
hed = {'Authorization': 'Bearer ' + auth_token}
@cjohannsen81
cjohannsen81 / websocket.js
Created Mar 13, 2018
node.js script to connect mattermost websockets and listen for events
View websocket.js
const WebSocket = require('ws');
var ws = new WebSocket("ws://YourMattermostServer:8065/api/v4/websocket");
ws.on('open', function open(){
var msg = {
"seq": 1,
"action": "authentication_challenge",
"data": {
"token": "YourTokenFromTheMattermostCookie"
View default.rb
#
# Cookbook Name:: compliance
# Recipe:: default
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
case node[:platform]
when "ubuntu"
cookbook_file 'tmp/chef-compliance_0.14.5-1_amd64.deb' do
source 'chef-compliance_0.14.5-1_amd64.deb'
@cjohannsen81
cjohannsen81 / gist:9702773
Created Mar 22, 2014
Get Facebook message based on location using koala in ruby
View gist:9702773
require 'koala'
APP_ID = ""
APP_SECRET = ""
access_token = ""
oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET)
oauth.exchange_access_token_info(access_token)
@graph = Koala::Facebook::API.new(access_token)
You can’t perform that action at this time.