machineconfig 2.0__py3-none-any.whl → 2.1__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.

Files changed (235) hide show
  1. machineconfig/cluster/cloud_manager.py +0 -3
  2. machineconfig/cluster/data_transfer.py +0 -1
  3. machineconfig/cluster/file_manager.py +0 -1
  4. machineconfig/cluster/job_params.py +0 -3
  5. machineconfig/cluster/loader_runner.py +0 -3
  6. machineconfig/cluster/remote_machine.py +0 -1
  7. machineconfig/cluster/script_notify_upon_completion.py +0 -1
  8. machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +3 -5
  9. machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
  10. machineconfig/cluster/sessions_managers/enhanced_command_runner.py +17 -57
  11. machineconfig/cluster/sessions_managers/wt_local.py +36 -110
  12. machineconfig/cluster/sessions_managers/wt_local_manager.py +42 -112
  13. machineconfig/cluster/sessions_managers/wt_remote.py +23 -30
  14. machineconfig/cluster/sessions_managers/wt_remote_manager.py +20 -62
  15. machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +10 -15
  16. machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +27 -127
  17. machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +10 -43
  18. machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +22 -101
  19. machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +11 -39
  20. machineconfig/cluster/sessions_managers/zellij_local.py +49 -102
  21. machineconfig/cluster/sessions_managers/zellij_local_manager.py +34 -78
  22. machineconfig/cluster/sessions_managers/zellij_remote.py +17 -24
  23. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +7 -13
  24. machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -2
  25. machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +6 -6
  26. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +18 -88
  27. machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +2 -6
  28. machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +12 -40
  29. machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -2
  30. machineconfig/cluster/templates/cli_click.py +0 -1
  31. machineconfig/cluster/templates/cli_gooey.py +0 -2
  32. machineconfig/cluster/templates/cli_trogon.py +0 -1
  33. machineconfig/cluster/templates/run_cloud.py +0 -1
  34. machineconfig/cluster/templates/run_cluster.py +0 -1
  35. machineconfig/cluster/templates/run_remote.py +0 -1
  36. machineconfig/cluster/templates/utils.py +26 -10
  37. machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
  38. machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
  39. machineconfig/jobs/python/check_installations.py +1 -0
  40. machineconfig/jobs/python/create_bootable_media.py +0 -2
  41. machineconfig/jobs/python/python_ve_symlink.py +9 -11
  42. machineconfig/jobs/python/tasks.py +0 -1
  43. machineconfig/jobs/python/vscode/api.py +5 -5
  44. machineconfig/jobs/python/vscode/link_ve.py +13 -14
  45. machineconfig/jobs/python/vscode/select_interpreter.py +21 -22
  46. machineconfig/jobs/python/vscode/sync_code.py +9 -13
  47. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  48. machineconfig/jobs/python_custom_installers/archive/ngrok.py +13 -13
  49. machineconfig/jobs/python_custom_installers/dev/aider.py +7 -15
  50. machineconfig/jobs/python_custom_installers/dev/alacritty.py +9 -18
  51. machineconfig/jobs/python_custom_installers/dev/brave.py +10 -19
  52. machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +8 -15
  53. machineconfig/jobs/python_custom_installers/dev/code.py +14 -21
  54. machineconfig/jobs/python_custom_installers/dev/cursor.py +3 -14
  55. machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +8 -7
  56. machineconfig/jobs/python_custom_installers/dev/espanso.py +15 -19
  57. machineconfig/jobs/python_custom_installers/dev/goes.py +5 -12
  58. machineconfig/jobs/python_custom_installers/dev/lvim.py +9 -17
  59. machineconfig/jobs/python_custom_installers/dev/nerdfont.py +12 -19
  60. machineconfig/jobs/python_custom_installers/dev/redis.py +12 -20
  61. machineconfig/jobs/python_custom_installers/dev/wezterm.py +12 -19
  62. machineconfig/jobs/python_custom_installers/dev/winget.py +5 -23
  63. machineconfig/jobs/python_custom_installers/docker.py +12 -21
  64. machineconfig/jobs/python_custom_installers/gh.py +11 -19
  65. machineconfig/jobs/python_custom_installers/hx.py +32 -16
  66. machineconfig/jobs/python_custom_installers/warp-cli.py +12 -20
  67. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  68. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  69. machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
  70. machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
  71. machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
  72. machineconfig/jobs/windows/start_terminal.ps1 +1 -1
  73. machineconfig/profile/create.py +29 -22
  74. machineconfig/profile/create_hardlinks.py +26 -19
  75. machineconfig/profile/shell.py +51 -28
  76. machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  77. machineconfig/scripts/cloud/init.sh +2 -2
  78. machineconfig/scripts/linux/checkout_versions +1 -1
  79. machineconfig/scripts/linux/choose_wezterm_theme +1 -1
  80. machineconfig/scripts/linux/cloud_copy +1 -1
  81. machineconfig/scripts/linux/cloud_manager +1 -1
  82. machineconfig/scripts/linux/cloud_mount +1 -1
  83. machineconfig/scripts/linux/cloud_repo_sync +1 -1
  84. machineconfig/scripts/linux/cloud_sync +1 -1
  85. machineconfig/scripts/linux/croshell +1 -1
  86. machineconfig/scripts/linux/devops +4 -6
  87. machineconfig/scripts/linux/fire +1 -1
  88. machineconfig/scripts/linux/fire_agents +3 -2
  89. machineconfig/scripts/linux/ftpx +1 -1
  90. machineconfig/scripts/linux/gh_models +1 -1
  91. machineconfig/scripts/linux/kill_process +1 -1
  92. machineconfig/scripts/linux/mcinit +1 -1
  93. machineconfig/scripts/linux/repos +1 -1
  94. machineconfig/scripts/linux/scheduler +1 -1
  95. machineconfig/scripts/linux/start_slidev +1 -1
  96. machineconfig/scripts/linux/start_terminals +1 -1
  97. machineconfig/scripts/linux/url2md +1 -1
  98. machineconfig/scripts/linux/warp-cli.sh +122 -0
  99. machineconfig/scripts/linux/wifi_conn +1 -1
  100. machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
  101. machineconfig/scripts/python/__pycache__/croshell.cpython-313.pyc +0 -0
  102. machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
  103. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
  104. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
  105. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
  106. machineconfig/scripts/python/ai/__init__.py +0 -0
  107. machineconfig/scripts/python/ai/__pycache__/__init__.cpython-313.pyc +0 -0
  108. machineconfig/scripts/python/ai/__pycache__/generate_files.cpython-313.pyc +0 -0
  109. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-313.pyc +0 -0
  110. machineconfig/scripts/python/ai/generate_files.py +84 -0
  111. machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +2 -2
  112. machineconfig/scripts/python/ai/mcinit.py +7 -3
  113. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +10 -5
  114. machineconfig/scripts/python/cloud_copy.py +1 -1
  115. machineconfig/scripts/python/cloud_mount.py +1 -1
  116. machineconfig/scripts/python/cloud_repo_sync.py +4 -4
  117. machineconfig/scripts/python/croshell.py +5 -3
  118. machineconfig/scripts/python/devops_add_identity.py +1 -1
  119. machineconfig/scripts/python/devops_add_ssh_key.py +1 -1
  120. machineconfig/scripts/python/devops_backup_retrieve.py +1 -1
  121. machineconfig/scripts/python/devops_update_repos.py +140 -52
  122. machineconfig/scripts/python/dotfile.py +1 -1
  123. machineconfig/scripts/python/fire_agents.py +28 -9
  124. machineconfig/scripts/python/fire_jobs.py +3 -4
  125. machineconfig/scripts/python/ftpx.py +2 -1
  126. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
  127. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
  128. machineconfig/scripts/python/helpers/helpers2.py +2 -2
  129. machineconfig/scripts/python/helpers/helpers4.py +1 -2
  130. machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
  131. machineconfig/scripts/python/mount_nfs.py +1 -1
  132. machineconfig/scripts/python/mount_ssh.py +1 -1
  133. machineconfig/scripts/python/repos.py +1 -1
  134. machineconfig/scripts/python/start_slidev.py +1 -1
  135. machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
  136. machineconfig/scripts/windows/checkout_version.ps1 +1 -3
  137. machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
  138. machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
  139. machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
  140. machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
  141. machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
  142. machineconfig/scripts/windows/croshell.ps1 +2 -2
  143. machineconfig/scripts/windows/devops.ps1 +1 -4
  144. machineconfig/scripts/windows/dotfile.ps1 +1 -3
  145. machineconfig/scripts/windows/fire.ps1 +1 -1
  146. machineconfig/scripts/windows/ftpx.ps1 +2 -2
  147. machineconfig/scripts/windows/gpt.ps1 +1 -1
  148. machineconfig/scripts/windows/kill_process.ps1 +1 -2
  149. machineconfig/scripts/windows/mcinit.ps1 +1 -1
  150. machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
  151. machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
  152. machineconfig/scripts/windows/pomodoro.ps1 +1 -1
  153. machineconfig/scripts/windows/py2exe.ps1 +1 -3
  154. machineconfig/scripts/windows/repos.ps1 +1 -1
  155. machineconfig/scripts/windows/scheduler.ps1 +1 -1
  156. machineconfig/scripts/windows/snapshot.ps1 +2 -2
  157. machineconfig/scripts/windows/start_slidev.ps1 +1 -1
  158. machineconfig/scripts/windows/start_terminals.ps1 +1 -1
  159. machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
  160. machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
  161. machineconfig/settings/lf/linux/lfrc +1 -1
  162. machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
  163. machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
  164. machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
  165. machineconfig/settings/svim/linux/init.toml +1 -1
  166. machineconfig/settings/svim/windows/init.toml +1 -1
  167. machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -54
  168. machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
  169. machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
  170. machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
  171. machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
  172. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
  173. machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
  174. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +66 -12
  175. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +44 -36
  176. machineconfig/utils/ai/generate_file_checklist.py +8 -10
  177. machineconfig/utils/ai/url2md.py +4 -2
  178. machineconfig/utils/cloud/onedrive/setup_oauth.py +1 -0
  179. machineconfig/utils/cloud/onedrive/transaction.py +63 -98
  180. machineconfig/utils/code.py +60 -39
  181. machineconfig/utils/installer.py +27 -33
  182. machineconfig/utils/installer_utils/installer_abc.py +8 -7
  183. machineconfig/utils/installer_utils/installer_class.py +149 -70
  184. machineconfig/utils/links.py +22 -11
  185. machineconfig/utils/notifications.py +197 -0
  186. machineconfig/utils/options.py +29 -23
  187. machineconfig/utils/path.py +13 -6
  188. machineconfig/utils/path_reduced.py +485 -216
  189. machineconfig/utils/procs.py +47 -41
  190. machineconfig/utils/scheduling.py +0 -1
  191. machineconfig/utils/ssh.py +157 -76
  192. machineconfig/utils/terminal.py +82 -37
  193. machineconfig/utils/utils.py +12 -10
  194. machineconfig/utils/utils2.py +38 -48
  195. machineconfig/utils/utils5.py +183 -116
  196. machineconfig/utils/ve.py +9 -4
  197. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/METADATA +3 -2
  198. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/RECORD +200 -217
  199. machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
  200. machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
  201. machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
  202. machineconfig/jobs/python/archive/python_tools.txt +0 -12
  203. machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
  204. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  205. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  206. machineconfig/jobs/python_generic_installers/update.py +0 -3
  207. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  208. machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
  209. machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
  210. machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
  211. machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  212. machineconfig/scripts/linux/activate_ve +0 -87
  213. machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
  214. machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
  215. machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
  216. machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
  217. machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
  218. machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
  219. machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
  220. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
  221. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
  222. machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
  223. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
  224. machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
  225. machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
  226. machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
  227. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
  228. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
  229. machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
  230. machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
  231. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
  232. machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
  233. machineconfig/scripts/windows/activate_ve.ps1 +0 -54
  234. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/WHEEL +0 -0
  235. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,3 @@
