-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
73 lines (63 loc) · 1.68 KB
/
.bash_profile
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
#!/usr/bin/env bash
# Load ~/.exports and ~/.aliases
for file in $HOME/dotfiles/.{exports,aliases}; do
[ -r "$file" ] && source "$file"
done
# ======= Functions =======
#Portmanteu for mkdir and go to that folder.
function mcd(){
mkdir -p "$1" && cd "$1";
}
#Number of files in the current directory
function numfiles(){
echo $(ls -1 | wc -l);
}
function ll(){
ls -alFG;
}
#alarm
function alarm(){
cd $HOME/Study/Sandbox/Python\ Practice/alarm/ && python my_alarm.py;
}
# run python server
function server() {
local port="${1:-8000}";
python -m SimpleHTTPServer "$port";
}
# change ~/.bash_profile on changing ~/dotfiles/.bash_profile
function bashed(){
cd $HOME/dotfiles;
source ./install.sh;
reload;
cd $HOME;
}
function re_install_docker() {
sudo service docker stop &&
sudo apt-get purge -y docker-ce &&
sudo apt-get autoremove --purge -y docker-ce &&
sudo rm -rf /var/lib/docker &&
sudo apt-get update &&
sudo apt-get install -y docker-ce &&
sudo service docker start &&
sudo docker run hello-world &&
sudo usermod -aG docker $USER
}
function install_docker() {
sudo apt-get remove docker docker-engine docker.io &&
sudo apt-get update &&
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" &&
sudo apt-get update &&
sudo apt-get install docker-ce &&
sudo groupadd docker &&
sudo usermod -aG docker $USER &&
docker run hello-world
}
# Usage: get_up dev
function get_up() {
git fetch upstream && git merge upstream/$1
}