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_ros_kinetic_on_ubuntu.sh
Last active December 22, 2020 02:24
Install ROS on Ubuntu, either for Ubuntu Desktop or Ubuntu Server.
#!/bin/bash
# -------------------------------------------------------------------------
# [Bugra] install_ros_kinetic_on_ubuntu.sh
# An installation script to install ROS on top of Ubuntu Xenial.
# -------------------------------------------------------------------------
doTheInstallation() {
# setup my sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# set up your keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# cd your workspace directory
git init
git remote add <remote_url_name> <your_remote_url>
@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
# 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 / 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
#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
#!/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
@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
#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 / 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