1
-
2
1
  # """
3
2
  # This module contains utility functions for the cluster module.
4
3
  # """
@@ -8,7 +7,7 @@
8
7
 
9
8
  # from machineconfig.cluster.remote_machine import WorkloadParams
10
9
  from typing import Optional
11
- from machineconfig.utils.path_reduced import P, PLike
10
+ from machineconfig.utils.path_reduced import PathExtended, PLike
12
11
 
13
12
  # def expensive_function(workload_params: WorkloadParams, sim_dict: Optional[dict[str, Any]] = None) -> P:
14
13
  # import time
@@ -38,12 +37,25 @@ from machineconfig.utils.path_reduced import P, PLike
38
37
  # return True
39
38
 
40
39
 
41
- def to_cloud(localpath: PLike, cloud: str, remotepath: Optional[PLike], zip: bool = False, encrypt: bool = False,
42
- key: Optional[bytes] = None, pwd: Optional[str] = None, rel2home: bool = False, strict: bool = True,
43
- # obfuscate: bool = False,
44
- share: bool = False, verbose: bool = True, os_specific: bool = False, transfers: int = 10, root: Optional[str] = "myhome") -> 'P':
40
+ def to_cloud(
41
+ localpath: PLike,
42
+ cloud: str,
43
+ remotepath: Optional[PLike],
44
+ zip: bool = False,
45
+ encrypt: bool = False,
46
+ key: Optional[bytes] = None,
47
+ pwd: Optional[str] = None,
48
+ rel2home: bool = False,
49
+ strict: bool = True,
50
+ # obfuscate: bool = False,
51
+ share: bool = False,
52
+ verbose: bool = True,
53
+ os_specific: bool = False,
54
+ transfers: int = 10,
55
+ root: Optional[str] = "myhome",
56
+ ) -> "PathExtended":
45
57
  to_del = []
