@sebastienrousseau/dotfiles 0.2.440 → 0.2.453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/COPYRIGHT +5 -0
  2. package/LICENSE +1260 -2
  3. package/Makefile +79 -0
  4. package/README.md +390 -70
  5. package/bin/dotfiles.sh +157 -0
  6. package/index.js +24 -0
  7. package/package.json +99 -25
  8. package/pnpm-lock.yaml +232 -0
  9. package/pnpm-workspace.yaml +2 -0
  10. package/shell/README.md +3 -0
  11. package/{Icon/r → shell/aliases/default/README.md} +0 -0
  12. package/shell/aliases/default/default.aliases.sh +199 -0
  13. package/shell/aliases/gcloud/gcloud.aliases.sh +121 -0
  14. package/shell/aliases/git/git.aliases.wip +586 -0
  15. package/shell/aliases/heroku/heroku.aliases.sh +1031 -0
  16. package/shell/aliases/jekyll/jekyll.aliases.sh +50 -0
  17. package/shell/aliases/pnpm/pnpm.aliases.sh +42 -0
  18. package/shell/aliases/subversion/subversion.aliases.sh +123 -0
  19. package/shell/aliases/tmux/tmux.aliases.sh +14 -0
  20. package/shell/aliases.sh +12 -0
  21. package/shell/configurations/README.md +3 -0
  22. package/shell/configurations/bash/bashrc +36 -0
  23. package/shell/configurations/curl/cacert.pem +3460 -0
  24. package/shell/configurations/curl/curlrc +55 -0
  25. package/shell/configurations/default/color.sh +17 -0
  26. package/shell/configurations/default/editor.sh +16 -0
  27. package/shell/configurations/default/prompt.sh +37 -0
  28. package/shell/configurations/inputrc/inputrc +22 -0
  29. package/shell/configurations/jshint/jshintrc +37 -0
  30. package/shell/configurations/profile/profile +36 -0
  31. package/shell/configurations/tmux/tmux +95 -0
  32. package/shell/configurations/vim/vimrc +73 -0
  33. package/{.wgetrc → shell/configurations/wget/wgetrc} +4 -0
  34. package/shell/configurations/zsh/zshrc +50 -0
  35. package/shell/configurations.sh +10 -0
  36. package/shell/exit.sh +9 -0
  37. package/shell/functions/README.md +3 -0
  38. package/shell/functions/cdls.sh +19 -0
  39. package/shell/functions/changediskpwd.wip +19 -0
  40. package/shell/functions/code.wip +18 -0
  41. package/shell/functions/countdown.wip +33 -0
  42. package/shell/functions/curlheader.sh +20 -0
  43. package/shell/functions/curltime.sh +31 -0
  44. package/shell/functions/encode64.sh +25 -0
  45. package/shell/functions/environment.sh +37 -0
  46. package/shell/functions/extract.sh +32 -0
  47. package/shell/functions/filehead.sh +4 -0
  48. package/{zsh/zsh/functions/genpwd.zsh → shell/functions/genpwd.sh} +8 -3
  49. package/shell/functions/goto.sh +14 -0
  50. package/shell/functions/headers.wip +4 -0
  51. package/{zsh/zsh/functions/hidehiddenfiles.zsh → shell/functions/hidehiddenfiles.sh} +7 -2
  52. package/shell/functions/history-all.wip +7 -0
  53. package/shell/functions/hostinfo.sh +25 -0
  54. package/{zsh/zsh/functions/hstats.zsh → shell/functions/hstats.sh} +6 -1
  55. package/shell/functions/httpdebug.sh +7 -0
  56. package/shell/functions/keygen.sh +23 -0
  57. package/shell/functions/last.sh +9 -0
  58. package/shell/functions/logout.sh +10 -0
  59. package/shell/functions/lowercase.sh +28 -0
  60. package/shell/functions/macos.sh +47 -0
  61. package/shell/functions/matrix.sh +9 -0
  62. package/shell/functions/mcd.sh +18 -0
  63. package/shell/functions/mount_read_only.sh +9 -0
  64. package/shell/functions/myproc.sh +7 -0
  65. package/shell/functions/prependpath.sh +19 -0
  66. package/shell/functions/print.wip +13 -0
  67. package/shell/functions/ql.sh +7 -0
  68. package/shell/functions/rd.sh +15 -0
  69. package/shell/functions/remove_disk.sh +9 -0
  70. package/shell/functions/ren.sh +11 -0
  71. package/shell/functions/rm.wip +13 -0
  72. package/shell/functions/rps.wip +103 -0
  73. package/{zsh/zsh/functions/showhiddenfiles.zsh → shell/functions/showhiddenfiles.sh} +7 -2
  74. package/{zsh/zsh/functions/size.zsh → shell/functions/size.sh} +6 -1
  75. package/shell/functions/stopwatch.sh +13 -0
  76. package/shell/functions/trash.wip +13 -0
  77. package/shell/functions/tree.wip +13 -0
  78. package/shell/functions/uppercase.sh +28 -0
  79. package/shell/functions/uuidgen.wip +27 -0
  80. package/shell/functions/view-source.sh +8 -0
  81. package/shell/functions/vscode.sh +31 -0
  82. package/shell/functions/whoisport.sh +12 -0
  83. package/shell/functions/zipf.sh +14 -0
  84. package/shell/functions.sh +10 -0
  85. package/shell/history.sh +107 -0
  86. package/shell/paths/ant/ant.paths.sh +15 -0
  87. package/shell/paths/default/default.paths.sh +17 -0
  88. package/shell/paths/homebrew/homebrew.paths.sh +25 -0
  89. package/shell/paths/java/java.paths.sh +16 -0
  90. package/shell/paths/maven/maven.paths.sh +17 -0
  91. package/shell/paths/node/node.paths.sh +13 -0
  92. package/shell/paths/nvm/nvm.paths.sh +21 -0
  93. package/shell/paths/pnpm/pnpm.paths.sh +13 -0
  94. package/shell/paths/python/python.paths.sh +19 -0
  95. package/shell/paths/ruby/ruby.paths.sh +23 -0
  96. package/shell/paths/tmux/tmux.paths.sh +14 -0
  97. package/shell/paths.sh +12 -0
  98. package/.curlrc +0 -17
  99. package/.eslintrc +0 -44
  100. package/.jshintrc +0 -22
  101. package/.travis.yml +0 -21
  102. package/CODE_OF_CONDUCT.md +0 -46
  103. package/CONTRIBUTING.md +0 -60
  104. package/Dotfiles.png +0 -0
  105. package/ISSUE_TEMPLATE.md +0 -43
  106. package/bash/.bash_aliases +0 -409
  107. package/bash/.bash_exit +0 -25
  108. package/bash/.bash_functions +0 -312
  109. package/bash/.bash_load_completion +0 -62
  110. package/bash/.bash_profile +0 -295
  111. package/bash/.bashrc +0 -47
  112. package/homebrew/brew-cask.sh +0 -165
  113. package/homebrew/brew-package.sh +0 -256
  114. package/homebrew/brew-tap.sh +0 -35
  115. package/homebrew/install.sh +0 -29
  116. package/zsh/.zshrc +0 -64
  117. package/zsh/aliases.zsh +0 -427
  118. package/zsh/configurations.zsh +0 -19
  119. package/zsh/exit.zsh +0 -21
  120. package/zsh/functions.zsh +0 -42
  121. package/zsh/history.zsh +0 -53
  122. package/zsh/profile.zsh +0 -17
  123. package/zsh/zsh/configurations/color.zsh +0 -21
  124. package/zsh/zsh/configurations/editor.zsh +0 -21
  125. package/zsh/zsh/configurations/history.zsh +0 -53
  126. package/zsh/zsh/configurations/path.zsh +0 -123
  127. package/zsh/zsh/configurations/prompt.zsh +0 -24
  128. package/zsh/zsh/functions/cd.zsh +0 -51
  129. package/zsh/zsh/functions/cdls.zsh +0 -11
  130. package/zsh/zsh/functions/changediskpwd.zsh +0 -4
  131. package/zsh/zsh/functions/code.zsh +0 -2
  132. package/zsh/zsh/functions/countdown.zsh +0 -33
  133. package/zsh/zsh/functions/curlheader.zsh +0 -12
  134. package/zsh/zsh/functions/curltime.zsh +0 -12
  135. package/zsh/zsh/functions/extract.zsh +0 -27
  136. package/zsh/zsh/functions/goto.zsh +0 -8
  137. package/zsh/zsh/functions/history-all.zsh +0 -2
  138. package/zsh/zsh/functions/hostinfo.zsh +0 -19
  139. package/zsh/zsh/functions/httpdebug.zsh +0 -2
  140. package/zsh/zsh/functions/keygen.zsh +0 -18
  141. package/zsh/zsh/functions/logout.zsh +0 -5
  142. package/zsh/zsh/functions/lowercase.zsh +0 -23
  143. package/zsh/zsh/functions/matrix.zsh +0 -4
  144. package/zsh/zsh/functions/mcd.zsh +0 -11
  145. package/zsh/zsh/functions/mount_read_only.zsh +0 -4
  146. package/zsh/zsh/functions/myproc.zsh +0 -2
  147. package/zsh/zsh/functions/print.zsh +0 -8
  148. package/zsh/zsh/functions/ql.zsh +0 -2
  149. package/zsh/zsh/functions/rd.zsh +0 -8
  150. package/zsh/zsh/functions/remove_disk.zsh +0 -4
  151. package/zsh/zsh/functions/rm.zsh +0 -10
  152. package/zsh/zsh/functions/stopwatch.zsh +0 -8
  153. package/zsh/zsh/functions/trash.zsh +0 -8
  154. package/zsh/zsh/functions/tree.zsh +0 -8
  155. package/zsh/zsh/functions/uppercase.zsh +0 -23
  156. package/zsh/zsh/functions/zipf.zsh +0 -9
