@sebastienrousseau/dotfiles 0.2.469 → 0.2.499

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 (221) hide show
  1. package/docs/ARCHITECTURE.md +62 -0
  2. package/docs/COMPLIANCE.md +47 -0
  3. package/docs/COPYRIGHT +6 -0
  4. package/docs/OPERATIONS.md +103 -0
  5. package/docs/PLAN.md +161 -0
  6. package/docs/PR_DESCRIPTION.md +150 -0
  7. package/docs/ROADMAP.md +148 -0
  8. package/docs/ROADMAP_legacy.md +556 -0
  9. package/docs/SECURITY_CHECKLIST.md +25 -0
  10. package/docs/TASK.md +99 -0
  11. package/docs/WALKTHROUGH.md +46 -0
  12. package/package.json +64 -76
  13. package/scripts/backup.sh +142 -0
  14. package/{dist/scripts → scripts}/banner.sh +1 -1
  15. package/scripts/benchmark.sh +20 -0
  16. package/{dist/scripts → scripts}/build.sh +1 -1
  17. package/{dist/scripts → scripts}/clean.sh +1 -1
  18. package/{dist/scripts → scripts}/compile.sh +1 -1
  19. package/{dist/scripts → scripts}/copy.sh +1 -1
  20. package/scripts/detect-collisions.py +84 -0
  21. package/scripts/doctor.sh +79 -0
  22. package/{dist/scripts → scripts}/dotfiles.sh +1 -1
  23. package/{dist/scripts → scripts}/download.sh +1 -1
  24. package/{dist/scripts → scripts}/help.sh +1 -1
  25. package/scripts/lock-configs.sh +57 -0
  26. package/scripts/package.sh +46 -0
  27. package/{dist/scripts → scripts}/ssh.sh +1 -1
  28. package/scripts/teleport.sh +23 -0
  29. package/scripts/test-aliases.sh +25 -0
  30. package/scripts/test_smoke.sh +88 -0
  31. package/{dist/scripts → scripts}/unpack.sh +1 -1
  32. package/scripts/verify_state.sh +60 -0
  33. package/templates/projects/go/README.md +3 -0
  34. package/templates/projects/go/cmd/__PROJECT_NAME__/main.go +7 -0
  35. package/templates/projects/go/go.mod +3 -0
  36. package/templates/projects/node/README.md +3 -0
  37. package/templates/projects/node/package.json +10 -0
  38. package/templates/projects/node/src/index.js +2 -0
  39. package/templates/projects/python/README.md +3 -0
  40. package/templates/projects/python/pyproject.toml +10 -0
  41. package/templates/projects/python/src/__PROJECT_NAME__/__init__.py +1 -0
  42. package/templates/projects/python/tests/test_basic.py +2 -0
  43. package/LICENSE +0 -1283
  44. package/README.md +0 -398
  45. package/dist/Makefile +0 -140
  46. package/dist/bin/backup.d.ts +0 -3
  47. package/dist/bin/backup.d.ts.map +0 -1
  48. package/dist/bin/backup.js +0 -4
  49. package/dist/bin/backup.js.map +0 -1
  50. package/dist/bin/constants.d.ts +0 -7
  51. package/dist/bin/constants.d.ts.map +0 -1
  52. package/dist/bin/constants.js +0 -2
  53. package/dist/bin/constants.js.map +0 -1
  54. package/dist/bin/copy.d.ts +0 -3
  55. package/dist/bin/copy.d.ts.map +0 -1
  56. package/dist/bin/copy.js +0 -3
  57. package/dist/bin/copy.js.map +0 -1
  58. package/dist/bin/dotfiles.d.ts +0 -3
  59. package/dist/bin/dotfiles.d.ts.map +0 -1
  60. package/dist/bin/dotfiles.js +0 -2
  61. package/dist/bin/dotfiles.js.map +0 -1
  62. package/dist/bin/download.d.ts +0 -3
  63. package/dist/bin/download.d.ts.map +0 -1
  64. package/dist/bin/download.js +0 -2
  65. package/dist/bin/download.js.map +0 -1
  66. package/dist/bin/index.d.ts +0 -2
  67. package/dist/bin/index.d.ts.map +0 -1
  68. package/dist/bin/index.js +0 -1
  69. package/dist/bin/index.js.map +0 -1
  70. package/dist/bin/transfer.d.ts +0 -3
  71. package/dist/bin/transfer.d.ts.map +0 -1
  72. package/dist/bin/transfer.js +0 -4
  73. package/dist/bin/transfer.js.map +0 -1
  74. package/dist/bin/unpack.d.ts +0 -3
  75. package/dist/bin/unpack.d.ts.map +0 -1
  76. package/dist/bin/unpack.js +0 -3
  77. package/dist/bin/unpack.js.map +0 -1
  78. package/dist/filesizes.txt +0 -382
  79. package/dist/lib/README.md +0 -86
  80. package/dist/lib/aliases/README.md +0 -57
  81. package/dist/lib/aliases/archives/README.md +0 -145
  82. package/dist/lib/aliases/archives/archives.aliases.sh +0 -114
  83. package/dist/lib/aliases/cd/README.md +0 -146
  84. package/dist/lib/aliases/cd/cd.aliases.sh +0 -51
  85. package/dist/lib/aliases/chmod/README.md +0 -160
  86. package/dist/lib/aliases/chmod/chmod.aliases.sh +0 -107
  87. package/dist/lib/aliases/clear/README.md +0 -37
  88. package/dist/lib/aliases/clear/clear.aliases.sh +0 -71
  89. package/dist/lib/aliases/configuration/README.md +0 -39
  90. package/dist/lib/aliases/configuration/configuration.aliases.sh +0 -70
  91. package/dist/lib/aliases/default/README.md +0 -40
  92. package/dist/lib/aliases/default/default.aliases.sh +0 -139
  93. package/dist/lib/aliases/dig/README.md +0 -37
  94. package/dist/lib/aliases/dig/dig.aliases.sh +0 -43
  95. package/dist/lib/aliases/disk-usage/README.md +0 -36
  96. package/dist/lib/aliases/disk-usage/du.aliases.sh +0 -84
  97. package/dist/lib/aliases/editor/README.md +0 -53
  98. package/dist/lib/aliases/editor/editor.aliases.sh +0 -26
  99. package/dist/lib/aliases/find/README.md +0 -46
  100. package/dist/lib/aliases/find/find.aliases.sh +0 -60
  101. package/dist/lib/aliases/gcloud/README.md +0 -63
  102. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +0 -335
  103. package/dist/lib/aliases/git/README.md +0 -153
  104. package/dist/lib/aliases/git/git.aliases.sh +0 -544
  105. package/dist/lib/aliases/gnu/README.md +0 -89
  106. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +0 -150
  107. package/dist/lib/aliases/heroku/README.md +0 -430
  108. package/dist/lib/aliases/heroku/heroku.aliases.sh +0 -1053
  109. package/dist/lib/aliases/interactive/README.md +0 -55
  110. package/dist/lib/aliases/interactive/interactive.aliases.sh +0 -50
  111. package/dist/lib/aliases/list/README.md +0 -131
  112. package/dist/lib/aliases/list/list.aliases.sh +0 -132
  113. package/dist/lib/aliases/macOS/README.md +0 -42
  114. package/dist/lib/aliases/macOS/macos.aliases.sh +0 -65
  115. package/dist/lib/aliases/make/README.md +0 -32
  116. package/dist/lib/aliases/make/make.aliases.sh +0 -35
  117. package/dist/lib/aliases/mkdir/README.md +0 -30
  118. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +0 -29
  119. package/dist/lib/aliases/npm/README.md +0 -41
  120. package/dist/lib/aliases/npm/npm.aliases.sh +0 -61
  121. package/dist/lib/aliases/permission/README.md +0 -47
  122. package/dist/lib/aliases/permission/permission.aliases.sh +0 -73
  123. package/dist/lib/aliases/pnpm/README.md +0 -53
  124. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +0 -76
  125. package/dist/lib/aliases/ps/README.md +0 -29
  126. package/dist/lib/aliases/ps/ps.aliases.sh +0 -20
  127. package/dist/lib/aliases/python/python.aliases.sh +0 -141
  128. package/dist/lib/aliases/rsync/README.md +0 -25
  129. package/dist/lib/aliases/rsync/rsync.aliases.sh +0 -17
  130. package/dist/lib/aliases/rust/README.md +0 -182
  131. package/dist/lib/aliases/rust/rust.aliases.sh +0 -119
  132. package/dist/lib/aliases/subversion/README.md +0 -66
  133. package/dist/lib/aliases/subversion/subversion.aliases.sh +0 -47
  134. package/dist/lib/aliases/sudo/README.md +0 -27
  135. package/dist/lib/aliases/sudo/sudo.aliases.sh +0 -20
  136. package/dist/lib/aliases/tmux/README.md +0 -31
  137. package/dist/lib/aliases/tmux/tmux.aliases.sh +0 -36
  138. package/dist/lib/aliases/update/README.md +0 -38
  139. package/dist/lib/aliases/update/update.aliases.sh +0 -310
  140. package/dist/lib/aliases/uuid/README.md +0 -24
  141. package/dist/lib/aliases/uuid/uuid.aliases.sh +0 -19
  142. package/dist/lib/aliases/wget/README.md +0 -27
  143. package/dist/lib/aliases/wget/wget.aliases.sh +0 -22
  144. package/dist/lib/aliases.sh +0 -50
  145. package/dist/lib/configurations/README.md +0 -18
  146. package/dist/lib/configurations/bash/bashrc +0 -167
  147. package/dist/lib/configurations/curl/cacert.pem +0 -3460
  148. package/dist/lib/configurations/curl/curlrc +0 -53
  149. package/dist/lib/configurations/default/color.sh +0 -24
  150. package/dist/lib/configurations/default/constants.sh +0 -43
  151. package/dist/lib/configurations/default/editor.sh +0 -18
  152. package/dist/lib/configurations/default/prompt.sh +0 -48
  153. package/dist/lib/configurations/gem/gemrc +0 -9
  154. package/dist/lib/configurations/input/inputrc +0 -23
  155. package/dist/lib/configurations/jshint/jshintrc +0 -37
  156. package/dist/lib/configurations/nano/nanorc +0 -35
  157. package/dist/lib/configurations/profile/profile +0 -37
  158. package/dist/lib/configurations/prompt/prompt.sh +0 -81
  159. package/dist/lib/configurations/tmux/default +0 -18
  160. package/dist/lib/configurations/tmux/display +0 -30
  161. package/dist/lib/configurations/tmux/linux +0 -18
  162. package/dist/lib/configurations/tmux/navigation +0 -30
  163. package/dist/lib/configurations/tmux/panes +0 -10
  164. package/dist/lib/configurations/tmux/theme +0 -29
  165. package/dist/lib/configurations/tmux/tmux +0 -21
  166. package/dist/lib/configurations/vim/vimrc +0 -193
  167. package/dist/lib/configurations/wget/wgetrc +0 -40
  168. package/dist/lib/configurations/zsh/zshrc +0 -50
  169. package/dist/lib/configurations.sh +0 -45
  170. package/dist/lib/functions/README.md +0 -92
  171. package/dist/lib/functions/apihealth.sh +0 -277
  172. package/dist/lib/functions/apilatency.sh +0 -157
  173. package/dist/lib/functions/apiload.sh +0 -165
  174. package/dist/lib/functions/backup.sh +0 -143
  175. package/dist/lib/functions/cdls.sh +0 -60
  176. package/dist/lib/functions/curlheader.sh +0 -78
  177. package/dist/lib/functions/curlstatus.sh +0 -74
  178. package/dist/lib/functions/curltime.sh +0 -75
  179. package/dist/lib/functions/encode64.sh +0 -107
  180. package/dist/lib/functions/environment.sh +0 -78
  181. package/dist/lib/functions/extract.sh +0 -86
  182. package/dist/lib/functions/freespace.sh +0 -67
  183. package/dist/lib/functions/genpwd.sh +0 -105
  184. package/dist/lib/functions/goto.sh +0 -67
  185. package/dist/lib/functions/hexdump.sh +0 -96
  186. package/dist/lib/functions/hiddenfiles.sh +0 -77
  187. package/dist/lib/functions/hostinfo.sh +0 -98
  188. package/dist/lib/functions/hstats.sh +0 -75
  189. package/dist/lib/functions/httpdebug.sh +0 -113
  190. package/dist/lib/functions/kebabcase.sh +0 -61
  191. package/dist/lib/functions/keygen.sh +0 -194
  192. package/dist/lib/functions/last.sh +0 -112
  193. package/dist/lib/functions/logout.sh +0 -120
  194. package/dist/lib/functions/lowercase.sh +0 -61
  195. package/dist/lib/functions/matrix.sh +0 -216
  196. package/dist/lib/functions/mount_read_only.sh +0 -11
  197. package/dist/lib/functions/myproc.sh +0 -9
  198. package/dist/lib/functions/prependpath.sh +0 -21
  199. package/dist/lib/functions/ql.sh +0 -9
  200. package/dist/lib/functions/rd.sh +0 -17
  201. package/dist/lib/functions/remove_disk.sh +0 -11
  202. package/dist/lib/functions/ren.sh +0 -73
  203. package/dist/lib/functions/sentencecase.sh +0 -63
  204. package/dist/lib/functions/showhiddenfiles.sh +0 -14
  205. package/dist/lib/functions/size.sh +0 -16
  206. package/dist/lib/functions/snakecase.sh +0 -61
  207. package/dist/lib/functions/stopwatch.sh +0 -15
  208. package/dist/lib/functions/sysinfo.sh +0 -145
  209. package/dist/lib/functions/titlecase.sh +0 -65
  210. package/dist/lib/functions/uppercase.sh +0 -61
  211. package/dist/lib/functions/view-source.sh +0 -9
  212. package/dist/lib/functions/vscode.sh +0 -32
  213. package/dist/lib/functions/whoisport.sh +0 -14
  214. package/dist/lib/functions/zipf.sh +0 -16
  215. package/dist/lib/functions.sh +0 -46
  216. package/dist/lib/history.sh +0 -90
  217. package/dist/lib/paths/README.md +0 -52
  218. package/dist/lib/paths/custom.paths.sh +0 -40
  219. package/dist/lib/paths/default.paths.sh +0 -37
  220. package/dist/lib/paths.sh +0 -46
  221. package/dist/scripts/backup.sh +0 -95
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂 - Free Disk Space Cleaner (freespace)
5
- # Made with ♥ by Sebastien Rousseau
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
- ################################################################################
28
-
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
56
- if [[ -z "$1" ]]; then
57
- echo "[ERROR] No disk provided. Use 'freespace --help' for usage information."
58
- echo
59
- echo "Available Disks:"
60
- df -h | awk 'NR == 1 || /^\/dev\/disk/'
61
- return 1
62
- fi
63
-
64
- # Perform secure erase of free space on the selected disk
65
- echo "[INFO] Cleaning purgeable files from disk: $1..."
66
- diskutil secureErase freespace 0 "$1"
67
- }
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂 - Password Generator (genpwd)
5
- # Made with ♥ by Sebastien Rousseau
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
- ################################################################################
30
-
31
- genpwd() {
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
60
-
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
65
-
66
- # Generate a sufficiently long random alphanumeric base
67
- local base_password=$(openssl rand -base64 128 | tr -dc '[:alnum:]')
68
-
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
83
-
84
- # Output the password
85
- echo "[INFO] Generated password: ${password}"
86
-
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
103
-
104
- return 0
105
- }
@@ -1,67 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂 - Change Directory Helper (goto)
5
- # Made with ♥ by Sebastien Rousseau
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
- ################################################################################
28
-
29
- # Function to change to the specified directory and list its contents
30
- goto() {
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
63
- else
64
- echo "[ERROR] '$1' is not a valid directory." >&2
65
- return 1
66
- fi
67
- }
@@ -1,96 +0,0 @@
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
- }
@@ -1,77 +0,0 @@
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
- }
@@ -1,98 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂 - Host Information Viewer (hostinfo)
5
- # Made with ♥ by Sebastien Rousseau
6
- # License: MIT
7
- #
8
- # Description:
9
- # hostinfo is a utility function to display detailed information about the
10
- # current host in a structured table format. This includes system stats,
11
- # network configuration, and public-facing IP address.
12
- #
13
- # Usage:
14
- # hostinfo
15
- # hostinfo --help
16
- #
17
- # Arguments:
18
- # --help Displays this help menu and exits.
19
- #
20
- # Examples:
21
- # hostinfo
22
- # # Displays detailed host information in a table format.
23
- #
24
- # hostinfo --help
25
- # # Displays the help menu.
26
- #
27
- ################################################################################
28
-
29
- hostinfo() {
30
- # Display help menu
31
- if [[ "$1" == "--help" ]]; then
32
- echo "hostinfo: Host Information Viewer"
33
- echo
34
- echo "Usage:"
35
- echo " hostinfo"
36
- echo " hostinfo --help"
37
- echo
38
- echo "Arguments:"
39
- echo " --help Displays this help menu and exits."
40
- echo
41
- echo "Examples:"
42
- echo " hostinfo"
43
- echo " # Displays detailed host information in a table format."
44
- echo
45
- echo " hostinfo --help"
46
- echo " # Displays the help menu."
47
- echo
48
- return 0
49
- fi
50
-
51
- # Fetch host information
52
- local username
53
- local hostname
54
- local system_info
55
- local users_logged_on
56
- local current_date
57
- local machine_stats
58
- local network_location="Not available"
59
- local public_ip="Not available"
60
- local dns_config="Not available"
61
-
62
- username=$(whoami)
63
- hostname=$(hostname)
64
- system_info=$(uname -a)
65
- users_logged_on=$(w -h | awk '{print $1}' | sort | uniq | paste -sd ", " -)
66
- current_date=$(date)
67
- machine_stats=$(uptime | sed 's/^ *//')
68
-
69
- # Check if scselect is available (macOS specific)
70
- if command -v scselect &>/dev/null; then
71
- network_location=$(scselect | grep '^ *\*' | sed 's/^ *\* //')
72
- fi
73
-
74
- # Fetch public IP address using a reliable service
75
- if command -v curl &>/dev/null; then
76
- public_ip=$(curl -s https://api.ipify.org || echo "Not available")
77
- elif command -v wget &>/dev/null; then
78
- public_ip=$(wget -qO- https://api.ipify.org || echo "Not available")
79
- fi
80
-
81
- # Fetch DNS configuration (macOS specific)
82
- if command -v scutil &>/dev/null; then
83
- dns_config=$(scutil --dns | awk '/nameserver/ {print $3}' | paste -sd ", " -)
84
- fi
85
-
86
- # Display information in a table format
87
- echo "====================================="
88
- printf "%-25s : %s\n" "Username" "$username"
89
- printf "%-25s : %s\n" "Hostname" "$hostname"
90
- printf "%-25s : %s\n" "System Information" "$system_info"
91
- printf "%-25s : %s\n" "Users Logged On" "${users_logged_on:-None}"
92
- printf "%-25s : %s\n" "Current Date" "$current_date"
93
- printf "%-25s : %s\n" "Machine Stats" "$machine_stats"
94
- printf "%-25s : %s\n" "Network Location" "$network_location"
95
- printf "%-25s : %s\n" "Public IP Address" "$public_ip"
96
- printf "%-25s : %s\n" "DNS Servers" "${dns_config:-None}"
97
- echo "====================================="
98
- }
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ################################################################################
4
- # 🅳🅾🆃🅵🅸🅻🅴🆂 - History Statistics Viewer (hstats)
5
- # Made with ♥ by Sebastien Rousseau
6
- # License: MIT
7
- #
8
- # Description:
9
- # hstats is a utility function to display statistics about the most commonly
10
- # used commands from the shell history. It shows the top 20 commands along
11
- # with their usage count and the full command.
12
- #
13
- # Usage:
14
- # hstats
15
- # hstats --help
16
- #
17
- # Arguments:
18
- # --help Displays this help menu and exits.
19
- #
20
- # Examples:
21
- # hstats
22
- # # Displays the top 20 most commonly used commands from shell history.
23
- #
24
- # hstats --help
25
- # # Displays the help menu.
26
- #
27
- ################################################################################
28
-
29
- hstats() {
30
- # Display help menu
31
- if [[ "$1" == "--help" ]]; then
32
- echo "hstats: History Statistics Viewer"
33
- echo
34
- echo "Usage:"
35
- echo " hstats"
36
- echo " hstats --help"
37
- echo
38
- echo "Arguments:"
39
- echo " --help Displays this help menu and exits."
40
- echo
41
- echo "Examples:"
42
- echo " hstats"
43
- echo " # Displays the top 20 most commonly used commands from shell history."
44
- echo
45
- echo " hstats --help"
46
- echo " # Displays the help menu."
47
- echo
48
- return 0
49
- fi
50
-
51
- # Ensure the history command is available
52
- if ! command -v history &>/dev/null; then
53
- echo "[ERROR] 'history' command is not available in this shell." >&2
54
- return 1
55
- fi
56
-
57
- # Extract only the commands from history, removing timestamps or extra metadata
58
- if [[ "$SHELL" =~ "zsh" ]]; then
59
- # For zsh, use `fc -l` to get clean commands
60
- history_output=$(fc -l 1 | awk '{$1=""; print $0}')
61
- else
62
- # For bash, use `history` directly
63
- history_output=$(history | awk '{$1=""; print $0}')
64
- fi
65
-
66
- # Generate statistics
67
- echo "============================================"
68
- echo "Commonly Used Commands"
69
- echo "============================================"
70
- echo "$history_output" | awk '{CMD[$1]++; count++;} END {for (a in CMD) printf "%-15s %s\n", CMD[a], a;}' \
71
- | sort -nr \
72
- | head -n20 \
73
- | nl
74
- echo "============================================"
75
- }