Skip to content

Commit 890e263

Browse files
committed
At the beginning, there was darkness ...
0 parents  commit 890e263

34 files changed

+627
-0
lines changed

zprofile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/local/bin/zsh
2+
3+
# Use gpg-agent as SSH agent (for smart keys)
4+
#
5+
#
6+
ps x | grep -v "grep" | grep "gpg-agent.*--enable-ssh-support" > /dev/null
7+
gpg_agent_ssh_enabled=$?
8+
if [[ $gpg_agent_ssh_enabled -eq 1 ]];then
9+
gpgconf --kill gpg-agent
10+
gpg-agent --options ~/.gnupg/gpg-agent.conf --daemon
11+
fi
12+
13+
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
14+
launchctl setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK
15+
16+
GPG_TTY=$(tty)
17+
export GPG_TTY

zsh/env-available/zshenv-android

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ANDROID SDK
4+
#
5+
#
6+
if [[ -d /usr/local/Cellar/android-sdk ]]; then
7+
ANDROID_SDK_ROOT=/usr/local/Cellar/android-sdk/`ls /usr/local/Cellar/android-sdk`
8+
export ANDROID_SDK_ROOT
9+
ANDROID_HOME=$ANDROID_SDK_ROOT
10+
export ANDROID_HOME
11+
fi

zsh/env-available/zshenv-asdf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ASDF
4+
#
5+
#
6+
[[ -d "/usr/local/opt/asdf" ]] && source /usr/local/opt/asdf/asdf.sh

zsh/env-available/zshenv-aws

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ZSHENV AWS
4+
#
5+
#
6+
7+
function aig() {
8+
PARAMS=$*
9+
EGREP_PARAMS=$(echo $PARAMS | sed 's/ /|/g')
10+
aws-instances | egrep "($EGREP_PARAMS)"
11+
}

zsh/env-available/zshenv-brew

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/local/bin/zsh
2+
3+
# HOMEBREW sbin
4+
#
5+
#
6+
7+
# Added for brew zsh-completions
8+
if [[ `alias | grep "^run-help"` ]]; then
9+
unalias run-help
10+
autoload run-help
11+
HELPDIR=/usr/local/share/zsh/helpfiles
12+
fi
13+
14+
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
15+
16+
# Aliases
17+
alias buuc="brew update && brew upgrade && brew cleanup"

zsh/env-available/zshenv-docker

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ZSHENV Docker
4+
#
5+
#
6+
7+
# general docker commands
8+
alias di="docker images"
9+
alias dps="docker ps"
10+
alias dl="docker logs"
11+
alias dlf="docker logs -f"
12+
alias drm="docker rm"
13+
alias drmi="docker rmi"
14+
15+
# docker-compose shortcuts
16+
alias dc="docker-compose"
17+
alias dcu="docker-compose up"
18+
alias dcud="docker-compose up -d"
19+
alias dcd="docker-compose down"
20+
21+
# Run bash in docker container
22+
docker_exec_helper() {
23+
docker exec -it $1 sh
24+
}
25+
alias dex=docker_exec_helper
26+
27+
# Kill all running containers.
28+
function docker-killall() {
29+
if [[ $(docker ps -q | wc -l) -gt 0 ]]; then
30+
docker kill $(docker ps -q)
31+
return 0
32+
else
33+
echo "\n>>> No running containers found!"
34+
return 1
35+
fi
36+
}
37+
38+
# Delete all stopped containers.
39+
function docker-clean-containers() {
40+
if [[ $(docker ps -aq | wc -l) -gt 0 ]]; then
41+
echo "\n>>> Deleting stopped containers"
42+
docker rm $(docker ps -aq)
43+
return 0
44+
else
45+
echo "\n>>> No stopped containers found!"
46+
return 1
47+
fi
48+
}
49+
50+
# Delete all untagged images.
51+
function docker-clean-tangling-images() {
52+
if [[ $(docker images -qf dangling=true | wc -l) -gt 0 ]]; then
53+
echo "\n>>> Deleting untagged images!"
54+
docker rmi $(docker images -qf dangling=true)
55+
return 0
56+
else
57+
echo "\n>>> No untagged images found!"
58+
return 1
59+
fi
60+
}
61+
62+
# Delete ALL (!) images
63+
function docker-clean-all-images() {
64+
if [[ $(docker images -q | wc -l) -gt 0 ]]; then
65+
echo "\n>>> Deleting ALL(!) images!"
66+
docker rmi $(docker images -q)
67+
return 0
68+
else
69+
echo "\n>>> No images found!"
70+
return 1
71+
fi
72+
}
73+
74+
# Delete all tangling volumes
75+
function docker-clean-tangling-volumes() {
76+
if [[ $(docker volume ls -qf dangling=true | wc -l) -gt 0 ]]; then
77+
echo "\n>>> Deleting untagged, tangling volumes!"
78+
docker volume rm $(docker volume ls -qf dangling=true)
79+
return 0
80+
else
81+
echo "\n>>> No untagged, tangling volumes found!"
82+
return 1
83+
fi
84+
}
85+
86+
# Delete all stopped containers and untagged images.
87+
alias docker-clean='docker-clean-containers; docker-clean-tangling-images ; docker-clean-tangling-volumes'

