machineconfig 6.83__py3-none-any.whl → 6.85__py3-none-any.whl
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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/cluster/sessions_managers/wt_local.py +16 -221
- machineconfig/cluster/sessions_managers/wt_local_manager.py +33 -174
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +39 -197
- machineconfig/cluster/sessions_managers/wt_utils/manager_persistence.py +52 -0
- machineconfig/cluster/sessions_managers/wt_utils/monitoring_helpers.py +50 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporting.py +76 -0
- machineconfig/cluster/sessions_managers/wt_utils/wt_helpers.py +199 -0
- machineconfig/scripts/linux/mcfgs +1 -1
- machineconfig/scripts/linux/term +39 -0
- machineconfig/scripts/python/ai/vscode_tasks.py +7 -2
- machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
- machineconfig/scripts/python/fire_jobs.py +30 -65
- machineconfig/scripts/python/helpers_devops/cli_config.py +1 -1
- machineconfig/scripts/python/helpers_devops/cli_nw.py +50 -0
- machineconfig/scripts/python/helpers_devops/cli_self.py +3 -3
- machineconfig/scripts/python/helpers_devops/cli_utils.py +1 -1
- machineconfig/scripts/python/helpers_fire/helpers4.py +15 -0
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +1 -1
- machineconfig/scripts/python/nw/mount_nfs +1 -1
- machineconfig/scripts/python/nw/wifi_conn.py +1 -53
- machineconfig/scripts/python/terminal.py +110 -0
- machineconfig/scripts/python/utils.py +2 -0
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
- machineconfig/scripts/windows/term.ps1 +48 -0
- machineconfig/settings/shells/bash/init.sh +2 -0
- machineconfig/settings/shells/pwsh/init.ps1 +1 -0
- machineconfig/setup_linux/web_shortcuts/interactive.sh +2 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +2 -1
- machineconfig/utils/code.py +21 -14
- machineconfig/utils/installer.py +0 -1
- machineconfig/utils/options.py +12 -2
- machineconfig/utils/path_helper.py +1 -1
- machineconfig/utils/scheduling.py +0 -2
- machineconfig/utils/ssh.py +2 -2
- {machineconfig-6.83.dist-info → machineconfig-6.85.dist-info}/METADATA +1 -1
- {machineconfig-6.83.dist-info → machineconfig-6.85.dist-info}/RECORD +39 -35
- {machineconfig-6.83.dist-info → machineconfig-6.85.dist-info}/entry_points.txt +1 -0
- machineconfig/scripts/linux/other/share_smb +0 -1
- machineconfig/scripts/linux/warp-cli.sh +0 -122
- machineconfig/scripts/linux/z_ls +0 -104
- {machineconfig-6.83.dist-info → machineconfig-6.85.dist-info}/WHEEL +0 -0
- {machineconfig-6.83.dist-info → machineconfig-6.85.dist-info}/top_level.txt +0 -0
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Installs Cloudflare WARP (warp-cli) on supported Ubuntu / Debian systems.
|
|
3
|
-
# Usage: sudo ./warp-cli.sh [--allow-unsupported] [--force-reinstall]
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
ALLOW_UNSUPPORTED=0
|
|
8
|
-
FORCE_REINSTALL=0
|
|
9
|
-
|
|
10
|
-
for arg in "$@"; do
|
|
11
|
-
case "$arg" in
|
|
12
|
-
--allow-unsupported) ALLOW_UNSUPPORTED=1 ;;
|
|
13
|
-
--force-reinstall) FORCE_REINSTALL=1 ;;
|
|
14
|
-
-h|--help)
|
|
15
|
-
printf "Usage: %s [--allow-unsupported] [--force-reinstall]\n" "$0"
|
|
16
|
-
exit 0
|
|
17
|
-
;;
|
|
18
|
-
*)
|
|
19
|
-
printf "Unknown argument: %s\n" "$arg" >&2
|
|
20
|
-
exit 2
|
|
21
|
-
;;
|
|
22
|
-
esac
|
|
23
|
-
done
|
|
24
|
-
|
|
25
|
-
require_root() {
|
|
26
|
-
if [ "${EUID}" -ne 0 ]; then
|
|
27
|
-
printf "Please run as root (use sudo).\n" >&2
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
have_cmd() { command -v "$1" >/dev/null 2>&1; }
|
|
33
|
-
|
|
34
|
-
detect_os() {
|
|
35
|
-
if have_cmd lsb_release; then
|
|
36
|
-
DIST_ID=$(lsb_release -si 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
|
37
|
-
CODENAME=$(lsb_release -sc 2>/dev/null | tr '[:upper:]' '[:lower:]')
|
|
38
|
-
elif [ -f /etc/os-release ]; then
|
|
39
|
-
# shellcheck disable=SC1091
|
|
40
|
-
. /etc/os-release
|
|
41
|
-
DIST_ID=$(printf "%s" "${ID:-}" | tr '[:upper:]' '[:lower:]')
|
|
42
|
-
CODENAME=$(printf "%s" "${VERSION_CODENAME:-}" | tr '[:upper:]' '[:lower:]')
|
|
43
|
-
else
|
|
44
|
-
printf "Cannot detect distribution. Install lsb_release or provide /etc/os-release.\n" >&2
|
|
45
|
-
exit 1
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
is_supported() {
|
|
50
|
-
case "$DIST_ID" in
|
|
51
|
-
ubuntu)
|
|
52
|
-
# Supported: noble jammy focal (older: bionic xenial)
|
|
53
|
-
case "$CODENAME" in
|
|
54
|
-
noble|jammy|focal|bionic|xenial) return 0 ;; esac ;;
|
|
55
|
-
debian)
|
|
56
|
-
# Supported: bookworm bullseye buster (older: stretch)
|
|
57
|
-
case "$CODENAME" in
|
|
58
|
-
bookworm|bullseye|buster|stretch) return 0 ;; esac ;;
|
|
59
|
-
esac
|
|
60
|
-
return 1
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
add_key() {
|
|
64
|
-
local key_path="/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg"
|
|
65
|
-
if [ -s "$key_path" ]; then
|
|
66
|
-
return 0
|
|
67
|
-
fi
|
|
68
|
-
curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | gpg --yes --dearmor --output "$key_path"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
add_repo() {
|
|
72
|
-
local list_file="/etc/apt/sources.list.d/cloudflare-client.list"
|
|
73
|
-
if grep -q "pkg.cloudflareclient.com" "$list_file" 2>/dev/null; then
|
|
74
|
-
return 0
|
|
75
|
-
fi
|
|
76
|
-
echo "deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ ${CODENAME} main" > "$list_file"
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
need_update=0
|
|
80
|
-
install_package() {
|
|
81
|
-
if dpkg -s cloudflare-warp >/dev/null 2>&1; then
|
|
82
|
-
if [ "$FORCE_REINSTALL" -eq 1 ]; then
|
|
83
|
-
apt-get install --reinstall -y cloudflare-warp
|
|
84
|
-
else
|
|
85
|
-
printf "cloudflare-warp already installed. Use --force-reinstall to reinstall.\n"
|
|
86
|
-
fi
|
|
87
|
-
else
|
|
88
|
-
apt-get install -y cloudflare-warp
|
|
89
|
-
fi
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
main() {
|
|
93
|
-
require_root
|
|
94
|
-
if ! have_cmd apt-get; then
|
|
95
|
-
printf "apt-get not found. This script supports only Debian/Ubuntu.\n" >&2
|
|
96
|
-
exit 1
|
|
97
|
-
fi
|
|
98
|
-
detect_os
|
|
99
|
-
if ! is_supported; then
|
|
100
|
-
if [ "$ALLOW_UNSUPPORTED" -ne 1 ]; then
|
|
101
|
-
printf "Distribution %s (%s) not in supported list. Use --allow-unsupported to proceed.\n" "$DIST_ID" "$CODENAME" >&2
|
|
102
|
-
exit 3
|
|
103
|
-
else
|
|
104
|
-
printf "Proceeding on unsupported distribution %s (%s).\n" "$DIST_ID" "$CODENAME"
|
|
105
|
-
fi
|
|
106
|
-
fi
|
|
107
|
-
pre_key_checksum=$( [ -f /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg ] && sha256sum /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg | cut -d' ' -f1 || true )
|
|
108
|
-
add_key
|
|
109
|
-
post_key_checksum=$(sha256sum /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg | cut -d' ' -f1)
|
|
110
|
-
if [ "$pre_key_checksum" != "$post_key_checksum" ]; then need_update=1; fi
|
|
111
|
-
repo_before=$(grep -R "pkg.cloudflareclient.com" /etc/apt/sources.list.d 2>/dev/null || true)
|
|
112
|
-
add_repo
|
|
113
|
-
repo_after=$(grep -R "pkg.cloudflareclient.com" /etc/apt/sources.list.d 2>/dev/null || true)
|
|
114
|
-
if [ "$repo_before" != "$repo_after" ]; then need_update=1; fi
|
|
115
|
-
if [ "$need_update" -eq 1 ]; then
|
|
116
|
-
apt-get update
|
|
117
|
-
fi
|
|
118
|
-
install_package
|
|
119
|
-
printf "Done. Basic usage: 'warp-cli register' then 'warp-cli connect'. For account: 'warp-cli set-mode warp'.\n"
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
main "$@"
|
machineconfig/scripts/linux/z_ls
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# if variable zellij is not set, then set it to /$HOME/.local/bin/zellij
|
|
4
|
-
if [ -z "$zellij" ]; then
|
|
5
|
-
# zellij="$HOME/.local/bin/zellij"
|
|
6
|
-
PATH="$HOME/.local/bin:$PATH"
|
|
7
|
-
fi
|
|
8
|
-
|
|
9
|
-
# adopted from https://zellij.dev/documentation/integration.html
|
|
10
|
-
ZJ_SESSIONS=$(zellij list-sessions)
|
|
11
|
-
# echo "$ZJ_SESSIONS"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
attach=false
|
|
15
|
-
|
|
16
|
-
while (( "$#" )); do
|
|
17
|
-
case "$1" in
|
|
18
|
-
--attach)
|
|
19
|
-
attach=true
|
|
20
|
-
shift
|
|
21
|
-
;;
|
|
22
|
-
*)
|
|
23
|
-
shift
|
|
24
|
-
;;
|
|
25
|
-
esac
|
|
26
|
-
done
|
|
27
|
-
|
|
28
|
-
if $attach; then
|
|
29
|
-
echo "attached"
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l)
|
|
34
|
-
# if ZJ_SESSIONS is empty, then set NO_SESSIONS to 0
|
|
35
|
-
if [ -z "${ZJ_SESSIONS}" ]; then
|
|
36
|
-
NO_SESSIONS=0
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
# check whether the string "(current)" is in ZJ_SESSIONS
|
|
40
|
-
if [[ "${ZJ_SESSIONS}" == *"(current)"* ]]; then
|
|
41
|
-
# if so, then we are in a zellijsession
|
|
42
|
-
echo "already inside a session, existing."
|
|
43
|
-
COMMANDS=$(ls $HOME/.config/machineconfig/settings/zellij/commands)
|
|
44
|
-
# fzf the results
|
|
45
|
-
res="$(echo -e "${COMMANDS}" | fzf --ansi)"
|
|
46
|
-
# run the bash fiZJ_SESSIONSle chosen
|
|
47
|
-
bash $HOME/.config/machineconfig/settings/zellij/commands/$res
|
|
48
|
-
|
|
49
|
-
else # ==> we are not in a zellijsession
|
|
50
|
-
if [ "${NO_SESSIONS}" -ge 1 ]; then # sessions do exist
|
|
51
|
-
|
|
52
|
-
# remove sessions that have 'EXITED' in them
|
|
53
|
-
ZJ_SESSIONS=$(echo -e "${ZJ_SESSIONS}" | grep -v "EXITED")
|
|
54
|
-
|
|
55
|
-
echo "zj_sessions:$ZJ_SESSIONS:end of zj_sessions"
|
|
56
|
-
|
|
57
|
-
# if the result has only 1 line in it and $attach is raised, then attach to it and exit the if statement and the script
|
|
58
|
-
NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l)
|
|
59
|
-
|
|
60
|
-
echo "NO_SESSIONS: $NO_SESSIONS"
|
|
61
|
-
|
|
62
|
-
# if ZJ_SESSIONS is empty, then set NO_SESSIONS to 0
|
|
63
|
-
if [ -z "${ZJ_SESSIONS}" ]; then
|
|
64
|
-
NO_SESSIONS=0
|
|
65
|
-
zellij --layout st2
|
|
66
|
-
exit 0
|
|
67
|
-
fi
|
|
68
|
-
echo "NO_SESSIONS: $NO_SESSIONS"
|
|
69
|
-
|
|
70
|
-
if [ "${NO_SESSIONS}" -eq 1 ] && $attach; then
|
|
71
|
-
chosen_session=$(echo -e "${ZJ_SESSIONS}" | cut -d' ' -f1)
|
|
72
|
-
# remove the ansi colors from chosen_session
|
|
73
|
-
chosen_session=$(echo $chosen_session | sed 's/\x1b\[[0-9;]*m//g')
|
|
74
|
-
# echo "attaching to $chosen_session exclusively."
|
|
75
|
-
zellij attach "$chosen_session"
|
|
76
|
-
exit 0
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
# add my options to the list of sessions
|
|
80
|
-
# if number of sessions is zero, then exclude ZJ_SESSIONS from the fzf options
|
|
81
|
-
if [ "${NO_SESSIONS}" -eq 0 ]; then
|
|
82
|
-
ZJ_SESSIONS="new_session\nkill_all_and_create_fresh_one\nexit_zellij"
|
|
83
|
-
else
|
|
84
|
-
ZJ_SESSIONS="$ZJ_SESSIONS\nnew_session\nkill_all_and_create_fresh_one\nexit_zellij"
|
|
85
|
-
fi
|
|
86
|
-
|
|
87
|
-
res="$(echo -e "${ZJ_SESSIONS}" | fzf --ansi)"
|
|
88
|
-
# split `res` at the first space, and take the first element
|
|
89
|
-
res=$(echo $res | cut -d' ' -f1)
|
|
90
|
-
if [ "${res}" = "exit_zellij" ]; then
|
|
91
|
-
echo "existing zellij."
|
|
92
|
-
elif [ "${res}" = "new_session" ]; then
|
|
93
|
-
zellij --layout st2 # can't specify name here. I can call it "main" only if it is the first, otherwise name conflict! also, can't use attach -c syntax because layout can't be specified.
|
|
94
|
-
elif [ "${res}" = "kill_all_and_create_fresh_one" ]; then
|
|
95
|
-
zellij ka -y
|
|
96
|
-
zellij --layout st2
|
|
97
|
-
else
|
|
98
|
-
zellij attach $res # options --mirror-session false
|
|
99
|
-
fi
|
|
100
|
-
else # no sessions, create one called main
|
|
101
|
-
zellij --layout st2
|
|
102
|
-
fi
|
|
103
|
-
|
|
104
|
-
fi
|
|
File without changes
|
|
File without changes
|