File tree 4 files changed +68
-16
lines changed
4 files changed +68
-16
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # change directory
3
+
4
+ # -------------------------------------------------------------------
5
+ # Change Directory
6
+ # -------------------------------------------------------------------
4
7
alias ..=" cd .."
5
8
alias ...=" cd ../.."
6
9
alias ....=" cd ../../.."
7
10
alias .....=" cd ../../../.."
8
11
9
- # hdd
12
+ # -------------------------------------------------------------------
13
+ # HDD
14
+ # -------------------------------------------------------------------
10
15
alias df=' df -h'
11
16
alias du=' du -h'
12
17
13
- # # utilities
14
-
18
+ # -------------------------------------------------------------------
19
+ # Utilities
20
+ # -------------------------------------------------------------------
15
21
# open with system default application
16
22
alias o=' open_command'
17
23
alias o.=' o .'
18
-
19
24
# Lock the screen (when going AFK)
20
25
alias afk=" i3lock -c 000000"
26
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # #############################################################################
3
+ # dockerfunc
4
+ # -----------
5
+ # Usefull bash docker functions
6
+ #
7
+ # :authors: Sébastien BARON, @cbastienbaron
8
+ # :date: 18 March 2018
9
+ # :version: 0.0.1
10
+ # #############################################################################
11
+
12
+ del_stopped (){
13
+ local name=$1
14
+ local state
15
+ state=$( docker inspect --format " {{.State.Running}}" " $name " 2> /dev/null)
16
+
17
+ if [[ " $state " == " false" ]]; then
18
+ docker rm " $name "
19
+ fi
20
+ }
21
+
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # File: .functions
4
- # Description:
5
- # contains all functions defined by the user. Separated from shell rc files
6
- # for portability between different machines.
7
- # Avoid syntax and commands not portable to other different setups,
8
- # check out http://hyperpolyglot.org/unix-shells for more information
9
-
3
+ # #############################################################################
4
+ # functions
5
+ # -----------
6
+ # Usefull bash functions
7
+ #
8
+ # :authors: Sébastien BARON, @cbastienbaron
9
+ # :date: 18 March 2018
10
+ # :version: 0.0.1
11
+ # #############################################################################
10
12
11
13
# run command in the background
12
14
background () {
@@ -15,7 +17,7 @@ background() {
15
17
}
16
18
17
19
# serve PWD as web server
18
- serve () {
20
+ function serve() {
19
21
# serve [port] [directory]
20
22
local port=${1:- 8000}
21
23
local dir=$2
Original file line number Diff line number Diff line change
1
+ [alias ]
2
+ # View the current working tree status using the short format
3
+ s = status -s
4
+
5
+ # View abbreviated SHA, description, and history graph of the latest 20 commits
6
+ l = log --pretty=oneline -n 20 --graph --abbrev-commit
7
+
8
+ # Switch to a branch, creating it if necessary
9
+ co = " ! f() { git checkout -b \" $1 \" 2> /dev/null || git checkout \" $1 \" ; }; f "
10
+
11
+ # Color graph log view
12
+ graph = log --graph --color --pretty=format:"%C(yellow)%H%C(green)%d%C(reset)%n%x20%cd%n%x20%cn%x20(%ce)%n%x20%s%n"
13
+
14
+ # List contributors with number of commits
15
+ contributors = shortlog --summary --numbered
16
+
17
+ # Show verbose output about tags, branches or remotes
18
+ tags = tag -l
19
+ branches = branch -a
20
+ remotes = remote -v
21
+
22
+ alias = ! git config -l | grep ^alias | cut -c 7- | sort
23
+
1
24
[user ]
2
25
name = cbastienbaron
3
26
4
27
signingkey = 3F1C80C6
28
+
5
29
[core ]
6
30
autocrlf = input
31
+ editor = nano
32
+
7
33
[commit ]
8
34
gpgsign = false
9
35
10
- [alias ]
11
- remotes = remote -v
12
-
13
36
[color ]
14
37
ui = true
You can’t perform that action at this time.
0 commit comments