Skip to content

Instantly share code, notes, and snippets.

View cjohannsen81's full-sized avatar

Christian Johannsen cjohannsen81

View GitHub Profile
@cjohannsen81
cjohannsen81 / gist:9702773
Created March 22, 2014 07:42
Get Facebook message based on location using koala in ruby
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)
#
# 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'
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 March 13, 2018 09:56
node.js script to connect mattermost websockets and listen for events
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"
# Stage 1: Build
FROM python:3.9 as build
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Stage 2: Runtime
FROM python:3.9-slim as runtime