updated stuff

This commit is contained in:
Nikolas Weger 2020-05-26 21:52:12 +02:00
parent 638dc45020
commit 586aa3b5e7
10 changed files with 82 additions and 37 deletions

View file

@ -78,12 +78,20 @@
compact = "%C(auto)%h %s %C(green)%ar%n %C(auto)%d%n" compact = "%C(auto)%h %s %C(green)%ar%n %C(auto)%d%n"
detail = "%C(auto)%h %s%n %C(yellow)by %C(blue)%an %C(magenta)<%ae> [%G?] %C(green)%ar%n %C(auto)%d%n" detail = "%C(auto)%h %s%n %C(yellow)by %C(blue)%an %C(magenta)<%ae> [%G?] %C(green)%ar%n %C(auto)%d%n"
[merge] [diff]
defaultToUpstream = true tool = meld
tool = vimdiff
[mergetool] [difftool]
keepBackup = false prompt = false
[difftool "meld"]
cmd = meld "$REMOTE" "$LOCAL"
[merge]
tool = meld
[mergetool "meld"]
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
[push] [push]
default = upstream default = upstream

View file

@ -1,6 +1,11 @@
Host * Host *
AddressFamily inet
ServerAliveInterval 300 ServerAliveInterval 300
ServerAliveCountMax 2 ServerAliveCountMax 2
Host web Host web
HostName megumi.eeleater.org
ForwardX11 yes ForwardX11 yes
Host pxm
HostName pxm.eeleater.org

View file

