machineconfig 1.94__py3-none-any.whl â 1.95__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/data_transfer.py +2 -1
- machineconfig/cluster/job_params.py +1 -1
- machineconfig/cluster/script_execution.py +1 -1
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/linux/msc/lid.sh +2 -4
- machineconfig/jobs/linux/msc/network.sh +3 -6
- machineconfig/jobs/python/check_installations.py +6 -6
- machineconfig/jobs/python/checkout_version.py +4 -4
- machineconfig/jobs/python/python_cargo_build_share.py +2 -2
- machineconfig/jobs/python/python_ve_symlink.py +4 -4
- machineconfig/jobs/python/vscode/api.py +2 -2
- machineconfig/jobs/python/vscode/link_ve.py +4 -4
- machineconfig/jobs/python/vscode/select_interpreter.py +4 -4
- machineconfig/jobs/python/vscode/sync_code.py +6 -6
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/aider.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/brave.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/code.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/docker.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/espanso.py +8 -8
- machineconfig/jobs/python_custom_installers/dev/goes.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/lvim.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/redis.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/warp-cli.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +4 -4
- machineconfig/jobs/python_custom_installers/gh.py +6 -6
- machineconfig/jobs/python_custom_installers/hx.py +28 -58
- machineconfig/jobs/python_custom_installers/scripts/linux/brave.sh +4 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/docker.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/docker_start.sh +3 -6
- machineconfig/jobs/python_custom_installers/scripts/linux/edge.sh +3 -6
- machineconfig/jobs/python_custom_installers/scripts/linux/nerdfont.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/pgsql.sh +4 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/redis.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/timescaledb.sh +6 -12
- machineconfig/jobs/python_custom_installers/scripts/linux/vscode.sh +9 -8
- machineconfig/jobs/python_custom_installers/scripts/linux/warp-cli.sh +5 -10
- machineconfig/jobs/python_custom_installers/scripts/linux/wezterm.sh +3 -6
- machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/shell.py +26 -47
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/cloud/init.sh +9 -18
- machineconfig/scripts/linux/fire +5 -24
- machineconfig/scripts/linux/share_cloud.sh +6 -12
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_repo_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/archive/im2text.py +30 -30
- machineconfig/scripts/python/archive/tmate_conn.py +10 -13
- machineconfig/scripts/python/archive/tmate_start.py +12 -16
- machineconfig/scripts/python/choose_wezterm_theme.py +9 -18
- machineconfig/scripts/python/cloud_copy.py +38 -93
- machineconfig/scripts/python/cloud_manager.py +61 -53
- machineconfig/scripts/python/cloud_mount.py +23 -34
- machineconfig/scripts/python/cloud_repo_sync.py +20 -69
- machineconfig/scripts/python/cloud_sync.py +35 -45
- machineconfig/scripts/python/croshell.py +48 -73
- machineconfig/scripts/python/devops.py +50 -104
- machineconfig/scripts/python/devops_add_identity.py +41 -101
- machineconfig/scripts/python/devops_add_ssh_key.py +33 -140
- machineconfig/scripts/python/devops_backup_retrieve.py +23 -112
- machineconfig/scripts/python/devops_devapps_install.py +0 -4
- machineconfig/scripts/python/devops_update_repos.py +1 -1
- machineconfig/scripts/python/fire_jobs.py +73 -25
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/cloud_helpers.py +37 -34
- machineconfig/scripts/python/helpers/helpers2.py +17 -31
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +19 -54
- machineconfig/scripts/python/pomodoro.py +1 -1
- machineconfig/scripts/python/repos.py +49 -34
- machineconfig/scripts/python/wifi_conn.py +5 -3
- machineconfig/scripts/windows/fire.ps1 +27 -15
- machineconfig/settings/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/playext.cpython-311.pyc +0 -0
- machineconfig/setup_linux/nix/cli_installation.sh +9 -18
- machineconfig/setup_linux/others/openssh-server_add_pub_key.sh +3 -6
- machineconfig/setup_linux/web_shortcuts/all.sh +5 -10
- machineconfig/setup_linux/web_shortcuts/ascii_art.sh +7 -14
- machineconfig/setup_linux/web_shortcuts/croshell.sh +6 -12
- machineconfig/setup_linux/web_shortcuts/interactive.sh +34 -68
- machineconfig/setup_linux/web_shortcuts/ssh.sh +8 -16
- machineconfig/setup_linux/web_shortcuts/update_system.sh +7 -14
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +16 -12
- machineconfig/utils/ai/browser_user_wrapper.py +60 -45
- machineconfig/utils/ai/generate_file_checklist.py +4 -7
- machineconfig/utils/ai/url2md.py +13 -5
- machineconfig/utils/{utils_code.py â code.py} +4 -10
- machineconfig/utils/installer.py +4 -10
- machineconfig/utils/{utils_links.py â links.py} +9 -20
- machineconfig/utils/{utils_options.py â options.py} +10 -20
- machineconfig/utils/{utils_path.py â path.py} +28 -80
- machineconfig/utils/procs.py +26 -30
- machineconfig/utils/scheduling.py +11 -11
- machineconfig/utils/utils.py +12 -19
- machineconfig/utils/ve.py +5 -21
- machineconfig/utils/ve_utils/ve2.py +15 -2
- {machineconfig-1.94.dist-info â machineconfig-1.95.dist-info}/METADATA +4 -2
- {machineconfig-1.94.dist-info â machineconfig-1.95.dist-info}/RECORD +120 -118
- {machineconfig-1.94.dist-info â machineconfig-1.95.dist-info}/WHEEL +1 -1
- {machineconfig-1.94.dist-info â machineconfig-1.95.dist-info}/top_level.txt +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
1
|
from crocodile.core import Struct
|
|
4
2
|
from crocodile.file_management import Read
|
|
5
3
|
from machineconfig.scripts.python.helpers.cloud_helpers import Args, ArgsDefaults, absolute, find_cloud_config, get_secure_share_cloud_config
|
|
6
4
|
from machineconfig.utils.utils import DEFAULTS_PATH
|
|
7
5
|
from typing import Optional
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
from rich.panel import Panel
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
ES = "^" # chosen carefully to not mean anything on any shell. `$` was a bad choice.
|
|
11
|
+
console = Console()
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def parse_cloud_source_target(args: Args, source: str, target: str) -> tuple[str, str, str]:
|
|
15
|
+
print("Source:", source)
|
|
16
|
+
print("Target:", target)
|
|
14
17
|
config = args.config
|
|
15
18
|
if config == "ss":
|
|
16
19
|
cloud_maybe: Optional[str] = target.split(":")[0]
|
|
17
|
-
if cloud_maybe == "": cloud_maybe = source.split(":")[0]
|
|
20
|
+
# if cloud_maybe == "": cloud_maybe = source.split(":")[0]
|
|
18
21
|
if cloud_maybe == "": cloud_maybe = None
|
|
22
|
+
print("cloud_maybe:", cloud_maybe)
|
|
19
23
|
maybe_config = get_secure_share_cloud_config(interactive=True, cloud=cloud_maybe)
|
|
20
24
|
elif config is not None:
|
|
21
|
-
print(f"""
|
|
22
|
-
â{'â' * 70}âŽ
|
|
23
|
-
â đ Loading configuration from: {config} â
|
|
24
|
-
â°{'â' * 70}â¯
|
|
25
|
-
""")
|
|
25
|
+
console.print(Panel(f"đ Loading configuration from: {config}", width=150, border_style="blue"))
|
|
26
26
|
maybe_config = Args.from_config(absolute(config))
|
|
27
27
|
else:
|
|
28
28
|
maybe_config = None
|
|
@@ -55,11 +55,7 @@ def parse_cloud_source_target(args: Args, source: str, target: str) -> tuple[str
|
|
|
55
55
|
|
|
56
56
|
if maybe_config is None:
|
|
57
57
|
default_cloud: str=Read.ini(DEFAULTS_PATH)['general']['rclone_config_name']
|
|
58
|
-
print(f"""
|
|
59
|
-
â{'â' * 70}âŽ
|
|
60
|
-
â â ī¸ No cloud config found. Using default cloud: {default_cloud} â
|
|
61
|
-
â°{'â' * 70}â¯
|
|
62
|
-
""")
|
|
58
|
+
console.print(Panel(f"â ī¸ No cloud config found. Using default cloud: {default_cloud}", width=150, border_style="yellow"))
|
|
63
59
|
source = default_cloud + ":" + source[1:]
|
|
64
60
|
else:
|
|
65
61
|
tmp = maybe_config
|
|
@@ -74,18 +70,17 @@ def parse_cloud_source_target(args: Args, source: str, target: str) -> tuple[str
|
|
|
74
70
|
if target.startswith(":"): # default cloud name is omitted cloud_name: # or ES in target
|
|
75
71
|
assert ES not in source, "Not Implemented here yet."
|
|
76
72
|
path = absolute(source)
|
|
77
|
-
if maybe_config is None:
|
|
73
|
+
if maybe_config is None:
|
|
74
|
+
maybe_config = find_cloud_config(path)
|
|
78
75
|
|
|
79
76
|
if maybe_config is None:
|
|
80
77
|
default_cloud = Read.ini(DEFAULTS_PATH)['general']['rclone_config_name']
|
|
81
|
-
print(f"""
|
|
82
|
-
â{'â' * 70}âŽ
|
|
83
|
-
â â ī¸ No cloud config found. Using default cloud: {default_cloud} â
|
|
84
|
-
â°{'â' * 70}â¯
|
|
85
|
-
""")
|
|
78
|
+
console.print(Panel(f"â ī¸ No cloud config found. Using default cloud: {default_cloud}", width=150, border_style="yellow"))
|
|
86
79
|
target = default_cloud + ":" + target[1:]
|
|
80
|
+
print("target mutated to:", target, f"because of default cloud being {default_cloud}")
|
|
87
81
|
else:
|
|
88
82
|
tmp = maybe_config
|
|
83
|
+
# print("target mutated to:", target, f"because of cloud config being {tmp.cloud}")
|
|
89
84
|
target = f"{tmp.cloud}:" + target[1:]
|
|
90
85
|
root = tmp.root
|
|
91
86
|
rel2home = tmp.rel2home
|
|
@@ -131,19 +126,10 @@ def parse_cloud_source_target(args: Args, source: str, target: str) -> tuple[str
|
|
|
131
126
|
if zip_arg and ".zip" not in target: target += ".zip"
|
|
132
127
|
if encrypt and ".enc" not in target: target += ".enc"
|
|
133
128
|
else:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
â â ERROR: Invalid path configuration â
|
|
137
|
-
â {'â' * 70}âŖ
|
|
138
|
-
â Either source or target must be a remote path (i.e. machine:path) â
|
|
139
|
-
â{'â' * 70}â
|
|
140
|
-
""")
|
|
129
|
+
console.print(Panel("â ERROR: Invalid path configuration\nEither source or target must be a remote path (i.e. machine:path)", title="[bold red]Error[/bold red]", border_style="red"))
|
|
130
|
+
raise ValueError(f"Either source or target must be a remote path (i.e. machine:path)\nGot: source: `{source}`, target: `{target}`")
|
|
141
131
|
|
|
142
|
-
print(
|
|
143
|
-
â{'â' * 70}âŽ
|
|
144
|
-
â đ Path resolution complete â
|
|
145
|
-
â°{'â' * 70}â¯
|
|
146
|
-
""")
|
|
132
|
+
console.print(Panel("đ Path resolution complete", title="[bold blue]Resolution[/bold blue]", border_style="blue"))
|
|
147
133
|
Struct({"cloud": cloud, "source": str(source), "target": str(target)}).print(as_config=True, title="CLI Resolution")
|
|
148
134
|
_ = pwd, encrypt, zip_arg, share
|
|
149
135
|
return cloud, str(source), str(target)
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
1
|
from crocodile.file_management import P, Read
|
|
3
2
|
from crocodile.meta import Terminal
|
|
4
3
|
from machineconfig.scripts.python.get_zellij_cmd import get_zellij_cmd
|
|
5
|
-
from machineconfig.utils.utils import CONFIG_PATH, DEFAULTS_PATH
|
|
4
|
+
from machineconfig.utils.utils import CONFIG_PATH, DEFAULTS_PATH
|
|
5
|
+
from machineconfig.utils.code import write_shell_script_to_file
|
|
6
6
|
import platform
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.panel import Panel
|
|
9
|
+
|
|
10
|
+
console = Console()
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
def delete_remote_repo_copy_and_push_local(remote_repo: str, local_repo: str, cloud: str):
|
|
10
|
-
print(
|
|
11
|
-
â{'â' * 70}â
|
|
12
|
-
â đī¸ Deleting remote repo copy and pushing local copy â
|
|
13
|
-
â{'â' * 70}â
|
|
14
|
-
""")
|
|
14
|
+
console.print(Panel("đī¸ Deleting remote repo copy and pushing local copy", title="[bold blue]Repo Sync[/bold blue]", border_style="blue"))
|
|
15
15
|
repo_sync_root = P(remote_repo).expanduser().absolute()
|
|
16
16
|
repo_root_path = P(local_repo).expanduser().absolute()
|
|
17
17
|
repo_sync_root.delete(sure=True)
|
|
@@ -20,21 +20,13 @@ def delete_remote_repo_copy_and_push_local(remote_repo: str, local_repo: str, cl
|
|
|
20
20
|
from git.repo import Repo
|
|
21
21
|
try:
|
|
22
22
|
Remote.remove(Repo(repo_root_path), "originEnc")
|
|
23
|
-
print("đ Removed originEnc remote reference")
|
|
23
|
+
console.print(Panel("đ Removed originEnc remote reference", border_style="blue"))
|
|
24
24
|
except Exception: pass # type: ignore
|
|
25
|
-
print(f"""
|
|
26
|
-
â{'â' * 70}âŽ
|
|
27
|
-
â đ¤ Uploading local repository to cloud... â
|
|
28
|
-
â°{'â' * 70}â¯
|
|
29
|
-
""")
|
|
25
|
+
console.print(Panel(f"đ Deleting remote repository copy and pushing local changes", width=150, border_style="blue"))
|
|
30
26
|
|
|
31
27
|
repo_root_path.to_cloud(cloud=cloud, zip=True, encrypt=True, rel2home=True, os_specific=False)
|
|
32
28
|
|
|
33
|
-
print(
|
|
34
|
-
â{'â' * 70}â
|
|
35
|
-
â â
Repository successfully pushed to cloud â
|
|
36
|
-
â{'â' * 70}â
|
|
37
|
-
""")
|
|
29
|
+
console.print(Panel("â
Repository successfully pushed to cloud", title="[bold green]Repo Sync[/bold green]", border_style="green"))
|
|
38
30
|
|
|
39
31
|
|
|
40
32
|
# import sys
|
|
@@ -50,59 +42,36 @@ def get_wt_cmd(wd1: P, wd2: P) -> str:
|
|
|
50
42
|
|
|
51
43
|
|
|
52
44
|
def inspect_repos(repo_local_root: str, repo_remote_root: str):
|
|
53
|
-
print(f"""
|
|
54
|
-
â{'â' * 70}â
|
|
55
|
-
â đ Inspecting Repositories â
|
|
56
|
-
â {'â' * 70}âŖ
|
|
57
|
-
â đ Local: {repo_local_root}
|
|
58
|
-
â đ Remote: {repo_remote_root}
|
|
59
|
-
â{'â' * 70}â
|
|
60
|
-
""")
|
|
45
|
+
console.print(Panel(f"đ Local: {repo_local_root}\nđ Remote: {repo_remote_root}", title="[bold blue]đ Inspecting Repositories[/bold blue]", border_style="blue"))
|
|
61
46
|
|
|
62
47
|
if platform.system() == "Windows":
|
|
63
48
|
program = get_wt_cmd(wd1=P(repo_local_root), wd2=P(repo_local_root))
|
|
64
|
-
|
|
49
|
+
write_shell_script_to_file(program=program, execute=True, desc="Inspecting repos ...", preserve_cwd=True, display=True)
|
|
65
50
|
return None
|
|
66
51
|
elif platform.system() == "Linux":
|
|
67
52
|
program = get_zellij_cmd(wd1=P(repo_local_root), wd2=P(repo_remote_root))
|
|
68
|
-
|
|
53
|
+
write_shell_script_to_file(program=program, execute=True, desc="Inspecting repos ...", preserve_cwd=True, display=True)
|
|
69
54
|
return None
|
|
70
55
|
else: raise NotImplementedError(f"Platform {platform.system()} not implemented.")
|
|
71
56
|
|
|
72
57
|
|
|
73
58
|
def fetch_dotfiles():
|
|
74
|
-
print(
|
|
75
|
-
â{'â' * 70}â
|
|
76
|
-
â đ Fetching Dotfiles â
|
|
77
|
-
â{'â' * 70}â
|
|
78
|
-
""")
|
|
59
|
+
console.print(Panel("đ Fetching Dotfiles", title="[bold blue]Dotfiles[/bold blue]", border_style="blue"))
|
|
79
60
|
|
|
80
61
|
cloud_resolved = Read.ini(DEFAULTS_PATH)['general']['rclone_config_name']
|
|
81
|
-
print(f"""
|
|
82
|
-
â{'â' * 70}âŽ
|
|
83
|
-
â â ī¸ Using default cloud: `{cloud_resolved}` from {DEFAULTS_PATH} â
|
|
84
|
-
â°{'â' * 70}â¯
|
|
85
|
-
""")
|
|
62
|
+
console.print(Panel(f"â ī¸ Using default cloud: `{cloud_resolved}` from {DEFAULTS_PATH}", width=150, border_style="yellow"))
|
|
86
63
|
|
|
87
64
|
dotfiles_local = P.home().joinpath("dotfiles")
|
|
88
65
|
CONFIG_PATH.joinpath("remote").create()
|
|
89
66
|
dotfiles_remote = CONFIG_PATH.joinpath("remote", dotfiles_local.rel2home())
|
|
90
67
|
remote_path = dotfiles_local.get_remote_path(rel2home=True, os_specific=False, root="myhome") + ".zip.enc"
|
|
91
68
|
|
|
92
|
-
print(f"""
|
|
93
|
-
â{'â' * 70}âŽ
|
|
94
|
-
â đĨ Downloading dotfiles from cloud... â
|
|
95
|
-
â°{'â' * 70}â¯
|
|
96
|
-
""")
|
|
69
|
+
console.print(Panel(f"đĨ Downloading dotfiles from cloud...", width=150, border_style="blue"))
|
|
97
70
|
|
|
98
71
|
dotfiles_remote.from_cloud(remotepath=remote_path, cloud=cloud_resolved,
|
|
99
72
|
unzip=True, decrypt=True, rel2home=True, os_specific=False, pwd=None)
|
|
100
73
|
|
|
101
|
-
print(f"""
|
|
102
|
-
â{'â' * 70}âŽ
|
|
103
|
-
â đī¸ Removing old dotfiles and replacing with cloud version... â
|
|
104
|
-
â°{'â' * 70}â¯
|
|
105
|
-
""")
|
|
74
|
+
console.print(Panel(f"đī¸ Removing old dotfiles and replacing with cloud version...", width=150, border_style="blue"))
|
|
106
75
|
|
|
107
76
|
dotfiles_local.delete(sure=True)
|
|
108
77
|
dotfiles_remote.move(folder=P.home())
|
|
@@ -115,12 +84,8 @@ sudo chmod 600 $HOME/.ssh/*
|
|
|
115
84
|
sudo chmod 700 $HOME/.ssh
|
|
116
85
|
sudo chmod +x $HOME/dotfiles/scripts/linux -R
|
|
117
86
|
"""
|
|
118
|
-
shell_path =
|
|
87
|
+
shell_path = write_shell_script_to_file(shell_script=script)
|
|
119
88
|
Terminal().run(f". {shell_path}", shell="bash").capture().print()
|
|
120
89
|
|
|
121
|
-
print(
|
|
122
|
-
â{'â' * 70}â
|
|
123
|
-
â â
Dotfiles successfully fetched and installed â
|
|
124
|
-
â{'â' * 70}â
|
|
125
|
-
""")
|
|
90
|
+
console.print(Panel("â
Dotfiles successfully fetched and installed", title="[bold green]Dotfiles[/bold green]", border_style="green"))
|
|
126
91
|
|
|
@@ -31,8 +31,8 @@ def pomodoro(work: int = 25, rest: int = 5, repeats: int = 4):
|
|
|
31
31
|
def speak(txt: str):
|
|
32
32
|
print(f"đ Speaking: {txt}")
|
|
33
33
|
install_n_import("gtts").gTTS(txt, lang='en', tld='com.au').save(tmp := P.tmpfile(suffix=".mp3"))
|
|
34
|
-
time.sleep(0.5)
|
|
35
34
|
pyglet = install_n_import("pyglet")
|
|
35
|
+
time.sleep(0.5)
|
|
36
36
|
pyglet.resource.path = [tmp.parent.to_str()]
|
|
37
37
|
pyglet.resource.reindex()
|
|
38
38
|
pyglet.resource.media(tmp.name).play()
|
|
@@ -25,11 +25,11 @@ class GitAction(Enum):
|
|
|
25
25
|
class RepoRecord:
|
|
26
26
|
name: str
|
|
27
27
|
parent_dir: str
|
|
28
|
-
remotes:
|
|
28
|
+
remotes: dict[str, str] # Fixed: should be dict mapping remote name to URL
|
|
29
29
|
version: dict[str, str]
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def git_action(path: P, action: GitAction, mess: Optional[str] = None, r: bool=False) -> str:
|
|
32
|
+
def git_action(path: P, action: GitAction, mess: Optional[str] = None, r: bool = False, uv_sync: bool = False) -> str:
|
|
33
33
|
from git.exc import InvalidGitRepositoryError
|
|
34
34
|
from git.repo import Repo
|
|
35
35
|
try:
|
|
@@ -37,25 +37,27 @@ def git_action(path: P, action: GitAction, mess: Optional[str] = None, r: bool=F
|
|
|
37
37
|
except InvalidGitRepositoryError:
|
|
38
38
|
pprint(f"â ī¸ Skipping {path} because it is not a git repository.")
|
|
39
39
|
if r:
|
|
40
|
-
prgs = [git_action(path=sub_path, action=action, mess=mess, r=r) for sub_path in path.search()]
|
|
40
|
+
prgs = [git_action(path=sub_path, action=action, mess=mess, r=r, uv_sync=uv_sync) for sub_path in path.search()]
|
|
41
41
|
return "\n".join(prgs)
|
|
42
42
|
else: return "\necho 'skipped because not a git repo'\n\n"
|
|
43
43
|
|
|
44
44
|
program = f'''
|
|
45
|
-
|
|
45
|
+
echo '>>>>>>>>> đ§{action}'
|
|
46
46
|
cd '{path}'
|
|
47
47
|
'''
|
|
48
48
|
if action == GitAction.commit:
|
|
49
49
|
if mess is None: mess = "auto_commit_" + randstr()
|
|
50
50
|
program += f'''
|
|
51
|
-
|
|
51
|
+
git commit -am "{mess}"
|
|
52
52
|
'''
|
|
53
53
|
if action == GitAction.push or action == GitAction.pull:
|
|
54
54
|
action_name = "pull" if action == GitAction.pull else "push"
|
|
55
55
|
cmds = [f'echo "đ {action_name.capitalize()}ing from {remote.url}" ; git {action_name} {remote.name} {repo.active_branch.name}' for remote in repo.remotes]
|
|
56
56
|
program += '\n' + '\n'.join(cmds) + '\n'
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
uv_sync = "uv sync" if uv_sync else ""
|
|
58
|
+
program = program + f'''
|
|
59
|
+
{uv_sync}
|
|
60
|
+
echo "â
"; echo ""
|
|
59
61
|
'''
|
|
60
62
|
return program
|
|
61
63
|
|
|
@@ -70,6 +72,7 @@ def main():
|
|
|
70
72
|
parser.add_argument("directory", help="đ Folder containing repos to record or a specs JSON file to follow.", default="")
|
|
71
73
|
# FLAGS
|
|
72
74
|
parser.add_argument("--push", help="đ Push changes.", action="store_true")
|
|
75
|
+
parser.add_argument("--uv_sync", help="đ Sync UV dependencies.", action="store_true")
|
|
73
76
|
parser.add_argument("--pull", help="âŦī¸ Pull changes.", action="store_true")
|
|
74
77
|
parser.add_argument("--commit", help="đž Commit changes.", action="store_true")
|
|
75
78
|
parser.add_argument("--all", help="đ Pull, commit, and push changes.", action="store_true")
|
|
@@ -98,7 +101,7 @@ def main():
|
|
|
98
101
|
elif args.clone or args.checkout or args.checkout_to_branch:
|
|
99
102
|
print("\nđĨ Cloning or checking out repositories...")
|
|
100
103
|
program += """\necho '>>>>>>>>> Cloning Repos'\n"""
|
|
101
|
-
if not repos_root.exists() or repos_root.
|
|
104
|
+
if not repos_root.exists() or repos_root.name != 'repos.json': # Fixed: use name instead of stem
|
|
102
105
|
repos_root = CONFIG_PATH.joinpath("repos").joinpath(repos_root.rel2home()).joinpath("repos.json")
|
|
103
106
|
if not repos_root.exists():
|
|
104
107
|
if args.cloud is None:
|
|
@@ -111,12 +114,12 @@ def main():
|
|
|
111
114
|
assert (repos_root.exists() and repos_root.name == 'repos.json') or args.cloud is not None, f"Path {repos_root} does not exist and cloud was not passed. You can't clone without one of them."
|
|
112
115
|
program += install_repos(specs_path=str(repos_root), clone=args.clone, checkout_to_recorded_commit=args.checkout, checkout_to_branch=args.checkout_to_branch)
|
|
113
116
|
elif args.all or args.commit or args.pull or args.push:
|
|
114
|
-
print("\nđ Performing Git actions on repositories
|
|
117
|
+
print(f"\nđ Performing Git actions on repositories @ `{repos_root}`...")
|
|
115
118
|
for a_path in repos_root.search("*"):
|
|
116
119
|
program += f"""echo "{("Handling " + str(a_path)).center(80, "-")}" """
|
|
117
|
-
if args.pull or args.all: program += git_action(path=a_path, action=GitAction.pull, r=args.recursive)
|
|
118
|
-
if args.commit or args.all: program += git_action(a_path, action=GitAction.commit, r=args.recursive)
|
|
119
|
-
if args.push or args.all: program += git_action(a_path, action=GitAction.push, r=args.recursive)
|
|
120
|
+
if args.pull or args.all: program += git_action(path=a_path, action=GitAction.pull, r=args.recursive, uv_sync=args.uv_sync)
|
|
121
|
+
if args.commit or args.all: program += git_action(a_path, action=GitAction.commit, r=args.recursive, uv_sync=args.uv_sync)
|
|
122
|
+
if args.push or args.all: program += git_action(a_path, action=GitAction.push, r=args.recursive, uv_sync=args.uv_sync)
|
|
120
123
|
else: program = "echo 'â No action specified. Try passing --push, --pull, --commit, or --all.'"
|
|
121
124
|
write_shell_script_to_default_program_path(program=program, desc="Script to update repos", preserve_cwd=True, display=True, execute=False)
|
|
122
125
|
|
|
@@ -164,28 +167,40 @@ def install_repos(specs_path: str, clone: bool=True, checkout_to_recorded_commit
|
|
|
164
167
|
repos: list[dict[str, Any]] = Read.json(path_obj)
|
|
165
168
|
for repo in repos:
|
|
166
169
|
parent_dir = P(repo["parent_dir"]).expanduser().absolute().create()
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
170
|
+
|
|
171
|
+
# Handle cloning and remote setup
|
|
172
|
+
if clone:
|
|
173
|
+
# Select the remote to use for cloning
|
|
174
|
+
remote_name, remote_url = next(iter(repo["remotes"].items())) # Get first remote by default
|
|
175
|
+
if preferred_remote is not None and preferred_remote in repo["remotes"]:
|
|
176
|
+
remote_name = preferred_remote
|
|
177
|
+
remote_url = repo["remotes"][preferred_remote]
|
|
178
|
+
elif preferred_remote is not None:
|
|
179
|
+
print(f"â ī¸ `{preferred_remote=}` not found in {repo['remotes']}.")
|
|
180
|
+
|
|
181
|
+
# Clone with the selected remote
|
|
182
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}; git clone {remote_url} --origin {remote_name} --depth 2"
|
|
183
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}/{repo['name']}; git remote set-url {remote_name} {remote_url}"
|
|
184
|
+
|
|
185
|
+
# Add any additional remotes
|
|
186
|
+
for other_remote_name, other_remote_url in repo["remotes"].items():
|
|
187
|
+
if other_remote_name != remote_name:
|
|
188
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}/{repo['name']}; git remote add {other_remote_name} {other_remote_url}"
|
|
189
|
+
|
|
190
|
+
# Handle checkout operations (after all remotes are set up)
|
|
191
|
+
if checkout_to_recorded_commit:
|
|
192
|
+
commit = repo['version']['commit']
|
|
193
|
+
if isinstance(commit, str):
|
|
194
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}/{repo['name']}; git checkout {commit}"
|
|
195
|
+
else:
|
|
196
|
+
print(f"Skipping {repo['parent_dir']} because it doesn't have a commit recorded. Found {commit}")
|
|
197
|
+
elif checkout_to_branch:
|
|
198
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}/{repo['name']}; git checkout {repo['current_branch']}"
|
|
199
|
+
|
|
200
|
+
# Handle editable install
|
|
201
|
+
if editable_install:
|
|
202
|
+
program += f"\ncd {parent_dir.collapseuser().as_posix()}/{repo['name']}; uv pip install -e ."
|
|
203
|
+
|
|
189
204
|
program += "\n"
|
|
190
205
|
pprint(program)
|
|
191
206
|
return program
|
|
@@ -10,6 +10,10 @@ from pathlib import Path
|
|
|
10
10
|
import os
|
|
11
11
|
import platform
|
|
12
12
|
import subprocess
|
|
13
|
+
from rich.console import Console
|
|
14
|
+
from rich.panel import Panel
|
|
15
|
+
|
|
16
|
+
console = Console()
|
|
13
17
|
|
|
14
18
|
def create_new_connection(name: str, ssid: str, password: str):
|
|
15
19
|
print(f"\nđ§ Creating new connection: {name} (SSID: {ssid})")
|
|
@@ -45,9 +49,7 @@ def display_available_networks():
|
|
|
45
49
|
print("â
Network scan completed!\n")
|
|
46
50
|
|
|
47
51
|
def main():
|
|
48
|
-
print("
|
|
49
|
-
print("đļ Welcome to the WiFi Connector Tool")
|
|
50
|
-
print("=" * 50 + "\n")
|
|
52
|
+
console.print(Panel("đļ Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
|
|
51
53
|
|
|
52
54
|
creds = configparser.ConfigParser()
|
|
53
55
|
creds.read(Path.home().joinpath('dotfiles/machineconfig/setup/wifi.ini'))
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
# param(
|
|
3
|
+
# [switch]$IgnoreKeyboardInterrupt
|
|
4
|
+
# )
|
|
5
|
+
|
|
6
|
+
# Generate a random string of 10 characters
|
|
7
|
+
$random_str = -join ((65..90) + (97..122) + (48..57) | Get-Random -Count 10 | ForEach-Object {[char]$_})
|
|
8
|
+
$op_script = "$HOME\tmp_results\shells\$random_str\python_return_command.ps1"
|
|
9
|
+
# Export the op_script variable to environment so python can access it
|
|
10
|
+
$env:op_script = $op_script
|
|
11
|
+
|
|
12
|
+
# Create directory if it doesn't exist
|
|
13
|
+
$script_dir = Split-Path -Path $op_script -Parent
|
|
14
|
+
if (-not (Test-Path $script_dir)) {
|
|
15
|
+
New-Item -ItemType Directory -Path $script_dir -Force | Out-Null
|
|
5
16
|
}
|
|
6
17
|
|
|
18
|
+
# if (Test-Path $op_script ) {
|
|
19
|
+
# Remove-Item $op_script
|
|
20
|
+
# }
|
|
7
21
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
|
|
23
|
+
# try {
|
|
24
|
+
# # $null = & chafa --version
|
|
25
|
+
# # & chafa "$HOME\code\machineconfig\assets\aafire.webp" --speed 2 --duration 1
|
|
26
|
+
# # Chafa.exe "$HOME\code\machineconfig\assets\aafire.webp" --speed 2 --duration 1 --symbols ascii
|
|
27
|
+
# Write-Host "đĨ"
|
|
28
|
+
# } catch {
|
|
29
|
+
# Write-Host "Chafa not found, skipping."
|
|
30
|
+
# }
|
|
16
31
|
|
|
17
32
|
|
|
18
33
|
. "$HOME\scripts\activate_ve.ps1" ve
|
|
@@ -21,13 +36,10 @@ python -m machineconfig.scripts.python.fire_jobs $args
|
|
|
21
36
|
|
|
22
37
|
if (Test-Path $op_script ) {
|
|
23
38
|
. $op_script
|
|
24
|
-
# content of $op_script
|
|
25
|
-
# $content = Get-Content $op_script
|
|
26
|
-
# Invoke-Expression $content | Add-History # this way, $content will go to hisyory of powershell. You don't neet Add-history
|
|
27
39
|
}
|
|
28
40
|
else
|
|
29
41
|
{
|
|
30
|
-
Write-Host "No output script to be executed
|
|
42
|
+
Write-Host "No output script to be executed at $op_script."
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
deactivate -ErrorAction SilentlyContinue
|
|
Binary file
|
|
Binary file
|
machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/__init__.cpython-311.pyc
CHANGED
|
Binary file
|
machineconfig/settings/shells/ipy/profiles/default/startup/__pycache__/playext.cpython-311.pyc
CHANGED
|
Binary file
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
#=======================================================================
|
|
5
5
|
# This script installs various command-line utilities using the Nix package manager
|
|
6
6
|
|
|
7
|
-
echo """
|
|
8
|
-
#=======================================================================
|
|
7
|
+
echo """#=======================================================================
|
|
9
8
|
đ SYSTEM UTILITIES | Installing system management tools
|
|
10
9
|
#=======================================================================
|
|
11
10
|
"""
|
|
@@ -22,8 +21,7 @@ nix-env -iA nixpkgs.procs || true
|
|
|
22
21
|
echo "đĨ Installing watchexec - executes commands when files change..."
|
|
23
22
|
nix-env -iA nixpkgs.watchexec || true
|
|
24
23
|
|
|
25
|
-
echo """
|
|
26
|
-
#=======================================================================
|
|
24
|
+
echo """#=======================================================================
|
|
27
25
|
đ FILE MANAGEMENT | Installing file browsers and utilities
|
|
28
26
|
#=======================================================================
|
|
29
27
|
"""
|
|
@@ -58,8 +56,7 @@ nix-env -iA nixpkgs.diskonaut || true
|
|
|
58
56
|
echo "đĨ Installing kondo - cleanup tool for dev projects..."
|
|
59
57
|
nix-env -iA nixpkgs.kondo || true
|
|
60
58
|
|
|
61
|
-
echo """
|
|
62
|
-
#=======================================================================
|
|
59
|
+
echo """#=======================================================================
|
|
63
60
|
đŧī¸ VISUAL TOOLS | Installing terminal visualization tools
|
|
64
61
|
#=======================================================================
|
|
65
62
|
"""
|
|
@@ -74,8 +71,7 @@ nix-env -iA nixpkgs.bottom || true
|
|
|
74
71
|
echo "đĨ Installing delta - syntax-highlighting pager for git..."
|
|
75
72
|
nix-env -iA nixpkgs.delta || true
|
|
76
73
|
|
|
77
|
-
echo """
|
|
78
|
-
#=======================================================================
|
|
74
|
+
echo """#=======================================================================
|
|
79
75
|
đ§ DEVELOPMENT TOOLS | Installing programming utilities
|
|
80
76
|
#=======================================================================
|
|
81
77
|
"""
|
|
@@ -99,8 +95,7 @@ nix-env -iA nixpkgs.tokei || true
|
|
|
99
95
|
echo "đĨ Installing gitui - terminal UI for git..."
|
|
100
96
|
nix-env -iA nixpkgs.gitui || true
|
|
101
97
|
|
|
102
|
-
echo """
|
|
103
|
-
#=======================================================================
|
|
98
|
+
echo """#=======================================================================
|
|
104
99
|
đ SEARCH TOOLS | Installing fuzzy finders and search utilities
|
|
105
100
|
#=======================================================================
|
|
106
101
|
"""
|
|
@@ -113,8 +108,7 @@ nix-env -iA nixpkgs.mcfly || true
|
|
|
113
108
|
echo "đĨ Installing skim - fuzzy finder in Rust..."
|
|
114
109
|
nix-env -iA nixpkgs.skim || true
|
|
115
110
|
|
|
116
|
-
echo """
|
|
117
|
-
#=======================================================================
|
|
111
|
+
echo """#=======================================================================
|
|
118
112
|
đ NETWORK & CLOUD TOOLS | Installing file transfer and cloud utilities
|
|
119
113
|
#=======================================================================
|
|
120
114
|
"""
|
|
@@ -127,8 +121,7 @@ nix-env -iA nixpkgs.termscp || true
|
|
|
127
121
|
echo "đĨ Installing rclone - rsync for cloud storage..."
|
|
128
122
|
nix-env -iA nixpkgs.rclone || true
|
|
129
123
|
|
|
130
|
-
echo """
|
|
131
|
-
#=======================================================================
|
|
124
|
+
echo """#=======================================================================
|
|
132
125
|
đĄī¸ SECURITY TOOLS | Installing password management utilities
|
|
133
126
|
#=======================================================================
|
|
134
127
|
"""
|
|
@@ -137,8 +130,7 @@ echo """
|
|
|
137
130
|
echo "đĨ Installing gopass - team password manager with git..."
|
|
138
131
|
nix-env -iA nixpkgs.gopass || true
|
|
139
132
|
|
|
140
|
-
echo """
|
|
141
|
-
#=======================================================================
|
|
133
|
+
echo """#=======================================================================
|
|
142
134
|
đ DOCUMENTATION | Installing help and reference tools
|
|
143
135
|
#=======================================================================
|
|
144
136
|
"""
|
|
@@ -151,8 +143,7 @@ nix-env -iA nixpkgs.tldr || true
|
|
|
151
143
|
echo "đĨ Installing nushell - modern shell alternative..."
|
|
152
144
|
nix-env -iA nixpkgs.nushell || true
|
|
153
145
|
|
|
154
|
-
echo """
|
|
155
|
-
#=======================================================================
|
|
146
|
+
echo """#=======================================================================
|
|
156
147
|
â
INSTALLATION COMPLETE | All Nix CLI tools have been installed
|
|
157
148
|
#=======================================================================
|
|
158
149
|
"""
|
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
#=======================================================================
|
|
5
5
|
# This script helps set up passwordless SSH authentication to remote Linux machines
|
|
6
6
|
|
|
7
|
-
echo """
|
|
8
|
-
#=======================================================================
|
|
7
|
+
echo """#=======================================================================
|
|
9
8
|
âšī¸ PASSWORDLESS SSH SETUP | Manual instructions for key deployment
|
|
10
9
|
#=======================================================================
|
|
11
10
|
"""
|
|
12
11
|
|
|
13
|
-
echo """
|
|
14
|
-
đ There are two methods to copy your public key to a remote server:
|
|
12
|
+
echo """đ There are two methods to copy your public key to a remote server:
|
|
15
13
|
|
|
16
14
|
đ METHOD 1: Using ssh-copy-id (Linux clients only)
|
|
17
15
|
ssh-copy-id username@hostname
|
|
@@ -23,8 +21,7 @@ echo """
|
|
|
23
21
|
đ METHOD 3: Using SFTP (detailed below)
|
|
24
22
|
"""
|
|
25
23
|
|
|
26
|
-
echo """
|
|
27
|
-
#=======================================================================
|
|
24
|
+
echo """#=======================================================================
|
|
28
25
|
đ MANUAL SFTP PROCESS | Step-by-step instructions
|
|
29
26
|
#=======================================================================
|
|
30
27
|
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
#=======================================================================
|
|
5
5
|
# This script provides quick access to installation scripts via web
|
|
6
6
|
|
|
7
|
-
echo """
|
|
8
|
-
#=======================================================================
|
|
7
|
+
echo """#=======================================================================
|
|
9
8
|
đ AVAILABLE INSTALLATION OPTIONS | Web-based installers
|
|
10
9
|
#=======================================================================
|
|
11
10
|
|
|
12
11
|
Choose from the following installation options:
|
|
13
12
|
"""
|
|
14
13
|
|
|
15
|
-
echo """
|
|
16
|
-
#=======================================================================
|
|
14
|
+
echo """#=======================================================================
|
|
17
15
|
đĻ SYSTEM APPLICATIONS | Basic system applications
|
|
18
16
|
#=======================================================================
|
|
19
17
|
|
|
@@ -21,8 +19,7 @@ echo """
|
|
|
21
19
|
# curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps.sh | bash
|
|
22
20
|
"""
|
|
23
21
|
|
|
24
|
-
echo """
|
|
25
|
-
#=======================================================================
|
|
22
|
+
echo """#=======================================================================
|
|
26
23
|
đ PYTHON ENVIRONMENT | Virtual environment setup
|
|
27
24
|
#=======================================================================
|
|
28
25
|
|
|
@@ -30,8 +27,7 @@ Setting up Python virtual environment...
|
|
|
30
27
|
"""
|
|
31
28
|
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/ve.sh | bash
|
|
32
29
|
|
|
33
|
-
echo """
|
|
34
|
-
#=======================================================================
|
|
30
|
+
echo """#=======================================================================
|
|
35
31
|
đ CODE REPOSITORIES | Cloning project repositories
|
|
36
32
|
#=======================================================================
|
|
37
33
|
|
|
@@ -39,8 +35,7 @@ Setting up code repositories...
|
|
|
39
35
|
"""
|
|
40
36
|
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/repos.sh | bash
|
|
41
37
|
|
|
42
|
-
echo """
|
|
43
|
-
#=======================================================================
|
|
38
|
+
echo """#=======================================================================
|
|
44
39
|
âī¸ DEVELOPMENT TOOLS | Developer applications
|
|
45
40
|
#=======================================================================
|
|
46
41
|
|