Skip to content
Snippets Groups Projects
Commit f67ac5eb authored by Keegan Mullaney's avatar Keegan Mullaney
Browse files

clean ups and updates

remove configs for vm and tmux
remove server option
update node LTS version and nvm version
parent 597b0585
No related branches found
No related tags found
No related merge requests found
# Quick Config
 
Quickly configures a fresh install of [Ubuntu 16.04.1 LTS 64-bit][xx] on a workstation.
Quickly configures a fresh install of [Ubuntu 16.10 64-bit][yy] 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
@@ -25,16 +25,10 @@ Quickly configures a fresh install of [Ubuntu 16.04.1 LTS 64-bit][xx] on a works
- dark profile
- [autojump][aj]
- [incremental history searching][ihs]
- add [blackboard][bb] and [solarized][gsolar] color schemes to [gedit][gedit]
- add [solarized][msolar] color scheme to [Mutt][mutt]
- configure [tmux][tmux]
- install and configure [vim-gtk][vim]
- install and configure [Sublime Text][subl], it really is sublime for coding
- install and configure [Visual Studio Code][code]
- configure [git][git] global settings
- install the latest [VirtualBox][vb] and [Vagrant][vg]
- install [LXD][lxd], use it to download an [Ubuntu][xx] cloud image and create an [LXC][lxc] container
- install [ZFS][zfs] for use with [LXD][lxd]
- install [Juju][juju]
 
## Installation
 
Loading
Loading
@@ -55,24 +49,14 @@ SEE: http://keegoid.mit-license.org
 
 
[ubuntu]: http://www.ubuntu.com/global
[xx]: https://wiki.ubuntu.com/XenialXerus/ReleaseNotes
[lxd]: https://linuxcontainers.org/lxd/introduction/
[lxc]: https://linuxcontainers.org/lxc/introduction/
[zfs]: https://wiki.ubuntu.com/ZFS
[juju]: http://www.ubuntu.com/cloud/juju
[gedit]: https://wiki.gnome.org/Apps/Gedit
[subl]: https://www.sublimetext.com/
[yy]: https://wiki.ubuntu.com/YakketyYak/ReleaseNotes
[code]: https://code.visualstudio.com/
[vim]: http://www.vim.org/
[gt]: http://manpages.ubuntu.com/manpages/hardy/man1/gnome-terminal.1.html
[ihs]: https://help.ubuntu.com/community/UsingTheTerminal#An_extremely_handy_tool_::_Incremental_history_searching
[tsolar]: https://github.com/Anthony25/gnome-terminal-colors-solarized
[gsolar]: https://github.com/mattcan/solarized-gedit
[msolar]: https://github.com/altercation/mutt-colors-solarized
[bb]: https://github.com/afair/dot-gedit
[tmux]: https://tmux.github.io/
[mutt]: http://www.mutt.org/
[vb]: https://www.virtualbox.org/
[vg]: https://www.vagrantup.com/
[aj]: https://github.com/wting/autojump
[ssh]: http://en.wikipedia.org/wiki/Secure_Shell
[sshkey]: http://en.wikipedia.org/wiki/Ssh-keygen
Loading
Loading
Loading
Loading
@@ -19,6 +19,7 @@
 
# note: true=0 and false=1 in bash
 
# shellcheck source=/dev/null
source colors.sh
 
# -------------------------- STRING MANIPULATION
Loading
Loading
@@ -175,7 +176,7 @@ lkm_pause() {
[ -z "${prompt}" ] && prompt="Press [Enter] key to continue"
# how to go back, with either default or user message
[ "$back" = true ] && prompt="${prompt}, [Ctrl+Z] to go back"
read -p "$prompt..."
read -rp "$prompt..."
}
 
