Skip to content

Instantly share code, notes, and snippets.

View avtar's full-sized avatar

Avtar Gill avtar

  • Inclusive Design Research Centre
  • Toronto, Canada
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ansible_vars = YAML.load_file('provisioning/vars.yml')
app_name = ansible_vars["nodejs_app_name"]
app_directory = ansible_vars["nodejs_app_install_dir"]
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ansible_vars = YAML.load_file('provisioning/vars.yml')
app_name = ansible_vars["nodejs_app_name"]
app_directory = ansible_vars["nodejs_app_install_dir"]
---
- hosts: localhost
user: root
tasks:
- name: Install nginx
dnf:
name: nginx
state: latest
@avtar
avtar / build-gpii.ps1
Last active December 2, 2015 17:30
Set up the GPII framework on Windows 8.1
# The build process will fail if an empty 'universal' directory exists
$strFolderName="c:\vagrant\node_modules"
If (Test-Path $strFolderName){
Remove-Item -Recurse -Force -ErrorAction 0 $strFolderName
}
# Use ASCII characters for the npm tree drawing
$env:npm_config_unicode = "false"
# Build GPII
---
- hosts: localhost
user: root
vars_files:
- vars.yml
pre_tasks:
- include_vars: secrets.yml
ignore_errors: yes
# Jumbo frames are enabled on the compute nodes and switches in the cluster
# so we are able to utilize more bandwidth at the VM level by increasing
# the ethernet frame payload size to 9000 bytes
ifconfig eth0 mtu 9000
# Increase the transmit queue length
ifconfig eth0 txqueuelen 10000
# Increase the receive and send buffers to 16MB
net.core.rmem_max=16777216
@avtar
avtar / couchdb.conf
Created October 2, 2013 20:19
Nginx reverse proxy config for CouchDB, taking master-master replication into account
upstream couchdb_servers {
server couchdb1:5984 max_fails=0 fail_timeout=10s;
server couchdb2:5984 max_fails=0 fail_timeout=10s;
}
location / {
proxy_pass http://couchdb_servers:5984;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@avtar
avtar / couchdb replication command
Created October 10, 2013 01:43
Trigger replication of a database
curl \
-H "Content-Type: application/json" \
-X POST http://admin:password@localhost:5984/_replicate \
-d '{"source":"http://couchdb-rw1:5984/user", "target":"http://admin:password@127.0.0.1:5984/user", "create_target": true, "continuous":true}'
[
{
"sha": "718b599668e2350966a7a002ba776fe6c798ac2a",
"commit": {
"author": {
"name": "Kasper Markus",
"email": "kasper2@markus.dk",
"date": "2016-03-30T12:34:49Z"
},
"committer": {
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ansible_vars = YAML.load_file('provisioning/vars.yml')
app_name = "couchdb"
app_directory = "/home/vagrant/sync"