forked from driesvints/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaliases
More file actions
97 lines (78 loc) · 3.89 KB
/
aliases
File metadata and controls
97 lines (78 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Shortcuts
alias la="ls -laF"
alias -g G="| grep"
alias h="history"
alias ..="cd .."
alias ~="cd ~"
alias q="~ && clear"
alias clr="clear"
alias reloadcli="source $HOME/.zshrc"
# Git
alias glod="git pull origin develop"
# Directories
alias dotfiles="cd $DOTFILES"
# Config files
alias zshconfig="vim ~/.dotfiles/zshrc"
# Terraform
alias tf=terraform
# Meteo
alias meteo="curl wttr.in/quebec"
# Functions
function findstring() {
grep -rnw $2 -e $1
}
function findname() {
find $2 -name $1 -print
}
### BELL ALIASES ###
alias proxy-on="export HTTP_PROXY=http://fastweb.int.bell.ca:80; export HTTPS_PROXY=http://fastweb.int.bell.ca:80; export http_proxy=http://fastweb.int.bell.ca:80; export https_proxy=http://fastweb.int.bell.ca:80; export NO_PROXY=*.int.bell.ca;"
alias proxy-off="unset HTTP_PROXY; unset HTTPS_PROXY; unset http_proxy; unset https_proxy"
# Command to stop all the active docker containers
alias dockersPsStop='docker stop $(docker ps -a -q)'
# Command to remove a container
alias dockersPsRm='docker rm -v $(docker ps -aq -f status=exited)'
# Command to remove Docker images from your disk
alias dockersImgRm='docker images -q | xargs docker rmi -f'
# Command to see the stats of your running Docker containers
alias dockersStats='docker stats $(docker inspect -f {{.Name}} $(docker ps -q))'
alias set-bell-proxy='export HTTP_PROXY=http://fastweb.int.bell.ca:8083; export HTTPS_PROXY=http://fastweb.int.bell.ca:8083; export http_proxy=http://fastweb.int.bell.ca:8083; export https_proxy=http://fastweb.int.bell.ca:8083;'
alias unset-bell-proxy='unset HTTP_PROXY; unset HTTPS_PROXY; unset http_proxy; unset https_proxy;'
# random aliases
alias cdds='cd "$BELL_EWOC_DOCKER_SCRIPTS"'
alias cdgit='cd "$GIT_PROJECT_HOMES"'
alias lrp='cd "$GIT_PROJECT_HOMES/bell-ec-liferay"; rm deploy-dxp/*; rm liferayLastPluginsDeployed-dxp/*; cd -'
# maven aliases
alias mci='mvn clean install'
alias mcp='mvn clean package'
alias mcpd='mvn clean package; cp target/*.*ar "$BELL_EC_LF_SRC/deploy-dxp"'
# dm - docker manage aliases
# view number of open network connections
alias dm-cons='lsof -p $(pgrep vpnkit) | wc -l'
# view running container stats in real-time
alias dm-stats='docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}"'
# view bare container list
alias dm-ps='docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.RunningFor}}\t{{.Status}}\t{{.Names}}"'
# stop active containers
alias dm-stop='docker ps -q | xargs docker stop'
# remove old images
dm-rmoi(){ docker image ls | grep none | awk '{print $3}' | xargs docker rmi -f; }
# remove old containers
dm-rmoc(){ for c in $(docker ps -a | awk '{print $2}' | grep '[0-9a-f]$'); do docker ps -a | grep $c | awk '{print $1}' | xargs docker rm -v; done }
# dc - docker compose aliases
alias dc-all='cd "$BELL_DOCKER_SCRIPTS_V2"; ./common/common-all.sh;'
alias dc-ocall='cd "$BELL_DOCKER_SCRIPTS_V2"; ./oc/common/common-all.sh'
# sdk java
alias use-java8="sdk u java $JAVA_8_VERSION"
alias use-java11="sdk u java $JAVA_11_VERSION"
alias set-default-jvm-java8="sdk d java $JAVA_8_VERSION"
alias set-default-jvm-java11="sdk d java $JAVA_11_VERSION"
# In this example, I map my ~/Dev directory that contains all my GitLab projects and I can now launch them within the container.
alias dock-ans='docker run -it --rm -v ~/Dev:/workdir -w /workdir -e "SSH_KEY=$(cat ~/Dev/my_ssh_private_key)" vas-tools/ansible bash'dock-ans
# If you want to load your SSH_KEY in the SSH Agent of the container
# This will also make sure that SSH ignores the host keyseval $(ssh-agent)echo -e "$SSH_KEY" | ssh -mkdir -p /root/.sshecho -e "Host *\n\tStrictHostKeyChecking no\n" > /root/.ssh/config
# Any Ansible playbook can now be run without installing anything else on your Mac
alias r1='fix-host && networksetup -setv6off Wi-Fi'
alias r2='run_basic_common'
alias r3='run_oc_basic'
alias r4='run_oc_bali'
alias r5='ssh_uat_bali'