zsh/env-available/zshenv-drone

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/local/bin/zsh
2+
3+
# DRONE
4+
#
5+
#
6+
if [[ -f /usr/local/bin/drone ]]; then
7+
. ~/.dotfiles-private/drone/drone.meltwater.io
8+
fi

zsh/env-available/zshenv-elixir

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ZSHENV Elixir
4+
#
5+
#
6+
export ERL_AFLAGS="-kernel shell_history enabled"

zsh/env-available/zshenv-emacs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ZSHENV Emacs
4+
#
5+
#
6+
7+
# The emacs daemon can be started automatically in a very simple manner:
8+
# When you invoke emacsclient -t/-c the server will be started (with emacs --daemon) if it's not already running.
9+
export ALTERNATE_EDITOR=""
10+
11+
# Set emacsclient as default editor
12+
export EDITOR="/usr/local/bin/emacsclient"
13+
14+
# Aliases
15+
alias e="/usr/local/bin/emacsclient -t"
16+
alias ec="/usr/local/bin/emacsclient -c"

zsh/env-available/zshenv-general

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/local/bin/zsh
2+
3+
# ZSHENV General
4+
#
5+
#
6+
7+
# History settings
8+
export HISTFILESIZE=10000
9+
export HISTSIZE=20000
10+
export SAVEHIST=20000
11+
export HISTFILE=~/.zsh_history
12+
export KEYTIMEOUT=1 # reduce vi-mode lag of 0.4 second delay to 0.1
13+
14+
# Calculator should use higher precision (no rounding)
15+
alias bc="bc -l"
16+
17+
# General exports
18+
export PAGER="less"
19+
20+
# Preferred editor: emacsclient if available (this will be set in zshenv-emacs), otherwise vim.
21+
[[ -f `which emacsclient` ]] || export EDITOR="vim"
22+
23+
# Lang variables
24+
export LC_CTYPE="en_US.UTF-8"
25+
export LC_ALL="en_US.UTF-8"
26+
export LANG="en_US.UTF-8"
27+
export LANGUAGE="en_US.UTF-8"
28+
29+
# prevent emacs term-mode to print "4m" at the end of each command
30+
if [[ `uname -s` = "Darwin" ]]; then
31+
export TERM=xterm-256color
32+
fi
33+
34+
# Add ~/bin to our PATH
35+
[[ -d "$HOME/bin" ]] && export PATH=$PATH:$HOME/bin
36+
37+
# Add /opt/local/bin
38+
[[ -d "/opt/local/bin" ]] && export PATH=$PATH:/opt/local/bin
39+
40+
# General
41+
alias h=history
42+
alias sl=ls
43+
44+
# VI
45+
alias vi=vim

0 commit comments

Comments
 (0)