Skip to content

Instantly share code, notes, and snippets.

View vovimayhem's full-sized avatar
🎸
Taking names and kicking ass

Roberto Quintanilla vovimayhem

🎸
Taking names and kicking ass
View GitHub Profile
FROM fedora:22
ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8"
RUN dnf groupinstall -y "Development Tools" "Development Libraries" && dnf install -y wget git tar bzip2 && dnf clean all
RUN \
wget http://www.erlang.org/download/otp_src_18.1.tar.gz && \
tar -zxf otp_src_18.1.tar.gz && \
cd otp_src_18.1 && \
export ERL_TOP=`pwd` && \
@shreyaskarnik
shreyaskarnik / Instructions.md
Last active March 24, 2023 15:35
Route Docker Logs to ELK Stack
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
@jjb
jjb / gist:7389552
Last active March 16, 2024 18:48
Ruby 2.1 memory configuration

This all applies to Ruby 2.1. In some cases a setting is not available in 2.0, this is noted. There is also a different with 1.9, 1.8, and REE --- these are not noted.

All the relevant code is in https://github.com/ruby/ruby/blob/master/gc.c

RUBY_HEAP_MIN_SLOTS

default: 10000

The number of heap slots to start out with. This should be set high enough so that your app has enough or almost enough memory after loading so that it doesn't have to allocate more memory on the first request (althogh this probably isn't such a big deal for most apps).

(todo: figure out how big a slot is. i think the answer can be infered from this code.)

@turboladen
turboladen / psql_encoding.sql
Created October 2, 2013 08:46
Script for dealing with creating Postgres databases that complain with: ``` PG::InvalidParameterValue: ERROR: encoding UTF8 does not match locale en_US DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1. ``` ...when trying to create the production DB. Taken from: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-…
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@nandosola
nandosola / daemon.rb
Last active December 17, 2015 04:59 — forked from ik5/daemon.rb
Daemonizing Puma in JRuby using the 'spoon' gem
#!/usr/bin/env jruby
require 'rubygems'
require 'spoon'
APPNAME = 'fileserver'
WORK_PATH = Dir.pwd
EXEC = "#{ENV['HOME']}/.rbenv/shims/puma"
PID_PATH = "#{WORK_PATH}/log/#{APPNAME}.pid"
OUT_PATH = "#{WORK_PATH}/log/#{APPNAME}.out.log"
@mystix
mystix / install-elasticsearch-debian
Last active March 19, 2023 15:14 — forked from karussell/install-elasticsearch-debian
Install ElasticSearch on Debian
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
@colinsurprenant
colinsurprenant / Gemfile
Created June 12, 2012 20:43
Raad simple JRuby service example with Sinatra and Puma
source :rubygems
gem 'raad'
gem 'puma'
gem 'sinatra'
@samnang
samnang / rails31init.md
Created September 3, 2011 16:27 — forked from docwhat/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Simple Form, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile