Fred Damstra 5 年 前
コミット
6cda3e582a
2 ファイル変更57 行追加6 行削除
  1. 29 1
      .bashrc
  2. 28 5
      .vimrc

+ 29 - 1
.bashrc

@@ -127,6 +127,11 @@ if [ -d ~/scripts ]; then
   export PATH=$PATH:~/scripts
 fi
 
+# Add bin directories to the path
+if [ -d ~/bin ]; then
+  export PATH=$PATH:~/bin
+fi
+
 # Add autocompletion for git
 source ~/.bash/git-completion.bash
 
@@ -134,7 +139,7 @@ source ~/.bash/git-completion.bash
 [ -f ~/.git_token ] && source ~/.git_token
 
 # Add autocompletion for aws
-[ -x /usr/local/bin/aws_completer ] && complete -C '/usr/local/bin/aws_completer' aws
+#[ -x /usr/local/bin/aws_completer ] && complete -C '/usr/local/bin/aws_completer' aws
 
 ## iTerm integration
 #[ -f ~/.iterm2_shell_integration.bash ] && source ~/.iterm2_shell_integration.bash
@@ -168,4 +173,27 @@ export ANSIBLE_HOST_KEY_CHECKING=False
 # Python venv?
 if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
 
+if [ -f ~/awsinfo/scripts/awsinfo.bash ]; then
+    alias awsinfo=~/awsinfo/scripts/awsinfo.bash
+fi
+
 alias python='python3'
+
+# WHen were passwords changed
+#echo; echo Password Last Changed:; u=$(dscl . list /Users | egrep -v '^_|daemon|nobody'); for i in $u; do printf \\n$i\\t; currentUser=$i;t=$(dscl . read /Users/"$currentUser" | grep -A1 passwordLastSetTime | grep real | awk -F'real>|</real' '{print $2}'); date -j -f %s "$t" 2> /dev/null; done
+
+# Print password expirations:
+echo 
+echo -n Password Expiration:
+u=$(dscl . list /Users | egrep -v '^_|daemon|nobody|root')
+for i in $u; do 
+  printf \\n$i\\t; 
+  currentUser=$i;
+  t=$(dscl . read /Users/"$currentUser" | grep -A1 passwordLastSetTime | grep real | awk -F'real>|</real' '{print $2}'); 
+  t=$(echo "$t" | cut -f1 -d"."); 
+  t=$(expr $t + 5184000); 
+  echo -n $(date -j -f "%s" "$t" 2> /dev/null); 
+done;
+echo
+
+alias splunk='ssh fred@3.80.49.68'

+ 28 - 5
.vimrc

@@ -1,18 +1,19 @@
 set nocompatible              " be iMproved, required
 filetype off                  " required
 syntax on
+set encoding=utf-8
 
 " Accomodate a dark background
 set background=dark
 
 " set the runtime path to include Vundle and initialize
-"set rtp+=~/.vim/bundle/Vundle.vim
-"call vundle#begin()
+set rtp+=~/.vim/bundle/Vundle.vim
+call vundle#begin()
 " alternatively, pass a path where Vundle should install plugins
 "call vundle#begin('~/some/path/here')
 
 " let Vundle manage Vundle, required
-"Plugin 'gmarik/Vundle.vim'
+Plugin 'gmarik/Vundle.vim'
 
 " The following are examples of different formats supported.
 " Keep Plugin commands between vundle#begin/end.
@@ -31,10 +32,10 @@ set background=dark
 "n 'fatih/vim-go'Plugin 'user/L9', {'name': 'newL9'}
 " Go Plugin:
 "Plugin 'fatih/vim-go'
-
+Plugin 'vim-scripts/indentpython.vim'
 
 " All of your Plugins must be added before the following line
-"call vundle#end()            " required
+call vundle#end()            " required
 filetype plugin indent on    " required
 " To ignore plugin indent changes, instead use:
 "filetype plugin on
@@ -51,3 +52,25 @@ filetype plugin indent on    " required
 set tabstop=2
 set shiftwidth=2
 set expandtab
+
+" Python PEP-8
+au BufNewFile,BufRead *.py
+    \ set tabstop=4 |
+    \ set softtabstop=4 |
+    \ set shiftwidth=4 |
+    \ set textwidth=79 |
+    \ set expandtab |
+    \ set autoindent |
+    \ set fileformat=unix
+
+" But not for most files
+au BufNewFile,BufRead *.js, *.html, *.css
+    \ set tabstop=2 |
+    \ set softtabstop=2 |
+    \ set shiftwidth=2
+
+" Flag bad whitespace
+" I hate this because it highlights while i'm writing
+"highlight BadWhitespace ctermfg=16 ctermbg=253 guifg=#000000 guibg=#F8F8F0
+"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /[^\s]\s\+$/
+