Skip to content

Instantly share code, notes, and snippets.

@tonypiazza
Last active December 16, 2015 04:59
Show Gist options
  • Save tonypiazza/5380980 to your computer and use it in GitHub Desktop.
Save tonypiazza/5380980 to your computer and use it in GitHub Desktop.
A BASH script to setup everything we need for a Cassandra development machine with Ubuntu Desktop.
#!/bin/bash
# Script written by Tony Piazza (https://gist.github.com/tonypiazza)
# make sure we have sufficient privileges
if [ $UID != 0 ]
then
echo -e "Insufficient privileges!"
exit 1
fi
echo "-----> Adding required PPAs..."
add-apt-repository -y ppa:webupd8team/java
apt-get update
echo "-----> Downloading Cassandra..."
wget -P ~/Downloads http://mirror.cc.columbia.edu/pub/software/apache/cassandra/2.0.2/apache-cassandra-2.0.2-bin.tar.gz
echo "-----> Installing Java..."
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
apt-get -y install oracle-java7-installer
echo "-----> Installing Eclipse..."
eclipse_bin="#!/bin/sh
export ECLIPSE_HOME='/opt/eclipse'
\$ECLIPSE_HOME/eclipse \$*"
eclipse_desktop="[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true"
wget -P ~/Downloads http://mirror.cc.columbia.edu/pub/software/eclipse/technology/epp/downloads/release/kepler/SR1/eclipse-jee-kepler-SR1-linux-gtk-x86_64.tar.gz
cd /opt
tar -zxf ~/Downloads/eclipse-jee-kepler-SR1-linux-gtk-x86_64.tar.gz
touch /usr/bin/eclipse
chmod 755 /usr/bin/eclipse
echo -e "$eclipse_bin" | tee /usr/bin/eclipse
echo -e "$eclipse_desktop" | tee /usr/share/applications/eclipse.desktop
cd
echo "-----> Installing Ant..."
apt-get -y install ant
echo "-----> Installing LibYAML..."
wget -P ~/Downloads http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -zxf ~/Downloads/yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure
make
make install
cd
echo "-----> Installing python-dev..."
apt-get -y install python-dev
echo "-----> Installing PyYAML..."
wget -P ~/Downloads http://pyyaml.org/download/pyyaml/PyYAML-3.10.tar.gz
tar -zxf ~/Downloads/PyYAML-3.10.tar.gz
cd PyYAML-3.10
python setup.py --with-libyaml install
cd
echo "-----> Installing JNA..."
apt-get -y install libjna-java
echo "-----> Installing CCM..."
cd /opt
mkdir ccm
cd ccm
git init
git pull https://github.com/pcmanus/ccm.git
./setup.py install
cd
echo "-----> Reinstalling VMware Tools..."
apt-get -y autoremove
apt-get -y install build-essential linux-headers-`uname -r` psmisc
vmware-config-tools.pl -d
echo "-----> Installation completed in $SECONDS seconds."
@tonypiazza
Copy link
Author

Here are the steps I need to take on a newly installed machine with Ubuntu Desktop:

sudo apt-get -y install git
git init
git pull https://gist.github.com/5380980.git
chmod +x setup-cassandra-dev.sh
sudo ./setup-cassandra-dev.sh
ccm create casdev2 -v git:cassandra-2.0.2

@polandll
Copy link

Nice Tony! I'll see about modding your script for dse.

Lorina

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment