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
 
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 -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Loading
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
- generate an [RSA key][sshkey] for remote [SSH sessions][ssh]
- make the [terminal][gt] easier to read and use with:
- colored prompt string (PS1)
- [colored prompt string (PS1)][ps1]
- [autojump][aj]
- [incremental history searching][ihs]
- add [solarized][msolar] color scheme to [Mutt][mutt]
Loading
Loading
@@ -49,7 +49,7 @@ SEE: http://keegoid.mit-license.org
 
 
[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/
[vim]: http://www.vim.org/
[gt]: http://manpages.ubuntu.com/manpages/hardy/man1/gnome-terminal.1.html
Loading
Loading
@@ -67,3 +67,4 @@ SEE: http://keegoid.mit-license.org
[rbenv]: https://github.com/rbenv/rbenv
[nvm]: https://github.com/creationix/nvm
[venv]: https://github.com/pypa/virtualenv
[ps1]: https://gist.github.com/keegoid/13482742b6140ec0ffbc818173805889
\ No newline at end of file
Loading
Loading
@@ -76,7 +76,8 @@ qc_apt_install() {
# add git lfs from packagecloud.io to add large file support to git
qc_git_lfs() {
lkm_confirm "Install git-lfs?" true
if [ $? -eq 0 ]; then
RET="$?"
if [ $RET -eq 0 ]; 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
lkm_program_must_exist 'git'
Loading
Loading
@@ -87,7 +88,6 @@ qc_git_lfs() {
fi
fi
 
# shellcheck disable=SC2034
RET="$?"
lkm_debug
}
Loading
Loading
@@ -95,10 +95,15 @@ qc_git_lfs() {
# -------------------------- 64-BIT ARCHITECTURE
 
UPDATE=0
SKIP=1
if [ "$(dpkg --print-foreign-architectures)" = "i386" ]; then
dpkg --get-selections | grep i386 || lkm_notify "no i386 packages installed"
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
dpkg --get-selections | grep i386 || lkm_notify "no i386 packages installed" && SKIP=0
if [ "$SKIP" -eq 0 ]; then
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
 
# -------------------------- DEFAULT APT PACKAGES
Loading
Loading
Loading
Loading
@@ -40,7 +40,8 @@ qc_do_backup() {
local today
 
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)
mkdir -pv "$QC_BACKUP-$today"
Loading
Loading
@@ -80,6 +81,7 @@ qc_set_subl_config() {
local repo_dir
local cloned=1
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_parent_dir=$(lkm_trim_shortest_right_pattern "$conf_dir" "/")
Loading
Loading
@@ -99,7 +101,7 @@ qc_set_subl_config() {
 
# remove default user directory if not already a symlink
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
if [ -d "$repo_dir" ]; then
Loading
Loading
@@ -115,7 +117,8 @@ qc_set_subl_config() {
# copy config file to proper location
echo -e "copying $repo_file to \n$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"
fi
 
Loading
Loading
@@ -150,7 +153,8 @@ qc_set_git_config() {
 
# copy config file to proper location
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"
fi
 
Loading
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
fi
 
RET="$?"
# 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"
echo "Close and reopen the terminal to see the new prompt string."
fi
 
# shellcheck disable=SC2034
RET="$?"
lkm_debug
}
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@
{ # this ensures the entire script is downloaded #
 
# -------------------------- 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
 
Loading
Loading
@@ -34,12 +34,17 @@ qc_nvm() {
 
# source nvm
# shellcheck source=/dev/null
. ~/.nvm/nvm.sh
\. ~/.nvm/nvm.sh
 
# 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
echo "checking which node"
which node
Loading
Loading
@@ -128,7 +133,8 @@ qc_reset() {
# -------------------------- INSTALL PROGRAMS
 
lkm_confirm "Install Nodejs via NVM?" true
if [ $? -eq 0 ]; then
RET="$?"
if [ $RET -eq 0 ]; then
qc_nvm
fi
qc_npm_install
Loading
Loading
Loading
Loading
@@ -174,14 +174,10 @@ qc_reset() {
 
lkm_confirm "Install PIP via Virtualenv?" true
# 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
if [ $? -eq 0 ]; then
qc_virtualenv
echo "Close the terminal window and reopen to enable the new PIP with Virtualenv. Then rerun this script."
else
qc_pip_install
# qc_pip3_install
fi
qc_virtualenv
echo "Close the terminal window and reopen to enable the new PIP with Virtualenv."
qc_pip_install
# qc_pip3_install
 
qc_reset
 
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@
# install Sublime Text
qc_install_subl() {
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"
 
if lkm_not_installed "subl"; then
Loading
Loading