@sebastienrousseau/dotfiles 0.2.468 β†’ 0.2.469

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 (172) hide show
  1. package/README.md +5 -5
  2. package/dist/Makefile +126 -43
  3. package/dist/bin/constants.d.ts +2 -2
  4. package/dist/bin/constants.d.ts.map +1 -1
  5. package/dist/bin/constants.js +1 -1
  6. package/dist/filesizes.txt +146 -144
  7. package/dist/lib/README.md +79 -5
  8. package/dist/lib/aliases/README.md +44 -42
  9. package/dist/lib/aliases/archives/README.md +120 -34
  10. package/dist/lib/aliases/archives/archives.aliases.sh +106 -149
  11. package/dist/lib/aliases/cd/README.md +119 -38
  12. package/dist/lib/aliases/cd/cd.aliases.sh +37 -59
  13. package/dist/lib/aliases/chmod/README.md +146 -95
  14. package/dist/lib/aliases/chmod/chmod.aliases.sh +71 -55
  15. package/dist/lib/aliases/clear/README.md +2 -2
  16. package/dist/lib/aliases/clear/clear.aliases.sh +4 -4
  17. package/dist/lib/aliases/configuration/README.md +2 -2
  18. package/dist/lib/aliases/configuration/configuration.aliases.sh +3 -6
  19. package/dist/lib/aliases/default/README.md +2 -2
  20. package/dist/lib/aliases/default/default.aliases.sh +3 -3
  21. package/dist/lib/aliases/dig/README.md +2 -2
  22. package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
  23. package/dist/lib/aliases/disk-usage/README.md +2 -2
  24. package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
  25. package/dist/lib/aliases/editor/README.md +2 -2
  26. package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
  27. package/dist/lib/aliases/find/README.md +2 -2
  28. package/dist/lib/aliases/find/find.aliases.sh +4 -4
  29. package/dist/lib/aliases/gcloud/README.md +2 -2
  30. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
  31. package/dist/lib/aliases/git/README.md +2 -2
  32. package/dist/lib/aliases/git/git.aliases.sh +3 -3
  33. package/dist/lib/aliases/gnu/README.md +2 -2
  34. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
  35. package/dist/lib/aliases/heroku/README.md +2 -2
  36. package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
  37. package/dist/lib/aliases/interactive/README.md +2 -2
  38. package/dist/lib/aliases/interactive/interactive.aliases.sh +3 -3
  39. package/dist/lib/aliases/list/README.md +112 -23
  40. package/dist/lib/aliases/list/list.aliases.sh +130 -84
  41. package/dist/lib/aliases/macOS/README.md +2 -2
  42. package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
  43. package/dist/lib/aliases/make/README.md +2 -2
  44. package/dist/lib/aliases/make/make.aliases.sh +3 -3
  45. package/dist/lib/aliases/mkdir/README.md +2 -2
  46. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
  47. package/dist/lib/aliases/npm/README.md +2 -2
  48. package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
  49. package/dist/lib/aliases/permission/README.md +2 -2
  50. package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
  51. package/dist/lib/aliases/pnpm/README.md +2 -2
  52. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
  53. package/dist/lib/aliases/ps/README.md +2 -2
  54. package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
  55. package/dist/lib/aliases/python/python.aliases.sh +141 -0
  56. package/dist/lib/aliases/rsync/README.md +2 -2
  57. package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
  58. package/dist/lib/aliases/rust/README.md +165 -44
  59. package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
  60. package/dist/lib/aliases/subversion/README.md +2 -2
  61. package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
  62. package/dist/lib/aliases/sudo/README.md +2 -2
  63. package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
  64. package/dist/lib/aliases/tmux/README.md +2 -2
  65. package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
  66. package/dist/lib/aliases/update/README.md +2 -2
  67. package/dist/lib/aliases/update/update.aliases.sh +307 -66
  68. package/dist/lib/aliases/uuid/README.md +2 -2
  69. package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
  70. package/dist/lib/aliases/wget/README.md +2 -2
  71. package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
  72. package/dist/lib/aliases.sh +2 -2
  73. package/dist/lib/configurations/README.md +2 -2
  74. package/dist/lib/configurations/bash/bashrc +163 -35
  75. package/dist/lib/configurations/curl/curlrc +3 -6
  76. package/dist/lib/configurations/default/color.sh +3 -3
  77. package/dist/lib/configurations/default/constants.sh +4 -4
  78. package/dist/lib/configurations/default/editor.sh +3 -3
  79. package/dist/lib/configurations/default/prompt.sh +20 -11
  80. package/dist/lib/configurations/input/inputrc +3 -3
  81. package/dist/lib/configurations/nano/nanorc +3 -3
  82. package/dist/lib/configurations/profile/profile +3 -3
  83. package/dist/lib/configurations/prompt/prompt.sh +81 -0
  84. package/dist/lib/configurations/tmux/default +3 -3
  85. package/dist/lib/configurations/tmux/display +3 -3
  86. package/dist/lib/configurations/tmux/linux +3 -3
  87. package/dist/lib/configurations/tmux/navigation +3 -3
  88. package/dist/lib/configurations/tmux/panes +3 -3
  89. package/dist/lib/configurations/tmux/theme +4 -4
  90. package/dist/lib/configurations/tmux/tmux +3 -3
  91. package/dist/lib/configurations/vim/vimrc +191 -71
  92. package/dist/lib/configurations/wget/wgetrc +3 -3
  93. package/dist/lib/configurations/zsh/zshrc +3 -4
  94. package/dist/lib/configurations.sh +19 -7
  95. package/dist/lib/functions/README.md +68 -54
  96. package/dist/lib/functions/apihealth.sh +277 -0
  97. package/dist/lib/functions/apilatency.sh +157 -0
  98. package/dist/lib/functions/apiload.sh +165 -0
  99. package/dist/lib/functions/backup.sh +143 -0
  100. package/dist/lib/functions/cdls.sh +52 -6
  101. package/dist/lib/functions/curlheader.sh +66 -10
  102. package/dist/lib/functions/curlstatus.sh +64 -7
  103. package/dist/lib/functions/curltime.sh +56 -14
  104. package/dist/lib/functions/encode64.sh +87 -7
  105. package/dist/lib/functions/environment.sh +65 -25
  106. package/dist/lib/functions/extract.sh +79 -27
  107. package/dist/lib/functions/freespace.sh +55 -9
  108. package/dist/lib/functions/genpwd.sh +93 -29
  109. package/dist/lib/functions/goto.sh +59 -8
  110. package/dist/lib/functions/hexdump.sh +96 -0
  111. package/dist/lib/functions/hiddenfiles.sh +77 -0
  112. package/dist/lib/functions/hostinfo.sh +92 -21
  113. package/dist/lib/functions/hstats.sh +69 -5
  114. package/dist/lib/functions/httpdebug.sh +109 -5
  115. package/dist/lib/functions/kebabcase.sh +61 -0
  116. package/dist/lib/functions/keygen.sh +188 -25
  117. package/dist/lib/functions/last.sh +106 -5
  118. package/dist/lib/functions/logout.sh +114 -6
  119. package/dist/lib/functions/lowercase.sh +49 -17
  120. package/dist/lib/functions/matrix.sh +205 -30
  121. package/dist/lib/functions/mount_read_only.sh +3 -3
  122. package/dist/lib/functions/myproc.sh +3 -3
  123. package/dist/lib/functions/prependpath.sh +3 -3
  124. package/dist/lib/functions/ql.sh +3 -3
  125. package/dist/lib/functions/rd.sh +3 -3
  126. package/dist/lib/functions/remove_disk.sh +3 -3
  127. package/dist/lib/functions/ren.sh +68 -8
  128. package/dist/lib/functions/sentencecase.sh +63 -0
  129. package/dist/lib/functions/showhiddenfiles.sh +3 -3
  130. package/dist/lib/functions/size.sh +6 -5
  131. package/dist/lib/functions/snakecase.sh +61 -0
  132. package/dist/lib/functions/stopwatch.sh +3 -3
  133. package/dist/lib/functions/sysinfo.sh +145 -0
  134. package/dist/lib/functions/titlecase.sh +65 -0
  135. package/dist/lib/functions/uppercase.sh +51 -19
  136. package/dist/lib/functions/view-source.sh +3 -3
  137. package/dist/lib/functions/vscode.sh +3 -3
  138. package/dist/lib/functions/whoisport.sh +3 -3
  139. package/dist/lib/functions/zipf.sh +3 -3
  140. package/dist/lib/functions.sh +21 -7
  141. package/dist/lib/history.sh +36 -88
  142. package/dist/lib/paths/README.md +52 -0
  143. package/dist/lib/paths/custom.paths.sh +40 -0
  144. package/dist/lib/paths/default.paths.sh +37 -0
  145. package/dist/lib/paths.sh +27 -14
  146. package/dist/scripts/backup.sh +3 -3
  147. package/dist/scripts/banner.sh +3 -3
  148. package/dist/scripts/build.sh +3 -3
  149. package/dist/scripts/clean.sh +3 -3
  150. package/dist/scripts/compile.sh +3 -3
  151. package/dist/scripts/copy.sh +3 -3
  152. package/dist/scripts/dotfiles.sh +3 -3
  153. package/dist/scripts/download.sh +3 -3
  154. package/dist/scripts/help.sh +3 -3
  155. package/dist/scripts/ssh.sh +3 -3
  156. package/dist/scripts/unpack.sh +3 -3
  157. package/package.json +10 -10
  158. package/dist/lib/aliases/jekyll/README.md +0 -41
  159. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
  160. package/dist/lib/functions/filehead.sh +0 -4
  161. package/dist/lib/functions/hidehiddenfiles.sh +0 -14
  162. package/dist/lib/paths/ant/ant.paths.sh +0 -15
  163. package/dist/lib/paths/default/default.paths.sh +0 -19
  164. package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
  165. package/dist/lib/paths/java/java.paths.sh +0 -19
  166. package/dist/lib/paths/maven/maven.paths.sh +0 -18
  167. package/dist/lib/paths/node/node.paths.sh +0 -15
  168. package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
  169. package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
  170. package/dist/lib/paths/python/python.paths.sh +0 -36
  171. package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
  172. package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
