From e94f1caab362d2ed0edb0474b7e808b64d035ecd Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sat, 4 Feb 2017 07:53:38 -0800 Subject: [PATCH] Update install_tool script. --- bin/install_tool | 11 +++++++++-- dotfiles/zsh_custom/analyze_new_cluster.sh | 22 ++++++++++++++++++++++ dotfiles/zsh_custom/delete_old_cluster.sh | 3 +++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100755 dotfiles/zsh_custom/analyze_new_cluster.sh create mode 100755 dotfiles/zsh_custom/delete_old_cluster.sh diff --git a/bin/install_tool b/bin/install_tool index 984bfc5..6e09593 100755 --- a/bin/install_tool +++ b/bin/install_tool @@ -3,6 +3,7 @@ set -ue REINSTALL=0 +PACKAGES=1 while getopts -- "-:" a ; do case "${a}" in @@ -11,6 +12,9 @@ while getopts -- "-:" a ; do reinstall) REINSTALL=1 ;; + no-packages) + PACKAGES=0 + ;; *) echo "Unknown long option ${OPTARG}" >/dev/stderr exit 1 @@ -20,7 +24,6 @@ while getopts -- "-:" a ; do done shift $(($OPTIND-1)) -echo $* if [ $# -ne 1 ] ; then echo "Usage: ${0} " >/dev/stderr @@ -29,9 +32,13 @@ fi TOOL=${1} function install_pkgs { + if [ ${PACKAGES} -eq 0 ] ; then + return 0 + fi if [ `id -u` -ne "0" ] ; then sudo apt-get -y install $* || ( - echo "Unable to install packages, please ensure these are installed." >/dev/stderr + echo -n "Unable to install packages, please ensure these " >/dev/stderr + echo "are installed, then run with --no-packages." >/dev/stderr echo $* false ) return 0 diff --git a/dotfiles/zsh_custom/analyze_new_cluster.sh b/dotfiles/zsh_custom/analyze_new_cluster.sh new file mode 100755 index 0000000..23a2c1a --- /dev/null +++ b/dotfiles/zsh_custom/analyze_new_cluster.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +echo 'This script will generate minimal optimizer statistics rapidly' +echo 'so your system is usable, and then gather statistics twice more' +echo 'with increasing accuracy. When it is done, your system will' +echo 'have the default level of optimizer statistics.' +echo + +echo 'If you have used ALTER TABLE to modify the statistics target for' +echo 'any tables, you might want to remove them and restore them after' +echo 'running this script because they will delay fast statistics generation.' +echo + +echo 'If you would like default statistics as quickly as possible, cancel' +echo 'this script and run:' +echo ' "/opt/metasploit-framework/embedded/bin/vacuumdb" --all --analyze-only' +echo + +"/opt/metasploit-framework/embedded/bin/vacuumdb" --all --analyze-in-stages +echo + +echo 'Done' diff --git a/dotfiles/zsh_custom/delete_old_cluster.sh b/dotfiles/zsh_custom/delete_old_cluster.sh new file mode 100755 index 0000000..fd6f0a0 --- /dev/null +++ b/dotfiles/zsh_custom/delete_old_cluster.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -rf '/home/david/.msf4/db.prev'