46
- localpath = P(localpath).expanduser().absolute() if not P(localpath).exists() else P(localpath)
58
+ localpath = PathExtended(localpath).expanduser().absolute() if not PathExtended(localpath).exists() else PathExtended(localpath)
47
59
  if zip:
48
60
  localpath = localpath.zip(inplace=False)
49
61
  to_del.append(localpath)
@@ -52,19 +64,23 @@ def to_cloud(localpath: PLike, cloud: str, remotepath: Optional[PLike], zip: boo
52
64
  to_del.append(localpath)
53
65
  if remotepath is None:
54
66
  rp = localpath.get_remote_path(root=root, os_specific=os_specific, rel2home=rel2home, strict=strict) # if rel2home else (P(root) / localpath if root is not None else localpath)
55
- else: rp = P(remotepath)
67
+ else:
68
+ rp = PathExtended(remotepath)
56
69
 
57
70
  from rclone_python import rclone
71
+
58
72
  rclone.copy(localpath.as_posix(), f"{cloud}:{rp.as_posix()}", show_progress=True)
59
73
 
60
74
  if share:
61
- if verbose: print("🔗 SHARING FILE")
75
+ if verbose:
76
+ print("🔗 SHARING FILE")
62
77
  tmp = rclone.link(f"{cloud}:{rp.as_posix()}")
63
- return P(tmp)
78
+ return PathExtended(tmp)
64
79
  return localpath
65
80
 
66
81
 
67
82
  if __name__ == "__main__":
68
83
  from pathlib import Path
84
+
69
85
  localpath = Path.home().joinpath("Downloads", "exchangeInfo")
70
86
  to_cloud(localpath, "odp", remotepath=None)
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+
4
+ npm install -g @google/gemini-cli
5
+ npm install -g @charmland/crush
6
+ npm install -g opencode-ai@latest
7
+
8
+ curl https://cursor.com/install -fsS | bash
9
+
10
+ cd $HOME/Downloads
11
+ curl --proto '=https' --tlsv1.2 -sSf "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip" -o "q.zip"
12
+ unzip q.zip
13
+ ./q/install.sh # goes to ~/.local/bin.
14
+ rm q.zip
15
+ rm -rfd q
16
+
@@ -4,6 +4,7 @@
4
4
 
5
5
  # import time
6
6
  import platform
7
+
7
8
  # from typing import Any
8
9
  # from rich.console import Console
9
10
  # from machineconfig.utils.utils2 import pprint
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  # try ventory or netboot.xyz
4
2
 
5
3
  # # one can either install rufus: https://rufus.ie/en/
@@ -1,31 +1,29 @@
1
- """Symlinks
2
- """
1
+ """Symlinks"""
3
2
 
4
- from machineconfig.utils.path_reduced import P as PathExtended
3
+ from machineconfig.utils.path_reduced import PathExtended as PathExtended
5
4
  # from machineconfig.utils.utils import display_options
6
5
 
7
6
 
8
7
  def main():
9
8
  print(f"""
10
- {'=' * 150}
9
+ {"=" * 150}
11
10
  🔗 SYMLINK CREATOR | Create symlinks for virtual environments
12
- {'=' * 150}
11
+ {"=" * 150}
13
12
  """)
14
13
  target = PathExtended(input("đŸŽ¯ Symlink to which target? ")).expanduser().absolute()
15
14
  source = input(f"📍 Symlink from which source? [default to: CWD/{target.name}] ") or PathExtended.cwd().joinpath(target.name)
16
- if isinstance(source, str): source = PathExtended(source).expanduser().absolute()
17
- # ve_path = display_options(msg="symlin link? ", options=PathExtended.home().joinpath("ve").starget.symlink_to; PathExtended(r'$pwd').joinpath('venv').symlink_to(r'$to'); PathExtended('.gitignore').modify_text('venv', 'venv', replace_line=True)"(target.symlink_to(
18
- # PathExtended('.gitignore').modify_text('venv', 'venv', replace_line=True)"
15
+ if isinstance(source, str):
16
+ source = PathExtended(source).expanduser().absolute()
19
17
  source.symlink_to(target, overwrite=True)
20
18
  print(f"""
21
- {'=' * 150}
19
+ {"=" * 150}
22
20
  ✅ SUCCESS | Symlink created successfully
23
21
  📍 Source: {source}
24
22
  đŸŽ¯ Target: {target}
25
- {'=' * 150}
23
+ {"=" * 150}
26
24
  """)
27
25
  return "echo '🔗 Finished creating symlink.'"
28
26
 
29
27
 
30
- if __name__ == '__main__':
28
+ if __name__ == "__main__":
31
29
  pass
@@ -1,4 +1,3 @@
1
-
2
1
  from machineconfig.scripts.python.devops_backup_retrieve import main_backup_retrieve
3
2
 
4
3
  program = main_backup_retrieve(direction="BACKUP", which="all")
@@ -4,6 +4,7 @@ from machineconfig.utils.utils2 import randstr
4
4
 
5
5
  def open_file_in_new_instance(file_path: str):
6
6
  import git
7
+
7
8
  repo = git.Repo(search_parent_directories=True)
8
9
  repo_path = repo.working_tree_dir
9
10
  # Ensure repo_path is not None before passing to Path
@@ -19,13 +20,10 @@ code --profile bitProfile --new-window {file_path}
19
20
  from rich.console import Console
20
21
  from rich.syntax import Syntax
21
22
  from rich.panel import Panel
23
+
22
24
  console = Console()
23
25
  console.print(f"\n{'=' * 150}")
24
- console.print(Panel(
25
- Syntax(code, lexer="bash"),
26
- title="🔍 VS CODE API | Opening file in new instance",
27
- subtitle=f"📂 {file_path}"
28
- ), style="bold blue")
26
+ console.print(Panel(Syntax(code, lexer="bash"), title="🔍 VS CODE API | Opening file in new instance", subtitle=f"📂 {file_path}"), style="bold blue")
29
27
  console.print(f"{'=' * 150}\n")
30
28
 
31
29
  code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
@@ -33,11 +31,13 @@ code --profile bitProfile --new-window {file_path}
33
31
  code_path.write_text(code, encoding="utf-8")
34
32
  code_path.chmod(0o755)
35
33
  import subprocess
34
+
36
35
  subprocess.run([str(code_path)], shell=True, check=True)
37
36
 
38
37
 
39
38
  def main():
40
39
  import argparse
40
+
41
41
  parser = argparse.ArgumentParser(description="Open file in new vscode instance")
42
42
  parser.add_argument("file_path", type=str, help="Path to the file to open")
43
43
  args = parser.parse_args()
@@ -1,5 +1,4 @@
1
- """VScode task to set interpreter
2
- """
1
+ """VScode task to set interpreter"""
3
2
 
4
3
  # import os
5
4
  # import json
@@ -10,51 +9,51 @@ import argparse
10
9
 
11
10
  def select_interpreter(workspace_root: str):
12
11
  print(f"""
13
- {'=' * 150}
12
+ {"=" * 150}
14
13
  🔗 VSCODE VE LINKER | Linking virtual environment for VS Code
15
14
  📂 Workspace: {workspace_root}
16
- {'=' * 150}
15
+ {"=" * 150}
17
16
  """)
18
17
 
19
- path = Path(workspace_root).joinpath('.ve_path')
18
+ path = Path(workspace_root).joinpath(".ve_path")
20
19
 
21
20
  if not path.exists():
22
21
  print(f"""
23
- {'âš ī¸' * 20}
22
+ {"âš ī¸" * 20}
24
23
  ❌ ERROR | Could not find .ve_path file in workspace
25
24
  📂 Expected at: {path}
26
- {'âš ī¸' * 20}
25
+ {"âš ī¸" * 20}
27
26
  """)
28
27
  return
29
28
 
30
- with open(path, 'r', encoding='utf-8') as f:
29
+ with open(path, "r", encoding="utf-8") as f:
31
30
  ve_path = Path(f.read().strip()).expanduser()
32
31
 
33
32
  venv_link = Path(workspace_root).joinpath(".venv")
34
33
 
35
34
  if venv_link.exists() and not venv_link.is_symlink():
36
35
  print(f"""
37
- {'âš ī¸' * 20}
36
+ {"âš ī¸" * 20}
38
37
  ❌ ERROR | .venv already exists and is not a symlink
39
38
  📂 Path: {venv_link}
40
- {'âš ī¸' * 20}
39
+ {"âš ī¸" * 20}
41
40
  """)
42
41
  return
43
42
 
44
43
  venv_link.symlink_to(target=ve_path.expanduser().absolute())
45
44
 
46
45
  print(f"""
47
- {'=' * 150}
46
+ {"=" * 150}
48
47
  ✅ SUCCESS | Virtual environment linked successfully
49
48
  🔗 Link: {venv_link}
50
49
  đŸŽ¯ Target: {ve_path.expanduser().absolute()}
51
- {'=' * 150}
50
+ {"=" * 150}
52
51
  """)
53
52
 
54
53
 
55
54
  def main():
56
- parser = argparse.ArgumentParser(description='Link ve from repo to ve location.')
57
- parser.add_argument('workspace_path', type=str, help='The workspace path')
55
+ parser = argparse.ArgumentParser(description="Link ve from repo to ve location.")
56
+ parser.add_argument("workspace_path", type=str, help="The workspace path")
58
57
 
59
58
  args = parser.parse_args()
60
59
  select_interpreter(args.workspace_path)
@@ -1,5 +1,4 @@
1
- """VScode task to set interpreter
2
- """
1
+ """VScode task to set interpreter"""
3
2
 
4
3
  # import os
5
4
  # import json
@@ -12,39 +11,39 @@ import platform
12
11
 
13
12
  def select_interpreter(workspace_root: str):
14
13
  print(f"""
15
- {'=' * 150}
14
+ {"=" * 150}
16
15
  🐍 PYTHON INTERPRETER | Setting up VS Code Python interpreter
17
16
  📂 Workspace: {workspace_root}
18
- {'=' * 150}
17
+ {"=" * 150}
19
18
  """)
20
19
 
21
- path = Path(workspace_root).joinpath('.ve_path')
20
+ path = Path(workspace_root).joinpath(".ve_path")
22
21
  if not path.exists():
23
22
  print(f"""
24
- {'âš ī¸' * 20}
23
+ {"âš ī¸" * 20}
25
24
  ❌ ERROR | Could not find .ve_path file in workspace
26
25
  📂 Expected at: {path}
27
- {'âš ī¸' * 20}
26
+ {"âš ī¸" * 20}
28
27
  """)
29
28
  return
30
29
 
31
- with open(path, 'r', encoding='utf-8') as f:
30
+ with open(path, "r", encoding="utf-8") as f:
32
31
  python_path = Path(f.read().strip()).expanduser()
33
32
 
34
33
  print(f"📁 Virtual environment path: {python_path}")
35
34
 
36
- if platform.system() == 'Windows':
37
- python_path = python_path.joinpath('Scripts', 'python.exe')
38
- elif platform.system() == 'Linux':
39
- python_path = python_path.joinpath('bin', 'python')
40
- elif platform.system() == 'Darwin':
41
- python_path = python_path.joinpath('bin', 'python')
35
+ if platform.system() == "Windows":
36
+ python_path = python_path.joinpath("Scripts", "python.exe")
37
+ elif platform.system() == "Linux":
38
+ python_path = python_path.joinpath("bin", "python")
39
+ elif platform.system() == "Darwin":
40
+ python_path = python_path.joinpath("bin", "python")
42
41
  else:
43
42
  error_msg = f"Unsupported platform: {platform.system()}"
44
43
  print(f"""
45
- {'âš ī¸' * 20}
44
+ {"âš ī¸" * 20}
46
45
  ❌ ERROR | {error_msg}
47
- {'âš ī¸' * 20}
46
+ {"âš ī¸" * 20}
48
47
  """)
49
48
  raise NotImplementedError(error_msg)
50
49
 
@@ -53,7 +52,7 @@ def select_interpreter(workspace_root: str):
53
52
  # tmp = os.getenv('APPDATA')
54
53
  # assert tmp is not None
55
54
  # settings_path = Path(tmp).joinpath('Code', 'User', 'settings.json')
56
- work_space_settings = Path(workspace_root).joinpath('.vscode', 'settings.json')
55
+ work_space_settings = Path(workspace_root).joinpath(".vscode", "settings.json")
57
56
  work_space_settings.parent.mkdir(parents=True, exist_ok=True)
58
57
  if not work_space_settings.exists():
59
58
  print(f"📄 Creating new settings file: {work_space_settings}")
@@ -64,21 +63,21 @@ def select_interpreter(workspace_root: str):
64
63
  print(f"📄 Updating existing settings file: {work_space_settings}")
65
64
 
66
65
  settings = read_json(work_space_settings)
67
- settings['python.defaultInterpreterPath'] = str(python_path)
66
+ settings["python.defaultInterpreterPath"] = str(python_path)
68
67
  save_json(obj=settings, path=str(work_space_settings), indent=4)
69
68
 
70
69
  print(f"""
71
- {'=' * 150}
70
+ {"=" * 150}
72
71
  ✅ SUCCESS | Python interpreter configured successfully
73
72
  🐍 Interpreter: {python_path}
74
73
  📄 Settings: {work_space_settings}
75
- {'=' * 150}
74
+ {"=" * 150}
76
75
  """)
77
76
 
78
77
 
79
78
  def main():
80
- parser = argparse.ArgumentParser(description='Set Python Interpretor in VSCode settings.')
81
- parser.add_argument('workspace_path', type=str, help='The workspace path')
79
+ parser = argparse.ArgumentParser(description="Set Python Interpretor in VSCode settings.")
80
+ parser.add_argument("workspace_path", type=str, help="The workspace path")
82
81
 
83
82
  args = parser.parse_args()
84
83
  select_interpreter(args.workspace_path)
@@ -7,10 +7,10 @@ config = read_ini(Path.home().joinpath(".ssh", "config"))
7
7
 
8
8
  def sync_remote(machine_name: str):
9
9
  print(f"""
10
- {'=' * 150}
10
+ {"=" * 150}
11
11
  🔄 SYNC REMOTE | Initiating remote code synchronization
12
12
  đŸ–Ĩī¸ Target machine: {machine_name}
13
- {'=' * 150}
13
+ {"=" * 150}
14
14
  """)
15
15
 
16
16
  # Handle config as a ConfigParser object
@@ -21,15 +21,15 @@ def sync_remote(machine_name: str):
21
21
  if machine_config is None:
22
22
  error_msg = f"Machine {machine_name} not found in SSH config."
23
23
  print(f"""
24
- {'âš ī¸' * 20}
24
+ {"âš ī¸" * 20}
25
25
  ❌ ERROR | {error_msg}
26
- {'âš ī¸' * 20}
26
+ {"âš ī¸" * 20}
27
27
  """)
28
28
  raise ValueError(error_msg)
29
29
 
30
30
  # this is template: code = """ssh -o "HostName=zgeby8zhe6ipftpad.alexsaffar.com" -o "User=alex" -o "ProxyCommand=cloudflared access ssh --hostname %h" -o "Port=443" -o "RequestTTY=yes" -o "RemoteCommand=bash ~/scripts/z_ls --attach; bash" tpadCF"""
31
31
  code = f"""
32
- ssh -o "HostName={machine_config['HostName']}" -o "User={machine_config['User']}" -o "ProxyCommand=cloudflared access ssh --hostname %h" -o "Port={machine_config['Port']}" -o "RequestTTY=yes" -o "RemoteCommand=devops --which update; bash" {machine_name}
32
+ ssh -o "HostName={machine_config["HostName"]}" -o "User={machine_config["User"]}" -o "ProxyCommand=cloudflared access ssh --hostname %h" -o "Port={machine_config["Port"]}" -o "RequestTTY=yes" -o "RemoteCommand=devops --which update; bash" {machine_name}
33
33
  """
34
34
  from rich.console import Console
35
35
  from rich.syntax import Syntax
@@ -37,11 +37,7 @@ ssh -o "HostName={machine_config['HostName']}" -o "User={machine_config['User']}
37
37
 
38
38
  console = Console()
39
39
  console.print(f"\n{'=' * 150}")
40
- console.print(Panel(
41
- Syntax(code, lexer="bash"),
42
- title=f"🔄 SYNC COMMAND | Connecting to {machine_name}",
43
- subtitle=f"🌐 Host: {machine_config['HostName']}"
44
- ), style="bold blue")
40
+ console.print(Panel(Syntax(code, lexer="bash"), title=f"🔄 SYNC COMMAND | Connecting to {machine_name}", subtitle=f"🌐 Host: {machine_config['HostName']}"), style="bold blue")
45
41
  console.print(f"{'=' * 150}\n")
46
42
 
47
43
  code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
@@ -52,12 +48,12 @@ ssh -o "HostName={machine_config['HostName']}" -o "User={machine_config['User']}
52
48
  print(f"🚀 Executing sync command for {machine_name}...")
53
49
 
54
50
  import subprocess
51
+
55
52
  subprocess.run([str(code_path)], shell=True, check=True)
56
53
 
57
54
  print(f"""
58
- {'=' * 150}
55
+ {"=" * 150}
59
56
  ✅ SUCCESS | Remote sync completed successfully
60
57
  đŸ–Ĩī¸ Machine: {machine_name}
61
- {'=' * 150}
58
+ {"=" * 150}
62
59
  """)
63
-
@@ -8,21 +8,21 @@ from typing import Optional
8
8
 
9
9
 
10
10
  config_dict = {
11
- "repo_url": "CUSTOM",
12
- "doc": "ngrok secure introspectable tunnels to localhost",
13
- "filename_template_windows_amd_64": "ngrok-stable-windows-amd64.zip",
14
- "filename_template_linux_amd_64": "ngrok-stable-linux-amd64.zip",
15
- "strip_v": False,
16
- "exe_name": "ngrok"
17
- }
11
+ "repo_url": "CUSTOM",
12
+ "doc": "ngrok secure introspectable tunnels to localhost",
13
+ "filename_template_windows_amd_64": "ngrok-stable-windows-amd64.zip",
14
+ "filename_template_linux_amd_64": "ngrok-stable-linux-amd64.zip",
15
+ "strip_v": False,
16
+ "exe_name": "ngrok",
17
+ }
18
18
 