@@ -1,34 +1,86 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ (v0.2.468) - <https://dotfiles.io>
4
- # Made with β™₯ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2024. All rights reserved
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Archive Extractor (extract)
5
+ # Made with β™₯ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # extract is a function to extract most known archive formats with a single
10
+ # command. It supports various archive types like .tar, .zip, .gz, .7z, and more.
11
+ #
12
+ # Usage:
13
+ # extract [file]
14
+ # extract --help
15
+ #
16
+ # Arguments:
17
+ # file The archive file to extract.
18
+ # --help Displays this help menu and exits.
19
+ #
20
+ # Examples:
21
+ # extract file.tar.gz
22
+ # # Extracts the contents of file.tar.gz.
23
+ #
24
+ # extract archive.zip
25
+ # # Extracts the contents of archive.zip.
26
+ #
27
+ # extract --help
28
+ # # Displays the help menu.
29
+ #
30
+ ################################################################################
7
31
 
8
- # extract: Function to extract most know archives with one command
32
+ # Function to extract most known archive formats
9
33
  extract() {
10
- if [[ "$#" != 1 ]]; then
11
- echo "[ERROR] Please add one argument" >&2
12
- return 1
13
- fi
34
+ # Display help menu
35
+ if [[ "$1" == "--help" ]]; then
36
+ echo "extract: Archive Extractor"
37
+ echo
38
+ echo "Usage:"
39
+ echo " extract [file]"
40
+ echo " extract --help"
41
+ echo
42
+ echo "Arguments:"
43
+ echo " file The archive file to extract."
44
+ echo " --help Displays this help menu and exits."
45
+ echo
46
+ echo "Examples:"
47
+ echo " extract file.tar.gz"
48
+ echo " # Extracts the contents of file.tar.gz."
49
+ echo
50
+ echo " extract archive.zip"
51
+ echo " # Extracts the contents of archive.zip."
52
+ echo
53
+ echo " extract --help"
54
+ echo " # Displays the help menu."
55
+ echo
56
+ return 0
57
+ fi
14
58
 
15
- if [[ -f "$1" ]]; then
16
- echo "[INFO] Extracting $1"
17
- case $1 in
18
- *.tar.bz2) tar xjf "$1" ;;
19
- *.tar.gz) tar xzf "$1" ;;
20
- *.bz2) bunzip2 "$1" ;;
21
- *.rar) unrar e "$1" ;;
22
- *.gz) gunzip "$1" ;;
23
- *.tar) tar xf "$1" ;;
24
- *.tbz2) tar xjf "$1" ;;
25
- *.tgz) tar xzf "$1" ;;
26
- *.zip) unzip "$1" ;;
27
- *.Z) uncompress "$1" ;;
28
- *.7z) 7z x "$1" ;;
29
- *) echo "[ERROR] '$1' cannot be extracted via extract()" ;;
30
- esac
31
- else
32
- echo "[ERROR] '$1' is not a valid file"
33
- fi
59
+ # Validate input
60
+ if [[ "$#" != 1 ]]; then
61
+ echo "[ERROR] Please provide one argument (the archive file to extract)." >&2
62
+ return 1
63
+ fi
64
+
65
+ # Check if the file exists
66
+ if [[ -f "$1" ]]; then
67
+ echo "[INFO] Extracting '$1'..."
68
+ case "$1" in
69
+ *.tar.bz2) tar xjf "$1" ;;
70
+ *.tar.gz) tar xzf "$1" ;;
71
+ *.bz2) bunzip2 "$1" ;;
72
+ *.rar) unrar e "$1" ;;
73
+ *.gz) gunzip "$1" ;;
74
+ *.tar) tar xf "$1" ;;
75
+ *.tbz2) tar xjf "$1" ;;
76
+ *.tgz) tar xzf "$1" ;;
77
+ *.zip) unzip "$1" ;;
78
+ *.Z) uncompress "$1" ;;
79
+ *.7z) 7z x "$1" ;;
80
+ *) echo "[ERROR] '$1' cannot be extracted via extract()." ;;
81
+ esac
82
+ else
83
+ echo "[ERROR] '$1' is not a valid file." >&2
84
+ return 1
85
+ fi
34
86
  }
