Skip to content

Instantly share code, notes, and snippets.

@sr75
sr75 / vagrant.org
Created January 24, 2013 20:34 — forked from akiatoji/vagrant.org

Installing CentOS

Download net install iso: CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
  • Version: Red Hat
@sr75
sr75 / wordpress-htaccess-rewrite
Created December 27, 2012 16:03
wordpress htaccess rewrite to subfolder of install
# BEGIN Custom
Options -Indexes
RewriteEngine On
RewriteCond $1 !^wordpress/
RewriteRule ^(.*)$ wordpress/$1 [L]
# END Custom
# 4 workers is enough for our app
worker_processes 4
# App location
@app = "/var/rails/myapp/current"
# Listen on fs socket for better performance
listen "#{@app}/tmp/sockets/unicorn.sock", :backlog => 64
# Nuke workers after 30 seconds instead of 60 seconds (the default)
@sr75
sr75 / Gemfile
Created July 25, 2012 01:36 — forked from flomotlik/Gemfile
Unicorn config for cedar stack on Heroku.
gem 'unicorn'
@sr75
sr75 / 0. nginx_setup.sh
Created July 25, 2012 01:46 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn (production-ready setup)
# Nginx optimal congifuration guide.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.2.tar.gz
$ tar xzvf ./nginx-1.2.2.tar.gz && rm -f ./nginx-1.2.2.tar.gz
$ wget http://zlib.net/zlib127.zip
@sr75
sr75 / Gemfile
Created April 11, 2012 16:06
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@sr75
sr75 / create-mysql-app-user-example.sql
Created April 4, 2012 20:58
create mysql app user example
CREATE USER 'sysadmin'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `appname_environment`.* TO 'sysadmin'@'localhost';
@sr75
sr75 / centos6-barebones-vps-rails-server-walkthrough
Last active October 2, 2015 12:38
centos6-barebones-vps-rails-server-walkthrough (rvm, nginx, mysql, memcached)
# CentOS 6.4 barebones walkthrough guide for a new vps rails server instance
# assumes you already have a personal ssh key locally
#
# script implements the following security approaches:
# disables root login
# configures ssh setup for deployer user
# opens up standard ports
#
# setup includes:
# rvm & ruby-1.9.3-p429
@sr75
sr75 / parse_decimal_from_string.rb
Created March 21, 2012 13:37
parse decimal from string example method
def parse_decimal_from_string(value)
value.scan(/[-+]?\d*\.?\d+/).join('')
end
@sr75
sr75 / rvm-quick-setup.txt
Created March 14, 2012 13:55
rvm quick setup examples
# from your user dir
cd
# create or update .bash_profile
touch .bash_profile
# Install RVM: (https://rvm.io/rvm/install/)
curl -L get.rvm.io | bash -s stable