Skip to content

Instantly share code, notes, and snippets.

View bugra-derre's full-sized avatar

Bugra bugra-derre

View GitHub Profile
@bugra-derre
bugra-derre / install_erlang
Last active December 20, 2015 15:39
Installing Erlang on Linux
#!/bin/bash -ex
#Update repositories
sudo apt-get update
#Use this command to install the required dependency packages:
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev fop xsltproc unixodbc-dev
#To install packages for graphics support, use this command:
sudo apt-get install libwxbase2.8 libwxgtk2.8-dev libqt4-opengl-dev
@bugra-derre
bugra-derre / install_riak
Created August 5, 2013 14:53
Installing Riak on Debian and Ubuntu
#!/bin/bash -ex
# Riak install and config script snippets
# For Ubuntu
# http://docs.basho.com/riak/latest/tutorials/installation/Installing-on-Debian-and-Ubuntu/
# 1. First you must get the signing key.
curl http://apt.basho.com/gpg/basho.apt.key | sudo apt-key add -
# 2. Then add the Basho repository to your apt sources list (and update them).
@bugra-derre
bugra-derre / configure_limits
Created August 6, 2013 12:43
Open Files Limit for Riak in Ubuntu
#!/bin/bash -ex
cat >limits.conf <<END_OF_FILE
* soft nofile 32768
* hard nofile 32768
root soft nofile 32768
root hard nofile 32768
* soft memlock unlimited
* hard memlock unlimited
root soft memlock unlimited
#Stop the Riak node
sudo riak stop
#Delete the directory ring/ in your Riak data directory
sudo rm -r /var/lib/riak/ring
#Change the Node Name
sudo nano /etc/riak/vm.args #Change {-name riak@aaa.bbb.c.dd to correct IP address}
#Change the HTTP and Protocol Buffers binding address
@bugra-derre
bugra-derre / rsync_ycsb_results
Created August 15, 2013 14:17
rsync with YCSB node
rsync -ae ssh ubuntu@192.168.75.237:/home/ubuntu/results/* /home/bugra/Results
#!/bin/bash -ex
# Stop the Riak node
service riak stop
# Change standard IP to the Riak node's eth0 IP
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 -ire "s/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\"\, 8087/$my_ip\"\, 8087/g" /etc/riak/app.config
sed -ire "s/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\"\, 8098/$my_ip\"\, 8098/g" /etc/riak/app.config
sed -ire "s/\-name riak\@[0-9]*(\.[0-9]*){3}/\-name riak\@$my_ip/" /etc/riak/vm.args
#Install Python Easy Tools
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.5.tar.gz
sudo tar -xzvf setuptools-1.1.5.tar.gz
cd setuptools-1.1.5/
sudo python ez_setup.py
#Install AWS CLI
sudo easy_install awscli
@bugra-derre
bugra-derre / awscli_setup.sh
Created September 18, 2013 15:57
Has to be called with parameters for the AWS access id and the AWS secret key. Call will create a static S3 bucket in s3://edu.kit.aifb.eorg.distbench. A call may look like this: sudo bash awscli_setup.sh AKJXA5JA gSGIBoFiIc
#Set up AWS CLI
sudo mkdir /home/ubuntu/.aws
#Write configuration file
cat > /home/ubuntu/.aws/config << EOL
[default]
aws_access_key_id = $1
aws_secret_access_key = $2
region = us-east-1
EOL
# Example of how a file is copied to S3
# aws s3 cp test.txt s3://edu.kit.aifb.eorg.distbench/test2.txt
#The routine has to be defined
@bugra-derre
bugra-derre / install_java_from_url.sh
Created October 29, 2013 10:36
Install Java from a URL
#!/usr/bin/env bash -ex
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
# http://www.apache.org/licenses/LICENSE-2.0