Skip to content

Instantly share code, notes, and snippets.

@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 July 25, 2012 01:36 — forked from flomotlik/Gemfile
Unicorn config for cedar stack on Heroku.
gem 'unicorn'
@sr75
sr75 / my.cnf.txt
Created June 6, 2012 22:59
mysql-innodb-large-server-example-configuration
# *** Application-specific options follow here ***
#
# The MySQL server
#
[mysqld]
# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
@sr75
sr75 / .gitconfig
Last active October 24, 2019 21:17
gitconfig for git v1.8+ with terminal color and command aliases
[user]
name = yourname
email = yourname @ whatever
[core]
excludesfile = yourhomedir/.gitignore
#git config --global core.eol lf
#git config --global core.autocrlf input
eol = lf
autocrlf = input
#git rm -rf --cached .
@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 / run-ie-7-8-9-virtualbox-on-osx.txt
Created March 15, 2012 13:52
Run IE 7, 8, and 9 in Mac OS X
# the admin password for all of the IE VMs is “Password1″ without the quotes, it's also used for the password hints
1) Install VirtuaBox on your mac
http://download.virtualbox.org/virtualbox/4.1.10/VirtualBox-4.1.10-76795-OSX.dmg
2) Decide which versions of Internet Explorer you want to download and install – each version of Internet Explorer is contained within a separate virtual machine that runs within VirtualBox. In other words, if you want to run Internet Explorer 7, 8, and 9, you will need to download three separate VM’s, which may take a while so keep that in mind. Select the text below and copy it:
# Install ALL versions of Internet Explorer: IE 7, IE 8, and IE 9 (for now this script will also pull down a IE 6 vm with windows xp)
@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