Skip to content

Instantly share code, notes, and snippets.

@rahul100885
rahul100885 / issue.txt
Created April 26, 2012 14:28
macvim issue with brew doctor
brew doctor
Your system is raring to brew.
-------------------------------------------------------------------------------
brew install -v macvim
==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64
Already downloaded: /Library/Caches/Homebrew/macvim-7.3-64.tgz
/usr/bin/tar xf /Library/Caches/Homebrew/macvim-7.3-64.tgz
@rahul100885
rahul100885 / isssue
Created April 26, 2012 06:55
macvim installation issue
> brew install macvim
==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64
Already downloaded: /Library/Caches/Homebrew/macvim-7.3-64.tgz
==> ./configure --with-features=huge --with-tlib=ncurses --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-tclinterp
==> cd src/MacVim/icons && make getenvy
==> make
Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && make first
mkdir objects
@rahul100885
rahul100885 / bench1.rb
Created December 22, 2011 09:45
Benchmarking for uuid and hex(16)
require 'benchmark'
require 'securerandom'
Benchmark.bm(7) do |x|
x.report("UUID") { SecureRandom.uuid }
x.report("hex(16)") { SecureRandom.hex(16) }
end
#Output
require "benchmark"
val = (1..9).to_a
Benchmark.bm(7) do |x|
x.report("if:") {
val.each { |v|
if v == 9
a = 9
elsif v == 8
@rahul100885
rahul100885 / passenger_status.rb
Created October 31, 2011 09:42 — forked from dan-manges/passenger_status.rb
munin plugin for passenger
#!/usr/bin/env ruby
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions
max.label max processes
@rahul100885
rahul100885 / nginx.conf
Created October 14, 2011 08:33
Sample nginx file for web application with gzip and cache
user www-user;
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
@rahul100885
rahul100885 / redmine_heroku_deploy.sh
Created September 26, 2011 07:48
Deploy Redmine to Heroku
#!/bin/bash
set -e
REDMINE_URL="http://rubyforge.org/frs/download.php/75097/redmine-1.2.1.tar.gz"
S3_ACCESS_KEY_ID=""
S3_SECRET_ACCESS_KEY=""
S3_BUCKET_NAME=""
HEROKU_APP_NAME=""
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@rahul100885
rahul100885 / redis.conf
Created August 23, 2011 06:32
Configuration for redis
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@rahul100885
rahul100885 / nginx.conf
Created August 17, 2011 08:44
Nginx configuration for force https and www url
user deploy;
worker_processes 6;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7;