19
19
 
20
20
  def main(version: Optional[str]):
21
21
  print(f"""
22
- {'=' * 150}
22
+ {"=" * 150}
23
23
  🔄 NGROK INSTALLER | Setting up secure tunnels to localhost
24
24
  đŸ’ģ Platform: {platform.system()}
25
- {'=' * 150}
25
+ {"=" * 150}
26
26
  """)
27
27
 
28
28
  _ = version
@@ -43,17 +43,17 @@ sudo nala update && sudo nala install ngrok
43
43
  else:
44
44
  error_msg = f"Unsupported platform: {platform.system()}"
45
45
  print(f"""
46
- {'âš ī¸' * 20}
46
+ {"âš ī¸" * 20}
47
47
  ❌ ERROR | {error_msg}
48
- {'âš ī¸' * 20}
48
+ {"âš ī¸" * 20}
49
49
  """)
50
50
  raise NotImplementedError(error_msg)
51
51
 
52
52
  print(f"""
53
- {'=' * 150}
53
+ {"=" * 150}
54
54
  âš ī¸ SECURITY WARNING | ngrok has been flagged by some antivirus engines
55
55
  đŸ›Ąī¸ Use at your own risk - flagged by 35% of antivirus engines
56
- {'=' * 150}
56
+ {"=" * 150}
57
57
  """)
