This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const replace = require('gulp-replace'); | |
gulp.task('copy:index', ['clean'], function() { | |
gulp.src(['index.html']) | |
.pipe(replace(/node_modules(.*)\/(.*).js/g, 'lib/$2.js')) | |
.pipe(gulp.dest('dist')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = user and range key = datetime | |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
exports.handler = function(event, context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = user and range key = datetime | |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
exports.handler = function(event, context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo lvcreate -l 100%FREE -n riak-data ubuntu-vg | |
sudo mkfs.ext4 /dev/ubuntu-vg/riak-data | |
sudo mkdir -p /riak-data/riak | |
echo "/dev/ubuntu-vg/riak-data /riak-data ext4 default 0 0" | sudo tee -a /etc/fstab | |
sudo mount -a | |
sudo ln -s /riak-data/riak /var/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install -y xfsprogs | |
sudo lvcreate -l 100%FREE -n riak-data ubuntu-vg | |
sudo mkfs.xfs /dev/ubuntu-vg/riak-data | |
sudo mkdir /riak-data | |
echo "/dev/ubuntu-vg/riak-data /riak-data xfs noatime 0 0" | sudo tee -a /etc/fstab | |
sudo mount -a | |
sudo ln -s /riak-data/riak /var/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install haproxy | |
echo " | |
listen riak 0.0.0.0:8087 | |
balance leastconn | |
mode tcp | |
option tcplog | |
option contstats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
cat >sysctl.conf <<END_OF_FILE | |
vm.swappiness = 0 | |
net.ipv4.tcp_max_syn_backlog = 40000 | |
net.core.somaxconn=4000 | |
net.ipv4.tcp_timestamps = 0 | |
net.ipv4.tcp_sack = 1 | |
net.ipv4.tcp_window_scaling = 1 | |
net.ipv4.tcp_fin_timeout = 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) 2010 Yahoo! Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you | |
* may not use this file except in compliance with the License. You | |
* may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# Make sure the Riak cluster is stopped | |
sudo /usr/sbin/riak stop | |
# Change IP from 127.0.0.1 to whatever the eth0 ip is | |
my_ip=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'` | |
sed -i -e "s|127.0.0.1|$my_ip|" /etc/riak/app.config | |
sed -i -e "s|127.0.0.1|$my_ip|" /etc/riak/vm.args | |
# Get rid of old info that is stored on the node | |
sudo rm -rf /var/lib/riak/ring/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
# Riak install and config script snippets | |
# http://docs.basho.com/riak/latest/ops/building/installing/debian-ubuntu/ | |
# http://docs.basho.com/riak/latest/tutorials/installation/Installing-on-RHEL-and-CentOS/ | |
if which dpkg &> /dev/null; then | |
curl http://apt.basho.com/gpg/basho.apt.key | sudo apt-key add - | |
sudo bash -c "echo deb http://apt.basho.com $(lsb_release -sc) main > /etc/apt/sources.list.d/basho.list" | |
sudo apt-get update |
NewerOlder