Merge branch 'master' of ssh://git.0l.de:2222/stv0g/dotfiles

This commit is contained in:
Steffen Vogel 2019-01-22 03:52:08 +01:00
commit 28baa17c50
15 changed files with 2061 additions and 20 deletions

3
completion/awscli.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/bash
complete -C "$(which aws_completer)" aws

View file

@ -0,0 +1,430 @@
#!bash
#
# bash completion for docker-compose
#
# This work is based on the completion for the docker command.
#
# This script provides completion of:
# - commands and their options
# - service names
# - filepaths
#
# To enable the completions either:
# - place this file in /etc/bash_completion.d
# or
# - copy this file to e.g. ~/.docker-compose-completion.sh and add the line
# below to your .bashrc after bash completion features are loaded
# . ~/.docker-compose-completion.sh
# For compatibility reasons, Compose and therefore its completion supports several
# stack compositon files as listed here, in descending priority.
# Support for these filenames might be dropped in some future version.
__docker_compose_compose_file() {
local file
for file in docker-compose.y{,a}ml fig.y{,a}ml ; do
[ -e $file ] && {
echo $file
return
}
done
echo docker-compose.yml
}
# Extracts all service names from the compose file.
___docker_compose_all_services_in_compose_file() {
awk -F: '/^[a-zA-Z0-9]/{print $1}' "${compose_file:-$(__docker_compose_compose_file)}" 2>/dev/null
}
# All services, even those without an existing container
__docker_compose_services_all() {
COMPREPLY=( $(compgen -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
}
# All services that have an entry with the given key in their compose_file section
___docker_compose_services_with_key() {
# flatten sections to one line, then filter lines containing the key and return section name.
awk '/^[a-zA-Z0-9]/{printf "\n"};{printf $0;next;}' "${compose_file:-$(__docker_compose_compose_file)}" | awk -F: -v key=": +$1:" '$0 ~ key {print $1}'
}
# All services that are defined by a Dockerfile reference
__docker_compose_services_from_build() {
COMPREPLY=( $(compgen -W "$(___docker_compose_services_with_key build)" -- "$cur") )
}
# All services that are defined by an image
__docker_compose_services_from_image() {
COMPREPLY=( $(compgen -W "$(___docker_compose_services_with_key image)" -- "$cur") )
}
# The services for which containers have been created, optionally filtered
# by a boolean expression passed in as argument.
__docker_compose_services_with() {
local containers names
containers="$(docker-compose 2>/dev/null ${compose_file:+-f $compose_file} ${compose_project:+-p $compose_project} ps -q)"
names=( $(docker 2>/dev/null inspect --format "{{if ${1:-true}}} {{ .Name }} {{end}}" $containers) )
names=( ${names[@]%_*} ) # strip trailing numbers
names=( ${names[@]#*_} ) # strip project name
COMPREPLY=( $(compgen -W "${names[*]}" -- "$cur") )
}
# The services for which at least one paused container exists
__docker_compose_services_paused() {
__docker_compose_services_with '.State.Paused'
}
# The services for which at least one running container exists
__docker_compose_services_running() {
__docker_compose_services_with '.State.Running'
}
# The services for which at least one stopped container exists
__docker_compose_services_stopped() {
__docker_compose_services_with 'not .State.Running'
}
_docker_compose_build() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --no-cache" -- "$cur" ) )
;;
*)
__docker_compose_services_from_build
;;
esac
}
_docker_compose_docker_compose() {
case "$prev" in
--file|-f)
_filedir "y?(a)ml"
return
;;
--project-name|-p)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help -h --verbose --version -v --file -f --project-name -p" -- "$cur" ) )
;;
*)
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
;;
esac
}
_docker_compose_help() {
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
}
_docker_compose_kill() {
case "$prev" in
-s)
COMPREPLY=( $( compgen -W "SIGHUP SIGINT SIGKILL SIGUSR1 SIGUSR2" -- "$(echo $cur | tr '[:lower:]' '[:upper:]')" ) )
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help -s" -- "$cur" ) )
;;
*)
__docker_compose_services_running
;;
esac
}
_docker_compose_logs() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --no-color" -- "$cur" ) )
;;
*)
__docker_compose_services_all
;;
esac
}
_docker_compose_migrate_to_labels() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
esac
}
_docker_compose_pause() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_compose_services_running
;;
esac
}
_docker_compose_port() {
case "$prev" in
--protocol)
COMPREPLY=( $( compgen -W "tcp udp" -- "$cur" ) )
return;
;;
--index)
return;
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --index --protocol" -- "$cur" ) )
;;
*)
__docker_compose_services_all
;;
esac
}
_docker_compose_ps() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help -q" -- "$cur" ) )
;;
*)
__docker_compose_services_all
;;
esac
}
_docker_compose_pull() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_compose_services_from_image
;;
esac
}
_docker_compose_restart() {
case "$prev" in
--timeout|-t)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
;;
*)
__docker_compose_services_running
;;
esac
}
_docker_compose_rm() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--force -f --help -v" -- "$cur" ) )
;;
*)
__docker_compose_services_stopped
;;
esac
}
_docker_compose_run() {
case "$prev" in
-e)
COMPREPLY=( $( compgen -e -- "$cur" ) )
compopt -o nospace
return
;;
--entrypoint|--user|-u)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-d --entrypoint -e --help --no-deps --rm --service-ports --publish -p -T --user -u" -- "$cur" ) )
;;
*)
__docker_compose_services_all
;;
esac
}
_docker_compose_scale() {
case "$prev" in
=)
COMPREPLY=("$cur")
return
;;
--timeout|-t)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
compopt -o nospace
;;
esac
}
_docker_compose_start() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_compose_services_stopped
;;
esac
}
_docker_compose_stop() {
case "$prev" in
--timeout|-t)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
;;
*)
__docker_compose_services_running
;;
esac
}
_docker_compose_unpause() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
__docker_compose_services_paused
;;
esac
}
_docker_compose_up() {
case "$prev" in
--timeout|-t)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-d --help --no-build --no-color --no-deps --no-recreate --force-recreate --timeout -t" -- "$cur" ) )
;;
*)
__docker_compose_services_all
;;
esac
}
_docker_compose_version() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--short" -- "$cur" ) )
;;
esac
}
_docker_compose() {
local previous_extglob_setting=$(shopt -p extglob)
shopt -s extglob
local commands=(
build
help
kill
logs
migrate-to-labels
pause
port
ps
pull
restart
rm
run
scale
start
stop
unpause
up
version
)
COMPREPLY=()
local cur prev words cword
_get_comp_words_by_ref -n : cur prev words cword
# search subcommand and invoke its handler.
# special treatment of some top-level options
local command='docker_compose'
local counter=1
local compose_file compose_project
while [ $counter -lt $cword ]; do
case "${words[$counter]}" in
--file|-f)
(( counter++ ))
compose_file="${words[$counter]}"
;;
--project-name|p)
(( counter++ ))
compose_project="${words[$counter]}"
;;
-*)
;;
*)
command="${words[$counter]}"
break
;;
esac
(( counter++ ))
done
local completions_func=_docker_compose_${command//-/_}
declare -F $completions_func >/dev/null && $completions_func
eval "$previous_extglob_setting"
return 0
}
complete -F _docker_compose docker-compose

