@sebastienrousseau/dotfiles 0.2.466 β 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.
- package/README.md +19 -15
- package/dist/Makefile +126 -43
- package/dist/bin/backup.js.map +1 -1
- package/dist/bin/constants.d.ts +2 -2
- package/dist/bin/constants.d.ts.map +1 -1
- package/dist/bin/constants.js +1 -1
- package/dist/bin/dotfiles.d.ts +2 -2
- package/dist/bin/dotfiles.d.ts.map +1 -1
- package/dist/bin/dotfiles.js +1 -2
- package/dist/bin/dotfiles.js.map +1 -1
- package/dist/bin/download.d.ts +2 -2
- package/dist/bin/download.d.ts.map +1 -1
- package/dist/bin/download.js +1 -2
- package/dist/bin/download.js.map +1 -1
- package/dist/bin/index.js +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/filesizes.txt +161 -161
- package/dist/lib/README.md +83 -5
- package/dist/lib/aliases/README.md +49 -43
- package/dist/lib/aliases/archives/README.md +126 -37
- package/dist/lib/aliases/archives/archives.aliases.sh +112 -152
- package/dist/lib/aliases/cd/README.md +138 -55
- package/dist/lib/aliases/cd/cd.aliases.sh +45 -33
- package/dist/lib/aliases/chmod/README.md +151 -96
- package/dist/lib/aliases/chmod/chmod.aliases.sh +103 -69
- package/dist/lib/aliases/clear/README.md +8 -4
- package/dist/lib/aliases/clear/clear.aliases.sh +57 -28
- package/dist/lib/aliases/configuration/README.md +8 -4
- package/dist/lib/aliases/configuration/configuration.aliases.sh +53 -30
- package/dist/lib/aliases/default/README.md +8 -4
- package/dist/lib/aliases/default/default.aliases.sh +99 -86
- package/dist/lib/aliases/dig/README.md +8 -4
- package/dist/lib/aliases/dig/dig.aliases.sh +4 -4
- package/dist/lib/aliases/disk-usage/README.md +8 -4
- package/dist/lib/aliases/disk-usage/du.aliases.sh +2 -2
- package/dist/lib/aliases/editor/README.md +8 -4
- package/dist/lib/aliases/editor/editor.aliases.sh +4 -4
- package/dist/lib/aliases/find/README.md +8 -4
- package/dist/lib/aliases/find/find.aliases.sh +4 -4
- package/dist/lib/aliases/gcloud/README.md +8 -4
- package/dist/lib/aliases/gcloud/gcloud.aliases.sh +4 -4
- package/dist/lib/aliases/git/README.md +8 -4
- package/dist/lib/aliases/git/git.aliases.sh +3 -3
- package/dist/lib/aliases/gnu/README.md +8 -4
- package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +2 -2
- package/dist/lib/aliases/heroku/README.md +8 -4
- package/dist/lib/aliases/heroku/heroku.aliases.sh +3 -3
- package/dist/lib/aliases/interactive/README.md +29 -17
- package/dist/lib/aliases/interactive/interactive.aliases.sh +15 -18
- package/dist/lib/aliases/list/README.md +118 -25
- package/dist/lib/aliases/list/list.aliases.sh +130 -84
- package/dist/lib/aliases/macOS/README.md +8 -4
- package/dist/lib/aliases/macOS/macos.aliases.sh +3 -3
- package/dist/lib/aliases/make/README.md +8 -4
- package/dist/lib/aliases/make/make.aliases.sh +3 -3
- package/dist/lib/aliases/mkdir/README.md +8 -4
- package/dist/lib/aliases/mkdir/mkdir.aliases.sh +3 -3
- package/dist/lib/aliases/npm/README.md +8 -4
- package/dist/lib/aliases/npm/npm.aliases.sh +3 -3
- package/dist/lib/aliases/permission/README.md +8 -4
- package/dist/lib/aliases/permission/permission.aliases.sh +3 -3
- package/dist/lib/aliases/pnpm/README.md +8 -4
- package/dist/lib/aliases/pnpm/pnpm.aliases.sh +3 -3
- package/dist/lib/aliases/ps/README.md +8 -4
- package/dist/lib/aliases/ps/ps.aliases.sh +3 -3
- package/dist/lib/aliases/python/python.aliases.sh +141 -0
- package/dist/lib/aliases/rsync/README.md +8 -4
- package/dist/lib/aliases/rsync/rsync.aliases.sh +3 -3
- package/dist/lib/aliases/rust/README.md +171 -46
- package/dist/lib/aliases/rust/rust.aliases.sh +109 -117
- package/dist/lib/aliases/subversion/README.md +8 -4
- package/dist/lib/aliases/subversion/subversion.aliases.sh +3 -3
- package/dist/lib/aliases/sudo/README.md +8 -4
- package/dist/lib/aliases/sudo/sudo.aliases.sh +3 -3
- package/dist/lib/aliases/tmux/README.md +8 -4
- package/dist/lib/aliases/tmux/tmux.aliases.sh +3 -3
- package/dist/lib/aliases/update/README.md +8 -4
- package/dist/lib/aliases/update/update.aliases.sh +307 -66
- package/dist/lib/aliases/uuid/README.md +8 -4
- package/dist/lib/aliases/uuid/uuid.aliases.sh +3 -3
- package/dist/lib/aliases/wget/README.md +8 -4
- package/dist/lib/aliases/wget/wget.aliases.sh +3 -3
- package/dist/lib/aliases.sh +42 -12
- package/dist/lib/configurations/README.md +8 -4
- package/dist/lib/configurations/bash/bashrc +163 -35
- package/dist/lib/configurations/curl/curlrc +3 -6
- package/dist/lib/configurations/default/color.sh +3 -3
- package/dist/lib/configurations/default/constants.sh +4 -4
- package/dist/lib/configurations/default/editor.sh +3 -3
- package/dist/lib/configurations/default/prompt.sh +20 -11
- package/dist/lib/configurations/input/inputrc +3 -3
- package/dist/lib/configurations/nano/nanorc +3 -3
- package/dist/lib/configurations/profile/profile +3 -3
- package/dist/lib/configurations/prompt/prompt.sh +81 -0
- package/dist/lib/configurations/tmux/default +3 -3
- package/dist/lib/configurations/tmux/display +3 -3
- package/dist/lib/configurations/tmux/linux +3 -3
- package/dist/lib/configurations/tmux/navigation +3 -3
- package/dist/lib/configurations/tmux/panes +3 -3
- package/dist/lib/configurations/tmux/theme +4 -4
- package/dist/lib/configurations/tmux/tmux +3 -3
- package/dist/lib/configurations/vim/vimrc +191 -71
- package/dist/lib/configurations/wget/wgetrc +3 -3
- package/dist/lib/configurations/zsh/zshrc +11 -12
- package/dist/lib/configurations.sh +39 -9
- package/dist/lib/functions/README.md +73 -55
- package/dist/lib/functions/apihealth.sh +277 -0
- package/dist/lib/functions/apilatency.sh +157 -0
- package/dist/lib/functions/apiload.sh +165 -0
- package/dist/lib/functions/backup.sh +143 -0
- package/dist/lib/functions/cdls.sh +52 -6
- package/dist/lib/functions/curlheader.sh +66 -10
- package/dist/lib/functions/curlstatus.sh +64 -7
- package/dist/lib/functions/curltime.sh +56 -14
- package/dist/lib/functions/encode64.sh +87 -7
- package/dist/lib/functions/environment.sh +65 -25
- package/dist/lib/functions/extract.sh +79 -27
- package/dist/lib/functions/freespace.sh +55 -9
- package/dist/lib/functions/genpwd.sh +93 -29
- package/dist/lib/functions/goto.sh +59 -8
- package/dist/lib/functions/hexdump.sh +96 -0
- package/dist/lib/functions/hiddenfiles.sh +77 -0
- package/dist/lib/functions/hostinfo.sh +92 -21
- package/dist/lib/functions/hstats.sh +69 -5
- package/dist/lib/functions/httpdebug.sh +109 -5
- package/dist/lib/functions/kebabcase.sh +61 -0
- package/dist/lib/functions/keygen.sh +188 -25
- package/dist/lib/functions/last.sh +106 -5
- package/dist/lib/functions/logout.sh +114 -6
- package/dist/lib/functions/lowercase.sh +49 -17
- package/dist/lib/functions/matrix.sh +205 -30
- package/dist/lib/functions/mount_read_only.sh +3 -3
- package/dist/lib/functions/myproc.sh +3 -3
- package/dist/lib/functions/prependpath.sh +3 -3
- package/dist/lib/functions/ql.sh +3 -3
- package/dist/lib/functions/rd.sh +3 -3
- package/dist/lib/functions/remove_disk.sh +3 -3
- package/dist/lib/functions/ren.sh +68 -8
- package/dist/lib/functions/sentencecase.sh +63 -0
- package/dist/lib/functions/showhiddenfiles.sh +3 -3
- package/dist/lib/functions/size.sh +6 -5
- package/dist/lib/functions/snakecase.sh +61 -0
- package/dist/lib/functions/stopwatch.sh +3 -3
- package/dist/lib/functions/sysinfo.sh +145 -0
- package/dist/lib/functions/titlecase.sh +65 -0
- package/dist/lib/functions/uppercase.sh +51 -19
- package/dist/lib/functions/view-source.sh +3 -3
- package/dist/lib/functions/vscode.sh +3 -3
- package/dist/lib/functions/whoisport.sh +3 -3
- package/dist/lib/functions/zipf.sh +3 -3
- package/dist/lib/functions.sh +41 -10
- package/dist/lib/history.sh +68 -83
- package/dist/lib/paths/README.md +52 -0
- package/dist/lib/paths/custom.paths.sh +40 -0
- package/dist/lib/paths/default.paths.sh +37 -0
- package/dist/lib/paths.sh +40 -11
- package/dist/scripts/backup.sh +3 -3
- package/dist/scripts/banner.sh +3 -3
- package/dist/scripts/build.sh +3 -3
- package/dist/scripts/clean.sh +3 -3
- package/dist/scripts/compile.sh +3 -3
- package/dist/scripts/copy.sh +3 -3
- package/dist/scripts/dotfiles.sh +3 -3
- package/dist/scripts/download.sh +3 -3
- package/dist/scripts/help.sh +3 -3
- package/dist/scripts/ssh.sh +3 -3
- package/dist/scripts/unpack.sh +3 -3
- package/package.json +10 -9
- package/dist/lib/aliases/jekyll/README.md +0 -37
- package/dist/lib/aliases/jekyll/jekyll.aliases.sh +0 -54
- package/dist/lib/configurations/tmux/vi +0 -9
- package/dist/lib/functions/filehead.sh +0 -4
- package/dist/lib/functions/hidehiddenfiles.sh +0 -14
- package/dist/lib/paths/ant/ant.paths.sh +0 -15
- package/dist/lib/paths/default/default.paths.sh +0 -19
- package/dist/lib/paths/homebrew/homebrew.paths.sh +0 -27
- package/dist/lib/paths/java/java.paths.sh +0 -19
- package/dist/lib/paths/maven/maven.paths.sh +0 -18
- package/dist/lib/paths/node/node.paths.sh +0 -15
- package/dist/lib/paths/nvm/nvm.paths.sh +0 -23
- package/dist/lib/paths/pnpm/pnpm.paths.sh +0 -15
- package/dist/lib/paths/python/python.paths.sh +0 -36
- package/dist/lib/paths/ruby/ruby.paths.sh +0 -25
- package/dist/lib/paths/tmux/tmux.paths.sh +0 -12
|
@@ -1,34 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
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
|
-
#
|
|
32
|
+
# Function to extract most known archive formats
|
|
9
33
|
extract() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
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 "
|
|
12
|
-
echo "Example: $0 /dev/disk1s1"
|
|
57
|
+
echo "[ERROR] No disk provided. Use 'freespace --help' for usage information."
|
|
13
58
|
echo
|
|
14
|
-
echo "
|
|
15
|
-
df -h | awk 'NR == 1 || /^\/dev\/disk/'
|
|
59
|
+
echo "Available Disks:"
|
|
60
|
+
df -h | awk 'NR == 1 || /^\/dev\/disk/'
|
|
16
61
|
return 1
|
|
17
62
|
fi
|
|
18
63
|
|
|
19
|
-
|
|
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
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
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.466) - https://dotfiles.io
|
|
11
|
-
# Made with β₯ in London, UK by @sebastienrousseau
|
|
12
|
-
# Copyright (c) 2015-2023. 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
|
-
#
|
|
18
|
-
|
|
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
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
#
|
|
26
|
-
|
|
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
|
-
#
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
#
|
|
36
|
-
|
|
84
|
+
# Output the password
|
|
85
|
+
echo "[INFO] Generated password: ${password}"
|
|
37
86
|
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
4
|
-
#
|
|
5
|
-
#
|
|
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
|
-
#
|
|
29
|
+
# Function to change to the specified directory and list its contents
|
|
9
30
|
goto() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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]
|
|
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
|
+
}
|