@@ -1,21 +1,67 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ (v0.2.468) - <https://dotfiles.io>
4
- # Made with β™₯ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2024. All rights reserved
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Free Disk Space Cleaner (freespace)
5
+ # Made with β™₯ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # freespace is a utility function to securely erase purgeable disk space with
10
+ # zeros on the selected disk using the `diskutil secureErase freespace` command.
11
+ #
12
+ # Usage:
13
+ # freespace [disk]
14
+ # freespace --help
15
+ #
16
+ # Arguments:
17
+ # disk The disk to clean purgeable space from (e.g., /dev/disk1s1).
18
+ # --help Displays this help menu and exits.
19
+ #
20
+ # Examples:
21
+ # freespace /dev/disk1s1
22
+ # # Erases purgeable disk space with zeros on /dev/disk1s1.
23
+ #
24
+ # freespace --help
25
+ # # Displays the help menu.
26
+ #
27
+ ################################################################################
7
28
 
8
- # Erases purgeable disk space with 0s on the selected disk
9
29
  freespace() {
30
+ # Display help menu
31
+ if [[ "$1" == "--help" ]]; then
32
+ echo "freespace: Free Disk Space Cleaner"
33
+ echo
34
+ echo "Usage:"
35
+ echo " freespace [disk]"
36
+ echo " freespace --help"
37
+ echo
38
+ echo "Arguments:"
39
+ echo " disk The disk to clean purgeable space from (e.g., /dev/disk1s1)."
40
+ echo " --help Displays this help menu and exits."
41
+ echo
42
+ echo "Examples:"
43
+ echo " freespace /dev/disk1s1"
44
+ echo " # Erases purgeable disk space with zeros on /dev/disk1s1."
45
+ echo
46
+ echo " freespace --help"
47
+ echo " # Displays the help menu."
48
+ echo
49
+ echo "Available Disks:"
50
+ df -h | awk 'NR == 1 || /^\/dev\/disk/'
51
+ echo
52
+ return 0
53
+ fi
54
+
55
+ # Check if a disk argument is provided
10
56
  if [[ -z "$1" ]]; then
11
- echo "Usage: $0 <disk>"
12
- echo "Example: $0 /dev/disk1s1"
57
+ echo "[ERROR] No disk provided. Use 'freespace --help' for usage information."
13
58
  echo
14
- echo "Possible disks:"
15
- df -h | awk 'NR == 1 || /^\/dev\/disk/' || true
59
+ echo "Available Disks:"
60
+ df -h | awk 'NR == 1 || /^\/dev\/disk/'
16
61
  return 1
17
62
  fi
18
63
 
19
- echo "Cleaning purgeable files from disk: $1 ...."
64
+ # Perform secure erase of free space on the selected disk
65
+ echo "[INFO] Cleaning purgeable files from disk: $1..."
20
66
  diskutil secureErase freespace 0 "$1"
21
67
  }
@@ -1,41 +1,105 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ (v0.2.468) - <https://dotfiles.io>
4
- # Made with β™₯ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2024. All rights reserved
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Password Generator (genpwd)
5
+ # Made with β™₯ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # genpwd generates a strong random password with customizable length and
10
+ # separator. The user can specify the number of blocks and a separator
11
+ # character. Each block consists of 6 characters (5 alphanumeric + 1 special).
12
+ #
13
+ # Usage:
14
+ # genpwd [num_blocks] [separator]
15
+ #
16
+ # Arguments:
17
+ # num_blocks Number of blocks of 6 characters to generate (default: 3).
18
+ # separator Custom separator between blocks (default: '-').
19
+ #
20
+ # Examples:
21
+ # genpwd # Generates a password with 3 blocks separated by '-'
22
+ # genpwd 5 / # Generates a password with 5 blocks separated by '/'
23
+ # genpwd 6 : # Generates a password with 6 blocks separated by ':'
24
+ #
25
+ # Clipboard Support:
26
+ # If a clipboard utility is available (pbcopy, xclip, wl-copy, or clip), the
27
+ # password will automatically be copied to the clipboard.
28
+ #
29
+ ################################################################################
7
30
 
8
- # Function to generates a strong random password of 27 characters
9
- #!/usr/bin/env bash
10
- # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ (v0.2.468) - https://dotfiles.io
11
- # Made with β™₯ in London, UK by @sebastienrousseau
12
- # Copyright (c) 2015-2024. All rights reserved
13
- # License: MIT
14
-
15
- # genpwd: Function to generates a strong random password of 20 characters (similar to Apple)
16
31
  genpwd() {
17
- # Define the special characters
18
- SPECIAL="!@#$%^&*()+=[]{};':,.?~"
32
+ # Display help menu
33
+ if [[ "$1" == "--help" ]]; then
34
+ echo "genpwd: Generate a strong random password with customizable length and separator"
35
+ echo
36
+ echo "Usage:"
37
+ echo " genpwd [num_blocks] [separator]"
38
+ echo
39
+ echo "Arguments:"
40
+ echo " num_blocks Number of blocks of 6 characters to generate (default: 3)."
41
+ echo " separator Custom separator between blocks (default: '-')."
42
+ echo
43
+ echo "Examples:"
44
+ echo " genpwd # Generates a password with 3 blocks separated by '-'"
45
+ echo " genpwd 5 / # Generates a password with 5 blocks separated by '/'"
46
+ echo " genpwd 6 : # Generates a password with 6 blocks separated by ':'"
47
+ echo
48
+ echo "Clipboard Support:"
49
+ echo " If a clipboard utility is available (pbcopy, xclip, wl-copy, or clip), the password will"
50
+ echo " automatically be copied to the clipboard."
51
+ echo
52
+ return 0
53
+ fi
54
+
55
+ # Check for required tools
56
+ if ! command -v openssl &>/dev/null; then
57
+ echo "[ERROR] 'openssl' is required but not installed. Please install it and try again." >&2
58
+ return 1
59
+ fi
19
60
 
20
- # Generate 3 random strings of length 8
21
- m=$(openssl rand -base64 32 | tr -dc '[:alnum:]' | fold -w 8 | head -n 1 || true)
22
- a=$(openssl rand -base64 32 | tr -dc '[:alnum:]' | fold -w 8 | head -n 1 || true)
23
- c=$(openssl rand -base64 32 | tr -dc '[:alnum:]' | fold -w 8 | head -n 1 || true)
61
+ # Define the number of blocks (default: 3) and separator (default: '-')
62
+ local num_blocks="${1:-3}" # Number of blocks
63
+ local separator="${2:--}" # Separator between blocks
64
+ local SPECIAL="!@#$%^&*()+=[]{};':,.?~|<>€Β₯_" # Special characters
24
65
 
25
- # Choose random positions for the special characters
26
- m_pos=$((RANDOM % 8))
27
- a_pos=$((RANDOM % 8))
28
- c_pos=$((RANDOM % 8))
66
+ # Generate a sufficiently long random alphanumeric base
67
+ local base_password=$(openssl rand -base64 128 | tr -dc '[:alnum:]')
29
68
 
30
- # Choose a random special character from the list
31
- special_char1="${SPECIAL:$((RANDOM % ${#SPECIAL})):1}"
32
- special_char2="${SPECIAL:$((RANDOM % ${#SPECIAL})):1}"
33
- special_char3="${SPECIAL:$((RANDOM % ${#SPECIAL})):1}"
69
+ # Initialize the password variable
70
+ local password=""
71
+
72
+ # Build the password with the specified number of blocks
73
+ for ((i = 0; i < num_blocks; i++)); do
74
+ # Generate a random 6-character block with special characters
75
+ local block="${base_password:$((i * 6)):5}${SPECIAL:$((RANDOM % ${#SPECIAL})):1}"
76
+
77
+ # Append the block to the password
78
+ if [[ -n "$password" ]]; then
79
+ password+="${separator}"
80
+ fi
81
+ password+="${block}"
82
+ done
34
83
 
35
- # Combine the strings with the special character to form the password
36
- pwd="${m:0:${m_pos}}${special_char1}${m:${m_pos}}-${a:0:${a_pos}}${special_char2}${a:${a_pos}}-${c:0:${c_pos}}${special_char3}${c:${c_pos}}"
84
+ # Output the password
85
+ echo "[INFO] Generated password: ${password}"
37
86
 
38
- echo "[INFO] The password has been copied to the clipboard: ${pwd}"
39
- echo "${pwd}" | pbcopy | pbpaste || true
87
+ # Copy to clipboard if possible
88
+ if command -v pbcopy &>/dev/null; then
89
+ echo -n "${password}" | pbcopy
90
+ echo "[INFO] Password copied to clipboard (macOS)."
91
+ elif command -v xclip &>/dev/null; then
92
+ echo -n "${password}" | xclip -selection clipboard
93
+ echo "[INFO] Password copied to clipboard (Linux)."
94
+ elif command -v wl-copy &>/dev/null; then
95
+ echo -n "${password}" | wl-copy
96
+ echo "[INFO] Password copied to clipboard (Linux with Wayland)."
97
+ elif command -v clip &>/dev/null; then
98
+ echo -n "${password}" | clip
99
+ echo "[INFO] Password copied to clipboard (Windows)."
100
+ else
101
+ echo "[WARNING] Clipboard tool not found. Password not copied to clipboard."
102
+ fi
40
103
 
104
+ return 0
41
105
  }
