machineconfig 1.5__py3-none-any.whl → 1.8__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/__init__.py +8 -5
- machineconfig/jobs/python/check_installations.py +173 -163
- machineconfig/jobs/python/checkout_version.py +117 -0
- machineconfig/jobs/python/create_bootable_media.py +14 -14
- machineconfig/jobs/python/create_zellij_template.py +59 -56
- machineconfig/jobs/python/python_cargo_build_share.py +50 -45
- machineconfig/jobs/python/python_ve_symlink.py +20 -18
- machineconfig/jobs/python/tasks.py +4 -0
- machineconfig/jobs/script_installer/azure_data_studio.py +22 -0
- machineconfig/jobs/script_installer/bypass_paywall.py +23 -0
- machineconfig/jobs/script_installer/code.py +34 -0
- machineconfig/jobs/script_installer/docker_desktop.py +41 -0
- machineconfig/jobs/script_installer/ngrok.py +29 -0
- machineconfig/jobs/{python_linux_installers → script_installer}/skim.py +21 -19
- machineconfig/jobs/script_installer/wezterm.py +34 -0
- machineconfig/profile/create.py +107 -200
- machineconfig/profile/shell.py +127 -0
- machineconfig/scripts/__init__.py +6 -6
- machineconfig/scripts/python/cloud_copy.py +93 -0
- machineconfig/scripts/python/cloud_manager.py +38 -0
- machineconfig/scripts/python/cloud_mount.py +115 -52
- machineconfig/scripts/python/cloud_repo_sync.py +154 -114
- machineconfig/scripts/python/cloud_sync.py +261 -79
- machineconfig/scripts/python/croshell.py +151 -0
- machineconfig/scripts/python/devops.py +119 -87
- machineconfig/scripts/python/devops_add_identity.py +27 -23
- machineconfig/scripts/python/devops_add_ssh_key.py +70 -55
- machineconfig/scripts/python/devops_backup_retrieve.py +52 -46
- machineconfig/scripts/python/devops_devapps_install.py +120 -91
- machineconfig/scripts/python/devops_update_repos.py +82 -68
- machineconfig/scripts/python/dotfile.py +42 -38
- machineconfig/scripts/python/fire_jobs.py +351 -98
- machineconfig/scripts/python/ftpx.py +82 -0
- machineconfig/scripts/python/mount_nfs.py +54 -3
- machineconfig/scripts/python/mount_nw_drive.py +31 -0
- machineconfig/scripts/python/mount_ssh.py +44 -20
- machineconfig/scripts/python/onetimeshare.py +60 -51
- machineconfig/scripts/python/pomodoro.py +41 -37
- machineconfig/scripts/python/repos.py +195 -128
- machineconfig/scripts/python/scheduler.py +52 -0
- machineconfig/scripts/python/snapshot.py +21 -21
- machineconfig/scripts/python/start_slidev.py +104 -0
- machineconfig/scripts/python/start_terminals.py +97 -0
- machineconfig/scripts/python/wifi_conn.py +90 -71
- machineconfig/scripts/python/{transfer_wsl_win.py → wsl_windows_transfer.py} +47 -39
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +44 -48
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +136 -130
- machineconfig/utils/installer.py +251 -0
- machineconfig/utils/procs.py +114 -64
- machineconfig/utils/scheduling.py +188 -0
- machineconfig/utils/utils.py +353 -249
- machineconfig/utils/ve.py +222 -0
- {machineconfig-1.5.dist-info → machineconfig-1.8.dist-info}/METADATA +140 -110
- machineconfig-1.8.dist-info/RECORD +70 -0
- {machineconfig-1.5.dist-info → machineconfig-1.8.dist-info}/WHEEL +1 -1
- machineconfig/jobs/python/python_linux_installers_all.py +0 -73
- machineconfig/jobs/python/python_ve_installer.py +0 -73
- machineconfig/jobs/python/python_windows_installers_all.py +0 -23
- machineconfig/jobs/python_generic_installers/archive/nvim.py +0 -15
- machineconfig/jobs/python_generic_installers/archive/strongbox.py +0 -32
- machineconfig/jobs/python_generic_installers/archive/vtm.py +0 -25
- machineconfig/jobs/python_generic_installers/broot.py +0 -39
- machineconfig/jobs/python_generic_installers/browsh.py +0 -25
- machineconfig/jobs/python_generic_installers/bw.py +0 -26
- machineconfig/jobs/python_generic_installers/chatgpt.py +0 -24
- machineconfig/jobs/python_generic_installers/cpufetch.py +0 -23
- machineconfig/jobs/python_generic_installers/delta.py +0 -59
- machineconfig/jobs/python_generic_installers/dev/__init__.py +0 -0
- machineconfig/jobs/python_generic_installers/dev/autogpt.py +0 -28
- machineconfig/jobs/python_generic_installers/dev/bw.py +0 -29
- machineconfig/jobs/python_generic_installers/dev/evcxr.py +0 -22
- machineconfig/jobs/python_generic_installers/dev/kondo.py +0 -21
- machineconfig/jobs/python_generic_installers/dev/lvim.py +0 -60
- machineconfig/jobs/python_generic_installers/dev/ngrok.py +0 -35
- machineconfig/jobs/python_generic_installers/dev/opencommit.py +0 -21
- machineconfig/jobs/python_generic_installers/dev/qrcp.py +0 -25
- machineconfig/jobs/python_generic_installers/dev/qrscan.py +0 -16
- machineconfig/jobs/python_generic_installers/dev/rust-analyzer.py +0 -24
- machineconfig/jobs/python_generic_installers/dev/termscp.py +0 -23
- machineconfig/jobs/python_generic_installers/dev/tldr.py +0 -25
- machineconfig/jobs/python_generic_installers/dev/tokei.py +0 -24
- machineconfig/jobs/python_generic_installers/diskonaut.py +0 -26
- machineconfig/jobs/python_generic_installers/dua.py +0 -21
- machineconfig/jobs/python_generic_installers/evcxr.py +0 -21
- machineconfig/jobs/python_generic_installers/gitui.py +0 -23
- machineconfig/jobs/python_generic_installers/gopass.py +0 -19
- machineconfig/jobs/python_generic_installers/helix.py +0 -45
- machineconfig/jobs/python_generic_installers/kondo.py +0 -20
- machineconfig/jobs/python_generic_installers/lf.py +0 -25
- machineconfig/jobs/python_generic_installers/lvim.py +0 -34
- machineconfig/jobs/python_generic_installers/mprocs.py +0 -20
- machineconfig/jobs/python_generic_installers/navi.py +0 -20
- machineconfig/jobs/python_generic_installers/ots.py +0 -26
- machineconfig/jobs/python_generic_installers/ouch.py +0 -25
- machineconfig/jobs/python_generic_installers/pomodoro.py +0 -19
- machineconfig/jobs/python_generic_installers/procs.py +0 -20
- machineconfig/jobs/python_generic_installers/qrcp.py +0 -22
- machineconfig/jobs/python_generic_installers/qrscan.py +0 -14
- machineconfig/jobs/python_generic_installers/rclone.py +0 -21
- machineconfig/jobs/python_generic_installers/rust-analyzer.py +0 -24
- machineconfig/jobs/python_generic_installers/tere.py +0 -26
- machineconfig/jobs/python_generic_installers/termscp.py +0 -23
- machineconfig/jobs/python_generic_installers/tldr.py +0 -24
- machineconfig/jobs/python_generic_installers/tokei.py +0 -21
- machineconfig/jobs/python_generic_installers/vtm.py +0 -26
- machineconfig/jobs/python_generic_installers/watchexec.py +0 -21
- machineconfig/jobs/python_linux_installers/archive/__init__.py +0 -0
- machineconfig/jobs/python_linux_installers/archive/ranger.py +0 -18
- machineconfig/jobs/python_linux_installers/bandwhich.py +0 -11
- machineconfig/jobs/python_linux_installers/bottom.py +0 -17
- machineconfig/jobs/python_linux_installers/btop.py +0 -17
- machineconfig/jobs/python_linux_installers/dev/bandwhich.py +0 -13
- machineconfig/jobs/python_linux_installers/dev/bytehound.py +0 -20
- machineconfig/jobs/python_linux_installers/dev/nnn.py +0 -21
- machineconfig/jobs/python_linux_installers/gotty.py +0 -16
- machineconfig/jobs/python_linux_installers/joshuto.py +0 -28
- machineconfig/jobs/python_linux_installers/mcfly.py +0 -12
- machineconfig/jobs/python_linux_installers/nnn.py +0 -18
- machineconfig/jobs/python_linux_installers/topgrade.py +0 -15
- machineconfig/jobs/python_linux_installers/viu.py +0 -19
- machineconfig/jobs/python_linux_installers/xplr.py +0 -22
- machineconfig/jobs/python_linux_installers/zellij.py +0 -31
- machineconfig/jobs/python_windows_installers/archive/ntop.py +0 -20
- machineconfig/jobs/python_windows_installers/bat.py +0 -16
- machineconfig/jobs/python_windows_installers/boxes.py +0 -19
- machineconfig/jobs/python_windows_installers/bypass_paywall.py +0 -18
- machineconfig/jobs/python_windows_installers/dev/bypass_paywall.py +0 -21
- machineconfig/jobs/python_windows_installers/dev/obs_background_removal_plugin.py +0 -20
- machineconfig/jobs/python_windows_installers/fd.py +0 -17
- machineconfig/jobs/python_windows_installers/fzf.py +0 -19
- machineconfig/jobs/python_windows_installers/obs_background_removal_plugin.py +0 -19
- machineconfig/jobs/python_windows_installers/rg.py +0 -15
- machineconfig/jobs/python_windows_installers/ugrep.py +0 -14
- machineconfig/jobs/python_windows_installers/zoomit.py +0 -20
- machineconfig/jobs/python_windows_installers/zoxide.py +0 -20
- machineconfig/profile/fix_shell_profiles.py +0 -8
- machineconfig/scripts/python/archive/__init__.py +0 -0
- machineconfig/scripts/python/archive/bu_gdrive_rx.py +0 -41
- machineconfig/scripts/python/archive/bu_gdrive_sx.py +0 -40
- machineconfig/scripts/python/archive/bu_onedrive_rx.py +0 -59
- machineconfig/scripts/python/archive/bu_onedrive_sx.py +0 -45
- machineconfig/scripts/python/chatgpt.py +0 -28
- machineconfig/scripts/python/choose_ohmybash_theme.py +0 -25
- machineconfig/scripts/python/choose_ohmyposh_theme.py +0 -40
- machineconfig/scripts/python/cloud_rx.py +0 -42
- machineconfig/scripts/python/cloud_sx.py +0 -40
- machineconfig/scripts/python/ftprx.py +0 -37
- machineconfig/scripts/python/ftpsx.py +0 -36
- machineconfig/scripts/python/im2text.py +0 -15
- machineconfig/scripts/python/tmate_conn.py +0 -28
- machineconfig/scripts/python/tmate_start.py +0 -31
- machineconfig/utils/to_exe.py +0 -7
- machineconfig-1.5.dist-info/RECORD +0 -147
- /machineconfig/jobs/{python_generic_installers/archive → script_installer}/__init__.py +0 -0
- {machineconfig-1.5.dist-info → machineconfig-1.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
|
|
2
|
+
"""python and ve installation related utils
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from crocodile.file_management import P, Struct, modify_text, List
|
|
6
|
+
from machineconfig.utils.utils import LIBRARY_ROOT
|
|
7
|
+
import platform
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Optional, Literal
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class VE_Specs:
|
|
14
|
+
ve_name: str
|
|
15
|
+
py_version: str
|
|
16
|
+
ipy_profile: str
|
|
17
|
+
os: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class VE_INI:
|
|
22
|
+
specs: VE_Specs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def get_ipython_profile(init_path: P):
|
|
26
|
+
a_path = init_path
|
|
27
|
+
ipy_profile: str = "default"
|
|
28
|
+
idx = len(a_path.parts)
|
|
29
|
+
while idx >= 0:
|
|
30
|
+
if a_path.joinpath(".ipy_profile").exists():
|
|
31
|
+
ipy_profile = a_path.joinpath(".ipy_profile").read_text().rstrip()
|
|
32
|
+
print(f"✅ Using IPython profile: {ipy_profile}")
|
|
33
|
+
break
|
|
34
|
+
idx -= 1
|
|
35
|
+
a_path = a_path.parent
|
|
36
|
+
else:
|
|
37
|
+
print(f"⚠️ Using default IPython: {ipy_profile}")
|
|
38
|
+
return ipy_profile
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def get_ve_profile(init_path: P, strict: bool = False):
|
|
42
|
+
ve = ""
|
|
43
|
+
tmp = init_path
|
|
44
|
+
for _ in init_path.parents:
|
|
45
|
+
if tmp.joinpath(".ve_path").exists():
|
|
46
|
+
ve = P(tmp.joinpath(".ve_path").read_text().rstrip().replace("\n", "")).name
|
|
47
|
+
print(f"✅ Using Virtual Environment: {ve}")
|
|
48
|
+
break
|
|
49
|
+
tmp = tmp.parent
|
|
50
|
+
if ve == "" and strict: raise ValueError("❌ No virtual environment found.")
|
|
51
|
+
return ve
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def get_current_ve():
|
|
55
|
+
import sys
|
|
56
|
+
path = P(sys.executable) # something like ~\\venvs\\ve\\Scripts\\python.exe'
|
|
57
|
+
if str(P.home().joinpath("venvs")) in str(path): return path.parent.parent.stem
|
|
58
|
+
else: raise NotImplementedError("Not a kind of virtual enviroment that I expected.")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def get_installed_interpreters() -> list[P]:
|
|
62
|
+
system = platform.system()
|
|
63
|
+
if system == "Windows":
|
|
64
|
+
tmp: list[P] = P.get_env().PATH.search("python.exe").reduce().list[1:]
|
|
65
|
+
else:
|
|
66
|
+
tmp = list(set(List(P.get_env().PATH.search("python3*").reduce()).filter(lambda x: not x.is_symlink() and "-" not in x))) # type: ignore
|
|
67
|
+
List(tmp).print()
|
|
68
|
+
return list(set([P(x) for x in tmp]))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def get_ve_specs(ve_path: P) -> dict[str, str]:
|
|
72
|
+
ini = r"[mysection]\n" + ve_path.joinpath("pyvenv.cfg").read_text()
|
|
73
|
+
import configparser
|
|
74
|
+
config = configparser.ConfigParser()
|
|
75
|
+
config.read_string(ini)
|
|
76
|
+
res = dict(config['mysection'])
|
|
77
|
+
res['version_major_minor'] = ".".join(res['version'].split(".")[0:2])
|
|
78
|
+
return res
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_ve_install_script(ve_name: Optional[str] = None, py_version: Optional[str] = None, install_crocodile_and_machineconfig: Optional[bool] = None,
|
|
82
|
+
delete_if_exists: bool = True,
|
|
83
|
+
system: Optional[Literal["Windows", "Linux"]] = None) -> str:
|
|
84
|
+
from rich.console import Console
|
|
85
|
+
if system is None:
|
|
86
|
+
system_: str = platform.system()
|
|
87
|
+
else: system_ = system
|
|
88
|
+
console = Console()
|
|
89
|
+
|
|
90
|
+
if py_version is None:
|
|
91
|
+
print("\n\n")
|
|
92
|
+
console.rule("Existing Python versions", style="bold red")
|
|
93
|
+
res = get_installed_interpreters()
|
|
94
|
+
List(res).print()
|
|
95
|
+
print("\n\n")
|
|
96
|
+
dotted_py_version = input("Enter python version (3.11): ") or "3.11"
|
|
97
|
+
else: dotted_py_version = py_version
|
|
98
|
+
|
|
99
|
+
if ve_name is None:
|
|
100
|
+
console.rule(f"Existing virtual environments")
|
|
101
|
+
for ve_path in P.home().joinpath("venvs").search("*", files=False):
|
|
102
|
+
ve_specs = get_ve_specs(ve_path)
|
|
103
|
+
# console.print(Panel(str(ve_specs), title=ve_path.stem, style="bold blue"))
|
|
104
|
+
Struct(ve_specs).print(title=ve_path.stem, as_config=True)
|
|
105
|
+
ve_name = input("Enter virtual environment name (tst): ") or "tst"
|
|
106
|
+
|
|
107
|
+
if install_crocodile_and_machineconfig is None: croco_mac = input("Install essential repos? (y/[n]): ") == "y"
|
|
108
|
+
else: croco_mac = install_crocodile_and_machineconfig
|
|
109
|
+
|
|
110
|
+
env_path = P.home().joinpath("venvs", ve_name)
|
|
111
|
+
if delete_if_exists and env_path.exists():
|
|
112
|
+
sure = input(f"An existing environment found. Are you sure you want to delete {env_path} before making new one? (y/[n]): ") == "y"
|
|
113
|
+
console.rule(f"Deleting existing enviroment with similar name")
|
|
114
|
+
env_path.delete(sure=sure)
|
|
115
|
+
|
|
116
|
+
scripts = LIBRARY_ROOT.joinpath(f"setup_{system_.lower()}/ve.{'ps1' if system_ == 'Windows' else 'sh'}").read_text()
|
|
117
|
+
|
|
118
|
+
variable_prefix = "$" if system_ == "Windows" else ""
|
|
119
|
+
line1 = f"{variable_prefix}ve_name='{ve_name}'"
|
|
120
|
+
line2 = f"{variable_prefix}py_version='{dotted_py_version}'"
|
|
121
|
+
line_start = "# --- Define ve name and python version here ---"
|
|
122
|
+
line_end = "# --- End of user defined variables ---"
|
|
123
|
+
assert line_start in scripts and line_end in scripts, "Script template was mutated beyond recognition."
|
|
124
|
+
scripts = scripts.split(line_start)[0] + "\n".join([line_start, line1, line2, line_end]) + scripts.split(line_end)[1]
|
|
125
|
+
|
|
126
|
+
if croco_mac: # TODO make this more robust by removing sections of the script as opposed to word placeholders.
|
|
127
|
+
text = LIBRARY_ROOT.joinpath(f"setup_{system_.lower()}/repos.{'ps1' if system_ == 'Windows' else 'sh'}").read_text()
|
|
128
|
+
text = modify_text(txt_raw=text, txt_search="ve_name=", txt_alt=f"{variable_prefix}ve_name='{ve_name}'", replace_line=True)
|
|
129
|
+
scripts += text
|
|
130
|
+
|
|
131
|
+
# ve_ini_specs = VE_Specs(ve_name=ve_name, py_version=dotted_py_version, ipy_profile="default", os=system_)
|
|
132
|
+
# ve_ini = VE_INI(specs=ve_ini_specs)
|
|
133
|
+
return scripts
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def get_ve_install_script_from_specs(repo_root: str, system: Literal["Windows", "Linux"]):
|
|
137
|
+
from crocodile.file_management import Read, Save
|
|
138
|
+
ini_file = P(repo_root).joinpath(".ve.ini")
|
|
139
|
+
assert ini_file.exists(), f"File {ini_file} does not exist."
|
|
140
|
+
ini = Read.ini(ini_file)
|
|
141
|
+
ve_name = ini["specs"]["ve_name"]
|
|
142
|
+
py_version = ini["specs"]["py_version"]
|
|
143
|
+
ipy_profile = ini["specs"]["ipy_profile"]
|
|
144
|
+
|
|
145
|
+
# repo_root = ini_file.with_name("requirements.txt").parent
|
|
146
|
+
|
|
147
|
+
# for backward compatibility:
|
|
148
|
+
ini_file.with_name(".ve_path").write_text(f"~/venvs/{ve_name}")
|
|
149
|
+
ini_file.with_name(".ipy_profile").write_text(ipy_profile)
|
|
150
|
+
|
|
151
|
+
# vscode:
|
|
152
|
+
if not system == "Windows": # symlinks on windows require admin rights.
|
|
153
|
+
P(repo_root).joinpath(".venv").symlink_to(P.home().joinpath("venvs", ve_name))
|
|
154
|
+
|
|
155
|
+
vscode_settings = P(repo_root).joinpath(".vscode/settings.json")
|
|
156
|
+
if vscode_settings.exists():
|
|
157
|
+
settings = Read.json(vscode_settings)
|
|
158
|
+
else:
|
|
159
|
+
settings = {}
|
|
160
|
+
if system == "Windows":
|
|
161
|
+
settings["python.defaultInterpreterPath"] = f"~/venvs/{ve_name}/Scripts/python.exe"
|
|
162
|
+
elif system == "Linux":
|
|
163
|
+
settings["python.defaultInterpreterPath"] = f"~/venvs/{ve_name}/bin/python"
|
|
164
|
+
pass
|
|
165
|
+
else:
|
|
166
|
+
raise NotImplementedError(f"System {system} not supported.")
|
|
167
|
+
Save.json(obj=settings, path=vscode_settings, indent=4)
|
|
168
|
+
|
|
169
|
+
base_path = P(repo_root).joinpath("versions", "init").create()
|
|
170
|
+
if system == "Windows":
|
|
171
|
+
script = get_ps1_install_template(ve_name=ve_name, py_version=py_version)
|
|
172
|
+
base_path.joinpath("install_ve.ps1").write_text(script)
|
|
173
|
+
elif system == "Linux":
|
|
174
|
+
script = get_bash_install_template(ve_name=ve_name, py_version=py_version)
|
|
175
|
+
base_path.joinpath("install_ve.sh").write_text(script)
|
|
176
|
+
else:
|
|
177
|
+
raise NotImplementedError(f"System {system} not supported.")
|
|
178
|
+
|
|
179
|
+
base_path.joinpath("install_requirements.ps1").write_text(get_install_requirements_template(repo_root=P(repo_root)))
|
|
180
|
+
base_path.joinpath("install_requirements.sh").write_text(get_install_requirements_template(repo_root=P(repo_root)))
|
|
181
|
+
|
|
182
|
+
return script
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def get_ps1_install_template(ve_name: str, py_version: str):
|
|
186
|
+
template = f"""
|
|
187
|
+
$ve_name = '{ve_name}'
|
|
188
|
+
$py_version = '{py_version}' # type: ignore
|
|
189
|
+
(Invoke-WebRequest https://bit.ly/cfgvewindows).Content | Invoke-Expression
|
|
190
|
+
. $HOME/scripts/activate_ve $ve_name
|
|
191
|
+
"""
|
|
192
|
+
return template
|
|
193
|
+
def get_bash_install_template(ve_name: str, py_version: str):
|
|
194
|
+
template = f"""
|
|
195
|
+
export ve_name='{ve_name}'
|
|
196
|
+
export py_version='{py_version}' # type: ignore
|
|
197
|
+
curl -L https://bit.ly/cfgvelinux | bash
|
|
198
|
+
. $HOME/scripts/activate_ve $ve_name
|
|
199
|
+
"""
|
|
200
|
+
return template
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
def get_install_requirements_template(repo_root: P):
|
|
204
|
+
return f"""
|
|
205
|
+
# This is a template that is meant to be modified manually to install requirements.txt and editable packages.
|
|
206
|
+
# one can dispense with this and install libraries manually and on adhoc-basis and then use version_checkout utility.
|
|
207
|
+
cd $HOME/{repo_root.as_posix()}
|
|
208
|
+
. $HOME/scripts/activate_ve
|
|
209
|
+
pip install -r requirements.txt
|
|
210
|
+
pip install -e .
|
|
211
|
+
|
|
212
|
+
# cd ~/code; git clone https://github.com/thisismygitrepo/crocodile.git --origin origin
|
|
213
|
+
# cd ~/code/crocodile; git remote set-url origin https://github.com/thisismygitrepo/crocodile.git
|
|
214
|
+
# cd ~/code/crocodile; git remote add origin https://github.com/thisismygitrepo/crocodile.git
|
|
215
|
+
# cd ~/code/crocodile; pip install -e .
|
|
216
|
+
|
|
217
|
+
# cd ~/code; git clone https://github.com/thisismygitrepo/machineconfig --origin origin
|
|
218
|
+
# cd ~/code/machineconfig; git remote set-url origin https://github.com/thisismygitrepo/machineconfig
|
|
219
|
+
# cd ~/code/machineconfig; git remote add origin https://github.com/thisismygitrepo/machineconfig
|
|
220
|
+
# cd ~/code/machineconfig; pip install -e .
|
|
221
|
+
|
|
222
|
+
"""
|
|
@@ -1,110 +1,140 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: machineconfig
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Dotfiles management package
|
|
5
|
-
Home-page: https://github.com/thisismygitrepo/machineconfig
|
|
6
|
-
Author: Alex Al-Saffar
|
|
7
|
-
Author-email: programmer@usa.com
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/thisismygitrepo/machineconfig/issues
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.9
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: rich
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
######
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
curl
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: machineconfig
|
|
3
|
+
Version: 1.8
|
|
4
|
+
Summary: Dotfiles management package
|
|
5
|
+
Home-page: https://github.com/thisismygitrepo/machineconfig
|
|
6
|
+
Author: Alex Al-Saffar
|
|
7
|
+
Author-email: programmer@usa.com
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/thisismygitrepo/machineconfig/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.9
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: rich
|
|
15
|
+
Requires-Dist: paramiko
|
|
16
|
+
Requires-Dist: gitpython
|
|
17
|
+
Requires-Dist: pudb
|
|
18
|
+
Requires-Dist: pyfzf
|
|
19
|
+
Requires-Dist: clipboard
|
|
20
|
+
Requires-Dist: psutil
|
|
21
|
+
Requires-Dist: pydantic
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
|
|
26
|
+
<a href="https://github.com/thisismygitrepo/machineconfig/commits">
|
|
27
|
+
<img src="https://img.shields.io/github/commit-activity/m/thisismygitrepo/machineconfig" />
|
|
28
|
+
</a>
|
|
29
|
+
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Welcome to machineconfig
|
|
34
|
+
|
|
35
|
+
# Shortcuts
|
|
36
|
+
* `bit.ly/cfgroot` is a shortcut to this repo.
|
|
37
|
+
* `curl bit.ly/cfgread -L | bat -l md --style="header"` to get the readme file.
|
|
38
|
+
|
|
39
|
+
Machineconfig is a package for managing configuration files (aka dotfiles). The idea is to collect those critical, time-consuming-files-to-setup in one directory and reference them via symbolic links from their original locations. Thus, when a new machine is to be setup, all that is required is to clone the repo in that machine and create the symbolic links.
|
|
40
|
+
Dotfiles include, but are not limited to:
|
|
41
|
+
* `~/.gitconfig`
|
|
42
|
+
* `~/.ssh`
|
|
43
|
+
* `~/.aws`
|
|
44
|
+
* `~/.bash_profile`
|
|
45
|
+
* `~/.bashrc`
|
|
46
|
+
* `~/.config`
|
|
47
|
+
* `$profile` in Windows Powershell
|
|
48
|
+
* etc
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Additionally, files that contain data, sensitive information that should not be pushed to a repository are contained in a directory `~/dotfiles`. The files therein are encrypted before backedup.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Windows Setup
|
|
55
|
+
With elevated `PowerShell`, run the following: (short `curl bit.ly/cfgallwindows -L | iex`)
|
|
56
|
+
```shell
|
|
57
|
+
# apps # short: `(iwr bit.ly/cfgappswindows).Content | iex`
|
|
58
|
+
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/apps.ps1 | Invoke-Expression
|
|
59
|
+
# virtual enviornment # short (iwr bit.ly/cfgvewindows).Content | iex OR `curl bit.ly/cfgvewindows -L | iex`
|
|
60
|
+
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/ve.ps1 | Invoke-Expression
|
|
61
|
+
# dev repos # short `(iwr bit.ly/cfgreposwindows).Content | iex` OR `curl bit.ly/cfgreposwindows -L | iex`
|
|
62
|
+
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/repos.ps1 | Invoke-Expression
|
|
63
|
+
# symlinks # short `curl bit.ly/cfgsymlinkswindows -L | iex` OR `(iwr bit.ly/cfgsymlinkswindows).Content | iex`
|
|
64
|
+
. ~/code/machineconfig/src/machineconfig/setup_windows/symlinks.ps1
|
|
65
|
+
# devapps:
|
|
66
|
+
~/code/machineconfig/src/machineconfig/setup_windows/devapps.ps1
|
|
67
|
+
# pwsh and wt settings: (iwr bit.ly/cfgwt).Content | iex
|
|
68
|
+
iwr https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/wt_and_pwsh.ps1 | iex
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```shell
|
|
73
|
+
(iwr bit.ly/cfgappswindows).Content | iex
|
|
74
|
+
(iwr bit.ly/cfgvewindows).Content | iex
|
|
75
|
+
(iwr bit.ly/cfgreposwindows).Content | iex
|
|
76
|
+
. ~/code/machineconfig/src/machineconfig/setup_windows/devapps.ps1
|
|
77
|
+
(iwr bit.ly/cfgwt).Content | iex
|
|
78
|
+
. ~/code/machineconfig/src/machineconfig/setup_windows/symlinks.ps1
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
###### Setup SSH connection:
|
|
82
|
+
```shell
|
|
83
|
+
# CHANGE pubkey_string APPROPRIATELY
|
|
84
|
+
$pubkey_string=(Invoke-WebRequest 'https://github.com/thisismygitrepo.keys').Content
|
|
85
|
+
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/openssh_all.ps1 | Invoke-Expression
|
|
86
|
+
```
|
|
87
|
+
short `(iwr bit.ly/cfgsshwindows).Content | iex` OR `curl bit.ly/cfgsshwindows -L | iex`
|
|
88
|
+
|
|
89
|
+
###### Install Croshell Terminal Directly,
|
|
90
|
+
```shell
|
|
91
|
+
Invoke-WebRequest https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/web_shortcuts/croshell.ps1 | Invoke-Expression
|
|
92
|
+
```
|
|
93
|
+
short: `curl bit.ly/cfgcroshellwindows -L | iex` OR `(iwr bit.ly/cfgcroshellwindows).Content | iex`
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Linux Setup
|
|
97
|
+
With `sudo` access, run the following: (short `curl bit.ly/cfgalllinux -L | bash`)
|
|
98
|
+
```bash
|
|
99
|
+
export package_manager="apt"
|
|
100
|
+
export package_manager="nix"
|
|
101
|
+
|
|
102
|
+
# apps # short: `curl bit.ly/cfgappslinux -L | bash`
|
|
103
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps.sh | bash
|
|
104
|
+
# Optionally: curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/apps_dev.sh | bash
|
|
105
|
+
|
|
106
|
+
# virtual enviornment # short `curl bit.ly/cfgvelinux -L | bash`
|
|
107
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/ve.sh | bash
|
|
108
|
+
|
|
109
|
+
# repos # short `curl bit.ly/cfgreposlinux -L | bash`
|
|
110
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/repos.sh | bash
|
|
111
|
+
# symlinks and bash profile: # short `curl bit.ly/cfgsymlinkslinux -L | bash`
|
|
112
|
+
source ~/code/machineconfig/src/machineconfig/setup_linux/symlinks.sh # requires sudo since it invloves chmod of dotfiles/.ssh, however sudo doesn't work with source. best to have sudo -s earlier.
|
|
113
|
+
|
|
114
|
+
# devapps
|
|
115
|
+
source <(sudo cat ~/code/machineconfig/src/machineconfig/setup_linux/devapps.sh)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
###### Setup SSH connection:
|
|
119
|
+
```bash
|
|
120
|
+
pubkey_url='https://github.com/thisismygitrepo.keys' # (CHANGE APPROPRIATELY)
|
|
121
|
+
export pubkey_string=$(curl --silent $pubkey_url)
|
|
122
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/openssh_all.sh | sudo bash
|
|
123
|
+
# For WSL only, also run the following:
|
|
124
|
+
export port=2223
|
|
125
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/openssh_wsl.sh | sudo bash
|
|
126
|
+
# don't forget to run `wsl_ssh_windows_port_forwarding -p 2223` from Windows using the designated port with
|
|
127
|
+
```
|
|
128
|
+
short `curl bit.ly/cfgsshlinux -L | bash`
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
###### Install Croshell Terminal Directly
|
|
132
|
+
```bash
|
|
133
|
+
curl https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_linux/web_shortcuts/croshell.sh | sudo bash
|
|
134
|
+
```
|
|
135
|
+
short `curl bit.ly/cfgcroshelllinux -L | bash`
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
# Author
|
|
139
|
+
Alex Al-Saffar. [email](mailto:programmer@usa.com)
|
|
140
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
machineconfig/__init__.py,sha256=bsBSmmsUO8rqdzHk2wibjueFpDc0Q97faQnM6vKUNOU,79
|
|
2
|
+
machineconfig/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
machineconfig/jobs/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
machineconfig/jobs/python/check_installations.py,sha256=CKAfdl7-KafGMSGcSTMs-CpmB4zEP7KKNNnp-nWKI6M,7767
|
|
5
|
+
machineconfig/jobs/python/checkout_version.py,sha256=nrjpz6mK8T7XS1VArFi7slnKKPNlZw0zMr6V2_JeNic,5042
|
|
6
|
+
machineconfig/jobs/python/create_bootable_media.py,sha256=De1_DUXt5oE7PvNY5P9oIdqxD51qZLJjOfB-XMayVKg,585
|
|
7
|
+
machineconfig/jobs/python/create_zellij_template.py,sha256=tIGieeq2n21B_dpgkXiR_Zh2q4xUPG3QhqCwLKCkhog,1301
|
|
8
|
+
machineconfig/jobs/python/python_cargo_build_share.py,sha256=I-xhOKB4Sw0aaPnfk9Ip5Nmu2TOZITsZ_okGrd8deiM,1746
|
|
9
|
+
machineconfig/jobs/python/python_ve_symlink.py,sha256=ZdXuTfEBkO1uYc6F-xg_bWF46ScQ9Xaj3b2dDqO1BL4,837
|
|
10
|
+
machineconfig/jobs/python/tasks.py,sha256=1px4SuPYbcmCTGARxUaKvTx4Hza3yurVWEOqNevbaaM,119
|
|
11
|
+
machineconfig/jobs/python_generic_installers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
machineconfig/jobs/python_linux_installers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
machineconfig/jobs/python_linux_installers/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
machineconfig/jobs/python_windows_installers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
machineconfig/jobs/python_windows_installers/archive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
machineconfig/jobs/python_windows_installers/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
machineconfig/jobs/script_installer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
machineconfig/jobs/script_installer/azure_data_studio.py,sha256=iDPiKbEmkjnV_aPVvrnbSVMPw4USTAV1yoT2KuyUgRU,654
|
|
19
|
+
machineconfig/jobs/script_installer/bypass_paywall.py,sha256=c2_4UD2hIgs2v3gt_tWz7m5861Vsbt99KDk7kbIQdIY,592
|
|
20
|
+
machineconfig/jobs/script_installer/code.py,sha256=F9BPw6ErslGttrJ9M6EDIaF6TXchw8XmHUHAXUIa-mQ,1055
|
|
21
|
+
machineconfig/jobs/script_installer/docker_desktop.py,sha256=oPiUUEI5VXhHvnx8xD0IEtpWGg8g3ZoX0PQcYn8Ssk0,1431
|
|
22
|
+
machineconfig/jobs/script_installer/ngrok.py,sha256=r9w7VcErKOTLxpbxRIpjMkOjmJ1vJE03-Mf8P8kh2-c,726
|
|
23
|
+
machineconfig/jobs/script_installer/skim.py,sha256=O2EE5eT-W7cKiohfOrKj7OM7-3nVVJnjb1ifdWA2H9M,494
|
|
24
|
+
machineconfig/jobs/script_installer/wezterm.py,sha256=OcNYPUc2Dx9QCz-im0ryqPEdEAStgB-J0MSKq9n4c1U,950
|
|
25
|
+
machineconfig/profile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
machineconfig/profile/create.py,sha256=9QJGkyHDIG6ArA8RMqiZJrD79eZ0HXOy4qAfd269lV8,4962
|
|
27
|
+
machineconfig/profile/shell.py,sha256=oo40fnLvxcS2K6wvjN4ITVefhkvIW_VbP8Tua_9mqm0,6129
|
|
28
|
+
machineconfig/scripts/__init__.py,sha256=8aZPVoch_gcI0Ihcr30zQcPjRQMWiWzDnQXnOm7spzo,73
|
|
29
|
+
machineconfig/scripts/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
+
machineconfig/scripts/python/cloud_copy.py,sha256=fWy2D-oJpguj_VPIHRa-A6RNV2YiD10tk51FTvoJIMg,4619
|
|
31
|
+
machineconfig/scripts/python/cloud_manager.py,sha256=qfmO63t1LQxO6QHhz3qxePQnas4RsNOjLV1cGK8xK8I,1639
|
|
32
|
+
machineconfig/scripts/python/cloud_mount.py,sha256=DsOV_Pt6B_9IwCyf2W6qHlxx41W0f_WqDKcUCWQJPmo,4634
|
|
33
|
+
machineconfig/scripts/python/cloud_repo_sync.py,sha256=yZLqOSrCYLNV3mZaLl0wZSu1nE8z5BtAu6OU9Iwtx-8,7805
|
|
34
|
+
machineconfig/scripts/python/cloud_sync.py,sha256=oMaemB0DruVPQyHey-C0KvqJQY9ZPxOgTQAq09-7G9M,11240
|
|
35
|
+
machineconfig/scripts/python/croshell.py,sha256=Gk4jKJCAsZkCUceKdZdnIRsDbJl74z2xfQwB9dY3ODw,6073
|
|
36
|
+
machineconfig/scripts/python/devops.py,sha256=imvtmo1PRcP-SlGgPK_Eeghd-ZtHWwV30vx6zyG8lps,5363
|
|
37
|
+
machineconfig/scripts/python/devops_add_identity.py,sha256=q0DjXowg0dr5nDVrMdyViF_OQdeTN_fDXTVcVPgddfk,1549
|
|
38
|
+
machineconfig/scripts/python/devops_add_ssh_key.py,sha256=RoHO_lP1DuyKrPl_wYfAJuliRP7CVKssygy3cK2eJXo,3308
|
|
39
|
+
machineconfig/scripts/python/devops_backup_retrieve.py,sha256=sH3a5Uvz5SDhiypP_KIJR1-RiZT-IU8IOJjpvC1UeGk,2443
|
|
40
|
+
machineconfig/scripts/python/devops_devapps_install.py,sha256=64XFl6A1UyDFdUSvy-12wH4DxRAtMZ1MLlwnCR3Vaok,5220
|
|
41
|
+
machineconfig/scripts/python/devops_update_repos.py,sha256=ZW_jI1oNlus929Y2ErXhDWDr6A4SSbTxrutn-__AdI4,2809
|
|
42
|
+
machineconfig/scripts/python/dotfile.py,sha256=1zPwDgCjwsAFNBJ6h9qCTqpPPDpZzjdDkq6rFVlhvdo,1564
|
|
43
|
+
machineconfig/scripts/python/fire_jobs.py,sha256=42ynJDoRPaGKLAC2hpbuWAcjHIIRtBQalRe3N7w5TrU,17217
|
|
44
|
+
machineconfig/scripts/python/ftpx.py,sha256=_PDH8QghwTkeNsPXuKXXdRWyEvvSpUW41hMsiui2x_E,4141
|
|
45
|
+
machineconfig/scripts/python/mount_nfs.py,sha256=MLEZ2IjXPLuWqOwzzWhiV8nxcULS32JHzNnrwulmp4I,2485
|
|
46
|
+
machineconfig/scripts/python/mount_nw_drive.py,sha256=2AwmOF1IHI_ET9BBjhgMQ9AGn8uj6zoCC7Rg8Iy0G1A,1005
|
|
47
|
+
machineconfig/scripts/python/mount_ssh.py,sha256=R557UOF3uChH2Mf_eWgSu7GVyzcfNPSaFudn42n51oM,1406
|
|
48
|
+
machineconfig/scripts/python/onetimeshare.py,sha256=tveeuE_PmRuk7hwJy5c53b2eL0lvxR_MACX5X_4syy8,1881
|
|
49
|
+
machineconfig/scripts/python/pomodoro.py,sha256=-ag26tR7dre1Zw4xfKkPERDRvn7xSJkWfBpem8VjJzE,1974
|
|
50
|
+
machineconfig/scripts/python/repos.py,sha256=0dxJcQm8lzxzxn3aArT_UzwEHFtsjDWOP0LGcvaB3oM,10253
|
|
51
|
+
machineconfig/scripts/python/scheduler.py,sha256=PN-_GzkcMCAIdxWj_gQQIFR5OKs8pa3aeXn7Bn4YnEM,2305
|
|
52
|
+
machineconfig/scripts/python/snapshot.py,sha256=XxnGc8bOb7vgx-TpJVBzgkzQf9Fcz6VyQ3LH7sOsLDI,622
|
|
53
|
+
machineconfig/scripts/python/start_slidev.py,sha256=mhcXz6LcogTPU1CEGPRzFj8yC_w6ey1k-FeNEfOEiqk,4359
|
|
54
|
+
machineconfig/scripts/python/start_terminals.py,sha256=VwAbhZ4LxHhuWvmWaRxWh2HvlPK02kHG0-W7QekubVY,5441
|
|
55
|
+
machineconfig/scripts/python/wifi_conn.py,sha256=XABEqc_TNdKa-I3J2DmDgEtT5Xt95fcqjNJ9W9MsEPA,2916
|
|
56
|
+
machineconfig/scripts/python/wsl_windows_transfer.py,sha256=YDmN3bjz-auWktIlhkj4pEFykysXtMnpjZobhXJ69d4,2198
|
|
57
|
+
machineconfig/setup_windows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
+
machineconfig/setup_windows/wt_and_pwsh/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
+
machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py,sha256=bwOvQ8Lcmxy8Mds3pPR7itZA_8FUMOD5RzGZgrnzDlM,1611
|
|
60
|
+
machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py,sha256=WgJ9JkrjOZZW8JPw5wdkEIlE7Z4VDkDOXuag1qsqLlo,6242
|
|
61
|
+
machineconfig/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
+
machineconfig/utils/installer.py,sha256=uvXk3w1tjTBBnsoFzWHwv2Z38FLaafEjGB7rOL8pLIs,14393
|
|
63
|
+
machineconfig/utils/procs.py,sha256=GCdvGvowFm-GZe6PLcRe7yaWiBr6QFnSc_lAVWQDKo8,5146
|
|
64
|
+
machineconfig/utils/scheduling.py,sha256=PGSmJPjDN5ZP5pLzzV4aXCRaB71OlMSiEljRkzMWSX8,7341
|
|
65
|
+
machineconfig/utils/utils.py,sha256=izwiIvw_eLtbxvX7zhK7YZkrE6Xd8nw3u1O-r23AZ10,18780
|
|
66
|
+
machineconfig/utils/ve.py,sha256=rtweDN9Xs9xh8a0QNsKIhH6eZmC0H-RBLrIN_f68l6s,9113
|
|
67
|
+
machineconfig-1.8.dist-info/METADATA,sha256=ECcBQ2_UcFmk_ClfRF7vk9tq0uDYV77RAW-x1yCEw_o,6256
|
|
68
|
+
machineconfig-1.8.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
69
|
+
machineconfig-1.8.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
70
|
+
machineconfig-1.8.dist-info/RECORD,,
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import crocodile.toolbox as tb
|
|
3
|
-
import machineconfig.jobs.python_linux_installers as inst
|
|
4
|
-
import machineconfig.jobs.python_generic_installers as gens
|
|
5
|
-
import platform
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def get_cli_py_installers(dev=False):
|
|
9
|
-
path = tb.P(inst.__file__).parent
|
|
10
|
-
gens_path = tb.P(gens.__file__).parent
|
|
11
|
-
if dev:
|
|
12
|
-
path = path.joinpath("dev")
|
|
13
|
-
gens_path = gens_path.joinpath("dev")
|
|
14
|
-
return path.search("*.py", filters=[lambda x: "__init__" not in str(x)]) + gens_path.search("*.py", filters=[lambda x: "__init__" not in str(x)])
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def get_installed_cli_apps():
|
|
18
|
-
if platform.system() == "Windows": apps = tb.P.home().joinpath("AppData/Local/Microsoft/WindowsApps").search("*.exe", not_in=["notepad"])
|
|
19
|
-
elif platform.system() == "Linux": apps = tb.P(r"/usr/local/bin").search("*")
|
|
20
|
-
else: raise NotImplementedError("Not implemented for this OS")
|
|
21
|
-
apps = tb.L([app for app in apps if app.size("kb") > 0.1 and not app.is_symlink()]) # no symlinks like paint and wsl and bash
|
|
22
|
-
return apps
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def install_logic(py_file, version=None):
|
|
26
|
-
try:
|
|
27
|
-
old_version = tb.Terminal().run(f"{py_file.stem} --version", shell="powershell").op.replace("\n", "")
|
|
28
|
-
tb.Read.py(py_file)["main"](version=version)
|
|
29
|
-
new_version = tb.Terminal().run(f"{py_file.stem} --version", shell="powershell").op.replace("\n", "")
|
|
30
|
-
if old_version == new_version: return f"😑 {py_file.stem}, same version: {old_version}"
|
|
31
|
-
else: return f"🤩 {py_file.stem} updated from {old_version} === to ===> {new_version}"
|
|
32
|
-
except Exception as ex:
|
|
33
|
-
print(ex)
|
|
34
|
-
return f"Failed at {py_file.stem} with {ex}"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def main(installers=None, safe=False):
|
|
38
|
-
if safe:
|
|
39
|
-
from machineconfig.jobs.python.check_installations import safe_apps_url
|
|
40
|
-
apps_dir = tb.P(safe_apps_url.read_text()).download().unzip(inplace=True)
|
|
41
|
-
if platform.system().lower() == "windows":
|
|
42
|
-
apps_dir.search("*").apply(lambda app: app.move(folder=tb.P.get_env().WindowsApps))
|
|
43
|
-
elif platform.system().lower() == "linux":
|
|
44
|
-
tb.Terminal().run(f"sudo mv {apps_dir.as_posix()}/* /usr/local/bin/").print_if_unsuccessful(desc="MOVING executable to /usr/local/bin", strict_err=True, strict_returncode=True)
|
|
45
|
-
else: raise NotImplementedError(f"I don't know this system {platform.system()}")
|
|
46
|
-
apps_dir.delete(sure=True)
|
|
47
|
-
return None
|
|
48
|
-
|
|
49
|
-
installers = installers if installers is not None else tb.L(get_cli_py_installers(dev=False))
|
|
50
|
-
|
|
51
|
-
install_logic(installers[0]) # try out the first installer alone cause it will ask for password, so the rest will inherit the sudo session.
|
|
52
|
-
|
|
53
|
-
# summarize results
|
|
54
|
-
res = installers[1:].apply(install_logic, jobs=10)
|
|
55
|
-
from rich.console import Console
|
|
56
|
-
console = Console()
|
|
57
|
-
print("\n")
|
|
58
|
-
console.rule("Same version apps")
|
|
59
|
-
print(f"{res.filter(lambda x: 'same version' in x).print()}")
|
|
60
|
-
print("\n")
|
|
61
|
-
console.rule("Updated apps")
|
|
62
|
-
print(f"{res.filter(lambda x: 'updated from' in x).print()}")
|
|
63
|
-
print("\n")
|
|
64
|
-
console.rule("Failed apps")
|
|
65
|
-
print(f"{res.filter(lambda x: 'Failed at' in x).print()}")
|
|
66
|
-
|
|
67
|
-
print("\n")
|
|
68
|
-
print("Completed Installation".center(100, "-"))
|
|
69
|
-
print("\n" * 2)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if __name__ == '__main__':
|
|
73
|
-
main()
|