1562
completion/docker.sh Normal file

File diff suppressed because it is too large Load diff

5
devtools.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
gem install travis -v 1.8.0 --no-rdoc --no-ri
pip install awscli

View file

@ -1,2 +1,4 @@
[default]
region = eu-central-1
[preview]
cloudfront = true

View file

@ -1,3 +1,4 @@
<<<<<<< HEAD
export GOPATH=~/build/go
source $HOME/.cargo/env
@ -8,6 +9,23 @@ fi
if [ -d $GOPATH/bin ]; then
export PATH=$GOPATH/bin:$PATH
=======
export PATH=~/bin/scripts:~/bin:/usr/local/bin:$PATH
# We are on a Macports system
if [ -d /opt/local ]; then
export PATH=/opt/local/bin:$PATH
export PATH=/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin/:$PATH
export PATH=/opt/local/libexec/gnubin:$PATH
fi
if [ "$(id -u)" -eq "0" ]; then
if [ -d /opt/local/sbin ]; then
export PATH=/opt/local/sbin:$PATH
fi
export PATH=/usr/local/sbin:$PATH
>>>>>>> f2eb8b201305d0dc745297c82466df103afbcc76
fi
# OS X stuff if availabe
@ -58,6 +76,10 @@ else
fi
export RESTIC_REPOSITORY="sftp://172.23.157.2//srv/dev-disk-by-label-data4/Backup/Restic/"
export GCC_COLORS="error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01"
export EDITOR=vim
export DEBEMAIL="post@steffenvogel.de"
export DEBFULLNAME="Steffen Vogel"

