Posts Tagged ‘64-bit’

# .R script showing capabilities of sparklyr R package
# Prerequisites before running this R script: 
# Ubuntu 16.04.3 LTS 64-bit, r-base (version 3.4.1 or newer), 
# RStudio 64-bit version, libssl-dev, libcurl4-openssl-dev, libxml2-dev
install.packages("httr")
install.packages("xml2")
# New features in sparklyr 0.6:
# https://blog.rstudio.com/2017/07/31/sparklyr-0-6/
install.packages("sparklyr")
install.packages("dplyr")
install.packages("ggplot2")
install.packages("tidyr")
library(sparklyr)
library(dplyr)
library(ggplot2)
library(tidyr)
set.seed(100)
# sparklyr cheat sheet: https://github.com/rstudio/cheatsheets/raw/master/source/pdfs/sparklyr.pdf
# dplyr+tidyr: https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf
# sparklyr currently (2017-08-19) only supports Apache Spark version 2.2.0 or older
# Install Spark locally:
sc_version <- "2.2.0"
spark_install(sc_version)
config <- spark_config()
# number of CPU cores to use:
config$spark.executor.cores <- 6
# amount of RAM to use for Apache Spark executors:
config$spark.executor.memory <- "4G"
# Connect to local version:
sc <- spark_connect (master = "local",
 config = config, version = sc_version)
# Copy data to Spark memory:
import_iris <- sdf_copy_to(sc, iris, "spark_iris", overwrite = TRUE) 
# partition data:
partition_iris <- sdf_partition(import_iris,training=0.5, testing=0.5) 
# Create a hive metadata for each partition:
sdf_register(partition_iris,c("spark_iris_training","spark_iris_test")) 
# Create reference to training data in Spark table
tidy_iris <- tbl(sc,"spark_iris_training") %>% select(Species, Petal_Length, Petal_Width) 
# Spark ML Decision Tree Model
model_iris <- tidy_iris %>% ml_decision_tree(response="Species", features=c("Petal_Length","Petal_Width")) 
# Create reference to test data in Spark table
test_iris <- tbl(sc,"spark_iris_test") 
# Bring predictions data back into R memory for plotting:
pred_iris <- sdf_predict(model_iris, test_iris) %>% collect
pred_iris %>%
 inner_join(data.frame(prediction=0:2,
 lab=model_iris$model.parameters$labels)) %>%
 ggplot(aes(Petal_Length, Petal_Width, col=lab)) +
 geom_point() 
spark_disconnect(sc)
# how to compile and install newest version of 
# proftpd 
# in Ubuntu 16.04 LTS 64-bit:
sudo apt-get update
sudo apt-get install checkinstall build-essential
sudo apt-get build-dep proftpd-dfsg proftpd-basic 
sudo apt-get purge proftpd-basic
cd
sudo rm -rf proftpd
git clone https://github.com/proftpd/proftpd
cd proftpd
sudo ./configure
sudo make clean
sudo make
sudo checkinstall
# type 3 and hit  to enter 1.3.5b as the software version
apt-cache show proftpd
# Terminal output of 'apt-cache show proftpd' should be similar to this:
# Package: proftpd
# Status: install ok installed
# Priority: extra
# Section: checkinstall
# Installed-Size: 8492
# Maintainer: root
# Architecture: amd64
# Version: 1.3.5b-1
# Provides: proftpd
# Description: Package created with checkinstall 1.6.2
# Description-md5: 556b8d22567101c7733f37ce6557412e
# how to compile and install newest version of 
# picocom (Minimal dumb-terminal emulation program) 
# in Ubuntu 16.04 LTS 64-bit:
sudo apt-get update
sudo apt-get install checkinstall build-essential
sudo apt-get build-dep picocom
sudo apt-get purge picocom
cd
sudo rm -rf picocom
git clone https://github.com/npat-efault/picocom
cd picocom
sudo make clean
sudo make
sudo cp picocom /usr/bin
picocom --help |head -n 2
# the previous command should show picocom version 2.3a or higher
# How to fix SSL "certificate verify failed" error making it impossible to pull data from 'https://rubygems.org/ in Ubuntu 16.04 LTS 64-bit# 
# This bash script will make it possible to use the "sudo gem install <package>" command
# For example: sudo gem install tenancy   will work after running this script
sudo apt-get update
sudo apt-get install ruby
sudo update-ca-certificates
sudo gem sources -r https://rubygems.org/
sudo gem sources -a http://rubygems.org/
sudo gem update --system
sudo gem sources -r http://rubygems.org/
sudo gem sources -a https://rubygems.org/
sudo gem install tenancy
# Livestreamer Twitch GUI - A multi platform Twitch.tv browser for Livestreamer
# bash install script
sudo apt-get update
sudo apt-get install livestreamer x11-utils xdg-utils git
cd
sudo rm -rf livestreamer-twitch-gui
git clone https://github.com/bastimeyer/livestreamer-twitch-gui.git
cd livestreamer-twitch-gui/
sudo npm install -g grunt bower grunt-cli
npm install qunit phantomjs
npm update
bower install
grunt release
grunt
# the grunt command replaces the use of the following command:
# ~/livestreamer-twitch-gui/build/releases/livestreamer-twitch-gui/linux64/livestreamer-twitch-gui
# How to compile and install ChucK Music Programming Language (http://chuck.stanford.edu/) from source code (via Github) in Ubuntu 16.04 LTS 64-bit:
cd
sudo apt-get update
sudo apt-get purge chuck
sudo apt-get install pulseaudio aptitude curl cmake git checkinstall build-essential  git-core
sudo apt-get build-dep chuck
sudo rm -rf chuck
git clone https://github.com/ccrma/chuck.git
cd ~/chuck/src
sudo make linux-alsa
sudo checkinstall
# during the checkinstall process, press 2 to change the name from "src" to "chuck"
apt-cache show chuck
# Terminal output should look like this:
# Package: chuck
# Status: install ok installed
# Priority: extra
# Section: checkinstall
# Installed-Size: 2104
# Maintainer: root
# Architecture: amd64
# Version: 20160612-1
# Provides: src
# Description: Package created with checkinstall 1.6.2
# Description-md5: 556b8d22567101c7733f37ce6557412e
# How to compile and install root data analysis framework from source code (via Github) in Ubuntu 14.04 LTS 64-bit:
# Please run the following Terminal commands ONE LINE AT A TIME manually in bash shell
# The following commands CANNOT be successfully run using a bash script due to the way the privilege escalation occurs!
cd
sudo apt-get update
sudo apt-get build-dep root-system
sudo apt-get install aptitude curl cmake git checkinstall build-essential  git-core 
sudo aptitude install libafterimage-dev  freeglut3-dev    libftgl-dev    libgl1-mesa-dev   libglew-dev    libglu1-mesa-dev libnet-dev libroot-net-dev
sudo aptitude install  libiodbc2-dev   libqt4-opengl-dev mesa-common-dev  libdrm-dev  libiodbc2  libdrm-intel1 libxpm-dev libxft-dev
sudo rm -rf root
git clone http://root.cern.ch/git/root.git
cd root
sudo ./configure
sudo make
# use the following command to speed up the compilation process if you are using an 8-core CPU:
#sudo make -j8
sudo su
source bin/thisroot.sh
export ROOTSYS=/home/`logname`/root
checkinstall 
# during checkinstall process, press 3 and manually change 'Version' to 20160602
apt-cache show root
ln -s $ROOTSYS/bin/root  /usr/bin/root
# exit the bash shell session, open a new Terminal window and run the following Terminal command to start the root data analysis framework:
root