-
Notifications
You must be signed in to change notification settings - Fork 1
/
aliases
130 lines (130 loc) · 4.09 KB
/
aliases
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
alias vs='vagrant status'
alias vu='vagrant up'
alias vd='vagrant destroy'
alias vss='vagrant ssh'
alias vh='vagrant halt'
alias vr='vagrant rdp'
alias mvdeploy='mvn clean package wildfly:deploy'
alias mvundeploy='mvn wildfly:undeploy'
alias mcp='mvn clean package'
alias vi='vim'
alias gf='git fetch'
alias grm='git rm'
alias gs='git status'
alias gb='git branch'
alias gd='git diff --color'
alias gdt='git difftool'
alias gc='git clone'
alias gconf='git config'
alias ginit='git init'
alias greset='git reset'
alias gst='git stash'
alias gch='git checkout'
alias gr='git remote -v'
alias gm='git merge'
alias gmt='git mergetool'
alias gl='git log --oneline --decorate --color --graph'
alias gc='git commit'
alias gp='git pull'
alias gP='git push'
alias ga='git add'
alias jbc='$JBOSS_HOME/bin/jboss-cli.sh -c $JBOSS_URL'
title() {
echo -ne "\e]0;$1\a"
}
jbctl() {
case $1 in
version)
jbc --version
;;
start)
nohup $JBOSS_HOME/bin/domain.sh > /dev/null 2>&1 &
;;
stop)
jbc --command="shutdown --host=$2" || echo "\n\njbctl stop <node name>\n"
;;
restart)
jbc --command="shutdown --host=$2"
nohup $JBOSS_HOME/bin/domain.sh > /dev/null 2>&1 &
;;
sgrestart)
jbc --command="/server-group=`echo -e $2`:restart-servers()" || echo "\n\njbctl sgrestart <server group>\n"
;;
phist)
jbc --command="patch history --host=$2" || echo "\n\njbctl phist <node name>"
;;
lsservers)
jbc --command="ls -l /host"
;;
status)
ps aux | grep jboss | grep -v grep > /dev/null 2>&1 && echo "Running" || echo "Not Running"
;;
tail)
tail -f $JBOSS_HOME/domain/log/host-controller.log
;;
less)
less $JBOSS_HOME/domain/log/host-controller.log
;;
lsdeploy)
jbc --command="deployment-info --server-group=$2" || echo "\n\njbctl lsdeploy <server group>\n"
;;
tksnap)
jbc --command=":take-snapshot"
;;
lssnap)
jbc --command=":list-snapshots"
;;
rmsnap)
jbc --command=":delete-snapshot(name=$2)" || echo "\n\njbctl rmsnap <snapshot name>"
;;
deploy)
jbc --command="deploy $2 --server-groups=$3"
;;
undeploy)
jbc --command="undeploy $2 --all-relevant-server-groups"
;;
cmd)
jbc
;;
home)
echo "JBOSS_HOME is set to: $JBOSS_HOME"
;;
hist)
cat ~/.jboss-cli-history
;;
*)
echo "jbctl (command) <arguments>"
echo "version 1.2"
echo
echo -e "COMMAND\t\tPURPOSE\t\t\tARGUMENTS\t\tEXAMPLE"
echo -e "version\t\tCheck version\t\tn/a\t\t\tjbctl version"
echo -e "hist\t\tCLI history\t\tn/a\t\t\tjbctl hist"
echo -e "cmd\t\tOpen CLI\t\tn/a\t\t\tjbctl cmd"
echo -e "start\t\tStart JBoss\t\tn/a\t\t\tjbctl start"
echo -e "stop\t\tStop JBoss\t\tServer name\t\tjbctl stop work-s01"
echo -e "restart\t\tRestart JBoss\t\tServer name\t\tjbctl restart work-s01"
echo -e "home\t\tDisplay JBoss home\tn/a\t\t\tjbctl home"
echo -e "lssnap\t\tDisplay snaps\t\tn/a\t\t\tjbctl lssnap"
echo -e "tksnap\t\tTake snapshot\t\tn/a\t\t\tjbctl tksnap"
echo -e "rmsnap\t\tDelete snap\t\tSnapshot name\t\tjbctl rmsnap 20150810-221949391domain.xml"
echo -e "lsdeploy\tDisplay deployments\tServer group\t\tjbctl lsdeploy sg01"
echo -e "deploy\t\tDeploy artifact\t\tArtifact, Server group\tjbctl deploy myapp.war sg01"
echo -e "undeploy\tUndeploy artifact\tArtifact\t\tjbctl undeploy myapp.war"
echo -e "less\t\tOpen log in less\tn/a\t\t\tjbctl less"
echo -e "tail\t\tTail -f log\t\tn/a\t\t\tjbctl tail"
echo -e "status\t\tCheck running state\tn/a\t\t\tjbctl status"
echo -e "lsservers\tList servers in domain\tn/a\t\t\tjbctl lsservers"
echo -e "phist\t\tShow patch history\tServer name\t\tjbctl phist work-s01"
echo -e "sgrestart\tRestart a server group\tServer group\t\tjbctl sgrestart sg01"
echo
;;
esac
}
sshrun() {
for i in `echo $H | sed 's/,/\n/g'`; do echo $i; ssh $i "$1"; echo; done
}
alias ll='ls -l'
alias la='ls -la'
alias lh='ls -lh'
alias ltr='ls -ltr'
alias psg='ps aux | grep'