@ -1,2 +1 @@
LS_COLORS='no=00;38;2;171;178;191:fi=00:rs=00;38;2;171;178;191:di=00;38;2;97;175;239:ln=00;38;2;86;182;194:mh=00:pi=07;38;2;171;178;191:so=07;38;2;171;178;191:do=07;38;2;171;178;191:bd=07;38;2;171;178;191:cd=07;38;2;171;178;191:or=00;38;2;190;80;70:su=01;38;2;171;178;191:sg=04;01;38;2;171;178;191:ca=07;38;2;171;178;191:tw=04;01;38;2;97;175;239:ow=01;38;2;97;175;239:st=04;38;2;97;175;239:ex=00;38;2;152;195;121:*.jl=00;38;2;198;120;221:*.c=00;38;2;198;120;221:*.cpp=00;38;2;198;120;221:*.cc=00;38;2;198;120;221:*.h=00;38;2;198;120;221:*.asm=00;38;2;198;120;221:*.py=00;38;2;198;120;221:*.js=00;38;2;198;120;221:*.java=00;38;2;198;120;221:*.sh=00;38;2;198;120;221:*.perl=00;38;2;198;120;221:*.pl=00;38;2;198;120;221:*.go=00;38;2;198;120;221:*.scala=00;38;2;198;120;221:*.m=00;38;2;198;120;221:*.cs=00;38;2;198;120;221:*.r=00;38;2;198;120;221:*.csv=00;38;2;92;99;112:*.txt=00;38;2;92;99;112:*.md=00;38;2;92;99;112:*.toml=00;38;2;92;99;112:*.yml=00;38;2;92;99;112:*.yaml=00;38;2;92;99;112:*.xml=00;38;2;92;99;112:*.json=00;38;2;92;99;112:*.conf=00;38;2;92;99;112:*.tar=00;38;2;224;108;117:*.tgz=00;38;2;224;108;117:*.arj=00;38;2;224;108;117:*.taz=00;38;2;224;108;117:*.lzh=00;38;2;224;108;117:*.lzma=00;38;2;224;108;117:*.tlz=00;38;2;224;108;117:*.txz=00;38;2;224;108;117:*.zip=00;38;2;224;108;117:*.z=00;38;2;224;108;117:*.Z=00;38;2;224;108;117:*.dz=00;38;2;224;108;117:*.gz=00;38;2;224;108;117:*.lz=00;38;2;224;108;117:*.xz=00;38;2;224;108;117:*.bz2=00;38;2;224;108;117:*.bz=00;38;2;224;108;117:*.tbz=00;38;2;224;108;117:*.tbz2=00;38;2;224;108;117:*.tz=00;38;2;224;108;117:*.deb=00;38;2;224;108;117:*.rpm=00;38;2;224;108;117:*.jar=00;38;2;224;108;117:*.rar=00;38;2;224;108;117:*.ace=00;38;2;224;108;117:*.zoo=00;38;2;224;108;117:*.cpio=00;38;2;224;108;117:*.7z=00;38;2;224;108;117:*.rz=00;38;2;224;108;117:*.apk=00;38;2;224;108;117:*.gem=00;38;2;224;108;117:*.jpg=00;38;2;229;192;123:*.JPG=00;38;2;229;192;123:*.jpeg=00;38;2;229;192;123:*.gif=00;38;2;229;192;123:*.bmp=00;38;2;229;192;123:*.pbm=00;38;2;229;192;123:*.pgm=00;38;2;229;192;123:*.ppm=00;38;2;229;192;123:*.tga=00;38;2;229;192;123:*.xbm=00;38;2;229;192;123:*.xpm=00;38;2;229;192;123:*.tif=00;38;2;229;192;123:*.tiff=00;38;2;229;192;123:*.png=00;38;2;229;192;123:*.PNG=00;38;2;229;192;123:*.svg=00;38;2;229;192;123:*.svgz=00;38;2;229;192;123:*.mng=00;38;2;229;192;123:*.pcx=00;38;2;229;192;123:*.dl=00;38;2;229;192;123:*.xcf=00;38;2;229;192;123:*.xwd=00;38;2;229;192;123:*.yuv=00;38;2;229;192;123:*.cgm=00;38;2;229;192;123:*.emf=00;38;2;229;192;123:*.eps=00;38;2;229;192;123:*.CR2=00;38;2;229;192;123:*.ico=00;38;2;229;192;123:*.mov=00;38;2;229;192;123:*.MOV=00;38;2;229;192;123:*.mpg=00;38;2;229;192;123:*.mpeg=00;38;2;229;192;123:*.m2v=00;38;2;229;192;123:*.mkv=00;38;2;229;192;123:*.ogm=00;38;2;229;192;123:*.mp4=00;38;2;229;192;123:*.m4v=00;38;2;229;192;123:*.mp4v=00;38;2;229;192;123:*.vob=00;38;2;229;192;123:*.qt=00;38;2;229;192;123:*.nuv=00;38;2;229;192;123:*.wmv=00;38;2;229;192;123:*.asf=00;38;2;229;192;123:*.rm=00;38;2;229;192;123:*.rmvb=00;38;2;229;192;123:*.flc=00;38;2;229;192;123:*.avi=00;38;2;229;192;123:*.fli=00;38;2;229;192;123:*.flv=00;38;2;229;192;123:*.gl=00;38;2;229;192;123:*.m2ts=00;38;2;229;192;123:*.divx=00;38;2;229;192;123:*.webm=00;38;2;229;192;123:'; export LS_COLORS='no=00;38;2;171;178;191:fi=00:rs=00;38;2;171;178;191:di=00;38;2;97;175;239:ln=00;38;2;86;182;194:mh=00:pi=07;38;2;171;178;191:so=07;38;2;171;178;191:do=07;38;2;171;178;191:bd=07;38;2;171;178;191:cd=07;38;2;171;178;191:or=00;38;2;190;80;70:su=01;38;2;171;178;191:sg=04;01;38;2;171;178;191:ca=07;38;2;171;178;191:tw=04;01;38;2;97;175;239:ow=01;38;2;97;175;239:st=04;38;2;97;175;239:ex=00;38;2;152;195;121:*.jl=00;38;2;198;120;221:*.c=00;38;2;198;120;221:*.cpp=00;38;2;198;120;221:*.cc=00;38;2;198;120;221:*.h=00;38;2;198;120;221:*.asm=00;38;2;198;120;221:*.py=00;38;2;198;120;221:*.js=00;38;2;198;120;221:*.java=00;38;2;198;120;221:*.sh=00;38;2;198;120;221:*.perl=00;38;2;198;120;221:*.pl=00;38;2;198;120;221:*.go=00;38;2;198;120;221:*.scala=00;38;2;198;120;221:*.m=00;38;2;198;120;221:*.cs=00;38;2;198;120;221:*.r=00;38;2;198;120;221:*.csv=00;38;2;92;99;112:*.txt=00;38;2;92;99;112:*.md=00;38;2;92;99;112:*.toml=00;38;2;92;99;112:*.yml=00;38;2;92;99;112:*.yaml=00;38;2;92;99;112:*.xml=00;38;2;92;99;112:*.json=00;38;2;92;99;112:*.conf=00;38;2;92;99;112:*.tar=00;38;2;224;108;117:*.tgz=00;38;2;224;108;117:*.arj=00;38;2;224;108;117:*.taz=00;38;2;224;108;117:*.lzh=00;38;2;224;108;117:*.lzma=00;38;2;224;108;117:*.tlz=00;38;2;224;108;117:*.txz=00;38;2;224;108;117:*.zip=00;38;2;224;108;117:*.z=00;38;2;224;108;117:*.Z=00;38;2;224;108;117:*.dz=00;38;2;224;108;117:*.gz=00;38;2;224;108;117:*.lz=00;38;2;224;108;117:*.xz=00;38;2;224;108;117:*.bz2=00;38;2;224;108;117:*.bz=00;38;2;224;108;117:*.tbz=00;38;2;224;108;117:*.tbz2=00;38;2;224;108;117:*.tz=00;38;2;224;108;117:*.deb=00;38;2;224;108;117:*.rpm=00;38;2;224;108;117:*.jar=00;38;2;224;108;117:*.rar=00;38;2;224;108;117:*.ace=00;38;2;224;108;117:*.zoo=00;38;2;224;108;117:*.cpio=00;38;2;224;108;117:*.7z=00;38;2;224;108;117:*.rz=00;38;2;224;108;117:*.apk=00;38;2;224;108;117:*.gem=00;38;2;224;108;117:*.jpg=00;38;2;229;192;123:*.JPG=00;38;2;229;192;123:*.jpeg=00;38;2;229;192;123:*.gif=00;38;2;229;192;123:*.bmp=00;38;2;229;192;123:*.pbm=00;38;2;229;192;123:*.pgm=00;38;2;229;192;123:*.ppm=00;38;2;229;192;123:*.tga=00;38;2;229;192;123:*.xbm=00;38;2;229;192;123:*.xpm=00;38;2;229;192;123:*.tif=00;38;2;229;192;123:*.tiff=00;38;2;229;192;123:*.png=00;38;2;229;192;123:*.PNG=00;38;2;229;192;123:*.svg=00;38;2;229;192;123:*.svgz=00;38;2;229;192;123:*.mng=00;38;2;229;192;123:*.pcx=00;38;2;229;192;123:*.dl=00;38;2;229;192;123:*.xcf=00;38;2;229;192;123:*.xwd=00;38;2;229;192;123:*.yuv=00;38;2;229;192;123:*.cgm=00;38;2;229;192;123:*.emf=00;38;2;229;192;123:*.eps=00;38;2;229;192;123:*.CR2=00;38;2;229;192;123:*.ico=00;38;2;229;192;123:*.mov=00;38;2;229;192;123:*.MOV=00;38;2;229;192;123:*.mpg=00;38;2;229;192;123:*.mpeg=00;38;2;229;192;123:*.m2v=00;38;2;229;192;123:*.mkv=00;38;2;229;192;123:*.ogm=00;38;2;229;192;123:*.mp4=00;38;2;229;192;123:*.m4v=00;38;2;229;192;123:*.mp4v=00;38;2;229;192;123:*.vob=00;38;2;229;192;123:*.qt=00;38;2;229;192;123:*.nuv=00;38;2;229;192;123:*.wmv=00;38;2;229;192;123:*.asf=00;38;2;229;192;123:*.rm=00;38;2;229;192;123:*.rmvb=00;38;2;229;192;123:*.flc=00;38;2;229;192;123:*.avi=00;38;2;229;192;123:*.fli=00;38;2;229;192;123:*.flv=00;38;2;229;192;123:*.gl=00;38;2;229;192;123:*.m2ts=00;38;2;229;192;123:*.divx=00;38;2;229;192;123:*.webm=00;38;2;229;192;123:';
export LS_COLORS

