Skip to content

Instantly share code, notes, and snippets.

View ihassin's full-sized avatar
🏠
Working from home

Itamar Hassin ihassin

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ihassin on github.
  • I am itamar (https://keybase.io/itamar) on keybase.
  • I have a public key ASDrmzdPARW675_0HGog-jOPjeSuvIeG39Fl9XVs54PNAAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ihassin on github.
  • I am itamarhassin (https://keybase.io/itamarhassin) on keybase.
  • I have a public key whose fingerprint is 6ADD D726 34EC B42A 5F5C 58D9 4F1E 1B5A F429 72E5

To claim this, I am signing this object:

@ihassin
ihassin / .my.cnf
Created March 6, 2014 21:13
Relevant section of the mySQL .my.cnf file
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
user=root
password={{mysql_root_password}}
@ihassin
ihassin / production.rb
Created December 24, 2013 00:31
config/deploy/production.rb - Capistrano file to deploy
set :stage, :production
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
role :app, %w{deploy@33.33.33.33}
role :web, %w{deploy@33.33.33.33}
role :db, %w{deploy@33.33.33.33}
@ihassin
ihassin / dbserver.yml
Created December 24, 2013 00:17
Ansible script to install mySQL
- hosts: webservers
user: vagrant
sudo: true
vars_files:
- vars.yml
tasks:
- name: Install MySQL
action: apt pkg=$item state=installed
with_items:
@ihassin
ihassin / deploy.rb
Created December 24, 2013 00:11
Capistrano 3 script to deploy the app
set :application, '<APP_NAME>'
set :repo_url, "<git@PATH/REPO.git>"
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, "/home/deploy/rails/<APP_NAME>"
# set :scm, :git
set :format, :pretty
set :log_level, :debug
@ihassin
ihassin / project.yml
Last active December 31, 2015 09:39
Ansible project.yml playbook for blog post
- hosts: webservers
user: deploy
vars_files:
- vars.yml
tasks:
- name: Make directory for database.yml
shell: mkdir -p {{home_dir}}/rails/narui/shared/config
- name: Copy database.yml
- hosts: webservers
user: vagrant
vars_files:
- vars.yml
tasks:
- name: Download ruby
get_url: "url={{ruby_url}} dest={{ruby_dir}}/ruby-{{ project_ruby }}.tar"
- name: Extract ruby
@ihassin
ihassin / webserver.yml
Last active December 31, 2015 09:39
Ansible webserver.yml playbook used in the blog post
- hosts: webservers
user: vagrant
sudo: True
vars_files:
- vars.yml
vars:
deploy: deploy
home_dir: /home/deploy
tasks:
@ihassin
ihassin / vars.yml
Last active December 31, 2015 09:39
Vars.yml used in the blog post
---
app_name: <APP_NAME>
# created with:
# python -c 'import crypt; print crypt.crypt("<PASS>", "SomeSaltedValue")'
password: SosJkZOQixRak
mysql_root_password: <PASS>
home_dir: "/home/deploy"
repo: <PATH_TO_REPO>
project_ruby: 2.0.0-p353