View file

@ -53,3 +53,6 @@ if hash dircolors 2>/dev/null; then
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
source ~/.homesick/repos/homeshick/homeshick.sh
source ~/.homesick/repos/homeshick/completions/homeshick-completion.bash

View file

@ -29,7 +29,7 @@
[core]
# Exclude everything this file. Used for general exclusions.
excludesfile = ~/.gitignore
excludesfile = /Users/stv0g/.gitignore
# Set attributes on files. Used for general diff improvements.
attributesfile = ~/.gitattributes
autocrlf = input
@ -40,10 +40,10 @@
autocorrect = 1
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
cmd = /opt/local/bin/meld $LOCAL $REMOTE
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
cmd = /opt/local/bin/meld $LOCAL $REMOTE
trustExitCode = true
[diff "xml"]
@ -72,3 +72,7 @@
smtpServer = mail.0l.de
smtpUser = stv0g
smtpServerPort = 587
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true

View file

@ -1,5 +1,6 @@
pinentry-program /home/stv0g/.homesick/repos/dotfiles/pinentry.sh
write-env-file
enable-ssh-support
default-cache-ttl 600
max-cache-ttl 7200
default-cache-ttl 30
max-cache-ttl 180
ignore-cache-for-signing

View file

@ -1,3 +1,5 @@
file:///Users/stv0g/workspace/rwth/s2ss
file:///Users/stv0g/workspace/rwth/acs
file:///home/stv0g/Dokumente
file:///home/stv0g/Musik
file:///home/stv0g/Bilder

View file

@ -1 +0,0 @@
../../../../vim-neosnippet/

1
home/.vim/bundle/tex Symbolic link
View file

@ -0,0 +1 @@
../../../../vim-tex/

1
home/.vim/bundle/ultisnips Symbolic link
View file

@ -0,0 +1 @@
../../../../vim-ultisnips/

View file

@ -8,6 +8,9 @@ set background=dark
" Vim Modus statt Vi Modus verwenden
set nocompatible
" Make backspace work like most other apps
set backspace=2
" Sets how many lines of history VIM has to remember
set history=1000
@ -93,25 +96,26 @@ let g:airline_powerline_fonts=1
let g:quickfixsigns#marks#buffer=split('abcdefghijklmnopqrstuvwxyz', '\zs')
let g:neocomplete#enable_at_startup=1
let g:neocomplete#sources#tags#cache_limit_size=4000000
let g:neosnippet#snippets_directory=['~/.vim/bundle/snippets/snippets']
let g:neocomplete#sources#tags#cache_limit_size=40000000
" Plugin key-mappings.
"imap <C-k> <Plug>(neosnippet_expand_or_jump)
"smap <C-k> <Plug>(neosnippet_expand_or_jump)
"xmap <C-k> <Plug>(neosnippet_expand_target)
" Trigger configuration.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsSnippetsDir="~/.homesick/repos/dotfiles/snippets/"
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns={}
endif
let g:neocomplete#sources#omni#input_patterns.tex='\v\\\a*(ref|cite)\a*([^]]*\])?\{([^}]*,)*[^}]*'
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
set conceallevel=2 concealcursor=nv
endif
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown

View file

@ -35,6 +35,8 @@ case "$(hostname)" in
DISPLAY=:0.1 i3 &
sleep 0.1 && exec i3
;;
"cam-deb")
;;
*)
exec i3
esac