58
58
  return program
59
59
 
@@ -1,37 +1,29 @@
1
1
  from typing import Optional
2
2
  import platform
3
3
 
4
- config_dict = {
5
- "repo_url": "CUSTOM",
6
- "doc": "Aider Chat",
7
- "filename_template_windows_amd_64": "aider-chat-{}.exe",
8
- "filename_template_linux_amd_64": "aider-chat-{}.deb",
9
- "strip_v": True,
10
- "exe_name": "aider-chat"
11
- }
4
+ config_dict = {"repo_url": "CUSTOM", "doc": "Aider Chat", "filename_template_windows_amd_64": "aider-chat-{}.exe", "filename_template_linux_amd_64": "aider-chat-{}.deb", "strip_v": True, "exe_name": "aider-chat"}
12
5
 
13
6
 
14
7
  def main(version: Optional[str] = None):
15
8
  print(f"""
16
- {'=' * 150}
9
+ {"=" * 150}
17
10
  🤖 AIDER INSTALLER | Installing AI code assistant
18
11
  đŸ’ģ Platform: {platform.system()}
19
- 🔄 Version: {'latest' if version is None else version}
20
- {'=' * 150}
12
+ 🔄 Version: {"latest" if version is None else version}
13
+ {"=" * 150}
21
14
  """)