@@ -1,16 +1,67 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ (v0.2.468) - <https://dotfiles.io>
4
- # Made with β™₯ in London, UK by @wwdseb
5
- # Copyright (c) 2015-2024. All rights reserved
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Change Directory Helper (goto)
5
+ # Made with β™₯ by Sebastien Rousseau
6
6
  # License: MIT
7
+ #
8
+ # Description:
9
+ # goto is a utility function to quickly navigate to a specified directory.
10
+ # It changes to the given directory and lists its contents.
11
+ #
12
+ # Usage:
13
+ # goto [directory]
14
+ # goto --help
15
+ #
16
+ # Arguments:
17
+ # directory The directory to navigate to.
18
+ # --help Displays this help menu and exits.
19
+ #
20
+ # Examples:
21
+ # goto /tmp
22
+ # # Changes to the /tmp directory and lists its contents.
23
+ #
24
+ # goto --help
25
+ # # Displays the help menu.
26
+ #
27
+ ################################################################################
7
28
 
8
- # goto: Function to change to the directory inputed
29
+ # Function to change to the specified directory and list its contents
9
30
  goto() {
10
- if [[ -e "$1" ]]; then
11
- cd "$1" || exit
12
- l
31
+ # Display help menu
32
+ if [[ "$1" == "--help" ]]; then
33
+ echo "goto: Change Directory Helper"
34
+ echo
35
+ echo "Usage:"
36
+ echo " goto [directory]"
37
+ echo " goto --help"
38
+ echo
39
+ echo "Arguments:"
40
+ echo " directory The directory to navigate to."
41
+ echo " --help Displays this help menu and exits."
42
+ echo
43
+ echo "Examples:"
44
+ echo " goto /tmp"
45
+ echo " # Changes to the /tmp directory and lists its contents."
46
+ echo
47
+ echo " goto --help"
48
+ echo " # Displays the help menu."
49
+ echo
50
+ return 0
51
+ fi
52
+
53
+ # Check if a directory is provided
54
+ if [[ -z "$1" ]]; then
55
+ echo "[ERROR] No directory provided. Use 'goto --help' for usage information." >&2
56
+ return 1
57
+ fi
58
+
59
+ # Check if the directory exists
60
+ if [[ -d "$1" ]]; then
61
+ cd "$1" || return
62
+ ls -lh --group-directories-first
13
63
  else
14
- echo "[ERROR] Please add a directory name" >&2
64
+ echo "[ERROR] '$1' is not a valid directory." >&2
65
+ return 1
15
66
  fi
16
67
  }
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Hex Dump Viewer (hexdump)
5
+ # Made with β™₯ by Sebastien Rousseau
6
+ # License: MIT
7
+ #
8
+ # Description:
9
+ # hexdump is a utility function to display the contents of a file in a
10
+ # hex dump format. By default, it shows the entire file unless a line limit
11
+ # is specified.
12
+ #
13
+ # Usage:
14
+ # hexdump [file] [lines]
15
+ # hexdump --all
16
+ # hexdump --help
17
+ #
18
+ # Arguments:
19
+ # file The file to display in hex dump format.
20
+ # lines The number of lines to display (optional, default: all lines).
21
+ # --all Displays the entire file in hex dump format.
22
+ # --help Displays this help menu and exits.
23
+ #
24
+ # Examples:
25
+ # hexdump example.txt
26
+ # # Displays the entire file 'example.txt' in hex dump format.
27
+ #
28
+ # hexdump example.txt 20
29
+ # # Displays the first 20 lines of the file 'example.txt' in hex dump format.
30
+ #
31
+ # hexdump --help
32
+ # # Displays the help menu.
33
+ #
34
+ ################################################################################
35
+
36
+ hexdump() {
37
+ # Display help menu
38
+ if [[ "$1" == "--help" ]]; then
39
+ echo "hexdump: Hex Dump Viewer"
40
+ echo
41
+ echo "Usage:"
42
+ echo " hexdump [file] [lines]"
43
+ echo " hexdump --all"
44
+ echo " hexdump --help"
45
+ echo
46
+ echo "Arguments:"
47
+ echo " file The file to display in hex dump format."
48
+ echo " lines The number of lines to display (optional, default: all lines)."
49
+ echo " --all Displays the entire file in hex dump format."
50
+ echo " --help Displays this help menu and exits."
51
+ echo
52
+ echo "Examples:"
53
+ echo " hexdump example.txt"
54
+ echo " # Displays the entire file 'example.txt' in hex dump format."
55
+ echo
56
+ echo " hexdump example.txt 20"
57
+ echo " # Displays the first 20 lines of the file 'example.txt' in hex dump format."
58
+ echo
59
+ echo " hexdump --help"
60
+ echo " # Displays the help menu."
61
+ echo
62
+ return 0
63
+ fi
64
+
65
+ # Check if no arguments are provided
66
+ if [[ -z "$1" ]]; then
67
+ echo "[ERROR] No file provided. Use 'hexdump --help' for usage information." >&2
68
+ return 1
69
+ fi
70
+
71
+ # Handle --all option
72
+ if [[ "$1" == "--all" ]]; then
73
+ echo "[ERROR] '--all' requires a file argument. Use 'hexdump file.txt' instead." >&2
74
+ return 1
75
+ fi
76
+
77
+ # Check if the file exists
78
+ if [[ ! -f "$1" ]]; then
79
+ echo "[ERROR] '$1' is not a valid file." >&2
80
+ return 1
81
+ fi
82
+
83
+ # Detect file type
84
+ echo "[INFO] File type: $(file "$1")"
85
+
86
+ # Display hex dump
87
+ if [[ -z "$2" || "$2" == "--all" ]]; then
88
+ # Show the entire file if no line limit or --all is specified
89
+ echo "[INFO] Showing full file in hex dump format:"
90
+ /usr/bin/xxd -u -g 1 "$1"
91
+ else
92
+ # Limit output to the specified number of lines
93
+ echo "[INFO] Showing first $2 lines in hex dump format:"
94
+ /usr/bin/xxd -u -g 1 "$1" | /usr/bin/head -n "$2"
95
+ fi
96
+ }
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ################################################################################
4
+ # πŸ…³πŸ…ΎπŸ†ƒπŸ…΅πŸ…ΈπŸ…»πŸ…΄πŸ†‚ - Hidden Files Visibility Toggle (hiddenfiles)
5
+ # Made with β™₯ by Sebastien Rousseau
6
+ # License: MIT
7
+ #
8
+ # Description:
9
+ # hiddenfiles is a utility function to toggle the visibility of hidden files
10
+ # and system files in the Finder on macOS. By default, it hides hidden files.
11
+ #
12
+ # Usage:
13
+ # hiddenfiles [show|hide]
14
+ # hiddenfiles --help
15
+ #
16
+ # Arguments:
17
+ # show Show hidden files and system files in Finder.
18
+ # hide Hide hidden files and system files in Finder (default behavior).
19
+ # --help Displays this help menu and exits.
20
+ #
21
+ # Examples:
22
+ # hiddenfiles hide
23
+ # # Hides hidden files and system files in Finder.
24
+ #
25
+ # hiddenfiles show
26
+ # # Shows hidden files and system files in Finder.
27
+ #
28
+ # hiddenfiles --help
29
+ # # Displays the help menu.
30
+ #
31
+ ################################################################################
32
+
33
+ hiddenfiles() {
34
+ # Display help menu
35
+ if [[ "$1" == "--help" ]]; then
36
+ echo "hiddenfiles: Hidden Files Visibility Toggle"
37
+ echo
38
+ echo "Usage:"
39
+ echo " hiddenfiles [show|hide]"
40
+ echo " hiddenfiles --help"
41
+ echo
42
+ echo "Arguments:"
43
+ echo " show Show hidden files and system files in Finder."
44
+ echo " hide Hide hidden files and system files in Finder (default behavior)."
45
+ echo " --help Displays this help menu and exits."
46
+ echo
47
+ echo "Examples:"
48
+ echo " hiddenfiles hide"
49
+ echo " # Hides hidden files and system files in Finder."
50
+ echo
51
+ echo " hiddenfiles show"
52
+ echo " # Shows hidden files and system files in Finder."
53
+ echo
54
+ return 0
55
+ fi
56
+
57
+ # Set default action to 'hide' if no argument is provided
58
+ local action="${1:-hide}"
59
+
60
+ if [[ "$action" == "hide" ]]; then
61
+ echo "[INFO] Hiding hidden files and system files in Finder..."
62
+ defaults write com.apple.Finder AppleShowAllFiles NO
63
+ elif [[ "$action" == "show" ]]; then
64
+ echo "[INFO] Showing hidden files and system files in Finder..."
65
+ defaults write com.apple.Finder AppleShowAllFiles YES
66
+ else
67
+ echo "[ERROR] Invalid argument: '$1'. Use 'hiddenfiles --help' for usage information." >&2
68
+ return 1
69
+ fi
70
+
71
+ # Restart Finder to apply changes
72
+ osascript -e 'tell application "Finder" to quit'
73
+ sleep 0.25
74
+ osascript -e 'tell application "Finder" to activate'
75
+
76
+ echo "[INFO] Finder settings updated successfully."
77
+ }