<commit_before>#!/bin/bash
# Author : <EMAIL>
# Site : www.h3manth.com
# This script helps to setup diaspora.
#

# Set extented globbing 
shopt -s extglob

# Check if the user has sudo privileges.
[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1

# Install build tools 
echo "Installing build tools.."
sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2
echo "..Done installing build tools"

# Install Ruby 1.8.7 
echo "Installing ruby-full Ruby 1.8.7.." 
sudo apt-get -y --no-install-recommends install ruby-full
echo "..Done installing Ruby"

# Install Rake 
echo "Installing rake.."
sudo apt-get -y  --no-install-recommends install rake
echo "..Done installing rake"

# Get the current release and install mongodb
lsb=$(lsb_release -rs)
ver=${lsb//.+(0)/.}
repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen"
echo "Setting up MongoDB.."
echo "."
echo ${repo} | sudo tee -a /etc/apt/sources.list
echo "."
echo "Fetching keys.."
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "."
sudo apt-get  update
echo "."
sudo apt-get -y  --no-install-recommends install mongodb-stable
echo "Done installing monngodb-stable.."

# Install imagemagick
echo "Installing imagemagick.."
sudo apt-get -y --no-install-recommends install imagemagick libmagick9-dev
echo "Installed imagemagick.."

# Install git-core
echo "Installing git-core.."
sudo apt-get -y --no-install-recommends install git-core
echo "Installed git-core.."

# Setting up ruby gems
echo "Fetching and installing ruby gems.."
(
    echo "."
    cd /tmp 
    wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
    echo "."
    tar -xf rubygems-1.3.7.tgz
    echo "."
    cd rubygems-1.3.7
    echo "."
    sudo ruby setup.rb
    echo "."
    sudo ln -s /usr/bin/gem1.8 /usr/bin/gem 
    echo "."    
) 
echo "Done installing the gems.."

# Install blunder
echo "Installing blunder.."
sudo gem install bundler
echo "Installed blunder.."

# Take a clone of Diaspora
(
echo "Clone diaspora source.."
git clone http://github.com/diaspora/diaspora.git
echo "Cloned the source.."
# Install extra gems 
cd diaspora
echo "Installing more gems.."
sudo bundle install
echo "Installed."

# Install DB setup 
echo "Seting up DB.."
rake db:seed:tom
echo "DB ready. Login -> tom and password -> <PASSWORD>. More details ./diaspora/db/seeds/tom.rb."

# Run appserver 
echo "Starting server"
bundle exec thin start 
)
<commit_msg>ubuntu-setup.bash: for rubygems, use maverick's repo or if lucid use ppa or if old use tarball. create /var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games-friendly symlink if using debs<commit_after>#!/bin/bash
# Author : <EMAIL>
# Site : www.h3manth.com
# This script helps to setup diaspora.
#

# Set extented globbing 
shopt -s extglob

# Check if the user has sudo privileges.
[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1

# Install build tools 
echo "Installing build tools.."
sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2
echo "..Done installing build tools"

# Install Ruby 1.8.7 
echo "Installing ruby-full Ruby 1.8.7.." 
sudo apt-get -y --no-install-recommends install ruby-full
echo "..Done installing Ruby"

# Install Rake 
echo "Installing rake.."
sudo apt-get -y  --no-install-recommends install rake
echo "..Done installing rake"

# Get the current release and install mongodb
lsb=$(lsb_release -rs)
ver=${lsb//.+(0)/.}
repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen"
echo "Setting up MongoDB.."
echo "."
echo ${repo} | sudo tee -a /etc/apt/sources.list
echo "."
echo "Fetching keys.."
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "."
sudo apt-get  update
echo "."
sudo apt-get -y  --no-install-recommends install mongodb-stable
echo "Done installing monngodb-stable.."

# Install imagemagick
echo "Installing imagemagick.."
sudo apt-get -y --no-install-recommends install imagemagick libmagick9-dev
echo "Installed imagemagick.."

# Install git-core
echo "Installing git-core.."
sudo apt-get -y --no-install-recommends install git-core
echo "Installed git-core.."

# Setting up ruby gems
echo "Fetching and installing ruby gems.."
(
    RELEASE=$(lsb_release -c | cut -f2)
    if [ RELEASE == "maverick" ]
	then
    	sudo apt-get install --no-install-recommends -y rubygems
		sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH
	elsif [ RELEASE == "lucid" ]
    then
        sudo add-apt-repository ppa:maco.m/ruby
        sudo apt-get update
    	sudo apt-get install --no-install-recommends -y rubygems
		sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH
	else
		# Old version
		echo "."
		cd /tmp 
		wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
		echo "."
		tar -xf rubygems-1.3.7.tgz
		echo "."
		cd rubygems-1.3.7
		echo "."
		sudo ruby setup.rb
		echo "."
		sudo ln -s /usr/bin/gem1.8 /usr/bin/gem 
		echo "."    
    fi  
) 
echo "Done installing the gems.."

# Install blunder
echo "Installing blunder.."
sudo gem install bundler
echo "Installed blunder.."

# Take a clone of Diaspora
(
echo "Clone diaspora source.."
git clone http://github.com/diaspora/diaspora.git
echo "Cloned the source.."
# Install extra gems 
cd diaspora
echo "Installing more gems.."
sudo bundle install
echo "Installed."

# Install DB setup 
echo "Seting up DB.."
rake db:seed:tom
echo "DB ready. Login -> tom and password -> <PASSWORD>. More details ./diaspora/db/seeds/tom.rb."

# Run appserver 
echo "Starting server"
bundle exec thin start 
)

{'fraction_non_alphanumeric': 0.13284132841328414, 'fraction_numerical': 0.012124406958355299, 'mean_word_length': 3.2288261515601784, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5171450', 'n_tokens_mistral': 2194, 'n_tokens_neox': 1963, 'n_words': 629}