├── .vim ├── .DS_Store ├── .netrwhist ├── autoload │ └── pathogen.vim ├── bundle │ ├── doc │ │ └── vimpress.txt │ └── syntax │ │ └── blogsyntax.vim └── spell │ ├── en.utf-8.add │ └── en.utf-8.add.spl ├── .vimrc ├── .zshrc ├── README.md └── setup /.vim/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielmiessler/ServerConfig/4467ae0cbf51113d6651c37faae0b5e557096dfd/.vim/.DS_Store -------------------------------------------------------------------------------- /.vim/.netrwhist: -------------------------------------------------------------------------------- 1 | let g:netrw_dirhistmax =10 2 | let g:netrw_dirhist_cnt =3 3 | let g:netrw_dirhist_1='/Users/daniel/Development/GitHubRating' 4 | let g:netrw_dirhist_2='/Users/daniel/Development/alexa' 5 | let g:netrw_dirhist_3='/Users/daniel/Development/wappalyzer-script/wappalyzer' 6 | -------------------------------------------------------------------------------- /.vim/autoload/pathogen.vim: -------------------------------------------------------------------------------- 1 | " pathogen.vim - path option manipulation 2 | " Maintainer: Tim Pope 3 | " Version: 2.3 4 | 5 | " Install in ~/.vim/autoload (or ~\vimfiles\autoload). 6 | " 7 | " For management of individually installed plugins in ~/.vim/bundle (or 8 | " ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your 9 | " .vimrc is the only other setup necessary. 10 | " 11 | " The API is documented inline below. 12 | 13 | if exists("g:loaded_pathogen") || &cp 14 | finish 15 | endif 16 | let g:loaded_pathogen = 1 17 | 18 | " Point of entry for basic default usage. Give a relative path to invoke 19 | " pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke 20 | " pathogen#surround(). Curly braces are expanded with pathogen#expand(): 21 | " "bundle/{}" finds all subdirectories inside "bundle" inside all directories 22 | " in the runtime path. 23 | function! pathogen#infect(...) abort 24 | for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}'] 25 | if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]' 26 | call pathogen#surround(path) 27 | elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)' 28 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 29 | call pathogen#surround(path . '/{}') 30 | elseif path =~# '[{}*]' 31 | call pathogen#interpose(path) 32 | else 33 | call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') 34 | call pathogen#interpose(path . '/{}') 35 | endif 36 | endfor 37 | call pathogen#cycle_filetype() 38 | if pathogen#is_disabled($MYVIMRC) 39 | return 'finish' 40 | endif 41 | return '' 42 | endfunction 43 | 44 | " Split a path into a list. 45 | function! pathogen#split(path) abort 46 | if type(a:path) == type([]) | return a:path | endif 47 | if empty(a:path) | return [] | endif 48 | let split = split(a:path,'\\\@]','\\&','') 238 | endif 239 | endfunction 240 | 241 | " Like findfile(), but hardcoded to use the runtimepath. 242 | function! pathogen#runtime_findfile(file,count) abort "{{{1 243 | let rtp = pathogen#join(1,pathogen#split(&rtp)) 244 | let file = findfile(a:file,rtp,a:count) 245 | if file ==# '' 246 | return '' 247 | else 248 | return fnamemodify(file,':p') 249 | endif 250 | endfunction 251 | 252 | " Section: Deprecated 253 | 254 | function! s:warn(msg) abort 255 | echohl WarningMsg 256 | echomsg a:msg 257 | echohl NONE 258 | endfunction 259 | 260 | " Prepend all subdirectories of path to the rtp, and append all 'after' 261 | " directories in those subdirectories. Deprecated. 262 | function! pathogen#runtime_prepend_subdirectories(path) abort 263 | call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')') 264 | return pathogen#surround(a:path . pathogen#slash() . '{}') 265 | endfunction 266 | 267 | function! pathogen#incubate(...) abort 268 | let name = a:0 ? a:1 : 'bundle/{}' 269 | call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')') 270 | return pathogen#interpose(name) 271 | endfunction 272 | 273 | " Deprecated alias for pathogen#interpose(). 274 | function! pathogen#runtime_append_all_bundles(...) abort 275 | if a:0 276 | call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')') 277 | else 278 | call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') 279 | endif 280 | return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') 281 | endfunction 282 | 283 | if exists(':Vedit') 284 | finish 285 | endif 286 | 287 | let s:vopen_warning = 0 288 | 289 | function! s:find(count,cmd,file,lcd) 290 | let rtp = pathogen#join(1,pathogen#split(&runtimepath)) 291 | let file = pathogen#runtime_findfile(a:file,a:count) 292 | if file ==# '' 293 | return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" 294 | endif 295 | if !s:vopen_warning 296 | let s:vopen_warning = 1 297 | let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE' 298 | else 299 | let warning = '' 300 | endif 301 | if a:lcd 302 | let path = file[0:-strlen(a:file)-2] 303 | execute 'lcd `=path`' 304 | return a:cmd.' '.pathogen#fnameescape(a:file) . warning 305 | else 306 | return a:cmd.' '.pathogen#fnameescape(file) . warning 307 | endif 308 | endfunction 309 | 310 | function! s:Findcomplete(A,L,P) 311 | let sep = pathogen#slash() 312 | let cheats = { 313 | \'a': 'autoload', 314 | \'d': 'doc', 315 | \'f': 'ftplugin', 316 | \'i': 'indent', 317 | \'p': 'plugin', 318 | \'s': 'syntax'} 319 | if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) 320 | let request = cheats[a:A[0]].a:A[1:-1] 321 | else 322 | let request = a:A 323 | endif 324 | let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*' 325 | let found = {} 326 | for path in pathogen#split(&runtimepath) 327 | let path = expand(path, ':p') 328 | let matches = split(glob(path.sep.pattern),"\n") 329 | call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') 330 | call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') 331 | for match in matches 332 | let found[match] = 1 333 | endfor 334 | endfor 335 | return sort(keys(found)) 336 | endfunction 337 | 338 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) 339 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) 340 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) 341 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) 342 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) 343 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) 344 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) 345 | command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) 346 | 347 | " vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': 348 | -------------------------------------------------------------------------------- /.vim/bundle/doc/vimpress.txt: -------------------------------------------------------------------------------- 1 | *vimpress.txt* Plugin for managing wordpress blog from Vim. 2 | 3 | Script: blog.vim 4 | Authors: Adrien Friggeri 5 | Pigeond 6 | * Preston M.[BOYPT] 7 | Justin Sattery 8 | Lenin Lee 9 | * Conner McDaniel 10 | (* Currently developing) 11 | Conner's Repository: https://github.com/connermcd/VimRepress 12 | Preston's Repository: https://bitbucket.org/pentie/vimrepress 13 | 14 | License: Same terms as Vim itself (see |license|) 15 | 16 | ============================================================================ 17 | 18 | *INSTALL* 19 | 20 | Download vimpress_x.x.x.zip, extract it in your .vim directory: 21 | 22 | cd ~/.vim 23 | unzip /path/to/vimpress_x.x.x.zip 24 | 25 | *CONFIGURE* 26 | 27 | Create file `~/.vimpressrc' in the following format: 28 | 29 | [Blog0] 30 | blog_url = http://a-blog.com/ 31 | username = admin 32 | password = 123456 33 | 34 | [Blog1] 35 | blog_url = https://someone.wordpress.com/ 36 | username = someone 37 | password = 38 | 39 | > 40 | For Upgraded Users: 41 | 42 | Defining Account info in `.vimrc` is now obsolesced, if you have correspond defination in `.vimrc', they will automaticly copied into `~/.vimpressrc', now you're safe to remove the VIMPRESS defination in `.vimrc'. 43 | < 44 | 45 | Hardcoding the password is optional. If a password is not provided, 46 | the plugin will prompt for one the first time it's needed. 47 | 48 | If you need Markdown support, simply run `sudo apt-get install python-markdown' in Ubuntu. 49 | 50 | If you use other distributions (or OSs), refer to your package manager or the python-markdown 51 | project page: http://www.freewisdom.org/projects/python-markdown/Installation 52 | 53 | *COMMANDS* 54 | 55 | Vimpress Commands (parameters in square brackets are optional): 56 | > 57 | :BlogList [] [] 58 | < Lists a specified number of blog posts or pages for the current blog 59 | starting the with most recent. In this view, you can press 60 | to open a post for edit, or press to move a post to trash. 61 | The Delete function doesn't actually remove your post, but move to 62 | the trash. 63 | [] - either post or page, [Default post]. 64 | [] - number to display (only for posts, Default 30) 65 | > 66 | :BlogNew [] 67 | < Creates a new page editing window from the current buffer. 68 | [] - either post or page. [Default:post] 69 | > 70 | :BlogSave [] 71 | < Saves the current editing window. 72 | [] - either post or publish. [Default:draft] 73 | > 74 | :BlogPreview [] 75 | < If set to local, converts the editing window to HTML and displays it 76 | locally in a file browser. Otherwise, the command is the same as 77 | :BlogSave except that it opens a preview of the post or page on the blog. 78 | [] - either local, post, or publish. [Default:local] 79 | > 80 | :BlogOpen 81 | < Opens the specified post. 82 | - link you copied from the browser, or simply the 83 | numberic post id. 84 | > 85 | :BlogSwitch [] 86 | < Switches the current working blog to the next in the configuration 87 | array or the specified index. 88 | [] - index of blog to switch to. 89 | > 90 | :BlogUpload 91 | < Uploads a file to the blog's media library, then the attachment URL 92 | will append to the current buffer. 93 | - /path/to/file 94 | > 95 | :BlogCode [] 96 | < Appends a pre tag to the end of the current buffer of a specified 97 | code language. (i.e. python) 98 | [] - the coding language 99 | 100 | *TIPS* 101 | 102 | |Categories| When you're writing a new post, and you want to fill the "Cats" 103 | line in the meta field, press in INSERT mode, a menu will 104 | show up with all your categories names in your blog. Completion is supported. 105 | 106 | |Recovery| If you have a slow connection to your blog, there's a chance that gvim will got hanged during your posting the article, just wait patiently. If still vim crashed with fail posting your article (never happened here), don't worried, vim had a inteligent recovery system, reopen vim and strike |:recovery| command, your article should appear. Type |:help recovery| for more info. 107 | 108 | 109 | 110 | *EXAMPLES* 111 | 112 | Some commands list above contain special usage, example below may clearify them for you. 113 | 114 | > 115 | :BlogList - List 30 recent posts. 116 | :BlogList page - List 30 recent pages. 117 | :BlogList post 100 - List 100 recent posts. 118 | 119 | :BlogNew post - Write an new post. 120 | :BlogNew page - Write an new page. 121 | 122 | :BlogSave - Save (defautely published.) 123 | :BlogSave draft - Save as draft. 124 | 125 | :BlogPreview local - Preview page/post locally in your browser. 126 | :BlogPreview publish - Same as `:BlogSave publish' with brower opened. 127 | 128 | :BlogOpen 679 129 | :BlogOpen http://your-first-blog.com/archives/679 130 | :BlogOpen http://your-second-blog.com/?p=679 131 | :BlogOpen http://your-third-blog.com/with-your-custom-permalink 132 | < 133 | 134 | -------------------------------------------------------------------------------- /.vim/bundle/syntax/blogsyntax.vim: -------------------------------------------------------------------------------- 1 | if version < 600 2 | syntax clear 3 | elseif exists("b:current_syntax") 4 | finish 5 | endif 6 | sy match blogeditorEntry "^ *[0-9]*\t.*$" 7 | sy match blogeditorComment '^".*$' 8 | sy match blogeditorIdent '^"[^:]*:' 9 | hi link blogeditorComment Comment 10 | hi link blogeditorEntry Directory 11 | hi link blogeditorIdent Function 12 | let b:current_syntax = "blogsyntax" 13 | -------------------------------------------------------------------------------- /.vim/spell/en.utf-8.add: -------------------------------------------------------------------------------- 1 | StrID 2 | EditType 3 | EditFormat 4 | BlogAddr 5 | https 6 | danielmiessler 7 | google 8 | linkedin 9 | imdb 10 | wiki 11 | youtube 12 | screensaver 13 | alfred 14 | iTunes 15 | Blockchain 16 | Bitcoin 17 | blockchain 18 | keypairs 19 | username 20 | offline 21 | Facebook 22 | realtime 23 | Curation 24 | Twitter's 25 | curation 26 | firehose 27 | JSON 28 | CSV 29 | Exceptionalism 30 | exceptionalism 31 | Github 32 | -------------------------------------------------------------------------------- /.vim/spell/en.utf-8.add.spl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielmiessler/ServerConfig/4467ae0cbf51113d6651c37faae0b5e557096dfd/.vim/spell/en.utf-8.add.spl -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | " Configuration 2 | 3 | " Pathogen first 4 | 5 | execute pathogen#infect() 6 | 7 | " Basic Settings 8 | 9 | filetype plugin indent on 10 | syntax on 11 | set shell=/bin/zsh 12 | set guifont=Menlo:h14 13 | set nocompatible 14 | set modelines=0 15 | set tabstop=4 16 | set shiftwidth=4 17 | set softtabstop=4 18 | set expandtab 19 | set encoding=utf-8 20 | set scrolloff=3 21 | set autoindent 22 | set showmode 23 | set showcmd 24 | set hidden 25 | set wildmenu 26 | set wildmode=list:longest 27 | set visualbell 28 | set ttyfast 29 | set ruler 30 | set backspace=indent,eol,start 31 | set laststatus=2 32 | set number 33 | set relativenumber 34 | set noundofile 35 | nnoremap / /\v 36 | vnoremap / /\v 37 | set ignorecase 38 | set smartcase 39 | set gdefault 40 | set incsearch 41 | set showmatch 42 | set hlsearch 43 | nnoremap :noh 44 | nnoremap % 45 | vnoremap % 46 | set wrap 47 | set linebreak 48 | set nolist 49 | set formatoptions=qrn1 50 | 51 | " Mappings and shortcuts 52 | 53 | " Basics 54 | 55 | inoremap jk 56 | let mapleader = " " 57 | 58 | " Config 59 | :set spell spelllang=en_us 60 | 61 | " Arrows are unvimlike 62 | 63 | nnoremap 64 | nnoremap 65 | nnoremap 66 | nnoremap 67 | inoremap 68 | inoremap 69 | inoremap 70 | inoremap 71 | 72 | " Disable the ESC key 73 | 74 | inoremap 75 | 76 | " Miscellaneous 77 | 78 | inoremap 79 | nnoremap 80 | vnoremap 81 | au FocusLost * :wa 82 | vnoremap . :norm. 83 | 84 | " Leader shortcuts 85 | 86 | nnoremap W :%s/\s\+$//:let @/='' 87 | nnoremap a :Ack 88 | nnoremap ft Vatzf 89 | nnoremap S ?{jV/^\s*\}?$k:sort:noh 90 | nnoremap q gqip 91 | nnoremap v V`] 92 | nnoremap ev :e $MYVIMRC 93 | nnoremap w vl 94 | nnoremap j VipJ 95 | nnoremap q gqip 96 | nnoremap f 1z= 97 | nnoremap s ]s 98 | nnoremap u :!git pull website master && git commit -am 'Standard commit.' && git push website master 99 | nnoremap p :!git commit -am 'Standard commit.' && git push origin master 100 | nnoremap d :read !date 101 | nnoremap r :!! 102 | nnoremap m :normal @a 103 | nnoremap l :CtrlP 104 | nnoremap nt :NERDTree 105 | nnoremap s :set spell! 106 | nnoremap n :set nonumber! 107 | nnoremap rn :set norelativenumber! 108 | nnoremap c :nohl 109 | nnoremap pa :set nopaste! 110 | nnoremap rc :so $MYVIMRC 111 | nnoremap p :BlogSave publish 112 | nnoremap h :set ft=HTML 113 | nnoremap d :BlogSave draft 114 | 115 | " Control shortcuts 116 | 117 | nnoremap h 118 | nnoremap j 119 | nnoremap k 120 | nnoremap l 121 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | ####################################################### 2 | # Daniel Miessler's zsh configuration 3 | ####################################################### 4 | 5 | # Editor 6 | 7 | export EDITOR="/usr/bin/vim" 8 | 9 | # Source Prezto 10 | 11 | if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then 12 | source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" 13 | fi 14 | 15 | # Customize to your needs... 16 | 17 | bindkey -v 18 | bindkey -M viins 'jk' vi-cmd-mode 19 | 20 | # Aliases 21 | 22 | alias bt="wget http://cachefly.cachefly.net/400mb.test > /dev/null" 23 | alias zconf="vi ~/.zshrc" 24 | alias zsource="source ~/.zshrc" 25 | alias zhup="source ~/.zshrc" 26 | alias vhup="source ~/.vimrc" 27 | alias vconf="vim ~/.vimrc" 28 | alias v="cd ~/.vim" 29 | alias b="cd ~/.vim/bundle" 30 | alias nc="ncat" 31 | alias traceroute="/usr/local/sbin/mtr" 32 | alias fd="dscacheutil -flushcache" 33 | alias ds="dd if=/dev/zero of=/tmp/output.img bs=8k count=256k" 34 | alias vi="/usr/bin/vim" 35 | alias vim="/usr/bin/vim" 36 | alias ems="vim ~/.vim/bundle/snippets/snippets/markdown.snippets" 37 | alias ehs="vim ~/.vim/bundle/snippets/snippets/html.snippets" 38 | alias filetree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'" 39 | alias rm="rm -f" 40 | alias ds="du -hs * | sort -h" 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Server Config files 2 | 3 | It sucks to try to remember all the various things you need to do to a server when you set one up. 4 | 5 | This project takes my primary configs for zsh and vim, and places them into a GitHub repository that can be downloaded from new boxes. 6 | 7 | ## Installation 8 | 9 | 1. Clone down the repository on the new box 10 | 2. CD into ServerConfig directory 11 | 3. Run the setup script (it's a bit borked because it switches shells in the middle, so just do the steps) 12 | 4. Log out and back in 13 | 14 | You should now have your (my) preferred configuration for zsh and vim. For me this includes lots of vim configurations, such as alternate ESC functionality, and vim control in the zsh shell. 15 | -------------------------------------------------------------------------------- /setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ~/ServerConfig 4 | aptitude install git 5 | aptitude install zsh 6 | zsh 7 | setopt EXTENDED_GLOB 8 | for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do 9 | ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" 10 | done 11 | chsh -s /bin/zsh 12 | --------------------------------------------------------------------------------