Skip to content

Instantly share code, notes, and snippets.

@julioflima
Last active November 19, 2020 03:11
Show Gist options
  • Save julioflima/07e314fe3fd1de63fa1f45d4ebd86c92 to your computer and use it in GitHub Desktop.
Save julioflima/07e314fe3fd1de63fa1f45d4ebd86c92 to your computer and use it in GitHub Desktop.
Install Chrome on any Linux and install the extensiom Custom Javascript for Websites 2
#!/bin/bash
echo 'installing git'
sudo apt install git -y
git config --global user.name "Julio Lima"
git config --global user.email "julio_flima@hotmail.com"
clear
echo "Generating a SSH Key"
ssh-keygen -t rsa -b 4096 -C $git_config_user_email
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | xclip -selection clipboard
echo 'installing zsh'
sudo apt-get install zsh -y
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
chsh -s /bin/zsh
echo 'installing tool to handle clipboard via CLI'
sudo apt-get install xclip -y
export alias pbcopy='xclip -selection clipboard'
export alias pbpaste='xclip -selection clipboard -o'
source ~/.zshrc
clear
echo 'installing code'
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https -y
sudo apt-get update
echo 'installing chrome'
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install code -y # or code-insiders
echo 'installing extensions'
code --install-extension dracula-theme.theme-dracula
code --install-extension Shan.code-settings-sync
echo 'installing nvm'
sh -c "$(curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash)"
export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/creationix/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
source ~/.zshrc
nvm --version
nvm install 12
nvm alias default 12
node --version
npm --version
echo 'installing autosuggestions'
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc
source ~/.zshrc
echo 'installing theme'
sudo apt install fonts-firacode -y
wget -O ~/.oh-my-zsh/themes/node.zsh-theme https://raw.githubusercontent.com/skuridin/oh-my-zsh-node-theme/master/node.zsh-theme
sed -i 's/.*ZSH_THEME=.*/ZSH_THEME="node"/g' ~/.zshrc
echo 'installing yarn'
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn -y
install_chrome () {
if ! which "google-chrome" ; then
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub \
| sudo apt-key add -
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' \
| sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt install google-chrome-stable
else
echo Chrome already installed
fi
}
install_chrome_extension () {
preferences_dir_path="/opt/google/chrome/extensions"
pref_file_path="$preferences_dir_path/$1.json"
upd_url="https://clients2.google.com/service/update2/crx"
mkdir -p "$preferences_dir_path"
echo "{" > "$pref_file_path"
echo " \"external_update_url\": \"$upd_url\"" >> "$pref_file_path"
echo "}" >> "$pref_file_path"
echo Added \""$pref_file_path"\" ["$2"]
}
install_killer_chrome () {
sudo apt install wmctrl
}
## Installing Chrome
echo "Installing Chrome!";
install_chrome
## Installing Extension
echo "Installing Extension!";
install_chrome_extension "cfhdojbkjhnklbpkdaibdccddilifddb" "custom javascrip for websites 2"
## Installing Killer of Chrome
echo "Installing Killer of Chrome!";
install_killer_chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment