# !/bin/sh # apt-fast v0.03 by Matt Parnell http://www.mattparnell.com, this thing is fully open-source # if you do anything cool with it, let me know so I can publish or host it for you # contact me at admin@mattparnell.com
# Special thanks # Travis/travisn000 - support for complex apt-get commands # Allan Hoffmeister - aria2c support # Abhishek Sharma - aria2c with proxy support # Richard Klien - Autocompletion, Download Size Checking (made for on ubuntu, untested on other distros) # Patrick Kramer Ruiz - suggestions - see Suggestions.txt # Sergio Silva - test to see if axel is installed, root detection/sudo autorun
# Use this just like apt-get for faster package downloading.
# Test if the axel is installed if [ ! -x /usr/bin/axel ] then echo "axel is not installed, perform this?(y/n)" read ops case $ops in y) if apt-get install axel -y --force-yes then echo "axel installed" else echo "unable to install the axel. you are using sudo?" ; exit fi ;; n) echo "not possible usage apt-fast" ; exit ;; esac fi
# If the user entered arguments contain upgrade, install, or dist-upgrade if echo "$@" | grep -q "upgrade\|install\|dist-upgrade"; then echo "Working...";
# Go into the directory apt-get normally puts downloaded packages cd /var/cache/apt/archives/;
# Have apt-get print the information, including the URI's to the packages # Strip out the URI's, and download the packages with Axel for speediness # I found this regex elsewhere, showing how to manually strip package URI's you may need...thanks to whoever wrote it apt-get -y --print-uris $@ | egrep -o -e "(ht|f)tp://[^\']+" > apt-fast.list && cat apt-fast.list | xargs -l1 axel -a
# Perform the user's requested action via apt-get apt-get $@;
echo -e "\nDone! Verify that all packages were installed successfully. If errors are found, run apt-get clean as root and try again using apt-get directly.\n";
"Global Settings: {{{ syntaxon " highlight syntax filetypeplugin indent on " auto detect file type
setnocompatible " out of Vi compatible mode "setnumber " show line number setnumberwidth=3 " minimal culumns for line numbers settextwidth=0 " do not wrap words (insert) setnowrap " do not wrap words (view) setshowcmd " show (partial) command in status line setruler " line and column number of the cursor position setwildmenu " enhanced command completion setwildmode=list:longest,full " command completion mode setlaststatus=2 " always show the status line setmouse= " use mouse in all mode setfoldenable " fold lines setfoldmethod=marker " fold as marker setnoerrorbells " do not use error bell setnovisualbell " do not use visual bell sett_vb= " do not use terminal bell
setwildignore=.svn,.git,*.swp,*.bak,*~,*.o,*.a setautowrite " auto save before commands like :next and :make setcursorline sethidden " enable multiple modified buffers sethistory=1000 " record recent used command history setautoread " auto read file that has been changed on disk setbackspace=indent,eol,start " backspace can delete everything setcompleteopt=menuone,longest " complete options (insert) setpumheight=10 " complete popup height setscrolloff=5 " minimal number of screen lines to keep beyond the cursor setautoindent " automatically indent new line setcinoptions=:0,l1,g0,t0,(0,(s " C kind language indent options setclipboard+=unnamed " shared clipboard setnoexpandtab " do not use spaces instead of tabs
settabstop=4 " number of spaces in a tab setsofttabstop=4 " insert and delete space of <tab> setshiftwidth=4 " number of spaces for indent setexpandtab " expand tabs into spaces setincsearch " incremental search sethlsearch " highlight search match setignorecase " do case insensitive matching setsmartcase " do not ignore if search pattern has CAPS setnobackup " do not create backup file "setnoswapfile " do not create swap file setbackupcopy=yes " overwrite the original file
setbackground=dark "colorschemeSolarizedDark_modified "colorschemewombat_modified "gui settings ifhas("gui_running") setguioptions-=T " no toolbar setguioptions-=r " no right-hand scrollbar setguioptions-=R " no right-hand vertically scrollbar setguioptions-=l " no left-hand scrollbar setguioptions-=L " no left-hand vertically scrollbar autocmdGUIEnter * simalt ~x " window width and height languagemessages zh_CN.utf-8 " use chinese messages if has endif
"Restore the last quit position when open file. autocmdBufReadPost * \ ifline("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g'\"" | \ endif "}}}
# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything case$- in *i*);; *)return;; esac # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt-s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt-s checkwinsize # If set, the pattern "**" used in a pathname expansion context will # match all files and zero or more directories and subdirectories. #shopt -s globstar # make less more friendly for non-text input files, see lesspipe(1) #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if[ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we "want" color) case"$TERM" in xterm-color)color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt force_color_prompt=yes
if[ -n "$force_color_prompt" ]; then if[ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi
if[ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unsetcolor_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case"$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" ;; *) ;; esac # colored GCC warnings and errors exportGCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # enable color support of ls and also add handy aliases if[ -x /usr/bin/dircolors ]; then test-r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" aliasls='ls --color=auto' aliasdir='dir --color=auto' aliasvdir='vdir --color=auto'
aliasgrep='grep --color=auto' aliasfgrep='fgrep --color=auto' aliasegrep='egrep --color=auto' fi # some more ls aliases aliasll='ls -l' aliasla='ls -A' aliasl='ls -la' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
if[ -f ~/.bash_aliases ]; then .~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if! shopt -oq posix; then if[ -f /usr/share/bash-completion/bash_completion ]; then ./usr/share/bash-completion/bash_completion elif[ -f /etc/bash_completion ]; then ./etc/bash_completion fi fi