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
ROOT_UID=0 #Root has $UID 0
if [ $UID != $ROOT_UID ]
then
echo -e "Insufficient privileges!"
exit 1
fi
echo "Adding required PPAs..."
add-apt-repository -y ppa:webupd8team/java
apt-get update
echo "Installing Java..."
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
apt-get -y install oracle-java6-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/juno/SR2/eclipse-jee-juno-SR2-linux-gtk-x86_64.tar.gz
cd /opt
tar -zxf ~/Downloads/eclipse-jee-juno-SR2-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 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 CCM..."
mkdir ccm
cd ccm
git init
git pull https://github.com/pcmanus/ccm.git
./setup.py install
cd ~
echo "Customizing Launcher..."
rm /usr/share/applications/ubuntu-amazon-default.desktop
rm /usr/share/applications/UbuntuOneMusiconeubuntucom.desktop
rm /usr/share/applications/ubuntuone-installer.desktop
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