<commit_before>#!/bin/bash
# JDInstall

CODENAME="xenial"
RELEASE="16.04"
VERSION="JDInstall $CODENAME"
PINGSITE="www.google.com"

APP_OFFICIAL_REPOS="alacarte autofs build-essential bwm-ng calibre cmatrix compizconfig-settings-manager conky-all curl dconf-tools default-jdk dkms exfat-fuse exfat-utils faenza-icon-theme filezilla finch flashplugin-installer gdebi gimp git gnome-backgrounds gnome-commander gnome-gmail gnome-mplayer gnome-search-tool gnome-system-tools gnome-themes-standard gnome-tweak-tool gparted gthumb gtk-recordmydesktop gwakeonlan hardinfo hddtemp htop icedtea-plugin indicator-multiload inkscape inxi iotop jstest-gtk k3b libreoffice libsoil1 lm-sensors linux-headers-generic mc meld mercurial mplayer mumble nautilus-actions nautilus-dropbox nautilus-image-converter ncdu nfs-common nfs-kernel-server openjdk-8-jdk p7zip p7zip-full p7zip-rar pidgin powertop pavucontrol ppa-purge python-pip python-dev pwgen rar saidar silversearcher-ag sloccount skype smartmontools soundconverter sox subtitleeditor subversion synaptic synapse tagtool tig tofrodos tree ttf-mscorefonts-installer ubuntu-restricted-extras unity-tweak-tool unshield vdpau-va-driver vim vim-gtk vlc wakeonlan zlib1g-dev" #g15daemon tvtime me-tv eclipse texmaker texlive" #myunity ffmpeg synapse

APP_OTHER_REPOS="libdvdcss2 google-chrome-beta" # google-musicmanager-beta google-talkplugin indicator-sensors jdownloader  my-weather-indicator 


#if [[ `uname -m` == 'amd64' || `uname -m` == 'x86_64' ]]
#then
	#APP_OTHER_REPOS=$APP_OTHER_REPOS" g++-multilib"	
#fi

APPZ="$APP_OFFICIAL_REPOS $APP_OTHER_REPOS"

AUTOYES="--assume-yes"

case $TMPDIR in 
	'')
		tmp_dir="/tmp"
		;; 

	*)
		tmp_dir=$TMPDIR
		;;
esac

while getopts :ahvy PARAMETER
do
	case $PARAMETER in
		a)
		echo "List of the packages to install:"
		echo $APPZ
		exit 0
		;;
		h)
		echo "Uso: $0 [PARAMETER]"
		echo "If no parameter is specified, the script start the installation"
		echo "   -a		List of the packages to install"
		echo "   -h		Show this help text"
		echo "   -v		Show the version"
		echo ""
		echo "Issue tracker: https://github.com/leinardi/JDInstaller/issues"
		exit 0
		;;	
		v)
		echo $VERSION
		exit 0
		;;
		*)
		echo "Invalid parameter."
		echo ""
		$0 -h
		exit 1
		;;
	esac
done

lsb_release -c | grep -q $CODENAME 
if [[ $? -ne 0 ]]
then
	echo "This script can be used only with Ubuntu $RELEASE ($CODENAME)"
	echo ""
	echo "Distribution-specific information of your current installation:"
	lsb_release -d -c
	exit 1
fi


if [[ $EUID -ne 0 ]]
then
	echo "This script require root permission." 1>&2
	chmod 755 ./`basename $0`
	sudo ./`basename $0`
	exit 0
fi