@@ -1,53 +0,0 @@
1
- # ---------------------------------------------------------------------------
2
- #
3
- # ______ _ ______ _ _
4
- # | _ \ | | | ___(_) |
5
- # | | | |___ | |_| |_ _| | ___ ___
6
- # | | | / _ \| __| _| | | |/ _ \/ __|
7
- # | |/ / (_) | |_| | | | | __/\__ \
8
- # |___/ \___/ \__\_| |_|_|\___||___/
9
- #
10
- # Description: Mac OS X Dotfiles - Simply designed to fit your shell life.
11
- #
12
- # History options
13
- #
14
- # ---------------------------------------------------------------------------
15
-
16
- # Command history configuration
17
- if [ -z $HISTFILE ]; then
18
- export HISTFILE=$HOME/.zsh_history
19
- fi
20
-
21
- # Number of histories saved in memory
22
- export HISTSIZE=10000
23
-
24
- # Number of histories saved in history file
25
- export SAVEHIST=10000
26
-
27
- # Specifying some history options
28
- setopt always_to_end # Move cursor to the end of a completed word.
29
- setopt append_history # Sessions will append their history list to the history file, rather than replace it.
30
- setopt auto_cd # cd to a directory if it's given without a command.
31
- setopt auto_list # Automatically list choices on ambiguous completion.
32
- setopt auto_menu # Show completion menu on a successive tab press.
33
- setopt auto_param_keys # Automatically complements parentheses
34
- setopt auto_param_slash # If completed parameter is a directory, add a trailing slash.
35
- setopt auto_pushd # Automatically push when cd
36
- setopt auto_resume # Resume if you execute the same command name as the suspended process
37
- setopt bang_hist # Perform textual history expansion
38
- setopt complete_in_word # Complete from both ends of a word.
39
- setopt correct # Enable command correction prompts
40
- setopt extended_history # Save each command’s beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file.
41
- setopt hist_beep # Beep in ZLE when a widget attempts to access a history entry which isn’t there.
42
- setopt hist_expire_dups_first # Cause the oldest history event that has a duplicate to be lost before losing a unique event from the list.
43
- setopt hist_ignore_all_dups # If a new command line being added to the history list duplicates an older one, the older command is removed from the list (even if it is not the previous event).
44
- setopt hist_ignore_dups # Do not enter command lines into the history list if they are duplicates of the previous event.
45
- setopt hist_ignore_space # Remove command lines from the history list when the first character on the line is a space, or when one of the expanded aliases contains a leading space.
46
- setopt hist_no_store # Remove the history (fc -l) command from the history list when invoked.
47
- setopt hist_reduce_blanks # Remove superfluous blanks from each command line being added to the history list.
48
- setopt hist_save_no_dups # When writing out the history file, older commands that duplicate newer ones are omitted.
49
- setopt hist_verify # Whenever the user enters a line with history expansion, don’t execute the line directly; instead, perform history expansion and reload the line into the editing buffer.
50
- setopt list_packed # Display with complementary candidates packed
51
- setopt list_types # Mark the file type in the completion candidate list
52
- setopt pushd_ignore_dups # Don’t push multiple copies of the same directory onto the directory stack.
53
- setopt share_history # Imports new commands from the history file, and also causes the typed commands to be appended to the history file
@@ -1,123 +0,0 @@
1
- # ---------------------------------------------------------------------------
2
- #
3
- # ______ _ ______ _ _
4
- # | _ \ | | | ___(_) |
5
- # | | | |___ | |_| |_ _| | ___ ___
6
- # | | | / _ \| __| _| | | |/ _ \/ __|
7
- # | |/ / (_) | |_| | | | | __/\__ \
8
- # |___/ \___/ \__\_| |_|_|\___||___/
9
- #
10
- # Description: Mac OS X Dotfiles - Simply designed to fit your shell life.
11
- #
12
- # Environment Variables
13
- #
14
- # ---------------------------------------------------------------------------
15
-
16
- # Setting PATH environments
17
- export PATH="/usr/local/opt/openjdk/bin:$PATH"
18
-
19
- # Set ANT_HOME
20
- ANT_HOME="$(brew --prefix)/Cellar/ant/1.10.10/libexec/"
21
- export ANT_HOME
22
-
23
- # Set MAVEN_HOME
24
- MAVEN_HOME="$(brew --prefix)/Cellar/maven/3.8.1/libexec"
25
- export MAVEN_HOME
26
-
27
- # Set M2
28
- M2=$MAVEN_HOME/bin
29
- export M2
30
-
31
- # Set ARCHFLAGS
32
- ARCHFLAGS="-arch x86_64"
33
- export ARCHFLAGS
34
-
35
- # GO
36
- GOROOT=$(brew --prefix)/opt/go/libexec
37
- export GOROOT
38
- export GOPATH=$HOME/.go
39
- export PATH=$PATH:$GOPATH/bin
40
- export PATH=$PATH:$GOROOT/bin
41
-
42
- # set HOMEBREW_CASK_OPTS
43
- HOMEBREW_CASK_OPTS="--appdir=/Applications"
44
- export HOMEBREW_CASK_OPTS
45
-
46
- # set HOSTNAME
47
- HOSTNAME=$(hostname -f)
48
- export HOSTNAME
49
-
50
- # set INPUTRC (so that .inputrc is respected)
51
- INPUTRC=~/.inputrc
52
- export INPUTRC
53
-
54
- # set JENV_HOME
55
- _JENV_HOME="$HOME/.jenv"
56
-
57
- if [ -d "$_JENV_HOME" ]
58
- then
59
- export JENV_HOME=$_JENV_HOME
60
- export PATH="$JENV_HOME/bin:$PATH"
61
- eval "$(jenv init -)"
62
- fi
63
-
64
- # Set language flags
65
- LANG=en_GB.UTF-8
66
- export LANG
67
-
68
- # Set LIBCURL_CFLAGS
69
- LIBCURL_CFLAGS=-L$(brew --prefix)/opt/curl/lib
70
- export LIBCURL_CFLAGS
71
-
72
- # Set LIBCURL_LIBS
73
- LIBCURL_LIBS=-I$(brew --prefix)/opt/curl/include
74
- export LIBCURL_LIBS
75
-
76
- # Set MAVEN_OPTS
77
- MAVEN_OPTS="-Xms512m -Xmx512m"
78
- export MAVEN_OPTS
79
-
80
- # Set NVM_DIR
81
- NVM_DIR="$HOME/.nvm"
82
- export NVM_DIR
83
- [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
84
-
85
- # Set SSL_CERT_FILE
86
- SSL_CERT_FILE=~/cacert.pem
87
- export SSL_CERT_FILE
88
-
89
- # Set ZSH_CURRENT_USER
90
- ZSH_CURRENT_USER=$(whoami)
91
- export ZSH_CURRENT_USER
92
-
93
- ANDROID_HOME="$HOME/Library/Android/sdk/"
94
- export ANDROID_HOME
95
-
96
- PATH=$ANDROID_HOME/tools:$PATH
97
- export PATH
98
-
99
- PATH=$ANDROID_HOME/platform-tools:$PATH
100
- export PATH
101
-
102
- PATH="$(brew --prefix)/opt/python/libexec/bin:$PATH"
103
- export PATH
104
-
105
- PATH="$(brew --prefix)/sbin:$PATH"
106
- export PATH
107
-
108
- # GH_TOKEN="YOUR GH_TOKEN"
109
- # export GH_TOKEN
110
-
111
- # AWS_ACCESS_KEY_ID=<Your requested AWS access ID>
112
- # export AWS_ACCESS_KEY_ID
113
-
114
- # AWS_SECRET_ACCESS_KEY=<Your requested secret access key>
115
- # export AWS_SECRET_ACCESS_KEY
116
-
117
- eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
118
-
119
- # added by travis gem
120
- [ -f $HOME/.travis/travis.sh ] && source $HOME/.travis/travis.sh
121
-
122
- # Add RVM to PATH for scripting.
123
- export PATH="$PATH:$HOME/.rvm/bin"
@@ -1,24 +0,0 @@
1
- # ---------------------------------------------------------------------------
2
- #
3
- # ______ _ ______ _ _
4
- # | _ \ | | | ___(_) |
5
- # | | | |___ | |_| |_ _| | ___ ___
6
- # | | | / _ \| __| _| | | |/ _ \/ __|
7
- # | |/ / (_) | |_| | | | | __/\__ \
8
- # |___/ \___/ \__\_| |_|_|\___||___/
9
- #
10
- # Description: Mac OS X Dotfiles - Simply designed to fit your shell life.
11
- #
12
- # Prompt configuration
13
- #
14
- # ---------------------------------------------------------------------------
15
-
16
- # Normal prompt (👽) & Root prompt (😈)
17
- PROMPT='%(!.😈 %F{red}%S%n%s%f %F{red}❱❱❱%f .👽 %F{green}%S%n%s%f %F{green}❱❱❱%f )'
18
- export PROMPT
19
-
20
- RPROMPT='%(!.%F{red}%B%U%d%b%u%f.%F{green}%B%U%d%b%u%f)'
21
- export RPROMPT
22
-
23
- # Force prompt to write history after every command.
24
- PROMPT_COMMAND='history -a; $PROMPT_COMMAND'
@@ -1,51 +0,0 @@
1
- # cd: Function to Enable 'cd' into directory aliases
2
-
3
- # cd: Function to Enable 'cd' into directory aliases
4
- #function cd() {
5
- #if [ ${#1} == 0 ]; then
6
- # builtin cd
7
- #elif [ -d "${1}" ]; then
8
- # builtin cd "${1}"
9
- #elif [[ -f "${1}" || -L "${1}" ]]; then
10
- # path=$(getTrueName "$1")
11
- # builtin cd "$path"
12
- #else
13
- # builtin cd "${1}"
14
- #fi
15
- #}
16
-
17
- function cd()
18
- {
19
- function cdp()
20
- {
21
- if [ -d "$1" ]; then
22
- builtin cd "$1" && return 0
23
- else
24
- filered_array=($(cdlog_view | \grep -i "/${1}$"))
25
- for ((i=${#filered_array[*]}-1; i>=0; i--))
26
- do
27
- if [ "$PWD" = "${filered_array[i]}" ]; then
28
- _cdhist_cd "${filered_array[0]}" && return 0
29
- fi
30
- _cdhist_cd "${filered_array[i]}" && return 0
31
- done
32
- fi
33
- return 1
34
- }
35
-
36
- [ -z "$1" ] && _cdhist_cd $HOME && return 0
37
- while (( $# > 0 ))
38
- do
39
- case "$1" in
40
- -*)
41
- if [[ "$1" =~ 'l' ]]; then
42
- shift
43
- cdp "$1" && return 0
44
- fi
45
- ;;
46
- *)
47
- cdp "$1" && break
48
- ;;
49
- esac
50
- done
51
- }
@@ -1,11 +0,0 @@
1
- # cdls: Function cd & ls
2
- function cdls() {
3
- # Add \ because cd loops with alias
4
- if [[ "$#" != 1 ]]; then
5
- echo "[ERROR] Please add one argument" >&2
6
- return 1
7
- fi
8
- echo "[INFO] The operation completed successfully, directory listing of $1:"
9
- \cd $1;
10
- ls -lh;
11
- }
@@ -1,4 +0,0 @@
1
- # changediskpwd: Function to change the password on an encrypted disk image
2
- function changediskpwd() {
3
- hdiutil chpass '$1'
4
- }
@@ -1,2 +0,0 @@
1
- # Add Visual Studio Code (code)
2
- code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $"*" ;}
@@ -1,33 +0,0 @@
1
- # countdown: Function for countdown
2
- function countdown(){
3
- date1=$((`gdate +%s` + $1));
4
- while [ "$date1" -ge `gdate +%s` ]; do
5
- echo -ne "$(gdate -u --date @$(($date1 - `gdate +%s`)) +%H:%M:%S)\r";
6
- sleep 0.1
7
- done
8
- }
9
-
10
- #function countdown
11
- #(
12
- # IFS=:
13
- # set -- $*
14
- # secs=$(( ${1#0} * 3600 + ${2#0} * 60 + ${3#0} ))
15
- # PREFIX="$4"
16
- # while [ $secs -gt 0 ]
17
- # do
18
- # sleep 1 &
19
- # printf "\r%s > %02d:%02d:%02d" "$PREFIX" $((secs/3600)) $(( (secs/60)%60)) $((secs%60))
20
- # secs=$(( $secs - 1 ))
21
- # wait
22
- # done
23
- # echo
24
- #)
25
-
26
- # Execute the function
27
- #countdown "00" "20" "00" "Countdown-timer"
28
-
29
- # If you wish to run a command after this timer, place it after this comment
30
- #echo "Done!"
31
-
32
- # Exit cleanly
33
- #exit 0
@@ -1,12 +0,0 @@
1
- ## curlheader will return only a specific response header or all response headers for a given URL
2
- ## usage: curlheader $header $url
3
- ## usage: curlheader $url
4
- function curlheader() {
5
- if [[ -z "$2" ]]; then
6
- echo "curl -k -s -D - $1 -o /dev/null"
7
- curl -k -s -D - $1 -o /dev/null:
8
- else
9
- echo "curl -k -s -D - $2 -o /dev/null | grep $1:"
10
- curl -k -s -D - $2 -o /dev/null | grep $1:
11
- fi
12
- }
@@ -1,12 +0,0 @@
1
- ## get the timings for a curl to a URL
2
- ## usage: curltime $url
3
- function curltime(){
4
- curl -w " time_namelookup: %{time_namelookup}\n\
5
- time_connect: %{time_connect}\n\
6
- time_appconnect: %{time_appconnect}\n\
7
- time_pretransfer: %{time_pretransfer}\n\
8
- time_redirect: %{time_redirect}\n\
9
- time_starttransfer: %{time_starttransfer}\n\
10
- --------------------------\n\
11
- time_total: %{time_total}\n" -o /dev/null -s "$1"
12
- }
@@ -1,27 +0,0 @@
1
- # extract: Function to extract most know archives with one command
2
- function extract() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
-
8
- if [ -f $1 ]; then
9
- echo "[INFO] Extracting $1"
10
- case $1 in
11
- *.tar.bz2) tar xjf $1 ;;
12
- *.tar.gz) tar xzf $1 ;;
13
- *.bz2) bunzip2 $1 ;;
14
- *.rar) unrar e $1 ;;
15
- *.gz) gunzip $1 ;;
16
- *.tar) tar xf $1 ;;
17
- *.tbz2) tar xjf $1 ;;
18
- *.tgz) tar xzf $1 ;;
19
- *.zip) unzip $1 ;;
20
- *.Z) uncompress $1 ;;
21
- *.7z) 7z x $1 ;;
22
- *) echo "[ERROR] '$1' cannot be extracted via extract()" ;;
23
- esac
24
- else
25
- echo "[ERROR] '$1' is not a valid file"
26
- fi
27
- }
@@ -1,8 +0,0 @@
1
- # goto: Function to change to the directory inputed
2
- goto() {
3
- if [ -e "$1" ]; then
4
- cd "$1"; l
5
- else
6
- echo "[ERROR] Please add a directory name" >&2
7
- fi
8
- }
@@ -1,2 +0,0 @@
1
- # history-all: Function to display the full view of the history command
2
- function history-all { history -E 1 }
@@ -1,19 +0,0 @@
1
- # hostinfo: Function to display useful host related informaton
2
- function hostinfo() {
3
- echo -e "\\nYou are logged on ${RED}$HOST"
4
- echo -e "\\nAdditionnal information:$NC "
5
- uname -a
6
- echo -e "\\n${RED}Users logged on:$NC "
7
- w -h
8
- echo -e "\\n${RED}Current date :$NC "
9
- date
10
- echo -e "\\n${RED}Machine stats :$NC "
11
- uptime
12
- echo -e "\\n${RED}Current network location :$NC "
13
- scselect
14
- echo -e "\\n${RED}Public facing IP Address :$NC "
15
- myip
16
- echo -e "\\n${RED}DNS Configuration:$NC "
17
- scutil --dns
18
- echo
19
- }
@@ -1,2 +0,0 @@
1
- # httpdebug: Function to download a web page and show info on what took time
2
- function httpdebug() { /usr/bin/curl "$@" -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect} pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\\n"; }
@@ -1,18 +0,0 @@
1
- # keygen: Function to generates SSH key
2
- function keygen() {
3
-
4
- echo "What's the name of the Key (no space please) ? ";
5
- read -r name;
6
-
7
- echo "What's the email associated with it? ";
8
- read -r email;
9
-
10
- echo $(ssh-keygen -t rsa -f ~/.ssh/id_rsa_$name -C "$email");
11
-
12
- ssh-add ~/.ssh/id_rsa_$name;
13
-
14
- pbcopy < ~/.ssh/id_rsa_$name.pub;
15
-
16
- echo "[INFO] SSH Key id_rsa_$name.pub copied in your clipboard";
17
-
18
- }
@@ -1,5 +0,0 @@
1
- # logout: Function to logout from OS X via the Terminal
2
- function logout() {
3
- osascript -e 'tell application "System Events" to log out'
4
- builtin logout
5
- }
@@ -1,23 +0,0 @@
1
- # lowercase: Function to move filenames or directory names to lowercase
2
- function lowercase()
3
- {
4
- if [[ "$#" != 1 ]]; then
5
- echo "[ERROR] The filename or directory name is incorrect." >&2
6
- return 1
7
- fi
8
- for file ; do
9
- filename=${file##*/}
10
- case "$filename" in
11
- */*) dirname==${file%/*} ;;
12
- *) dirname=.;;
13
- esac
14
- nf=$(echo $filename | tr A-Z a-z)
15
- newname="${dirname}/${nf}"
16
- if [ "$nf" != "$filename" ]; then
17
- mv "$file" "$newname"
18
- echo "[INFO] Renaming $file to lowercase: $newname"
19
- else
20
- echo "[ERROR] The operation is not valid, $file has not changed."
21
- fi
22
- done
23
- }
@@ -1,4 +0,0 @@
1
- # matrix: Function to Enable Matrix Effect in the terminal
2
- function matrix() {
3
- echo -e "\\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
4
- }
@@ -1,11 +0,0 @@
1
- # mcd: Function to combine mkdir and cd
2
- function mcd() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- echo "[INFO] Creating the folder $1"
8
- mkdir "$1"
9
- echo "[INFO] Switching to $1 folder"
10
- cd "$1" || exit
11
- }
@@ -1,4 +0,0 @@
1
- # mount_read_only: Function to mount a read-only disk image as read-write
2
- function mount_read_only() {
3
- hdiutil attach "$1" -shadow /tmp/"$1".shadow -noverify
4
- }
@@ -1,2 +0,0 @@
1
- # myproc: Function to list processes owned by an user
2
- function myproc() { ps "$@" -u "$USER" -o pid,%cpu,%mem,start,time,bsdtime,command; }
@@ -1,8 +0,0 @@
1
- # print: Function to display the argument given
2
- print() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- echo "--- $1"
8
- }
@@ -1,2 +0,0 @@
1
- # ql: Function to open any file in MacOS Quicklook Preview
2
- function ql() { qlmanage -p "$*" >&/dev/null; }
@@ -1,8 +0,0 @@
1
- # rd: Function to remove a direcory and its files
2
- function rd() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- rm "$1"
8
- }
@@ -1,4 +0,0 @@
1
- # remove_disk: spin down unneeded disk
2
- function remove_disk () {
3
- diskutil eject "$1"
4
- }
@@ -1,10 +0,0 @@
1
- # rm: Function to make 'rm' move files to the trash
2
- function rm {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- [ ! -d ~/.Trash ] && mkdir ~/.Trash
8
- echo "[INFO] Removing $1"
9
- mv "$1" ~/.Trash
10
- }
@@ -1,8 +0,0 @@
1
- # stopwatch: Function for a stopwatch
2
- function stopwatch(){
3
- date1=`gdate +%s`;
4
- while true; do
5
- echo -ne "$(gdate -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r";
6
- sleep 0.1
7
- done
8
- }
@@ -1,8 +0,0 @@
1
- # trash: Function to moves a file to the MacOS trash
2
- function trash() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- rm "$1"
8
- }
@@ -1,8 +0,0 @@
1
- # tree: Function to generates a tree view from the current directory
2
- if [ ! -e /usr/local/bin/tree ]; then
3
- function tree(){
4
- pwd
5
- ls -R | grep ":$" | \
6
- sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
7
- }
8
- fi
@@ -1,23 +0,0 @@
1
- # uppercase: Function to move filenames or directory names to uppercase
2
- function uppercase()
3
- {
4
- if [[ "$#" != 1 ]]; then
5
- echo "[ERROR] The filename or directory name is incorrect." >&2
6
- return 1
7
- fi
8
- for file ; do
9
- filename=${file##*/}
10
- case "$filename" in
11
- */*) dirname==${file%/*} ;;
12
- *) dirname=.;;
13
- esac
14
- nf=$(echo $filename | tr a-z A-Z)
15
- newname="${dirname}/${nf}"
16
- if [ "$nf" != "$filename" ]; then
17
- mv "$file" "$newname"
18
- echo "[INFO] Renaming $file to uppercase: $newname"
19
- else
20
- echo "[ERROR] The operation is not valid, $file has not changed."
21
- fi
22
- done
23
- }
@@ -1,9 +0,0 @@
1
- # zipf: Function to create a ZIP archive of a folder
2
- function zipf() {
3
- if [[ "$#" != 1 ]]; then
4
- echo "[ERROR] Please add one argument" >&2
5
- return 1
6
- fi
7
- echo "[INFO] Creating the ZIP archive folder $1.zip"
8
- zip -r "$1".zip "$1";
9
- }