Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • keegoid/quick-config
1 result
Show changes
Commits on Source (7)
# Quick Config # Quick Config
   
Quickly configures a fresh install of [Ubuntu 17.04 64-bit][zz] on a workstation. Quickly configures a fresh install of [Ubuntu 17.10 64-bit][aa] on a workstation.
   
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Loading
@@ -20,7 +20,7 @@ Quickly configures a fresh install of [Ubuntu 17.04 64-bit][zz] on a workstation
Loading
@@ -20,7 +20,7 @@ Quickly configures a fresh install of [Ubuntu 17.04 64-bit][zz] on a workstation
- install gem, npm, and pip packages using appropriate package managers - install gem, npm, and pip packages using appropriate package managers
- generate an [RSA key][sshkey] for remote [SSH sessions][ssh] - generate an [RSA key][sshkey] for remote [SSH sessions][ssh]
- make the [terminal][gt] easier to read and use with: - make the [terminal][gt] easier to read and use with:
- colored prompt string (PS1) - [colored prompt string (PS1)][ps1]
- [autojump][aj] - [autojump][aj]
- [incremental history searching][ihs] - [incremental history searching][ihs]
- add [solarized][msolar] color scheme to [Mutt][mutt] - add [solarized][msolar] color scheme to [Mutt][mutt]
Loading
@@ -49,7 +49,7 @@ SEE: http://keegoid.mit-license.org
Loading
@@ -49,7 +49,7 @@ SEE: http://keegoid.mit-license.org
   
   
[ubuntu]: http://www.ubuntu.com/global [ubuntu]: http://www.ubuntu.com/global
[zz]: https://wiki.ubuntu.com/ZestyZapus/ReleaseNotes [aa]: https://wiki.ubuntu.com/ArtfulAardvark/ReleaseNotes
[subl]: https://www.sublimetext.com/ [subl]: https://www.sublimetext.com/
[vim]: http://www.vim.org/ [vim]: http://www.vim.org/
[gt]: http://manpages.ubuntu.com/manpages/hardy/man1/gnome-terminal.1.html [gt]: http://manpages.ubuntu.com/manpages/hardy/man1/gnome-terminal.1.html
Loading
@@ -67,3 +67,4 @@ SEE: http://keegoid.mit-license.org
Loading
@@ -67,3 +67,4 @@ SEE: http://keegoid.mit-license.org
[rbenv]: https://github.com/rbenv/rbenv [rbenv]: https://github.com/rbenv/rbenv
[nvm]: https://github.com/creationix/nvm [nvm]: https://github.com/creationix/nvm
[venv]: https://github.com/pypa/virtualenv [venv]: https://github.com/pypa/virtualenv
[ps1]: https://gist.github.com/keegoid/13482742b6140ec0ffbc818173805889
\ No newline at end of file
Loading
@@ -76,7 +76,8 @@ qc_apt_install() {
Loading
@@ -76,7 +76,8 @@ qc_apt_install() {
# add git lfs from packagecloud.io to add large file support to git # add git lfs from packagecloud.io to add large file support to git
qc_git_lfs() { qc_git_lfs() {
lkm_confirm "Install git-lfs?" true lkm_confirm "Install git-lfs?" true
if [ $? -eq 0 ]; then RET="$?"
if [ $RET -eq 0 ]; then
if lkm_not_installed 'git-lfs'; then if lkm_not_installed 'git-lfs'; then
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | os=debian dist=xenial sudo -E sudo bash curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | os=debian dist=xenial sudo -E sudo bash
lkm_program_must_exist 'git' lkm_program_must_exist 'git'
Loading
@@ -87,7 +88,6 @@ qc_git_lfs() {
Loading
@@ -87,7 +88,6 @@ qc_git_lfs() {
fi fi
fi fi
   
# shellcheck disable=SC2034
RET="$?" RET="$?"
lkm_debug lkm_debug
} }
Loading
@@ -95,10 +95,15 @@ qc_git_lfs() {
Loading
@@ -95,10 +95,15 @@ qc_git_lfs() {
# -------------------------- 64-BIT ARCHITECTURE # -------------------------- 64-BIT ARCHITECTURE
   
UPDATE=0 UPDATE=0
SKIP=1
if [ "$(dpkg --print-foreign-architectures)" = "i386" ]; then if [ "$(dpkg --print-foreign-architectures)" = "i386" ]; then
dpkg --get-selections | grep i386 || lkm_notify "no i386 packages installed" dpkg --get-selections | grep i386 || lkm_notify "no i386 packages installed" && SKIP=0
lkm_pause "Press [Enter] to purge all i386 packages and remove the i386 architecture" true if [ "$SKIP" -eq 0 ]; then
sudo apt-get purge ".*:i386" && sudo dpkg --remove-architecture i386 && sudo apt-get update && lkm_success "Success, goodbye i386!" && UPDATE=1 lkm_pause "Press [Enter] to continue"
else
lkm_pause "Press [Enter] to purge all i386 packages and remove the i386 architecture" true
sudo apt-get purge ".*:i386" && sudo dpkg --remove-architecture i386 && sudo apt-get update && lkm_success "Success, goodbye i386!" && UPDATE=1
fi
fi fi
   
# -------------------------- DEFAULT APT PACKAGES # -------------------------- DEFAULT APT PACKAGES
Loading
Loading
Loading
@@ -40,7 +40,8 @@ qc_do_backup() {
Loading
@@ -40,7 +40,8 @@ qc_do_backup() {
local today local today
   
lkm_confirm "Backup config files before making changes?" true lkm_confirm "Backup config files before making changes?" true
[ $? -gt 0 ] && return 1 RET="$?"
[ $RET -gt 0 ] && return 1
   
today=$(date +%Y%m%d_%s) today=$(date +%Y%m%d_%s)
mkdir -pv "$QC_BACKUP-$today" mkdir -pv "$QC_BACKUP-$today"
Loading
@@ -80,6 +81,7 @@ qc_set_subl_config() {
Loading
@@ -80,6 +81,7 @@ qc_set_subl_config() {
local repo_dir local repo_dir
local cloned=1 local cloned=1
local user_dir="$HOME/.config/sublime-text-3/Packages/User" local user_dir="$HOME/.config/sublime-text-3/Packages/User"
local user_dir_parent="$HOME/.config/sublime-text-3/Packages"
   
conf_dir=$(lkm_trim_shortest_right_pattern "$CONF3" "/") conf_dir=$(lkm_trim_shortest_right_pattern "$CONF3" "/")
conf_parent_dir=$(lkm_trim_shortest_right_pattern "$conf_dir" "/") conf_parent_dir=$(lkm_trim_shortest_right_pattern "$conf_dir" "/")
Loading
@@ -99,7 +101,7 @@ qc_set_subl_config() {
Loading
@@ -99,7 +101,7 @@ qc_set_subl_config() {
   
# remove default user directory if not already a symlink # remove default user directory if not already a symlink
echo "checking for symlink at $user_dir" echo "checking for symlink at $user_dir"
[ -L "$user_dir" ] || { echo "creating symlink from $user_dir to $conf_dir" ; ln -s "$conf_dir" "$user_dir" ; } [ -L "$user_dir" ] || { mv "$user_dir" "$user_dir".bak ; echo "creating symlink from $user_dir_parent to $conf_dir" ; ln -s "$conf_dir" "$user_dir_parent" ; }
   
# update or clone repository if symbolic link exists for User directory # update or clone repository if symbolic link exists for User directory
if [ -d "$repo_dir" ]; then if [ -d "$repo_dir" ]; then
Loading
@@ -115,7 +117,8 @@ qc_set_subl_config() {
Loading
@@ -115,7 +117,8 @@ qc_set_subl_config() {
# copy config file to proper location # copy config file to proper location
echo -e "copying $repo_file to \n$conf_file" echo -e "copying $repo_file to \n$conf_file"
cp -i "$repo_file" "$conf_file" cp -i "$repo_file" "$conf_file"
if [ $? -eq 0 ] && [ "$cloned" -eq 0 ]; then RET="$?"
if [ $RET -eq 0 ] && [ "$cloned" -eq 0 ]; then
lkm_success "configured: $conf_file" lkm_success "configured: $conf_file"
fi fi
   
Loading
@@ -150,7 +153,8 @@ qc_set_git_config() {
Loading
@@ -150,7 +153,8 @@ qc_set_git_config() {
   
# copy config file to proper location # copy config file to proper location
cp "$repo_file" "$conf_file" cp "$repo_file" "$conf_file"
if [ $? -eq 0 ] && [ "$cloned" -eq 0 ]; then RET="$?"
if [ $RET -eq 0 ] && [ "$cloned" -eq 0 ]; then
lkm_success "configured: $conf_file" lkm_success "configured: $conf_file"
fi fi
   
Loading
@@ -248,13 +252,14 @@ qc_set_ps1() {
Loading
@@ -248,13 +252,14 @@ qc_set_ps1() {
sed -i.bak -e '0,/PS1/s//#PS1/' -e "/\"\$color_prompt\" = yes/ a $src_cmd" "$conf_file" && configured=0 sed -i.bak -e '0,/PS1/s//#PS1/' -e "/\"\$color_prompt\" = yes/ a $src_cmd" "$conf_file" && configured=0
fi fi
   
RET="$?"
# success message # success message
if [ $? -eq 0 ] && [ "$configured" -eq 0 ]; then if [ $RET -eq 0 ] && [ "$configured" -eq 0 ]; then
lkm_success "configured: $conf_file with custom PS1 variable" lkm_success "configured: $conf_file with custom PS1 variable"
echo "Close and reopen the terminal to see the new prompt string." echo "Close and reopen the terminal to see the new prompt string."
fi fi
   
# shellcheck disable=SC2034
RET="$?" RET="$?"
lkm_debug lkm_debug
} }
Loading
Loading
Loading
@@ -15,7 +15,7 @@
Loading
@@ -15,7 +15,7 @@
{ # this ensures the entire script is downloaded # { # this ensures the entire script is downloaded #
   
# -------------------------- SETUP PARAMETERS # -------------------------- SETUP PARAMETERS
[ -z "$NVM_V" ] && read -rep "NVM version to use: " -i "0.33.2" NVM_V [ -z "$NVM_V" ] && read -rep "NVM version to use: " -i "0.33.8" NVM_V
   
# -------------------------- MISSING PROGRAM CHECKS # -------------------------- MISSING PROGRAM CHECKS
   
Loading
@@ -34,12 +34,17 @@ qc_nvm() {
Loading
@@ -34,12 +34,17 @@ qc_nvm() {
   
# source nvm # source nvm
# shellcheck source=/dev/null # shellcheck source=/dev/null
. ~/.nvm/nvm.sh \. ~/.nvm/nvm.sh
   
# install latest long term support version # install latest long term support version
nvm install --lts=Boron nvm install --lts=boron
   
if [ $? -eq 0 ]; then export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
RET="$?"
if [ $RET -eq 0 ]; then
# check which node and npm # check which node and npm
echo "checking which node" echo "checking which node"
which node which node
Loading
@@ -128,7 +133,8 @@ qc_reset() {
Loading
@@ -128,7 +133,8 @@ qc_reset() {
# -------------------------- INSTALL PROGRAMS # -------------------------- INSTALL PROGRAMS
   
lkm_confirm "Install Nodejs via NVM?" true lkm_confirm "Install Nodejs via NVM?" true
if [ $? -eq 0 ]; then RET="$?"
if [ $RET -eq 0 ]; then
qc_nvm qc_nvm
fi fi
qc_npm_install qc_npm_install
Loading
Loading
Loading
@@ -174,14 +174,10 @@ qc_reset() {
Loading
@@ -174,14 +174,10 @@ qc_reset() {
   
lkm_confirm "Install PIP via Virtualenv?" true lkm_confirm "Install PIP via Virtualenv?" true
# check if virtualenv and pip are already installed # check if virtualenv and pip are already installed
[ -f ~/.virtualenv/bin/pip ] && lkm_confirm "Looks like Virtualenv and PIP are already installed. Proceed anyway?" true qc_virtualenv
if [ $? -eq 0 ]; then echo "Close the terminal window and reopen to enable the new PIP with Virtualenv."
qc_virtualenv qc_pip_install
echo "Close the terminal window and reopen to enable the new PIP with Virtualenv. Then rerun this script." # qc_pip3_install
else
qc_pip_install
# qc_pip3_install
fi
   
qc_reset qc_reset
   
Loading
Loading
Loading
@@ -15,7 +15,7 @@
Loading
@@ -15,7 +15,7 @@
# install Sublime Text # install Sublime Text
qc_install_subl() { qc_install_subl() {
local subl_v local subl_v
[ -z "$subl_v" ] && read -rep "Sublime Text 3 version to use: " -i "3126" subl_v [ -z "$subl_v" ] && read -rep "Sublime Text 3 version to use: " -i "3143" subl_v
local subl_url="https://download.sublimetext.com/sublime-text_build-${subl_v}_amd64.deb" local subl_url="https://download.sublimetext.com/sublime-text_build-${subl_v}_amd64.deb"
   
if lkm_not_installed "subl"; then if lkm_not_installed "subl"; then
Loading
Loading