function add_repo {
echo -n "Repository $1: "
if cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -q "$2"
then
	echo "Already added"
else
	echo "$2" >> /etc/apt/sources.list.d/$1.list
	#	echo "$2 #$1" >> /etc/apt/sources.list
	chmod 644 /etc/apt/sources.list.d/$1.list
	echo "Added"
	if [[ $# -gt 2 ]]
	then
		echo -n "Adding trusted key for $1: "
		wget -q -O - $3 | apt-key add -
		sleep 2
	fi
fi
}

function enable_repo {
if cat /etc/apt/sources.list | grep -q "# $2"
then
	echo -n "Enabling repository $1: "
	if eval $3
	then
		echo "OK"
	else
		echo "FAIL!"
	fi
else
	echo -n "Repository $1: "
	if cat /etc/apt/sources.list | grep -q "$2"
	then
		echo "Already enabled"
	else
		echo "$2 #$1" >> /etc/apt/sources.list
		echo "Enabled"
	fi
fi

}

PARTNER="deb http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SRC="deb-src http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SED='sed -i -e "s/# deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'
PARTNER_SRC_SED='sed -i -e "s/# deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'

BACKPORTS="deb http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SRC="deb-src http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SED='sed -i -e "s/# deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'
BACKPORTS_SRC_SED='sed -i -e "s/# deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'


VIDEOLAN="deb http://download.videolan.org/pub/debian/stable/ /"
VIDEOLAN_KEY="http://download.videolan.org/pub/debian/videolan-apt.asc"
SKYPE="deb http://download.skype.com/linux/repos/debian stable non-free"
DROPBOX="deb http://linux.dropbox.com/ubuntu $CODENAME main"
DROPBOX_SRC="deb-src http://linux.dropbox.com/ubuntu $CODENAME main"
VIRTUALBOX="deb http://download.virtualbox.org/virtualbox/debian $CODENAME contrib"
VIRTUALBOX_KEY="http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc"
#VBOX_USB="none /proc/bus/usb usbfs devgid=125,devmode=664 0 0"
GOOGLE_CHROME="deb http://dl.google.com/linux/chrome/deb/ stable main"
GOOGLE_MUSIC_MANAGER="deb http://dl.google.com/linux/musicmanager/deb/ stable main"
GOOGLE_TALKPLUGIN="deb http://dl.google.com/linux/talkplugin/deb/ stable main"
GOOGLE_KEY="https://dl-ssl.google.com/linux/linux_signing_key.pub"
GETDEB="deb http://archive.getdeb.net/ubuntu $CODENAME-getdeb apps"
GETDEB_KEY="http://archive.getdeb.net/getdeb-archive.key"

echo "List of packages to be installed:"
echo "$APPZ"
echo
read -p "Continuae [Y/n]? " yn<commit_msg>Removed skype from xenial and fixed chrome repo arch<commit_after>#!/bin/bash
# JDInstall

CODENAME="xenial"
RELEASE="16.04"
VERSION="JDInstall $CODENAME"
PINGSITE="www.google.com"

APP_OFFICIAL_REPOS="alacarte autofs build-essential bwm-ng calibre cmatrix compizconfig-settings-manager conky-all curl dconf-tools default-jdk dkms exfat-fuse exfat-utils faenza-icon-theme filezilla finch flashplugin-installer gdebi gimp git gnome-backgrounds gnome-commander gnome-gmail gnome-mplayer gnome-search-tool gnome-system-tools gnome-themes-standard gnome-tweak-tool gparted gthumb gtk-recordmydesktop gwakeonlan hardinfo hddtemp htop icedtea-plugin indicator-multiload inkscape inxi iotop jstest-gtk k3b libreoffice libsoil1 lm-sensors linux-headers-generic mc meld mercurial mplayer mumble nautilus-actions nautilus-dropbox nautilus-image-converter ncdu nfs-common nfs-kernel-server openjdk-8-jdk p7zip p7zip-full p7zip-rar pidgin powertop pavucontrol ppa-purge python-pip python-dev pwgen rar saidar silversearcher-ag sloccount smartmontools soundconverter sox subtitleeditor subversion synaptic synapse tagtool tig tofrodos tree ttf-mscorefonts-installer ubuntu-restricted-extras unity-tweak-tool unshield vdpau-va-driver vim vim-gtk vlc wakeonlan zlib1g-dev" #g15daemon tvtime me-tv eclipse texmaker texlive" #myunity ffmpeg synapse

APP_OTHER_REPOS="libdvdcss2 google-chrome-beta" # google-musicmanager-beta google-talkplugin indicator-sensors jdownloader  my-weather-indicator 


#if [[ `uname -m` == 'amd64' || `uname -m` == 'x86_64' ]]
#then
	#APP_OTHER_REPOS=$APP_OTHER_REPOS" g++-multilib"	
#fi

APPZ="$APP_OFFICIAL_REPOS $APP_OTHER_REPOS"

AUTOYES="--assume-yes"

case $TMPDIR in 
	'')
		tmp_dir="/tmp"
		;; 

	*)
		tmp_dir=$TMPDIR
		;;
esac

while getopts :ahvy PARAMETER
do
	case $PARAMETER in
		a)
		echo "List of the packages to install:"
		echo $APPZ
		exit 0
		;;
		h)
		echo "Uso: $0 [PARAMETER]"
		echo "If no parameter is specified, the script start the installation"
		echo "   -a		List of the packages to install"
		echo "   -h		Show this help text"
		echo "   -v		Show the version"
		echo ""
		echo "Issue tracker: https://github.com/leinardi/JDInstaller/issues"
		exit 0
		;;	
		v)
		echo $VERSION
		exit 0
		;;
		*)
		echo "Invalid parameter."
		echo ""
		$0 -h
		exit 1
		;;
	esac
done

lsb_release -c | grep -q $CODENAME 
if [[ $? -ne 0 ]]
then
	echo "This script can be used only with Ubuntu $RELEASE ($CODENAME)"
	echo ""
	echo "Distribution-specific information of your current installation:"
	lsb_release -d -c
	exit 1
fi


if [[ $EUID -ne 0 ]]
then
	echo "This script require root permission." 1>&2
	chmod 755 ./`basename $0`
	sudo ./`basename $0`
	exit 0
fi

function add_repo {
echo -n "Repository $1: "
if cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -q "$2"
then
	echo "Already added"
else
	echo "$2" >> /etc/apt/sources.list.d/$1.list
	#	echo "$2 #$1" >> /etc/apt/sources.list
	chmod 644 /etc/apt/sources.list.d/$1.list
	echo "Added"
	if [[ $# -gt 2 ]]
	then
		echo -n "Adding trusted key for $1: "
		wget -q -O - $3 | apt-key add -
		sleep 2
	fi
fi
}

function enable_repo {
if cat /etc/apt/sources.list | grep -q "# $2"
then
	echo -n "Enabling repository $1: "
	if eval $3
	then
		echo "OK"
	else
		echo "FAIL!"
	fi
else
	echo -n "Repository $1: "
	if cat /etc/apt/sources.list | grep -q "$2"
	then
		echo "Already enabled"
	else
		echo "$2 #$1" >> /etc/apt/sources.list
		echo "Enabled"
	fi
fi

}

PARTNER="deb http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SRC="deb-src http://archive.canonical.com/ubuntu $CODENAME partner"
PARTNER_SED='sed -i -e "s/# deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'
PARTNER_SRC_SED='sed -i -e "s/# deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/deb-src http:\/\/archive.canonical.com\/ubuntu '$CODENAME' partner/g" /etc/apt/sources.list'

BACKPORTS="deb http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SRC="deb-src http://it.archive.ubuntu.com/ubuntu/ $CODENAME-backports main restricted universe multiverse"
BACKPORTS_SED='sed -i -e "s/# deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'
BACKPORTS_SRC_SED='sed -i -e "s/# deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/deb-src http:\/\/it.archive.ubuntu.com\/ubuntu\/ '$CODENAME'-backports main restricted universe multiverse/g" /etc/apt/sources.list'


VIDEOLAN="deb http://download.videolan.org/pub/debian/stable/ /"
VIDEOLAN_KEY="http://download.videolan.org/pub/debian/videolan-apt.asc"
SKYPE="deb http://download.skype.com/linux/repos/debian stable non-free"
DROPBOX="deb http://linux.dropbox.com/ubuntu $CODENAME main"
DROPBOX_SRC="deb-src http://linux.dropbox.com/ubuntu $CODENAME main"
VIRTUALBOX="deb http://download.virtualbox.org/virtualbox/debian $CODENAME contrib"
VIRTUALBOX_KEY="http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc"
#VBOX_USB="none /proc/bus/usb usbfs devgid=125,devmode=664 0 0"
GOOGLE_CHROME="deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main"
GOOGLE_MUSIC_MANAGER="deb http://dl.google.com/linux/musicmanager/deb/ stable main"
GOOGLE_TALKPLUGIN="deb http://dl.google.com/linux/talkplugin/deb/ stable main"
GOOGLE_KEY="https://dl-ssl.google.com/linux/linux_signing_key.pub"
GETDEB="deb http://archive.getdeb.net/ubuntu $CODENAME-getdeb apps"
GETDEB_KEY="http://archive.getdeb.net/getdeb-archive.key"

echo "List of packages to be installed:"
echo "$APPZ"
echo
read -p "Continuae [Y/n]? " yn
{'fraction_non_alphanumeric': 0.1364027538726334, 'fraction_numerical': 0.01153184165232358, 'mean_word_length': 4.222921348314607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '292101', 'n_tokens_mistral': 4731, 'n_tokens_neox': 4213, 'n_words': 1029}