lkm_confirm() {
Loading
Loading
@@ -381,7 +382,7 @@ lkm_install_gem() {
for pkg in $names; do
if ! gem list "$pkg" -i >/dev/null 2>&1; then
echo
read -p "Press [Enter] to install $pkg..."
read -rp "Press [Enter] to install $pkg..."
gem install "$pkg"
fi
done
Loading
Loading
@@ -399,7 +400,7 @@ lkm_install_npm() {
for pkg in $names; do
if ! npm ls -gs | grep -qw "$pkg"; then
echo
read -p "Press [Enter] to install $pkg..."
read -rp "Press [Enter] to install $pkg..."
npm install -g "$pkg"
fi
done
Loading
Loading
@@ -419,7 +420,7 @@ lkm_install_pip() {
pkg=$(lkm_trim_longest_right_pattern "$pkg" "[")
if ! pip list | grep "$pkg" >/dev/null 2>&1; then
echo
read -p "Press [Enter] to install $pkg..."
read -rp "Press [Enter] to install $pkg..."
sudo -H pip install "$pkg"
fi
done
Loading
Loading
@@ -443,7 +444,7 @@ lkm_gen_ssh_key() {
else
# create a new ssh key with provided ssh key comment
lkm_pause "Press [Enter] to generate a new SSH key at: ${ssh_dir}/id_rsa" true
read -ep "Enter an ssh key comment: " -i 'coding key' comment
read -rep "Enter an ssh key comment: " -i 'coding key' comment
ssh-keygen -b 4096 -t rsa -C "$comment"
echo "SSH key generated"
chmod -c 0600 "${ssh_dir}/id_rsa"
Loading
Loading
@@ -501,7 +502,7 @@ lkm_authorized_ssh_key() {
echo "*** NOTE ***"
echo "Paste (using ctrl+shift+v) your public ssh-rsa key from your workstation"
echo "to SSH into this server."
read -ep "Paste it here: " ssh_rsa
read -rep "Paste it here: " ssh_rsa
echo "${ssh_rsa}" > "${ssh_dir}/authorized_keys"
echo "public SSH key saved to ${ssh_dir}/authorized_keys"
chmod -c 0600 "${ssh_dir}/authorized_keys"
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@
 
echo "# --------------------------------------------"
echo "# Quickly configures a fresh install of "
echo "# Ubuntu 16.04 64-bit. "
echo "# Ubuntu 16.10 64-bit. "
echo "# "
echo "# Author : Keegan Mullaney "
echo "# Website: keegoid.com "
Loading
Loading
@@ -27,10 +27,6 @@ QC_DEBUG_MODE=0
# make sure $HOME variable is set
lkm_variable_set "$HOME"
 
# config for server
lkm_confirm "Is this a server?"
QC_IS_SERVER="$?"
# make sure curl and git are installed
lkm_program_must_exist curl
lkm_program_must_exist git
Loading
Loading
@@ -57,26 +53,17 @@ qc_exit_msg() {
qc_display_menu() {
[ $QC_DEBUG_MODE -eq 1 ] || clear
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~"
if [ $QC_IS_SERVER -eq 0 ]; then
echo " M A I N - M E N U "
echo " server "
else
echo " M A I N - M E N U "
echo " workstation "
fi
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "1. APT PACKAGES & UPDATES"
echo "2. RUBY & RUBYGEMS VIA RBENV"
echo "3. NODEJS & NPMS VIA NVM"
echo "4. PYTHON PACKAGES VIA PIP"
echo "5. SUBLIME TEXT"
echo "6. KEYBASE"
echo "7. SYSTEM CONFIG"
echo "8. SSH KEY"
echo "9. VIRTUALBOX & VAGRANT"
echo "10. WORDPRESS WITH LXD, ZFS & JUJU"
echo "11. FIX PERMISSIONS"
echo "12. QUIT"
echo "1. APT PACKAGES & UPDATES"
echo "2. RUBY & RUBYGEMS VIA RBENV"
echo "3. NODEJS & NPMS VIA NVM"
echo "4. PYTHON PACKAGES VIA PIP"
echo "5. KEYBASE"
echo "6. SYSTEM CONFIG"
echo "7. SSH KEY"
echo "8. FIX PERMISSIONS"
echo "9. QUIT"
}
 
# -------------------------- USER SELECTION
Loading
Loading
@@ -85,20 +72,17 @@ qc_select_options() {
local choice
# make sure we're always starting from the right place
cd "$QC_DIR" || exit
read -rp "Enter choice [1 - 12]: " choice
read -rp "Enter choice [1 - 9]: " choice
case $choice in
1) lkm_run_script apts.sh "script";;
2) lkm_run_script gems.sh "script";;
3) lkm_run_script npms.sh "script";;
4) lkm_run_script pips.sh "script";;
5) lkm_run_script subl.sh "script";;
6) lkm_run_script keybase.sh "script";;
7) lkm_run_script config.sh "script";;
8) lkm_run_script sshkey.sh "script";;
9) lkm_run_script vm.sh "script";;
10) lkm_run_script lxd.sh "script";;
11) qc_fix_permissions;;
12) qc_exit_msg && exit 0;;
1) lkm_run_script apts.sh "script";;
2) lkm_run_script gems.sh "script";;
3) lkm_run_script npms.sh "script";;
4) lkm_run_script pips.sh "script";;
5) lkm_run_script keybase.sh "script";;
6) lkm_run_script config.sh "script";;
7) lkm_run_script sshkey.sh "script";;
8) qc_fix_permissions;;
9) qc_exit_msg && exit 0;;
*) lkm_alert "Error..." && sleep 1
esac
 