22
15
 
23
16
  install_script = "uv tool install --force --python python3.12 aider-chat@latest"
24
17
 
25
18
  print(f"""
26
- {'=' * 150}
19
+ {"=" * 150}
27
20
  ✅ SUCCESS | Installation command prepared:
28
21
  📄 Command: {install_script}
29
- {'=' * 150}
22
+ {"=" * 150}
30
23
  """)
31
24
 
32
25
  return install_script
33
26
 
34
27
 
35
- if __name__ == '__main__':
28
+ if __name__ == "__main__":
36
29
  pass
37
-
@@ -1,27 +1,19 @@
1
- """alacritty
2
- """
1
+ """alacritty"""
3
2
 
4
3
  import platform
5
4
  from typing import Optional
6
5
 
7
6
 
8
- config_dict = {
9
- "repo_url": "CUSTOM",
10
- "doc": "Terminal Console",
11
- "filename_template_windows_amd_64": "",
12
- "filename_template_linux_amd_64": "",
13
- "strip_v": False,
14
- "exe_name": "alacritty"
15
- }
7
+ config_dict = {"repo_url": "CUSTOM", "doc": "Terminal Console", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "alacritty"}
16
8
 
17
9
 
18
10
  def main(version: Optional[str]):
19
11
  print(f"""
20
- {'=' * 150}
12
+ {"=" * 150}
21
13
  đŸ–Ĩī¸ ALACRITTY INSTALLER | Installing GPU-accelerated terminal emulator
22
14
  đŸ’ģ Platform: {platform.system()}
23
- 🔄 Version: {'latest' if version is None else version}
24
- {'=' * 150}
15
+ 🔄 Version: {"latest" if version is None else version}
16
+ {"=" * 150}
25
17
  """)
26
18
 
27
19
  _ = version
@@ -48,19 +40,19 @@ git clone https://github.com/alacritty/alacritty-theme ~/.config/alacritty/theme
48
40
  else:
49
41
  error_msg = f"Unsupported platform: {platform.system()}"
50
42
  print(f"""
51
- {'âš ī¸' * 20}
43
+ {"âš ī¸" * 20}
52
44
  ❌ ERROR | {error_msg}
53
- {'âš ī¸' * 20}
45
+ {"âš ī¸" * 20}
54
46
  """)
55
47
  raise NotImplementedError(error_msg)
56
48
 
57
49
  print(f"""
58
- {'=' * 150}
50
+ {"=" * 150}
59
51
  â„šī¸ INFO | Installation will proceed with the following steps:
60
52
  1ī¸âƒŖ Install Alacritty using Cargo
61
53
  2ī¸âƒŖ Create config directories
62
54
  3ī¸âƒŖ Clone theme repository
63
- {'=' * 150}
55
+ {"=" * 150}
64
56
  """)
65
57
 
66
58
  # _res = Terminal(stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).run_script(script=program, shell="default").print(desc="Running custom installer", capture=True)
@@ -70,4 +62,3 @@ git clone https://github.com/alacritty/alacritty-theme ~/.config/alacritty/theme
70
62
 
