Skip to content

Instantly share code, notes, and snippets.

View jjasghar's full-sized avatar

JJ Asghar jjasghar

View GitHub Profile
@jjasghar
jjasghar / README.md
Last active August 29, 2015 14:06 — forked from ejhayes/README.md

About

Use node-inspector to debug hubot!

sudo npm install -g node-inspector

Run Hubot in Debug Mode

coffee --nodejs --debug $(which hubot)

#!/bin/sh
# https://gist.githubusercontent.com/octocat/0831f3fbd83ac4d46451/raw/git-author-rewrite.sh
git filter-branch --env-filter '
OLD_EMAIL="awaxa@awaxa.com"
CORRECT_NAME="Greg Kitson"
CORRECT_EMAIL="greg.kitson@gmail.com"
export GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
@jjasghar
jjasghar / index.js
Last active August 29, 2015 14:06 — forked from therealklanni/index.js
var fs = require('fs');
var rfs = fs.readFileSync;
var wfs = fs.writeFileSync;
var path = require('path');
var yaml = require('js-yaml');
var inquirer = require('inquirer');
var program = require('commander');
var version = require('./package.json').version;
program
#
# Copyright 2012 Mortar Data Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software

channel operator quick reference

direct discussion about administrative action away from the main channel and into #reddit-diabetes-ops to minimise disruption. our -ops channel is the place where users should come to ask for our help. examples:

  • any sort of operator request or discussion of channel administration in the main channel
  • PMs asking why a ban was set
  • reports of harassment (unless the user is confiding in you)
  • any request for operator action

changing channel access permissions

# Description:
# Anyone can have voice or op
#
# Commands:
# hubot make me an op
# hubot make <name> an op
# hubot give me voice
# hubot give <name> voice
module.exports = (robot) ->
{
"chef_type": "environment",
"cookbook_versions": {},
"default_attributes": {
},
"description": "The 1+N environment",
"json_class": "Chef::Environment",
"name": "1+n environment",
"override_attributes": {
"openstack": {
#!/bin/bash
# collectd plugin to monitor passenger
# has better memory-requirement than a ruby script
# TODO: try writing it in c - if it makes a difference
HOSTNAME=`hostname -s`
PASSENGER_STATUS="/usr/local/bin/passenger-status"
PASSENGER_MEMORY_STATS="/usr/local/bin/passenger-memory-stats"
INTERVAL="${COLLECTD_INTERVAL:-10}"
PLUGIN_NAME="passenger_status"

This was a bit of a trick to get set up, so here it is for anyone who comes across it in search results.

ZNC User Account

  • Set up the account as usual (note the username and password)
  • Set the defualt buffer size to 0. Every time the bot reconnects after a crash, it would try to respond to the commands it hear or respond in the buffer, and might crash it again.
  • Go ahead and define a network and channel for your bot. Note the network name.
  • You should now see a "ghost" for your hubot connected.
  • Look at the ZNC user list. The hubot user will show 1 network, but 0 clients.
# Usage:
# 1. Drop this file into lib/capistrano/submodule_strategy.rb
# 2. Add the following to your Capfile:
# require 'capistrano/git'
# require './lib/capistrano/submodule_strategy'
# 3. Add the following to your config/deploy.rb
# set :git_strategy, SubmoduleStrategy
# 4. Add .capignore file and list each file or directory to exclude from deployment on a separate line. Example:
# .capignore
# lib