Loading
Loading
{
"folders":
[
{
"path": "."
}
]
}
Loading
Loading
@@ -103,26 +103,20 @@ fi
 
# -------------------------- DEFAULT APT PACKAGES
 
DEFAULT_SERVER_LIST='ca-certificates gettext-base less man-db openssh-server python-software-properties software-properites-common vim-gtk wget'
DEFAULT_WORKSTATION_LIST='autojump gpgv2 links mutt pinta x11vnc xclip vlc arp-scan'
DEFAULT_DEV_LIST='autoconf automake build-essential checkinstall dconf-cli shellcheck silversearcher-ag tidy xdotool vim-gtk'
 
# -------------------------- PROMPT FOR PROGRAMS
 
if [ "$QC_IS_SERVER" -eq 0 ]; then
lkm_notify "Server packages to install (none to skip)"
read -ep " : " -i "$DEFAULT_SERVER_LIST" APTS1
else
lkm_notify3 "The following default packages can be modified prior to installation."
echo
echo "WORKSTATION"
echo "DEVELOPER"
echo
lkm_notify "Workstation packages to install (delete all to skip)"
read -ep " : " -i "$DEFAULT_WORKSTATION_LIST" APTS1
lkm_notify "Developer packages to install"
read -ep " : " -i "$DEFAULT_DEV_LIST" APTS2
fi
lkm_notify3 "The following default packages can be modified prior to installation."
echo
echo "WORKSTATION"
echo "DEVELOPER"
echo
lkm_notify "Workstation packages to install (delete all to skip)"
read -rep " : " -i "$DEFAULT_WORKSTATION_LIST" APTS1
lkm_notify "Developer packages to install"
read -rep " : " -i "$DEFAULT_DEV_LIST" APTS2
 
# -------------------------- ARRAY ASSIGNMENTS
 
Loading
Loading
Loading
Loading
@@ -14,22 +14,22 @@
 
[ -z "$QC_CONFIG" ] && QC_CONFIG="$HOME/.qc"
[ -z "$QC_BACKUP" ] && QC_BACKUP="$QC_CONFIG/backup"
[ -z "$QC_SYNCED" ] && read -ep "Directory to store/sync your config: " -i "$HOME/Dropbox/config" QC_SYNCED
[ -z "$QC_SYNCED" ] && read -rep "Directory to store/sync your config: " -i "$HOME/" QC_SYNCED
 
# system and program config files
CONF1="$HOME/.bashrc"
CONF2="$HOME/.inputrc"
CONF3="$QC_SYNCED/sublime/User/Preferences.sublime-settings"
CONF5="$HOME/.muttrc"
CONF6="$HOME/.vimrc"
CONF7="$HOME/.gitignore_global"
CONF4="$HOME/.muttrc"
CONF5="$HOME/.vimrc"
CONF6="$HOME/.gitignore_global"
 
# config files copied from repositories
REPO1="/usr/share/autojump/autojump.sh"
REPO1="/usr/share/autojump/autojump.sh" #autojump.bash in CentOS
REPO3="$HOME/.config/sublime-text-3/Packages/Theme - KMS/subl.conf"
REPO5="$QC_CONFIG/mutt/colors/mutt-colors-solarized-dark-16.muttrc"
REPO6="$QC_CONFIG/vim/vim.conf"
REPO7="$QC_CONFIG/git/gitignore_global"
REPO4="$QC_CONFIG/mutt/colors/mutt-colors-solarized-dark-16.muttrc"
REPO5="$QC_CONFIG/vim/vim.conf"
REPO6="$QC_CONFIG/git/gitignore_global"
 
# -------------------------- BACKUPS
 
Loading
Loading
@@ -58,6 +58,15 @@ qc_do_backup() {
return 0
}
 
