Skip to content

Instantly share code, notes, and snippets.

View seyhunak's full-sized avatar
🏆
Winning The Life

Seyhun Akyürek seyhunak

🏆
Winning The Life
View GitHub Profile
# /etc/nginx/mime.types
# Global Nginx mime.types file
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
function rbenvsudo(){
executable=$1
shift 1
sudo $(rbenv which $executable) $*
}
@seyhunak
seyhunak / faye.rb
Created December 20, 2013 15:42 — forked from tmcallister/faye.rb
FAYE_TOKEN = 'secretToken'
if defined? Rails
if Rails.env == 'development'
FAYE_URI = "http://#{APP_CONFIG[:nameremoved_service][:host]}:9292/faye"
else
FAYE_URI = "https://#{APP_CONFIG[:nameremoved_service][:host]}/faye"
end
@seyhunak
seyhunak / gist:7856628
Last active December 30, 2015 16:48 — forked from pithyless/gist:1208841
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

You started mongodb server, but No matter what. However, when you run sudo status mongodb again, you’ll get
mongodb stop/waiting instead of mongodb start/running
Note: This condition is largely due to an unclean shutdown, and results in the creation of a lockfile /var/lib/mongodb/mongod.lock.
The fix is a quick two-step process as follows:
Remove the lockfile.
Run the repair script.
This is accomplished as follows:
@seyhunak
seyhunak / Gemfile
Created November 7, 2013 12:19 — forked from cblunt/Gemfile
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
# adapted from bin/sidekiq
# to invoke, run: zeus runner sidekiq.rb
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
cli.run
rescue => e
@seyhunak
seyhunak / README.md
Created March 20, 2013 13:36 — forked from juno/README.md

Install rbenv and ruby-build to Amazon Linux (cloud-init).

  1. Copy & paste content of user-data.sh to EC2 RunInstances user-data
  2. Then, logging in to EC2 instance as ec2-user and run install-ruby.sh.
require 'active_record'
require 'fileutils'
namespace :db do
desc "loads database configuration in for other tasks to run"
task :load_config do
ActiveRecord::Base.configurations = db_conf
ActiveRecord::Base.establish_connection db_conf
end
# First, make sure that you have the most recent rvm. Several bugs with 2.0.0-preview1
# have recently been fixed.
#
# Second, the openssl that comes with MacOS is too old for Ruby 2.0. You need to install
# a newer one with homebrew or the rvm pkg command.
# Option 1, with homebrew openssl:
brew update
brew install openssl