7
zsh/fpath/_extract Normal file
View file

@ -0,0 +1,7 @@
#compdef extract
#autoload
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
&& return 0

View file

@ -38,7 +38,7 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
zstyle ':completion::complete:*' use-cache 1 zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path "$HOME/.cache/zsh/compcache/" zstyle ':completion::complete:*' cache-path "$HOME/.cache/zsh/compcache/"
zstyle ':completion:*:*:*:users' ignored-patterns adm amanda apache at avahi avahi-autoipd backup beaglidx bin bitwarden_rs cacti canna clamav ceph colord consul daemon dbus distcache dnsdist dnsmasq dovecot eeleater elasticsearch fax flaskdemo ftp games gdm git gitea gkrellmd gluster gopher gophernicus gnats hacluster haldaemon halt hsqldb http ident irc junkbust kdm kibana landscape ldap list lldpd logstash lp lxd mail mailman mailnull man mattermost messagebus mldonkey mongodb mxisd mysql nagios named netdata netdump news nfsnobody nobody nscd ntp nut nweger nx obsrun openvpn operator pcap pcp polkitd pollinate postfix postgres powerdns privoxy proxy pulse prosody puppet pvm quagga radvd redis rpc rpcuser rpm rtkit root scard shutdown squid sshd statd svn synapse sync sys syslog systemd-coredump systemd-journal-remote systemd-network systemd-resolve systemd-timesync tcpdump teamspeak tftp tss turnserver usbmux unbound uucp uuidd vault vcsa webvirtmgr wildfly wwwrun www-data xfs youtrack zabbix-agent zabbix-server zabbix zerotier-one zerotier '_*' zstyle ':completion:*:*:*:users' ignored-patterns adm amanda apache at avahi avahi-autoipd backup beaglidx bin bitwarden_rs cacti canna clamav ceph colord consul cups daemon dbus dhcp dhcpcd distcache dnsdist dnsmasq dovecot eeleater elasticsearch fax flatpak flaskdemo ftp games gdm geoclue git gitea gkrellmd gluster gopher gophernicus gnats hacluster haldaemon halt hsqldb http ident irc junkbust kdm kibana landscape ldap lightdm list lldpd logstash lp lxd mail mailman mailnull man mattermost messagebus mldonkey mongodb mxisd mysql nagios named netdata netdump news nfsnobody nm-openvpn nobody nscd ntp nut nvidia-persistenced nweger nx obsrun openvpn operator pcap pcp polkitd pollinate postfix postgres powerdns privoxy proxy pulse prosody puppet pvm quagga radiusd radvd redis rpc rpcuser rpm rtkit root scard sddm shutdown squid sshd statd stunnel svn synapse sync sys syslog systemd-coredump systemd-journal-remote systemd-network systemd-resolve systemd-timesync tcpdump teamspeak tftp tinyproxy transmission tss turnserver usbmux unbound uucp uuidd vault vcsa webvirtmgr wildfly wwwrun www-data xfs youtrack zabbix-agent zabbix-server zabbix zerotier-one zerotier '_*'
zstyle '*' single-ignored show zstyle '*' single-ignored show

View file

@ -1,8 +1,3 @@
setopt auto_pushd setopt auto_pushd
setopt pushd_ignore_dups setopt pushd_ignore_dups
setopt pushdminus setopt pushdminus
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'

View file

@ -2,13 +2,6 @@ alias ls='exa -al --color=always --group-directories-first'
alias la='exa -a --color=always --group-directories-first' alias la='exa -a --color=always --group-directories-first'
alias ll='exa -l --color=always --group-directories-first' alias ll='exa -l --color=always --group-directories-first'
alias lt='exa -aT --color=always --group-directories-first' alias lt='exa -aT --color=always --group-directories-first'
alias lg='ls --git'
alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias fd='find . -type d -name'
alias ff='find . -type f -name'
alias rm='rm -i' alias rm='rm -i'
alias cp='cp -i' alias cp='cp -i'

View file

@ -1,19 +1,46 @@
# Docker
_appup_docker () { _appup_docker () {
if hash docker-compose >/dev/null 2>&1; then if hash docker-compose >/dev/null 2>&1; then
if hash docker-machine >/dev/null 2>&1; then # Check if docker has been started
if [ "${APPUP_CHECK_STARTED:-true}" = true ]; then
if hash docker-machine >/dev/null 2>&1 && [ "${APPUP_DOCKER_MACHINE:-true}" = true ]; then
if docker-machine status | grep -qi "Stopped"; then if docker-machine status | grep -qi "Stopped"; then
read -q "REPLY?Docker Machine is not running, would you like to start it? [y/n] " read -r -k 1 "REPLY?Docker Machine is not running, would you like to start it? [y/N] "
echo "" echo ""
if [[ "$REPLY" == "y" ]]; then if [[ "$REPLY" == "y" ]]; then
docker-machine start default && eval $(docker-machine env default) docker-machine start default && eval $(docker-machine env default)
echo "" echo ""
else else
return return 0
fi
fi
elif docker ps 2>&1 | grep -qi "Is the docker daemon running?"; then
read -r -k 1 "REPLY?Docker for Mac is not running, would you like to start it? [y/N] "
echo ""
if [[ "$REPLY" == "y" ]]; then
open -a Docker
echo ""
echo "Waiting for docker to start.."
echo ""
# Wait for it to start
while true; do
if docker ps 2>&1 | grep -qi "Is the docker daemon running?" || docker ps 2>&1 | grep -qi "connection refused"; then
sleep 5
else
break
fi
done
else
return0
fi fi
fi fi
fi fi
# Check YAML extension
compose_file='' compose_file=''
compose_project_file='' compose_project_file=''
@ -23,6 +50,7 @@ _appup_docker () {
compose_file='docker-compose.yaml' compose_file='docker-compose.yaml'
fi fi
# <cmd> <project name> will look for docker-compose.<project name>.yml
if [ -n "$2" ]; then if [ -n "$2" ]; then
if [ -e "docker-compose.$2.yml" ]; then if [ -e "docker-compose.$2.yml" ]; then
compose_project_file="docker-compose.$2.yml" compose_project_file="docker-compose.$2.yml"
@ -31,6 +59,7 @@ _appup_docker () {
fi fi
if [ -n "$compose_project_file" ]; then if [ -n "$compose_project_file" ]; then
# Override project name from custom env
if [ -e ".env.$2" ]; then if [ -e ".env.$2" ]; then
project=$(source ".env.$2"; echo $COMPOSE_PROJECT_NAME) project=$(source ".env.$2"; echo $COMPOSE_PROJECT_NAME)
@ -51,6 +80,7 @@ _appup_docker () {
fi fi
} }
# Vagrant
_appup_vagrant () { _appup_vagrant () {
if hash vagrant >/dev/null 2>&1; then if hash vagrant >/dev/null 2>&1; then
vagrant $1 "${@:2}" vagrant $1 "${@:2}"
@ -59,6 +89,7 @@ _appup_vagrant () {
fi fi
} }
# Commands
up () { up () {
if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then if [ -e "docker-compose.yml" ] || [ -e "docker-compose.yaml" ]; then
_appup_docker up "$@" _appup_docker up "$@"
@ -108,4 +139,3 @@ stop () {
env stop "$@" env stop "$@"
fi fi
} }

View file

@ -40,14 +40,24 @@ extract() {
tar --lzma --help &> /dev/null \ tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \ && tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;; || lzcat "$1" | tar xvf - ;;
(*.tar.zst|*.tzst)
tar --zstd --help &> /dev/null \
&& tar --zstd -xvf "$1" \
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;; (*.tar) tar xvf "$1" ;;
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
(*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;; (*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;; (*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
(*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;; (*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;; (*.rar) unrar x -ad "$1" ;;
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;
(*.deb) (*.deb)
mkdir -p "$extract_dir/control" mkdir -p "$extract_dir/control"
@ -58,6 +68,7 @@ extract() {
cd ..; rm *.tar.* debian-binary cd ..; rm *.tar.* debian-binary
cd .. cd ..
;; ;;
(*.zst) unzstd "$1" ;;
(*) (*)
echo "extract: '$1' cannot be extracted" >&2 echo "extract: '$1' cannot be extracted" >&2
success=1 success=1

View file

@ -3,6 +3,3 @@ cmds=(status show start stop reload restart enable disable daemon-reload)
for cmd in $cmds; do for cmd in $cmds; do
alias sc-$cmd="sudo systemctl $cmd" alias sc-$cmd="sudo systemctl $cmd"
done done
alias sc-enablenow="sc-enable --now"
alias sc-disablenow="sc-disable --now"