# -------------------------- MORE SECURE LOGIN SCREEN
# sudo mkdir -p /etc/lightdm/lightdm.conf.d
# cat '[SeatDefaults] \
# user-session=ubuntu \
# greeter-show-manual-login=true \
# greeter-hide-users=true \
# allow-guest=false'
# -------------------------- SUBL CONFIG
 
# clone or pull git repo and copy repo files into proper places
Loading
Loading
@@ -66,39 +75,41 @@ qc_set_subl_config() {
local conf_file="$CONF3"
local repo_file="$REPO3"
local repo_dir
local repo_name
local cloned=1
local user_dir="$HOME/.config/sublime-text-3/Packages/User"
 
repo_dir=$(lkm_trim_shortest_right_pattern "$REPO3" "/")
repo_name=$(lkm_trim_longest_left_pattern "$repo_dir" "/")
# check if standard directory exists and if so, make a backup and remove it
[ -d "$user_dir" ] && { mv "$user_dir" "${user_dir}-bak"; rm -r "$user_dir"; }
 
# make sure directories exist
mkdir -p "$HOME/.config/sublime-text-3/Packages"
mkdir -p "$QC_SYNCED/sublime/User"
 
# symlink to User directory in Dropbox
# check User directory exists in QC_SYNCED/sublime/User/, else move from $HOME/.config/sublime/User/
[ -d "$QC_SYNCED/sublime/User" ] || mv "$user_dir" "$QC_SYNCED/sublime/User"
# check if standard directory exists and if so, remove it
[ -d "$user_dir" ] && rm -r "$user_dir"
# symlink to User directory
ln -s "$QC_SYNCED/sublime/User" "$user_dir"
 
# update or clone repository
if [ -d "$repo_dir" ]; then
# update or clone repository if symbolic link exists for User directory
if [ -L "$repo_dir" ] && [ -d "$repo_dir" ]; then
(
cd "$repo_dir" || exit
echo "checking for updates: $repo_name"
echo "checking for updates: Keegoid's Sublime Text preferences"
git pull
)
else
git clone "$repo_url" "$repo_dir" && cloned=0
fi
 
# no need to do this since it is already a symbolic link?
# copy config file to proper location
cp "$repo_file" "$conf_file"
if [ $? -eq 0 ] && [ "$cloned" -eq 0 ]; then
lkm_success "configured: $conf_file"
fi
# cp "$repo_file" "$conf_file"
# if [ $? -eq 0 ] && [ "$cloned" -eq 0 ]; then
# lkm_success "configured: $conf_file"
# fi
 
RET="$?"
lkm_debug
Loading
Loading
@@ -109,13 +120,13 @@ qc_set_subl_config() {
# clone or pull git repo and copy repo file onto conf file
qc_set_git_config() {
local repo_url="$1"
local conf_file="$CONF7"
local repo_file="$REPO7"
local conf_file="$CONF6"
local repo_file="$REPO6"
local repo_dir
local repo_name
local cloned=1
 
repo_dir=$(lkm_trim_shortest_right_pattern "$REPO7" "/")
repo_dir=$(lkm_trim_shortest_right_pattern "$REPO6" "/")
repo_name=$(lkm_trim_longest_left_pattern "$repo_dir" "/")
 
# update or clone repository
Loading
Loading
@@ -137,12 +148,18 @@ qc_set_git_config() {
 
# check if git is already configured
if ! git config --list | grep -q "user.name"; then
read -ep "your name for git commit logs: " -i 'Keegan Mullaney' real_name
read -ep "your email for git commit logs: " -i 'keeganmullaney@gmail.com' email_address
read -ep "your preferred text editor for git commits: " -i 'vi' git_editor
lkm_configure_git "$real_name" "$email_address" "$git_editor" && lkm_success "configured: $CONF7"
read -rep "your name for git commit logs: " -i 'Keegan Mullaney' real_name
read -rep "your email for git commit logs: " -i 'keeganmullaney@gmail.com' email_address
read -rep "your preferred text editor for git commits: " -i 'code --wait' git_editor
lkm_configure_git "$real_name" "$email_address" "$git_editor" && lkm_success "configured: $CONF6"
fi
 
# todo:
# [diff]
# tool = default-difftool
# [difftool "default-difftool"]
# cmd = code --wait --diff $LOCAL $REMOTE
RET="$?"
lkm_debug
}
Loading
Loading
@@ -170,22 +187,6 @@ EOF
lkm_debug
}
 
# -------------------------- TERMINAL COLOR PROMPTS
qc_set_terminal_color() {
local conf_file="$1"
if grep -q "#force_color_prompt=yes" "$conf_file" >/dev/null 2>&1; then
lkm_pause "Press [Enter] to activate color terminal prompts" true
sed -i.bak -e "/force_color_prompt=yes/ s/^# //" "$conf_file" && source "$conf_file" && lkm_success "configured: $conf_file with color terminal prompts"
else
echo "already set color prompts"
fi
RET="$?"
lkm_debug
}
# -------------------------- AUTOJUMP (so awesome)
 
qc_set_autojump() {
Loading
Loading
@@ -196,6 +197,7 @@ qc_set_autojump() {
echo "already added autojump (usage: j directory)"
else
lkm_pause "Press [Enter] to configure autojump for gnome-terminal" true
# shellcheck disable=SC1090
echo -e "$src_cmd" >> "$conf_file" && source "$conf_file" && lkm_success "configured: $conf_file with autojump (usage: j directory)"
fi
 
Loading
Loading
@@ -208,14 +210,14 @@ qc_set_autojump() {
 
# unset the various functions defined during execution of the script
qc_reset() {
unset -f qc_reset qc_do_backup qc_set_subl_config qc_set_git_config qc_set_terminal_history qc_set_autojump
unset -f qc_reset qc_do_backup qc_set_code_config qc_set_git_config qc_set_terminal_history qc_set_autojump
}
 
# -------------------------- MAIN
 
lkm_pause "" true
 
qc_do_backup "$CONF1 $CONF2 $CONF3 $CONF5 $CONF6 $CONF7"
qc_do_backup "$CONF1 $CONF2 $CONF3 $CONF4 $CONF5 $CONF6"
 
# aliases (to practice terminal commands for Linux certification exams, I'm not using aliases at the moment)
#lkm_set_sourced_config "https://gist.github.com/9d74e08779c1db6cb7b7" \
Loading
Loading
@@ -225,22 +227,17 @@ qc_do_backup "$CONF1 $CONF2 $CONF3 $CONF5 $CONF6 $CONF7"
 
# mutt config
lkm_set_sourced_config "https://github.com/altercation/mutt-colors-solarized.git" \
"$CONF5" \
"$REPO5" \
"# source colorscheme file\nsource $REPO5\n\n# signature and alias files\nset signature=$QC_SYNCED/mutt/sig\nset alias_file=$QC_SYNCED/mutt/aliases\n\n# aliases are stored in their own file\nsource \"\$alias_file\""
"$CONF4" \
"$REPO4" \
"# source colorscheme file\nsource $REPO4\n\n# signature and alias files\nset signature=$QC_SYNCED/mutt/sig\nset alias_file=$QC_SYNCED/mutt/aliases\n\n# aliases are stored in their own file\nsource \"\$alias_file\""
 
# vim config
lkm_set_sourced_config "https://gist.github.com/00a60c7355c27c692262.git" \
"$CONF6" \
"$REPO6" \
"\" source config file\n:so $REPO6\n\nset spellfile=$QC_SYNCED/vim/vim.utf-8.add\t\" spell check file to sync with other computers"
[ -d "$QC_SYNCED/vim" ] || { mkdir -pv "$QC_SYNCED/vim"; lkm_notify3 "note: vim spellfile will be located in $QC_SYNCED/vim, you can change this in $CONF6"; }
"$CONF5" \
"$REPO5" \
"\" source config file\n:so $REPO5\n\nset spellfile=$QC_SYNCED/vim/vim.utf-8.add\t\" spell check file to sync with other computers"
 
# terminal profile (can't find profile file in new Ubuntu 16.04)
#set_copied_config "https://gist.github.com/dad1663d2463db32c6e8.git" \
# "$HOME/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml" \
# "$QC_CONFIG/terminal/profile/gconf.xml"
[ -d "$QC_SYNCED/vim" ] || { mkdir -pv "$QC_SYNCED/vim"; lkm_notify3 "note: vim spellfile will be located in $QC_SYNCED/vim, you can change this in $CONF5"; }
 
# sublime text
qc_set_subl_config "https://github.com/keegoid/kms-theme.git"
Loading
Loading
@@ -249,9 +246,6 @@ qc_set_git_config "https://gist.github.com/efa547b362910ac7077c.git"
 
qc_set_terminal_history "$CONF2"
 
# already done in Ubuntu 16.04
#qc_set_terminal_color "$CONF1"
qc_set_autojump "$CONF1" \
"\n# source autojump file\nif [ -f $REPO1 ]; then\n . $REPO1\nfi"
 
Loading
Loading
Loading
Loading
@@ -84,7 +84,7 @@ qc_install_rbenv() {
'[[ ":$PATH:" =~ ":$HOME/.rbenv/bin:" ]] || PATH="$HOME/.rbenv/bin:$PATH"'
 
# optional, to speed up rbenv
[ -d "$HOME/.rbenv" ] && cd "$HOME/.rbenv" && src/configure && make -C src && cd - >/dev/null
[ -d "$HOME/.rbenv" ] && cd "$HOME/.rbenv" && src/configure && make -C src && cd - >/dev/null
 
# add rbenv init - command to .bashrc and .bash_profile (for SublimeLinter)
# shellcheck disable=SC2016
Loading
Loading
@@ -165,7 +165,7 @@ echo
echo "Rubygems"
echo
lkm_notify "Packages to install with gem"
read -ep " : " -i 'bundler gist travis' GEMS
read -rep " : " -i 'bundler gist travis' GEMS
 
# -------------------------- ARRAY ASSIGNMENTS
 
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@
 
# -------------------------- SETUP PARAMETERS
 
[ -z "$QC_REPOS" ] && read -ep "Directory to use for repositories: ~/" -i "Dropbox/coding/repos" QC_REPOS
[ -z "$QC_REPOS" ] && read -rep "Directory to use for repositories: ~/" -i "Dropbox/coding/repos" QC_REPOS
QC_SELECTED_CONTAINER
 
# -------------------------- INSTALL LXD/LXC
Loading
Loading
@@ -45,7 +45,7 @@ qc_init_juju_lxd() {
[ $? -eq 0 ] && sudo lxd init
 
# set compression and turn off dedup
read -ep "Enter the name you used for your zpool: " zpool_name
read -rep "Enter the name you used for your zpool: " zpool_name
sudo zfs set compression=on "$zpool_name"
sudo zfs set compression=lz4 "$zpool_name"
sudo zfs set dedup=off "$zpool_name"
Loading
Loading
@@ -97,7 +97,7 @@ qc_import_lxd_image() {
# $1 -> host name
qc_set_hosts() {
lxc list
read -ep "Type an existing container name to use for ${1}: " QC_SELECTED_CONTAINER
read -rep "Type an existing container name to use for ${1}: " QC_SELECTED_CONTAINER
 
# add container's ip to /etc/hosts
lkm_pause "Press [Enter] to add $1 to /etc/hosts"
Loading
Loading
@@ -134,8 +134,8 @@ qc_set_hosts() {
# $1 -> host name
qc_set_shared_directory() {
# set syncing directory paths
read -ep "Choose a source directory on host to sync: ~/${QC_REPOS}/" -i "${1}/site" relative_source
read -ep "Choose a target directory in container to sync: /" -i "var/www/${1}/public_html" target_dir
read -rep "Choose a source directory on host to sync: ~/${QC_REPOS}/" -i "${1}/site" relative_source
read -rep "Choose a target directory in container to sync: /" -i "var/www/${1}/public_html" target_dir
source_dir="$HOME/${QC_REPOS}/$relative_source"
target_dir="/${target_dir}"
 
Loading
Loading
@@ -185,8 +185,8 @@ qc_create_lxd_container() {
 
# select an image and choose a container name
lxc image list
read -ep "Select an image to use for the new container: " -i 'ubuntu-trusty' selected_image
read -ep "Enter a host name to use with /etc/hosts: " -i 'wordpress.dev' host_name
read -rep "Select an image to use for the new container: " -i 'ubuntu-trusty' selected_image
read -rep "Enter a host name to use with /etc/hosts: " -i 'wordpress.dev' host_name
 
# create and start container
lxc launch "$selected_image"
Loading
Loading
@@ -221,7 +221,7 @@ qc_deploy_wordpress() {
 
# optionally set wp-content to git repository
lkm_confirm "Use a git repository for wp-content?" true
[ $? -eq 0 ] && lkm_notify3 "Format: git@host:path/repo.git or http://host/path/repo.git" && read -ep "Enter a git repository: " git_repo && juju set wordpress wp-content="$git_repo"
[ $? -eq 0 ] && lkm_notify3 "Format: git@host:path/repo.git or http://host/path/repo.git" && read -rep "Enter a git repository: " git_repo && juju set wordpress wp-content="$git_repo"
 
RET="$?"
lkm_debug
Loading
Loading
Loading
Loading
@@ -16,8 +16,8 @@
 
# -------------------------- SETUP PARAMETERS
 
[ -z "$QC_LTS" ] && QC_LTS=4
[ -z "$NVM_V" ] && NVM_V=0.31.1
[ -z "$QC_LTS" ] && QC_LTS=6
[ -z "$NVM_V" ] && NVM_V=0.33.2
 
# -------------------------- MISSING PROGRAM CHECKS
 
Loading
Loading
@@ -36,6 +36,7 @@ qc_nvm() {
curl -o- "https://raw.githubusercontent.com/creationix/nvm/v${NVM_V}/install.sh" | bash
 
# source nvm
# shellcheck source=/dev/null
. ~/.nvm/nvm.sh
 
# make sure nvm is installed
Loading
Loading
@@ -118,7 +119,7 @@ echo
echo "NODE.JS"
echo
lkm_notify "Packages to install with npm"
read -ep " : " -i 'bower browser-sync coffee-script csslint doctoc gulp npm-check-updates remark remark-lint' NPMS
read -rep " : " -i 'bower browser-sync coffee-script csslint doctoc gulp npm-check-updates remark remark-lint' NPMS
 
# -------------------------- ARRAY ASSIGNMENTS
 
Loading
Loading
Loading
Loading
@@ -43,6 +43,7 @@ qc_virtualenv() {
lkm_set_source_cmd "$HOME/.bashrc" \
'virtualenv/bin:' \
'[[ ":$PATH:" =~ ":$HOME/.virtualenv/bin:" ]] || PATH="$HOME/.virtualenv/bin:$PATH"'
# shellcheck source=/dev/null
source ~/.bashrc
 
# check which pip
Loading
Loading
@@ -151,10 +152,10 @@ echo
echo "PIPs"
echo
lkm_notify "Packages to install with pip"
read -ep " : " -i 'jrnl[encrypted] pyflakes python-slugify keyrings.alt' PIPS
read -rep " : " -i 'jrnl[encrypted] pyflakes python-slugify keyrings.alt' PIPS
# lkm_notify "Packages to install with pip3"
# shellcheck disable=SC2034
# read -ep " : " -i 'pep8' PIP3S
# read -rep " : " -i 'pep8' PIP3S
 
# -------------------------- ARRAY ASSIGNMENTS
 
Loading
Loading
Loading
Loading
@@ -23,8 +23,8 @@ qc_set_authorized_key() {
sudo chmod a-w /etc/ssh/sshd_config.original
 
# client allive interval
read -ep "Enter the client alive interval in seconds to prevent SSH from dropping out: " -i "60" client_alive
read -ep "Enter the ssh port number to use on the server: " -i "22" ssh_port
read -rep "Enter the client alive interval in seconds to prevent SSH from dropping out: " -i "60" client_alive
read -rep "Enter the ssh port number to use on the server: " -i "22" ssh_port
 
# edit /etc/ssh/sshd_config
sudo sed -i.bak -e "{ s/#Port 22/Port $ssh_port/
Loading
Loading
@@ -60,12 +60,6 @@ qc_set_authorized_key() {
 
# -------------------------- MAIN
 
if [ "$QC_IS_SERVER" -eq 0 ]; then
qc_set_authorized_key
else
lkm_gen_ssh_key "$HOME/.ssh" "$(whoami)"
fi
unset -f qc_set_authorized_key
lkm_gen_ssh_key "$HOME/.ssh" "$(whoami)"
 
} # this ensures the entire script is downloaded #
#!/bin/bash
# --------------------------------------------
# Install or update virtual machine apps.
#
# Author : Keegan Mullaney
# Website: keegoid.com
# Email : keeganmullaney@gmail.com
# License: keegoid.mit-license.org
# --------------------------------------------
{ # this ensures the entire script is downloaded #
# -------------------------- MAIN
lkm_confirm "install Virtualbox?" true
[ $? -eq 0 ] && lkm_install_apt virtualbox
lkm_confirm "install Vagrant?" true
[ $? -eq 0 ] && lkm_install_apt vagrant
} # this ensures the entire script is downloaded #
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment