Some changes

main
Thomas Ba. 9 years ago
parent 49f1883f14
commit cce7fa22aa

@ -9,7 +9,7 @@ import urllib.request
def get_page(url): def get_page(url):
f = urllib.request.urlopen(url) f = urllib.request.urlopen(url)
return f.readall().decode("utf-8") return f.read().decode("utf-8")
def retrieve(url, filename): def retrieve(url, filename):
urllib.request.urlretrieve(url, filename) urllib.request.urlretrieve(url, filename)
@ -22,7 +22,7 @@ def api_call(method, extreme_env):
authtoken = extreme_env["API_AUTH"] authtoken = extreme_env["API_AUTH"]
request = urllib.request.Request(url, headers={"X-API-Auth": authtoken}) request = urllib.request.Request(url, headers={"X-API-Auth": authtoken})
f = urllib.request.urlopen(request) f = urllib.request.urlopen(request)
return json.loads(f.readall().decode("utf-8")) return json.loads(f.read().decode("utf-8"))
def get_extreme_env(url): def get_extreme_env(url):
page = get_page(url) page = get_page(url)

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
CARD=$(aplay -l|sed -n 's/^Karte \([0-9]\+\): .*G930.*$/\1/p') CARD=$(LANG=en_US aplay -l|sed -n 's/^\(Karte\|card\) \([0-9]\+\): .*G930.*$/\2/p')
CH="PCM" CH="PCM"
if [ $# -eq 0 ] ; then if [ $# -eq 0 ] ; then

@ -196,7 +196,7 @@ bindsym $mod+r mode "resize"
bar { bar {
status_command i3blocks status_command i3blocks
i3bar_command /usr/bin/i3bar-icons i3bar_command /usr/bin/i3bar-icons
tray_output LVDS1 tray_output DVI-0
} }
bindsym $mod+Shift+g mode "$mode_gaps" bindsym $mod+Shift+g mode "$mode_gaps"

@ -13,6 +13,8 @@ call plug#begin('~/.vim/plugged')
" color " color
Plug 'thomasba/wombat256.vim' Plug 'thomasba/wombat256.vim'
Plug 'altercation/vim-colors-solarized'
Plug 'baeuml/summerfruit256.vim'
" filetype " filetype
@ -40,7 +42,8 @@ endif
" Utility " Utility
Plug 'Shougo/neocomplete.vim' Plug 'Shougo/neocomplete.vim'
Plug 'tpope/vim-speeddating' Plug 'tpope/vim-speeddating'
Plug 'bling/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/Tagbar' Plug 'vim-scripts/Tagbar'
Plug 'vim-scripts/loremipsum', { 'on': 'Loremipsum' } Plug 'vim-scripts/loremipsum', { 'on': 'Loremipsum' }
Plug 'vim-scripts/LanguageTool', {'on': 'LanguageToolCheck'} Plug 'vim-scripts/LanguageTool', {'on': 'LanguageToolCheck'}

@ -1,32 +1,38 @@
" load plugins using vundle " vim: set fdm=marker fdc=3 :
" load plugins using vundle {{{
if has("win32") if has("win32")
source ~/vimfiles/plug.vim source ~/vimfiles/plug.vim
else else
source ~/.vim/plug.vim source ~/.vim/plug.vim
endif endif
" }}}
syntax on " set colorscheme {{{
filetype plugin indent on if &term =~# '^\(screen\|xterm\)'
" delete always on backspace
set backspace=indent,eol,start
" set colorscheme
if &term =~# '^\(screen\|xterm\)$'
set t_Co=256 set t_Co=256
let g:solarized_termcolors=256
endif endif
if (&t_Co >= 255 && &term !~ '^linux$') || has("gui_running") if (&t_Co >= 255 && &term !~ '^linux$') || has("gui_running")
colorscheme wombat256_thomasba colorscheme wombat256_thomasba
else else
colorscheme elflord2 colorscheme elflord2
endif endif
" }}}
if has("gui_running") " GUI settings {{{
if has('gui_running')
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
set guifont="Monospace 10" set guifont="Monospace 10"
" Nooo, dont blink!!
set guicursor=a:blinkon0
endif endif
" }}}
" editor settings {{{
syntax on
filetype plugin indent on
" delete always on backspace
set backspace=indent,eol,start
set hidden set hidden
set number set number
set numberwidth=4 set numberwidth=4
@ -51,39 +57,38 @@ set ttyfast
set hlsearch set hlsearch
set spelllang=de_de,en set spelllang=de_de,en
set copyindent set copyindent
" }}}
" move by screen lines, not by real lines - great for creative writing " move by screen lines, not by real lines - great for creative writing {{{
nnoremap j gj nnoremap j gj
nnoremap k gk nnoremap k gk
nnoremap <Up> gk nnoremap <Up> gk
nnoremap <Down> gj nnoremap <Down> gj
" also in visual mode " also in visual mode
vnoremap j gj vnoremap j gj
vnoremap k gk vnoremap k gk
vnoremap <Up> gk vnoremap <Up> gk
vnoremap <Down> gj vnoremap <Down> gj
" }}}
nnoremap , : " fileencoding {{{
set encoding=utf-8 set encoding=utf-8
set fileencodings=ucs-bom,utf-8,latin,windows-1252 set fileencodings=ucs-bom,utf-8,latin,windows-1252
" }}}
" TOhtml settings {{{
let g:html_prevent_copy = "fn" let g:html_prevent_copy = "fn"
let html_use_xhtml=1 let html_use_xhtml=1
let html_use_css=1 let html_use_css=1
" }}}
" slightly highlight rows and columns " slightly highlight rows and columns {{{
"set cursorline "set cursorline
"set cursorcolumn "set cursorcolumn
" }}}
" mail " mail {{{
augroup mail augroup mail
autocmd! autocmd!
autocmd FileType mail set textwidth=70 wrap fo=tcrq autocmd FileType mail set textwidth=70 wrap fo=tcrq
augroup END augroup END
" }}}
" auto completion and menu " auto completion and menu {{{
if has("wildmenu") if has("wildmenu")
set wildignore+=*.a,*.o set wildignore+=*.a,*.o
set wildignore+=.DS_Store,.git,.hg,.svn set wildignore+=.DS_Store,.git,.hg,.svn
@ -91,7 +96,48 @@ if has("wildmenu")
set wildmenu set wildmenu
set wildmode=list,longest,full set wildmode=list,longest,full
inoremap <C-f> <C-X><C-F> inoremap <C-f> <C-X><C-F>
endif endif " }}}
" plugins {{{
" syntastic {{{
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_perl_checkers = ['perl']
let g:syntastic_enable_perl_checker = 1
let g:syntastic_python_checkers = ['pylint']
let g:syntastic_php_checkers = ['php']
let g:syntastic_html_tidy_ignore_errors = ['warning: <div> proprietary attribute "data-role"', '<input> proprietary attribute "required"', '<input> proprietary attribute "pattern"', '<select> proprietary attribute "required"']
" }}}
" github {{{
let g:github_dashboard = { 'username': $GITHUB_USERNAME, 'password': $GITHUB_TOKEN }
let g:github_access_token = $GITHUB_TOKEN
" }}}
" CtrlP {{{
nmap <C-b> :CtrlPBuffer<cr>
" }}}
" Move {{{
let g:move_key_modifier = 'C'
" }}}
" vimux {{{
" Set tmux pane percentage
let g:VimuxHeight = "30"
" Split tmux pane horizontally
let g:VimuxOrientation = "h"
" Prompt for a command to run
noremap <leader>vp :VimuxPromptCommand<CR>
" }}}
" NERDTree {{{
" Hide latex output
let NERDTreeIgnore=['\~$','\.\(aux\|nav\|out\|snm\|toc\|vrb\|o\)$']
let g:nerdtree_plugin_open_cmd = "xdg-open"
" }}}
" /plugins }}}
nnoremap , :
" Map keys to toggle functions " Map keys to toggle functions
function! MapToggle(key, opt) function! MapToggle(key, opt)
@ -167,26 +213,13 @@ nnoremap <leader>- YpVr-
"let g:neocomplcache_enable_at_startup = 1 "let g:neocomplcache_enable_at_startup = 1
let g:indent_guides_auto_colors = 0 let g:indent_guides_auto_colors = 0
" Hide latex output
let NERDTreeIgnore=['\~$','\.\(aux\|nav\|out\|snm\|toc\|vrb\|o\)$']
let g:nerdtree_plugin_open_cmd = "xdg-open"
let g:tex_flavor = "latex" let g:tex_flavor = "latex"
" Large files >= 200 " Large files >= 200
let g:LargeFile = 200 let g:LargeFile = 200
" Nooo, dont blink!!
set guicursor=a:blinkon0
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
if has('gui_running')
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
endif
let g:languagetool_lang = "de" let g:languagetool_lang = "de"
let g:languagetool_jar = "/usr/share/java/languagetool/languagetool.jar" let g:languagetool_jar = "/usr/share/java/languagetool/languagetool.jar"
@ -194,35 +227,6 @@ set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%* set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_perl_checkers = ['perl']
let g:syntastic_enable_perl_checker = 1
let g:syntastic_python_checkers = ['pylint']
let g:syntastic_php_checkers = ['php']
" syntastic
let g:syntastic_html_tidy_ignore_errors = ['warning: <div> proprietary attribute "data-role"', '<input> proprietary attribute "required"', '<input> proprietary attribute "pattern"', '<select> proprietary attribute "required"']
let g:github_dashboard = { 'username': $GITHUB_USERNAME, 'password': $GITHUB_TOKEN }
let g:github_access_token = $GITHUB_TOKEN
" vimux
" Set tmux pane percentage
let g:VimuxHeight = "30"
" Split tmux pane horizontally
let g:VimuxOrientation = "h"
" Prompt for a command to run
noremap <leader>vp :VimuxPromptCommand<CR>
" markdown " markdown
let g:vim_markdown_frontmatter=1 let g:vim_markdown_frontmatter=1
let g:vim_markdown_folding_disabled=1 let g:vim_markdown_folding_disabled=1
" CtrlP
nmap <C-b> :CtrlPBuffer<cr>
" Move
let g:move_key_modifier = 'C'

@ -117,6 +117,15 @@ cp_p()
} }
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
} }
# lima-city
function limaftp() {
if [ $# -ne 2 ] ; then
echo "Usage: $0 <username> <password>"
return 2
fi
lftp -u "$1:$2" "$1.lima-ftp.de"
}
# systemctl # systemctl
command -v systemctl > /dev/null && { command -v systemctl > /dev/null && {

@ -43,4 +43,20 @@ function offlineimap-solve-uuid-problem() {
echo "File or folder not found!" echo "File or folder not found!"
fi fi
} }
# ssh to the server a user in located on and change to his directory
function userssh() {
if [[ "$1" =~ "^[a-z][a-z0-9-]+[a-z0-9]$" ]] ; then
SERVER="$(curl -Ss "https://$LIMA_API_KEY@www.lima-city.de/internal_api/users/$1/placement"|jq -r '.user.placement')"
if [ "$SERVER" = "null" ] ; then
echo 'Invalid username!'
else
echo "Connecting to server $SERVER.trafficplex.de ..."
ssh "$SERVER.trafficplex.de" -t "cd /mnt/webhosting/$1/; exec \$SHELL --login"
fi
else
echo 'Invalid username!'
fi
}
# vim: ft=zsh : # vim: ft=zsh :

Loading…
Cancel
Save