-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathalias.txt
executable file
·103 lines (81 loc) · 2.41 KB
/
alias.txt
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
# start of my aliases
alias cl="clear"
alias dcstart="docker-compose up -d"
alias dcstop="docker-compose stop"
alias dcallstop="docker stop \$(docker ps -aq)"
alias dcedit="vim docker-compose.yml"
alias dcremoveallimages="docker image rm -f \$(docker image ls -aq)"
alias dcremoveallcontainers="docker container rm -f \$(docker container ls -aq)"
alias bashedit="cd && vim .bashrc"
alias bashrs="cd && source .bashrc"
alias pf="poweroff"
alias checkAllService="systemctl --type service --state running"
#git aliases
alias gs="git status"
alias gb="git branch"
alias grl="git reflog"
alias gl="git log"
alias ga="git add ."
alias gc="git commit"
alias gcm="git commit -m"
alias gps="git push"
alias gpl="git pull"
alias gmps="git push --recurse-submodules=on-demand"
alias gmpl="git pull --recurse-submodules"
alias gitclone="git clone"
alias git-drop-commit="git_drop_commit"
#machine aliases
alias updateMachine="sudo apt update -y && sudo apt upgrade -y && sudo apt full-upgrade -y"
alias myjupyter="cd && cd learning/my_jupyter_works/ && source my_jupyter_works/bin/activate && jupyter notebook"
alias mvnCleanInstallSkipTest="mvn clean install -DskipTests"
alias mavenRepoRemove="sudo rm -rf ~/.m2"
alias netNtlp="netstat -ntlp"
#version change alias
alias changeJavaVersionTo='bash ~/workspace/environment-setup/changeJavaVersionTo.sh'
#my alias function
git_drop_commit() {
if [ -z "$1" ]; then
echo "Usage: git drop-commit <commit-hash-or-prefix>"
return 1
fi
local commit_hash="$1"
# Check if the commit exists
if ! git rev-parse --verify "$commit_hash" &>/dev/null; then
echo "Error: Commit '$commit_hash' not found."
return 1
fi
echo "Dropping commit: $commit_hash"
# Start rebase and drop the commit
git rebase --onto "$commit_hash"^ "$commit_hash"
if [ $? -eq 0 ]; then
echo "Commit $commit_hash successfully dropped."
else
echo "Rebase failed. Please resolve conflicts and continue."
return 1
fi
}
killport () {
PID=$(sudo lsof -t -i:$1)
sudo kill -9 ${PID}
}
checkPort (){
sudo lsof -i :$1
}
catGitConfig (){
cat $1/.git/config
}
gmerge () {
git checkout $1 && git merge $2 && git pull && git push && git checkout $2
}
goto () {
cd ~/workspace/
if [ -d "$1" ]; then
cd "$1"
if [ -d "project" ]; then
cd project/
fi
else
echo "Directory '$1' not found."
fi
}
# end of my alias