small fixes

This commit is contained in:
Jörg Thalheim 2016-05-01 11:08:23 +02:00
parent 39c51e31a7
commit 37d5ed2e32
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA
4 changed files with 117 additions and 3 deletions

View File

@ -3,3 +3,4 @@ Dockerfile
Makefile
cache
etc/secrets-template
remote

View File

@ -16,7 +16,7 @@ RUN apk add --no-cache --update \
# sshd
RUN /usr/bin/ssh-keygen -A && \
sed -i -e "s!/root:/bin/ash!/root/:bin/bash!" /etc/passwd
sed -i -e "s!/root:/bin/ash!/root/:/bin/bash!" /etc/passwd
## temporary keys until letsencrypt certificate is generated
RUN mkdir -p /etc/ssl/letsencrypt/nginx /etc/ssl/letsencrypt/influxdb && \
@ -96,3 +96,4 @@ VOLUME ["/var/lib/influxdb/data", \
ADD . /
RUN chown 400 /etc/secrets && . /etc/secrets && \
sed -i -e "s/admin_password = replaceme/admin_password = $GRAFANA_PASSWORD/" /etc/grafana.ini

View File

@ -1,7 +1,10 @@
all: build
V ?= 1
IMAGE = registry.eu-gb.bluemix.net/mic92/monitoring:$(V)
build:
docker build -t monitoring .
docker build -t $(IMAGE) .
run: build
docker run --rm -ti \
@ -14,4 +17,7 @@ run: build
-v icinga2-lib:/var/lib/icinga2 \
-v icingaweb2-etc:/etc/icingaweb2 \
-v ssmtp-etc:/etc/ssmtp \
monitoring sh
$(IMAGE) sh
upload: build
docker push $(IMAGE)

106
root/.bashrc Normal file
View File

@ -0,0 +1,106 @@
#
# .bashrc - interactive shell configuration
#
# check for interactive
[[ $- = *i* ]] || return
export TTY=$(tty)
export GPG_TTY=$TTY
# shell opts: see bash(1)
shopt -s autocd cdspell dirspell extglob no_empty_cmd_completion
shopt -s checkwinsize checkhash
shopt -s histverify histappend histreedit cmdhist
set -o notify # notify of completed background jobs immediately
set -o noclobber # don\'t overwrite files by accident
ulimit -S -c 0 # disable core dumps
stty -ctlecho # turn off control character echoing
if [[ $TERM = linux ]]; then
setterm -regtabs 2 # set tab width of 4 (only works on TTY)
fi
# more for less
export LESS=-R # use -X to avoid sending terminal initialization
export LESS_TERMCAP_mb=$'\e[01;31m'
export LESS_TERMCAP_md=$'\e[01;31m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;44;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[01;32m'
# history
export HISTIGNORE="&:ls:[bf]g:exit:reset:clear:cd *"
export HISTCONTROL="ignoreboth:erasedups"
export HISTSIZE=1000
export HISTFILESIZE=2000
source_bash_completion() {
local f
[[ $BASH_COMPLETION ]] && return 0
for f in /{etc,usr/share/bash-completion}/bash_completion; do
if [[ -r $f ]]; then
. "$f"
return 0;
fi
done
}
# External config
if [[ -r ~/.dircolors ]] && type -p dircolors >/dev/null; then
eval $(dircolors -b "$HOME/.dircolors")
fi
PS1='\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
source_bash_completion
[[ -r /usr/share/bash-completion/completions/git ]] && . /usr/share/bash-completion/completions/git
unset -f source_bash_completion
# git prompt
[[ -f /usr/share/git/git-prompt.sh ]] && . /usr/share/git/git-prompt.sh
urlencode() {
local i= char= url=$*
declare -i len=${#url}
for (( i = 0; i < len; i++ )); do
char=${url:i:1}
case "$char" in
[a-zA-Z0-9.~_-]) printf "$char" ;;
' ') printf + ;;
*) printf '%%%X' "'$char" ;;
esac
done
}
mkcd() {
[[ $1 ]] || return 0
[[ -d $1 ]] || mkdir -vp "$1"
[[ -d $1 ]] && builtin cd "$1"
}
function ff() { find . -type f -iname '*'"$*"'*' -ls ; }
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias gensums='[[ -f PKGBUILD ]] && makepkg -g >> PKGBUILD'
alias info='info --vi-keys'
alias j='jobs'
alias lla='ls -la'
alias ls='ls --group-directories-first --color'
alias md5='md5sum'
alias sd='systemctl'
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
[[ -r "$HOME/.bashrc.local" ]] && . "$HOME/basrc.local"