Skip to content

Instantly share code, notes, and snippets.

@gregkare
gregkare / sockethub.tf
Created May 28, 2019 09:00
Create labels for repositories in a GitHub org
# Run `terraform init` to install the GitHub provider
# Configure the GitHub Provider
# Generate a Personal access token on https://github.com/settings/tokens with
# full control over private repositories (repo scope).
# When you run Terraform # it will ask for your token, you can also export it in
# your shell:
# $ export TF_VAR_github_token=YOUR_TOKEN
variable "github_token" {}
@gregkare
gregkare / hubot-xmpp-test.js
Last active November 3, 2017 20:57
Hubot XMPP plugin test
(function () {
var Stanza;
({Stanza} = require('node-xmpp-client'));
"use strict";
const xmpp_rooms = ["test3@muc.5apps.com"];
module.exports = function(robot) {
if (robot.adapterName == "xmpp") {
$ node --version
v6.11.4
$ npm --version
5.5.1
# Getting the same result with npm 5.4.2 and node 4.8.4
@gregkare
gregkare / yay_activesupport.rb
Created July 1, 2015 14:45
Yaay ActiveSupport
> r = "\x9A"
=> "\x9A"
> r.empty?
=> false
> r.nil?
=> false
> r.blank?
ArgumentError: invalid byte sequence in UTF-8
from /var/lib/gems/2.1.0/gems/activesupport-4.2.2/lib/active_support/core_ext/object/blank.rb:117:in `==='
from /var/lib/gems/2.1.0/gems/activesupport-4.2.2/lib/active_support/core_ext/object/blank.rb:117:in `blank?'
chef > node['graylog2']['elasticsearch']['max_size_per_index']
=> 1073741824
chef > node.override['graylog2']['elasticsearch']['max_size_per_index'] = nil
=> nil
chef > node['graylog2']['elasticsearch']['max_size_per_index']
=> 1073741824
require 'minitest/autorun'
describe 2 do
i_suck_and_my_tests_are_order_dependent!
describe '1' do
it 'runs the spec in the same order' do
puts '1'
end
$ file crul
crul: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xa4e9e283be451c3511b96c2636a263ae4b1b6792, not stripped
$ ./crul
./crul: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./crul)
#!/usr/bin/env sh
if ! which boot2docker; then
brew install boot2docker
mkdir $HOME/.boot2docker
echo DOCKER_PORT=32000 > $HOME/.boot2docker/profile
fi
if [[ -z $DOCKER_HOST ]]; then
export DOCKER_HOST="tcp://127.0.0.1:32000"
add_to_shell=1
@gregkare
gregkare / gist:08c196f6800e88d0ab61
Created September 24, 2014 11:10
ruby2.1 2.1.3-1bbox1~precise1
I, [2014-09-24T11:07:17.623792 #14749] INFO -- : Refreshing Gem list
/var/www/liquor-cabinet/releases/7cbef2dee01eade8bfb1cc83defd9abbb42968e1/vendor/bundle/ruby/2.1.0/gems/backports-3.3.0/lib/backports/1.9.1/io/open.rb:2:in `close': Bad file descriptor @ fptr_finalize - /var/www/
liquor-cabinet/releases/7cbef2dee01eade8bfb1cc83defd9abbb42968e1/vendor/bundle/ruby/2.1.0/gems/backports-3.3.0/lib/backports/1.9.1/io/open.rb (Errno::EBADF)
from /var/www/liquor-cabinet/releases/7cbef2dee01eade8bfb1cc83defd9abbb42968e1/vendor/bundle/ruby/2.1.0/gems/backports-3.3.0/lib/backports/1.9.1/io/open.rb:2:in `open'
from /var/www/liquor-cabinet/releases/7cbef2dee01eade8bfb1cc83defd9abbb42968e1/vendor/bundle/ruby/2.1.0/gems/backports-3.3.0/lib/backports/1.9.1/io/open.rb:2:in `<top (required)>'
from /var/www/liquor-cabinet/releases/7cbef2dee01eade8bfb1cc83defd9abbb42968e1/vendor/bundle/ruby/2.1.0/gems/backports-3.3.0/lib/backports/tools.rb:328:in `require'
from /var/www/liquor-cabinet/releases/7
@gregkare
gregkare / flash_hash.md
Last active April 27, 2018 16:51
FlashHash

How to crash Rails > 4.1.0 in a pretty confusing way:

def index
  redirect_to new_post_url, flash: flash
end
NoMethodError: