Skip to content

Instantly share code, notes, and snippets.

View barkerja's full-sized avatar
🤷‍♂️
🤷🏻

John Barker barkerja

🤷‍♂️
🤷🏻
  • Dryden, NY
View GitHub Profile

Keybase proof

I hereby claim:

  • I am barkerja on github.
  • I am barkerja (https://keybase.io/barkerja) on keybase.
  • I have a public key whose fingerprint is EBFE 7981 266D 10BF 09DE A535 AA95 0414 EDB7 CF9A

To claim this, I am signing this object:

@barkerja
barkerja / Dockerfile
Created March 31, 2014 10:54
Dockerfile for ElasticSearch with a few plugins
FROM dockerfile/java
RUN wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.tar.gz
RUN tar xzf elasticsearch-1.1.0.tar.gz
RUN mv elasticsearch-1.1.0 /opt/elasticsearch
RUN rm elasticsearch-1.1.0.tar.gz
RUN /opt/elasticsearch/bin/plugin -install mobz/elasticsearch-head
RUN /opt/elasticsearch/bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.1.0
RUN /opt/elasticsearch/bin/plugin -install karmi/elasticsearch-paramedic
upstream mostor_backend {
server unix:/tmp/unicorn.mostor-website.sock fail_timeout=0;
}
server {
listen 80;
root /home/work/www/mostor/current/public/;
client_max_body_size 1000m;
location ^~ /assets/ {
require 'celluloid'
WORKERS_COUNT = (ARGV[0] || 1).to_i
class Output
include Celluloid
def puts(msg)
Kernel.puts(msg)
end
#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
@barkerja
barkerja / object_allocation_count.rb
Created December 12, 2014 19:26
sort object allocation by count
objects = Hash.new(0)
ObjectSpace.each_object { |obj| objects[obj.class] += 1 }
p objects.sort_by { |_,v| -v }
# Description:
# Submit time query to www.timeapi.org
#
# Commands:
# hubot time - Current time in local timezone
# hubot time <timezone> - Current time in timezone
# hubot time <timezone> <query> - Time in timezone based on query
module.exports = (robot) ->
@barkerja
barkerja / db.rake
Last active August 29, 2015 14:14 — forked from tehpeh/db.rake
namespace :db do
namespace :enable do
desc "enable hstore extension"
task :hstore => [:environment, :load_config] do
ActiveRecord::Base.connection.execute('CREATE EXTENSION IF NOT EXISTS hstore;')
end
end
Rake::Task['db:schema:load'].enhance ['db:enable:hstore']
end
include RethinkDB::Shortcuts
conn = r.connect(host: ENV['RETHINKDB_URL'])
databases = r.db_list().run(conn)
databases.each do |database|
puts "Database: #{database}"
tables = r.db(database).table_list().run(conn)
<?php
/**
* Brightkite PHP Object to do basic things such as checkin, post a note, and search
* for location.
*
* This object is chain-able.
* Ex:
* Brightkite::factory()->current_location()->note('new note');
* Brightkite::factory()->address('San Francisco, CA')->checkin()->note('new note');