System Configuration

Destroy another computer?  Got a new one?  No matter.  Here's what you need.


General Desktop

spacer

1. Get Dave's Quick Search Deskbar (DQSD).
older version. -->Don't forget to use a Windows 7 style sheet, localsearch.css, and the updated mwd.xml (or df.xml) from subversion.

2. Get the GMail notifier. Apply the HTTPS registry patch. Google suggests using Chrome's Desktop notifications instead.

3. Get Google Chrome.

4. Setup Passwords for Google Two-Step Verification (You'll have to enter your Google password to continue through that link to the destination.)
You'll want application passwords for both Chrome Sync and the GMail Notifier.

5. Get Pure Text.
Never suffer the unwanted formatted text paste into Outlook again. Windows+V is your new friend.
Put the executable in a permanent location, run it, and right-click on the System Tray icon and select Options... to customize.

6. Windows 7 Configuration

spacer

spacer

7. FTP with FileZilla, and compress/extract with 7 Zip.

8. Get Paint.NET
Don't forget the plugins you like:

Also consider the other plugins you mentioned.


Porting Documents

1. The Usual Suspects: For every user account, including Public: "My Documents", "Downloads", "Music", "Pictures", "ThrowMeAway"

2. APPDATA: See what needs to be copied from %APPDATA%, for example Minecraft saves.

3. The Registry: PuTTY save files are at [HKEY_CURRENT_USER\Software\SimonTatham]. Speaking of PuTTY, don't forget to copy your public keys. (You know where they are.)

4. The Root: See what needs to be copied from the root, for example:

5. Individual App Setting Exports: IDEs, like UltraEdit and Eclipse may have custom ways to export settings. (In UltraEdit, go to Advanced -> Export Settings... and Backup/Restore User Customizations....)

6. Task Scheduler: Copy the scheduling of the encryption and backup tasks you've set for yourself.

7. The Cloud: Done. Makes you grateful for the cloud, eh?

8. Deauthorize the Old Computer: Steam, iTunes, stuff like that.


Development Environment

1. Get Python and a compatible win32all module and editor.
If that win32all link went stale, try sourceforge.
Consider one of these IDEs, depending on the target.

Some modules you may be interested in:

Some potential notes on installing IPython for cygwin. (Even more details.)

Install libffi

$ curl ftp://sourceware.org/pub/libffi/libffi-3.0.11.tar.gz > libffi-3.0.11.tar.gz
$ tar zxf libffi-3.0.11.tar.gz && rm libffi-3.0.11.tar.gz
$ curl www.linuxfromscratch.org/patches/blfs/svn/libffi-3.0.11-includedir-1.patch \
  > libffi-3.0.11-includedir-1.patch
$ cd libffi-3.0.11
$ patch -Np1 -i ../libffi-3.0.11-includedir-1.patch &&
  ./configure --prefix=/usr &&
  make
$ make install

Install Fortran from liblapack from cygwin's setup.exe for NumPy's installer.

Install NumPy 1.6.2 for Matplotlib 1.2.0

$ ... (I got the link from a browser download and moved it into my home directory.)
$ tar zxf numpy-1.6.2.tar.gz && rm numpy-1.6.2.tar.gz
Then either build with g77's fortran,
$ python setup.py build --fcompiler=gnu
or build with gfortran:
$ python setup.py build --fcompiler=gnu95

Install Matplotlib

$ curl cloud.github.com/downloads/matplotlib/matplotlib/matplotlib-1.2.0.tar.gz \
  > matplotlib-1.2.0.tar.gz
$ tar zxf matplotlib-1.2.0.tar.gz && rm matplotlib-1.2.0.tar.gz
$ cd matplotlib-1.2.0
$ cp setup.cfg.template setup.cfg
# In setup.cfg, uncomment the line, "tkagg = False"
$ ... (to do)
$ export PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'

Download and install IPython.

$ ... (to do)
$ tar -xzf ipython.tar.gz
$ cd ipython
$ python setup.py install

2. Get Cygwin and PuTTYCyg.

Module to consider installing:

  • Net:
    • curl
    • rsync
    • libssh2-devel
    • libssh2_1
    • openssh
  • Editors: vim
  • Devel:
    • ctags
    • gcc-core
    • gcc-g++
    • gcc-mingw-core
    • gcc-mingw-g++
    • libncurses-devel
    • libncursesw-devel
    • make
    • mercurial
    • python
  • Utils:
    • patch

If you're going to install cpanm, for installing CPAN modules, make sure you have some of the tools it uses, like "make".

.bashrc (or .bash_profile)
export PS1="\W\$ "

# if this is a CygWin .bashrc, then set CygWin's commands first in PATH
# because link.exe and find.exe exist in Windows's path.
if [ -z "$CYGWIN" ]; then
        export PATH=/usr/local/bin:/usr/bin:$PATH
fi

# If you think this is hard to read,
# change the color of directories in the ls command 
#
# After executing: dircolors -p > .dircolors
# And changing the following line in .dircolors:
# DIR 00;36 # directory
if [ "$TERM" != "dumb" ]; then
	[ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
	[ -e "$DIR_COLORS" ] || DIR_COLORS=""
	eval "`dircolors -b $DIR_COLORS`"
fi

alias findinpyfiles="find . -name \*.py -print0 | xargs -0 grep -nI"
  • Maybe get and run startxnosh.bat if you install the xinit module. Then running tools like xcalc from a PuTTY ssh connection with X11 forwarding checked will work. An alternative to that is Xming.

3. Configure or Install vim. (Here's a vim Cheat Sheet)

Ensure that vim supports the Python interpreter. (YouTube video.)

$ vim --version | grep +python

If it doesn't, then ensure you've got the required modules. (Mostly the same as listed above for PuTTY.) Then execute the following:

$ hg clone https://vim.googlecode.com/hg/ vim
$ cd vim/src
$ ./configure --enable-pythoninterp --with-features=huge --prefix=$HOME/opt/vim
$ make && make install
$ mkdir -p $HOME/bin 
$ cd $HOME/bin
$ ln -s $HOME/opt/vim/bin/vim; ln -s $HOME/opt/vim/bin/vim vi
$ which vim
$ vim --version | grep +python

Note: If you choose to install the gvim binary onto a Microsoft Windows machine, the .vimrc file is named, _vimrc, and might reside in C:\Program Files\Vim. The colors, autoload and bundle directories reside within a vimfiles directory there.

Make the .vim_undo directory with one of the two following commands. The last one is for GVim on Windows, since Windows won't let you start a directory name with a dot. Run the command from cygwin.

$ mkdir $HOME/.vim_undo
$ mkdir `cygpath -u $USERPROFILE`/.vim_undo

Set the font by editing your .gvimrc (or _gvimrc) file like so: :e $MYGVIMRC

" set guifont=Consolas:h10
set guifont=Courier\ New:h10
.vimrc (Even more tips.)
" Version 2013-01-08.0 - set undodir
set nocompatible    " Use Vim defaults, forget compatibility with vi.
set bs=2            " allow backspacing over everything in insert mode
set wildmenu        " Allows command-line completion with tab
set autoindent      " Copy indent from current line when starting a new line
set smartindent     " Do smart auto indenting when starting  new line
set smarttab        " Honor 'shiftwidth', 'tabstop' or 'softtabstop'
set hlsearch        " highlight all matches for previous search
set nofoldenable    " start unfolded
set foldlevel=0
set nowrap          " no wrapping text lines on the screen
set sidescroll=5
set listchars+=precedes:<,extends:@ " indicators of long lines

if v:version >= 703
  " Do save the undo tree to file, but not in the local directory.
  " Don't forget to mkdir ~/.vim_undo
  set undodir=~/.vim_undo,.
  set undofile        " undo even after closing and reopening a file
endif

" The following two lines set the use of perl regex 
nnoremap / /\v
vnoremap / /\v

" nnoremap <cr> :noh<cr><cr>     " clear search highlights

set ignorecase      " If you enter all lowercase, it's case insensitive,
set smartcase       " if you use mixed-case terms, it's case sensitive.

syntax on

" If you think this is hard to read,
" change the color of comments in vim, or
" use another color scheme like desert or peaksea
"
set t_Co=256
if v:version >= 703
  set colorcolumn=80
endif
if has('gui_running') " Didn't work: if &term != 'builtin_gui'
  " Light backgrounds for GUI experiences
  set background=light
  " colorscheme peaksea                        " install peaksea
  colorscheme tolerable                        " install tolerable
  if v:version >= 703
    highlight ColorColumn ctermbg=255 guibg=#F6F6F6
  endif
  highlight StatusLine   ctermfg=17 ctermbg=Gray " override scheme (overridden by powerline)
  highlight StatusLineNC ctermfg=20 ctermbg=LightGray" override scheme
  set lines=50 columns=100
else
  " Dark backgrounds for tty experiences
  set background=dark
  colorscheme desert
  if v:version >= 703
    highlight ColorColumn ctermbg=234 guibg=Black " dark gray (or 17, dark blue)
  endif
  highlight StatusLine   ctermfg=20 ctermbg=Gray " override scheme (overridden by powerline)
  highlight StatusLineNC ctermfg=17 ctermbg=DarkGray" override scheme
endif
" highlight Comment     term=bold ctermfg=Blue ctermbg=0 guifg=SlateBlue guibg=Black

" set mouse=v     " visual mode, not working great for PuTTY

set tags=tags;/

set history=50
set ruler
if has('statusline')
  set laststatus=2
  set statusline=%<%f\   " Filename
  set statusline+=%w%h%m%r " Options
  "set statusline+=%{fugitive#statusline()} " Git
  "set statusline+=\ [%{&ff}/%Y]            " filetype
  "set statusline+=\ [%{getcwd()}]          " current dir
  "set statusline+=\ [A=\%03.3b/H=\%02.2B]  " ASCII / Hexadecimal value of char
  set statusline+=%=%-14.(%l,%c%V%)\ %p%%   " Right aligned file nav info
endif

set encoding=utf-8

" I don't set comma for mapleader because it's useful for reverse-finding.
" let mapleader = ","
" let g:mapleader = ","

nmap <leader>w :w!<cr>         " Fast saving
" I use relative number for cursor movement.
nmap <leader>r :set relativenumber! relativenumber?<cr>


" Useful mappings for managing tabs
"
nmap <leader>th <esc>:tabprevious<cr>
nmap <leader>tl <esc>:tabnext<cr>
nmap <leader>tn :tabnew
nmap <leader>to :tabonly<cr>
nmap <leader>tc :tabclose<cr>
nmap <leader>tm :tabmove
" Opens a new tab with the current buffer's path
nmap <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/

" pastetoggle
nmap <leader>p :set invpaste paste?<cr>

nmap <leader>n :NERDTree<cr>          " install nerdtree
nmap <leader>l :TlistToggle<cr>       " install taglist

" Visual mode mappings
"""

" map sort function to a key
vnoremap <leader>s :sort<cr>

"easier moving of code blocks
vnoremap < <gv  " better indentation
vnoremap > >gv  " better indentation

" If too many file system events are getting triggered.
set nobackup       " ~ files
set nowritebackup
set noswapfile     " .swp files

" Switch between source and header files
function! SwitchSourceHeader()
  let s:ext  = expand("%:e")
  let s:base = expand("%:t:r")
  let s:cmd  = "find " . s:base
  if (s:ext == "cpp" || s:ext == "c")
    if findfile(s:base . ".h"  ) != "" | exe s:cmd . ".h"   | return | en
    if findfile(s:base . ".hpp") != "" | exe s:cmd . ".hpp" | return | en
  else
    if findfile(s:base . ".cpp") != "" | exe s:cmd . ".cpp" | return | en
    if findfile(s:base . ".c"  ) != "" | exe s:cmd . ".c"   | return | en
  endif
endfunc

" Demonstrates a way to look in a mirror directory
" function! OpenOther()
"    if expand("%:e") == "cpp"
"      exe "split" fnameescape(expand("%:p:r:s?src?include?").".h")
"    elseif expand("%:e") == "h"
"      exe "split" fnameescape(expand("%:p:r:s?include?src?").".cpp")
"    endif
" endfunc

" Delete trailing white space on save, useful for Python and CoffeeScript ;)
function! DeleteTrailingWS()
  exe "normal mz"
  %s/\s\+$//ge
  exe "normal `z"
endfunc

if has("autocmd")
  autocmd! BufWritePost .vimrc source %           " re-source this file when saved.
  autocmd BufWrite *.py :call DeleteTrailingWS()  " Delete trailing whitespace
  " Don't let smartindent unindent the # character in Python files
  autocmd FileType python  inoremap # X<c-h>#
  autocmd FileType python  set expandtab          " Use spaces instead of tabs
  autocmd Filetype make    setl noexpandtab       " ...not for files that use tabs.

  " Use the vim command %retab before applying the following
  " two with files that have 8-space tabs.
  autocmd FileType c,cpp,python  set tabstop=4
  autocmd FileType c,cpp,python  set shift

  autocmd FileType python  set foldmethod=indent  " 'za' to fold
  autocmd FileType python  set foldlevel=99

  autocmd Filetype c,cpp nmap <buffer> <leader>s :call SwitchSourceHeader()<cr>
  autocmd FileType c,cpp set foldmethod=syntax

  if v:version >= 703
    " I toggle out of relative number when Vim's focus is lost, because
    " if I'm not editing, then I may be referring to errors with line numbers.
    autocmd FocusLost * if &relativenumber | set number | endif
    autocmd FocusGained * if &number | set relativenumber | endif
  endif

  " Since I have the undo tree saved to disk now (see above), I might prefer to
  " automatically save the file when focus is lost.
  " autocmd FocusLost * silent! wa

  autocmd BufRead *.txt set tw=78                 " Limit width of text to 78 chars
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  \   exe "normal! g'\"" |
  \ endif
endif

" This requires vim to be compiled with +python
" Use auto complete in insert mode with ctrl-x, ctrl-o
" See :help new-omni-completion for more.
filetype plugin on
set omnifunc=syntaxcomplete#Complete
" Auto completion via ctrl-space (instead of ctrl-x ctrl-o)
" set omnifunc=pythoncomplete#Complete
" inoremap <Nul> <C-x><C-o>

" This function attempts to reuse the same scratch
" buffer over and over, so you always see output in 
" the same location in your window layout.
function! ExecuteFileIntoScratchBuffer()
  write
  let f=expand("%:p")
  let cur_win = winnr()
  if buflisted("_vim_output")
    exe bufwinnr("_vim_output") . "wincmd w"
    enew
  else
    vnew
    let cur_win = cur_win+1
  endif
  setlocal buftype=nofile
  setlocal bufhidden=delete
  setlocal noswapfile
  silent file _vim_output
  execute '.! "'.f.'"'
  exe cur_win . "wincmd w"
endfunc
nmap <F5> :call ExecuteFileIntoScratchBuffer()<cr>

" Execute a selection of code
" Use Visual to select a range and then hit ctrl-h to execute it.
if has("python")
python << EOL
import vim
def EvaluateCurrentRange():
    eval(compile('\n'.join(vim.current.range),'','exec'),globals())
EOL
vnoremap <C-h> :py EvaluateCurrentRange()<cr>
endif

" Install Pathogen for this next call to work
call pathogen#infect()

Use a color scheme you like, like peaksea and tolerable.

$ mkdir -p ~/.vim/colors
$ curl -Sso ~/.vim/colors/peaksea.vim \
  www.vim.org/scripts/download_script.php?src_id=15675
$ curl -Sso ~/.vim/colors/tolerable.vim \
  vim.sourceforge.net/scripts/download_script.php?src_id=3741

Install some modules. Start with Pathogen to manage the modules.

$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ curl -Sso ~/.vim/autoload/pathogen.vim \
  https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim

Now you can install any plugin into a .vim/bundle/plugin-name/ folder.

For example, install powerline.

$ cd ~/.vim/bundle
$ git clone git://github.com/Lokaltog/vim-powerline.git
$ cd ~/.vim/bundle/vim-powerline/doc; vim -c ":helptags ."

If you use a light background, put this colorscheme in bundle/vim-powerline/autoload/Powerline/Colorschemes/default.vim.

taglist is indispensable. Check the link for further instructions regarding interaction with ctags if you don't already have it set up. (To do: See why Mir Nazim recommended tagbar instead.)

$ cd ~/.vim/bundle
$ curl vim.sourceforge.net/scripts/download_script.php?src_id=7701 > taglist_45.zip
$ unzip taglist_45.zip -d taglist
$ rm taglist_45.zip
$ cd ~/.vim/bundle/taglist/doc; vim -c ":helptags ."

nerdtree is another good candidate.

$ cd ~/.vim/bundle
$ git clone https://github.com/scrooloose/nerdtree.git
$ cd ~/.vim/bundle/nerdtree/doc; vim -c ":helptags ."

command-t was recommended by Steve Losh. But it requires vim to have been compiled with Ruby support.

$ vim --version | grep +ruby

Most filetypes should have correct syntax coloring, but just in case, you could add it yourself. For example, for yaml, you'd get yaml.vim. You'll need to create a new filetype in your .vimrc file, and add an entry to read your syntax file, too.

  autocmd BufRead,BufNewFile *.yaml set filetype=yaml
  autocmd! Syntax yaml source $VIM/yaml.vim

And install the syntax file...

$ curl -Sso ~/.vim/yaml.vim \
  www.vim.org/scripts/download_script.php?src_id=2249

4. Get WinMerge.

5. Get Eclipse.

6. Get SVN for home.

7. Get Fiddler2 for a web debugging proxy outside Firefox.

7. To Access SharePoint from FireFox.
Go to your Firefox address bar and type about:config.  Find the key called network.automatic-ntlm-auth.trusted-uris. Set that key's value to a comma separated list of servers for which you want NTLM authentication.


Discretionary

1. Get Mozilla Firefox.
Your favorite themes were Winestripe or StrataStripe, but things are different in Firefox 4.  Get the Add-ons you love:

Consider some of these good ideas. Consider setting the following about:config parameters:
browser.tabs.tabMinWidth 75
browser.tabs.closeButtons 3
browser.urlbar.hideGoButton true

2. Inkscape for vector graphics. (I need to test this out.)

3. PDF creation: PDF Creator and reading: Foxit.

4. Fraps for recording desktop video.

5. Use Soluto to check boot speed and crash problems.

6. Consider syncing Outlook to Google Calendar.

7. Microsoft Security Essentials, as mentioned in a 2011-11-24 email exchange with Alan Henry.

8. Enable Remote Desktop.

9. Prey. (If your new computer is a laptop, that is.) Remember to leave a Guest Account available for the thief to use, so that Prey has a chance to checkin.



© 2006-2012, David Blume
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.