-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
106 lines (94 loc) · 3.28 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
# Alias definitions
# terminal ease of use
# alias rst="source ~/.bashrc"
rst() {
if [[ "$SHELL" == *"zsh"* ]]; then
source ~/.zshrc
fi
if [[ "$SHELL" == *"bash"* ]]; then
source ~/.bashrc
fi
}
cdl() {
cd "$1"
ls
}
src() {
set -a
source "$1"
set +a
}
hist() {
history | grep "$@"
}
update() {
if type "apt" > /dev/null; then
echo "Running apt"
sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y
fi
if type "nix-channel" > /dev/null; then
echo "Running nix channels"
nix-channel --update
fi
if type "nixos-rebuild" > /dev/null; then
echo "Running nixos-rebuild"
sudo nixos-rebuild switch
fi
if type "nix-env" > /dev/null; then
echo "Running nix-env"
nix-env -u '*'
fi
if type "home-manager" > /dev/null; then
echo "Running home-manager"
home-manager build && home-manager switch
fi
}
# dev server aliases
alias pocketinfinitycode='ssh -N -f -L 8443:localhost:8443 pocketinfinity'
alias pocketjupyter='ssh -N -f -L 8888:localhost:8888 pocketinfinity'
# ssh aliases
# ssh for NIU resources
alias flickjupyter='ssh -N -f -M -S /tmp/flickjupyter-sock -L 8888:localhost:8888 [email protected] flickjupyter && echo "Success! Connect to http://localhost:8888."'
alias baileyjupyter='ssh -N -f -M -S /tmp/baileyjupyter-sock -L 9999:localhost:9999 [email protected] baileyjupyter && echo "Success! Connect to http://localhost:9999"'
alias killflickjupyter='ssh -S /tmp/flickjupyter-sock -O exit flickjupyter'
alias killbaileyjupyter='ssh -S /tmp/baileyjupyter-sock -O exit baileyjupyter'
# ls and grep color support
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# more ls aliases
alias ll='ls -alhFo'
alias la='ls -A'
alias l='ls -CF'
# tmux session alias
alias homemux='tmux new -A -s Home'
alias homemuxnew='tmux new -A -s Home \; new-window'
mux() {
tmux new -A -s "$1"
}
# Updating and Upgrading
#alias update='sudo apt update -y && sudo apt upgrade -y'
#alias update-ding='sudo apt update -y && sudo apt upgrade -y && ding'
alias updateprotonvpn='sudo pip3 install protonvpn-cli --upgrade'
alias fixtime='sudo ntpdate time.windows.com'
# Docker aliases
alias dc="docker compose"
alias dcupdate="docker compose pull && docker compose down && docker compose up -d"
alias dockerkillall='docker rm $(docker ps -aq)'
# Fun terminal stuff
alias ding='paplay /usr/share/sounds/freedesktop/stereo/complete.oga'
alias say='echo "$1" | espeak -v mb-us1'
# Rover and ROS Aliases
alias roverlaunch='/home/luckierdodge/repos/Dockerfiles/ros2_foxy/launch.sh'
alias roverattach='/home/luckierdodge/repos/Dockerfiles/ros2_foxy/attach.sh'
alias rosdepupdate='rosdep update && rosdep install -i --from-path ~/dev_ws/src --rosdistro foxy -y'
alias rosdepinstall='rosdep install --from-paths src --ignore-src -r -y'
# Mcity Aliases
alias mcity-build="src .env && docker compose -f docker-compose-dev.yml build"
alias mcity-run="docker compose -f docker-compose-dev.yml up"
alias scheduling-web="docker exec -it scheduling_host /bin/bash -c 'source .env && npm run serve'"
#alias keys-web="docker exec -it keys_host /binb/bash -c 'source .env && npm run serve'"