71
63
  if __name__ == "__main__":
72
64
  pass
73
-
@@ -1,28 +1,19 @@
1
- """brave installer
2
- """
1
+ """brave installer"""
3
2
 
4
3
  import platform
5
4
  from typing import Optional
6
5
 
7
6
 
8
- config_dict = {
9
- "repo_url": "CUSTOM",
10
- "doc": "Chrome with no ads",
11
- "filename_template_windows_amd_64": "",
12
- "filename_template_linux_amd_64": "",
13
- "strip_v": False,
14
- "exe_name": "brave"
15
- }
16
-
7
+ config_dict = {"repo_url": "CUSTOM", "doc": "Chrome with no ads", "filename_template_windows_amd_64": "", "filename_template_linux_amd_64": "", "strip_v": False, "exe_name": "brave"}
17
8
 
18
9
 
19
10
  def main(version: Optional[str]):
20
11
  print(f"""
21
- {'=' * 150}
12
+ {"=" * 150}
22
13
  đŸĻ BRAVE BROWSER | Installing privacy-focused web browser
23
14
  đŸ’ģ Platform: {platform.system()}
24
- 🔄 Version: {'latest' if version is None else version}
25
- {'=' * 150}
15
+ 🔄 Version: {"latest" if version is None else version}
16
+ {"=" * 150}
26
17
  """)
27
18
 
28
19
  _ = version
@@ -38,6 +29,7 @@ winget install --Name "Brave Browser" --Id Brave.Brave --source winget --accept-
38
29
  print(f"🐧 Installing Brave Browser on {system_name}...")
39
30
  import machineconfig.jobs.python_custom_installers as module
40
31
  from pathlib import Path
32
+
41
33
  if platform.system() == "Linux":
42
34
  program = Path(module.__file__).parent.joinpath("scripts/linux/brave.sh").read_text(encoding="utf-8")
43
35
  else: # Darwin/macOS
@@ -45,20 +37,20 @@ winget install --Name "Brave Browser" --Id Brave.Brave --source winget --accept-
45
37
  else:
46
38
  error_msg = f"Unsupported platform: {platform.system()}"
47
39
  print(f"""
48
- {'âš ī¸' * 20}
40
+ {"âš ī¸" * 20}
49
41
  ❌ ERROR | {error_msg}
50
- {'âš ī¸' * 20}
42
+ {"âš ī¸" * 20}
51
43
  """)
52
44
  raise NotImplementedError(error_msg)
53
45
 
54
46
  print(f"""
55
- {'=' * 150}
47
+ {"=" * 150}
56
48
  â„šī¸ INFO | Brave Browser features:
57
49
  🔒 Built-in ad blocking
58
50
  đŸ›Ąī¸ Privacy-focused browsing
59
51
  💨 Faster page loading
60
52
  đŸĒ™ Optional crypto rewards
61
- {'=' * 150}
53
+ {"=" * 150}
62
54
  """)
63
55
 
64
56
  # _res = Terminal(stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE).run_script(script=program, shell="default").print(desc="Running custom installer", capture=True)
@@ -68,4 +60,3 @@ winget install --Name "Brave Browser" --Id Brave.Brave --source winget --accept-
68
60
 
69
61
  if __name__ == "__main__":
70
62
  pass
71
-