machineconfig 7.50__py3-none-any.whl → 8.12__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/remote/cloud_manager.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +23 -11
- machineconfig/cluster/sessions_managers/wt_local_manager.py +22 -19
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +3 -1
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +3 -1
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +3 -2
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +2 -2
- machineconfig/jobs/installer/installer_data.json +1185 -165
- machineconfig/jobs/installer/linux_scripts/q.sh +10 -7
- machineconfig/jobs/installer/linux_scripts/redis.sh +1 -0
- machineconfig/jobs/installer/package_groups.py +52 -84
- machineconfig/jobs/installer/powershell_scripts/install_fonts.ps1 +129 -34
- machineconfig/jobs/installer/{custom → python_scripts}/boxes.py +2 -2
- machineconfig/jobs/installer/{custom_dev → python_scripts}/brave.py +5 -3
- machineconfig/jobs/installer/python_scripts/cloudflare_warp_cli.py +23 -0
- machineconfig/jobs/installer/{custom_dev → python_scripts}/code.py +4 -1
- machineconfig/jobs/installer/{custom_dev → python_scripts}/dubdb_adbc.py +1 -1
- machineconfig/jobs/installer/{custom → python_scripts}/hx.py +16 -12
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerdfont.py +2 -2
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerfont_windows_helper.py +27 -22
- machineconfig/jobs/installer/python_scripts/sysabc.py +139 -0
- machineconfig/jobs/installer/{custom_dev → python_scripts}/wezterm.py +2 -19
- machineconfig/jobs/installer/{custom_dev → python_scripts}/winget.py +10 -14
- machineconfig/jobs/installer/python_scripts/yazi.py +121 -0
- machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_nfs +0 -1
- machineconfig/jobs/scripts/powershell_scripts/mount_ssh.ps1 +13 -0
- machineconfig/jobs/scripts/powershell_scripts/obs.ps1 +4 -0
- machineconfig/jobs/scripts_dynamic/a.py +25 -0
- machineconfig/logger.py +0 -1
- machineconfig/profile/create_helper.py +21 -22
- machineconfig/profile/create_links_export.py +25 -11
- machineconfig/profile/create_shell_profile.py +14 -3
- machineconfig/profile/mapper.toml +8 -6
- machineconfig/scripts/__init__.py +0 -4
- machineconfig/scripts/linux/wrap_mcfg +20 -21
- machineconfig/scripts/python/agents.py +74 -50
- machineconfig/scripts/python/ai/initai.py +1 -1
- machineconfig/scripts/python/ai/scripts/command_runner.ps1 +33 -0
- machineconfig/scripts/python/ai/{command_runner → scripts}/command_runner.sh +1 -1
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Thinking-Beast-Mode.chatmode.md → agents/Thinking-Beast-Mode.agent.md} +0 -1
- machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md → agents/Ultimate-Transparent-Thinking-Beast-Mode.agent.md} +0 -1
- machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/deepResearch.chatmode.md → agents/deepResearch.agent.md} +2 -2
- machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +5 -5
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +4 -0
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/watch_exec.prompt.md +20 -0
- machineconfig/scripts/python/ai/solutions/generic.py +1 -1
- machineconfig/scripts/python/ai/{generate_files.py → utils/generate_files.py} +2 -2
- machineconfig/scripts/python/cloud.py +6 -6
- machineconfig/scripts/python/croshell.py +67 -60
- machineconfig/scripts/python/devops.py +41 -21
- machineconfig/scripts/python/devops_navigator.py +0 -4
- machineconfig/scripts/python/env_manager/env_manager_tui.py +204 -0
- machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
- machineconfig/scripts/python/fire_jobs.py +95 -67
- machineconfig/scripts/python/ftpx.py +44 -17
- machineconfig/scripts/python/helpers/ast_search.py +74 -0
- machineconfig/scripts/python/helpers/qr_code.py +166 -0
- machineconfig/scripts/python/helpers/repo_rag.py +325 -0
- machineconfig/scripts/python/helpers/symantic_search.py +25 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.json +1 -1
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +9 -7
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +21 -8
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +0 -12
- machineconfig/scripts/python/helpers_agents/fire_agents_help_launch.py +30 -11
- machineconfig/scripts/python/helpers_agents/fire_agents_helper_types.py +9 -2
- machineconfig/scripts/python/helpers_agents/privacy/configs/aichat/config.yaml +5 -0
- machineconfig/scripts/python/helpers_agents/privacy/configs/aider/.aider.conf.yml +2 -0
- machineconfig/scripts/python/helpers_agents/privacy/configs/copilot/config.yml +1 -0
- machineconfig/scripts/python/helpers_agents/privacy/configs/crush/crush.json +10 -0
- machineconfig/scripts/python/helpers_agents/privacy/configs/gemini/settings.json +12 -0
- machineconfig/scripts/python/helpers_agents/privacy/privacy.py +109 -0
- machineconfig/scripts/python/helpers_agents/templates/prompt.txt +8 -4
- machineconfig/scripts/python/helpers_agents/templates/template.sh +18 -8
- machineconfig/scripts/python/helpers_cloud/cloud_copy.py +28 -21
- machineconfig/scripts/python/helpers_cloud/cloud_helpers.py +1 -1
- machineconfig/scripts/python/helpers_cloud/cloud_mount.py +19 -17
- machineconfig/scripts/python/helpers_cloud/cloud_sync.py +8 -7
- machineconfig/scripts/python/helpers_croshell/crosh.py +3 -3
- machineconfig/scripts/python/helpers_croshell/start_slidev.py +6 -7
- machineconfig/scripts/python/helpers_devops/cli_config.py +19 -25
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +22 -13
- machineconfig/scripts/python/helpers_devops/cli_nw.py +113 -26
- machineconfig/scripts/python/helpers_devops/cli_repos.py +37 -11
- machineconfig/scripts/python/helpers_devops/cli_self.py +84 -39
- machineconfig/scripts/python/helpers_devops/cli_share_file.py +9 -9
- machineconfig/scripts/python/helpers_devops/cli_share_server.py +13 -12
- machineconfig/scripts/python/helpers_devops/{cli_terminal.py → cli_share_terminal.py} +15 -17
- machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +4 -4
- machineconfig/scripts/python/helpers_devops/devops_status.py +7 -19
- machineconfig/scripts/python/helpers_devops/run_script.py +168 -0
- machineconfig/scripts/python/helpers_devops/themes/choose_wezterm_theme.py +1 -1
- machineconfig/scripts/python/helpers_fire_command/file_wrangler.py +2 -19
- machineconfig/scripts/python/helpers_fire_command/fire_jobs_args_helper.py +1 -0
- machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py +25 -15
- machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfg +3 -3
- machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfg.ps1 +58 -1
- machineconfig/scripts/python/helpers_navigator/command_tree.py +50 -18
- machineconfig/scripts/python/helpers_network/address.py +176 -0
- machineconfig/scripts/python/helpers_network/address_switch.py +78 -0
- machineconfig/scripts/python/{nw → helpers_network}/mount_nfs.py +2 -2
- machineconfig/scripts/python/{nw → helpers_network}/mount_ssh.py +1 -1
- machineconfig/scripts/python/{nw/devops_add_identity.py → helpers_network/ssh_add_identity.py} +35 -1
- machineconfig/scripts/python/{nw/devops_add_ssh_key.py → helpers_network/ssh_add_ssh_key.py} +26 -7
- machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_linux.py +7 -7
- machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_windows.py +4 -4
- machineconfig/scripts/python/helpers_repos/clone.py +0 -1
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +13 -5
- machineconfig/scripts/python/helpers_repos/entrypoint.py +2 -1
- machineconfig/scripts/python/helpers_repos/record.py +2 -1
- machineconfig/scripts/python/helpers_repos/repo_analyzer_1.py +160 -0
- machineconfig/scripts/python/helpers_repos/{count_lines.py → repo_analyzer_2.py} +113 -192
- machineconfig/scripts/python/helpers_sessions/sessions_multiprocess.py +19 -13
- machineconfig/scripts/python/helpers_utils/download.py +150 -0
- machineconfig/scripts/python/helpers_utils/pdf.py +96 -0
- machineconfig/scripts/python/helpers_utils/python.py +187 -0
- machineconfig/scripts/python/interactive.py +17 -26
- machineconfig/scripts/python/{machineconfig.py → mcfg_entry.py} +4 -5
- machineconfig/scripts/python/msearch.py +57 -6
- machineconfig/scripts/python/sessions.py +100 -31
- machineconfig/scripts/python/terminal.py +26 -17
- machineconfig/scripts/python/utils.py +17 -15
- machineconfig/scripts/windows/wrap_mcfg.ps1 +6 -3
- machineconfig/settings/lf/windows/lfcd.ps1 +1 -1
- machineconfig/settings/linters/.ruff.toml +1 -1
- machineconfig/settings/shells/bash/init.sh +29 -2
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +1 -1
- machineconfig/settings/shells/nushell/config.nu +2 -2
- machineconfig/settings/shells/nushell/env.nu +45 -6
- machineconfig/settings/shells/nushell/init.nu +282 -95
- machineconfig/settings/shells/pwsh/init.ps1 +1 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
- machineconfig/settings/shells/zsh/init.sh +1 -8
- machineconfig/settings/television/cable_unix/alias.toml +8 -0
- machineconfig/settings/television/cable_unix/aws-buckets.toml +14 -0
- machineconfig/settings/television/cable_unix/aws-instances.toml +13 -0
- machineconfig/settings/television/cable_unix/bash-history.toml +8 -0
- machineconfig/settings/television/cable_unix/channels.toml +19 -0
- machineconfig/settings/television/cable_unix/dirs.toml +13 -0
- machineconfig/settings/television/cable_unix/distrobox-list.toml +42 -0
- machineconfig/settings/television/cable_unix/docker-images.toml +13 -0
- machineconfig/settings/television/cable_unix/dotfiles.toml +11 -0
- machineconfig/settings/television/cable_unix/env.toml +17 -0
- machineconfig/settings/television/cable_unix/files.toml +11 -0
- machineconfig/settings/television/cable_unix/fish-history.toml +8 -0
- machineconfig/settings/television/cable_unix/git-branch.toml +11 -0
- machineconfig/settings/television/cable_unix/git-diff.toml +10 -0
- machineconfig/settings/television/cable_unix/git-log.toml +12 -0
- machineconfig/settings/television/cable_unix/git-reflog.toml +12 -0
- machineconfig/settings/television/cable_unix/git-repos.toml +16 -0
- machineconfig/settings/television/cable_unix/guix.toml +20 -0
- machineconfig/settings/television/cable_unix/just-recipes.toml +18 -0
- machineconfig/settings/television/cable_unix/k8s-deployments.toml +36 -0
- machineconfig/settings/television/cable_unix/k8s-pods.toml +50 -0
- machineconfig/settings/television/cable_unix/k8s-services.toml +36 -0
- machineconfig/settings/television/cable_unix/man-pages.toml +24 -0
- machineconfig/settings/television/cable_unix/nu-history.toml +7 -0
- machineconfig/settings/television/cable_unix/procs.toml +20 -0
- machineconfig/settings/television/cable_unix/text.toml +17 -0
- machineconfig/settings/television/cable_unix/tldr.toml +18 -0
- machineconfig/settings/television/cable_unix/zsh-history.toml +9 -0
- machineconfig/settings/television/cable_windows/alias.toml +7 -0
- machineconfig/settings/television/cable_windows/dirs.toml +13 -0
- machineconfig/settings/television/cable_windows/docker-images.toml +13 -0
- machineconfig/settings/television/cable_windows/dotfiles.toml +11 -0
- machineconfig/settings/television/cable_windows/env.toml +17 -0
- machineconfig/settings/television/cable_windows/files.toml +14 -0
- machineconfig/settings/television/cable_windows/git-branch.toml +11 -0
- machineconfig/settings/television/cable_windows/git-diff.toml +10 -0
- machineconfig/settings/television/cable_windows/git-log.toml +11 -0
- machineconfig/settings/television/cable_windows/git-reflog.toml +11 -0
- machineconfig/settings/television/cable_windows/git-repos.toml +15 -0
- machineconfig/settings/television/cable_windows/nu-history.toml +7 -0
- machineconfig/settings/television/cable_windows/pwsh-history.toml +6 -0
- machineconfig/settings/television/cable_windows/text.toml +17 -0
- machineconfig/settings/wt/__init__.py +0 -0
- machineconfig/settings/yazi/init.lua +49 -24
- machineconfig/settings/yazi/keymap_linux.toml +19 -4
- machineconfig/settings/yazi/keymap_windows.toml +0 -1
- machineconfig/settings/yazi/shell/yazi_cd.ps1 +29 -5
- machineconfig/settings/yazi/theme.toml +4 -0
- machineconfig/settings/yazi/yazi_linux.toml +84 -0
- machineconfig/settings/yazi/yazi_windows.toml +58 -0
- machineconfig/settings/zellij/layouts/st.kdl +39 -8
- machineconfig/setup_linux/__init__.py +1 -2
- machineconfig/setup_linux/apps_desktop.sh +8 -27
- machineconfig/setup_linux/web_shortcuts/interactive.sh +12 -10
- machineconfig/setup_linux/web_shortcuts/live_from_github.sh +31 -0
- machineconfig/setup_mac/__init__.py +2 -3
- machineconfig/setup_windows/__init__.py +3 -5
- machineconfig/setup_windows/ssh/openssh-server.ps1 +1 -1
- machineconfig/setup_windows/uv.ps1 +8 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +12 -10
- machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +30 -0
- machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +17 -0
- machineconfig/utils/accessories.py +7 -4
- machineconfig/utils/code.py +39 -11
- machineconfig/utils/files/headers.py +2 -2
- machineconfig/utils/installer_utils/github_release_bulk.py +156 -119
- machineconfig/utils/installer_utils/install_from_url.py +183 -0
- machineconfig/utils/installer_utils/installer_class.py +43 -100
- machineconfig/utils/installer_utils/installer_cli.py +175 -0
- machineconfig/utils/installer_utils/installer_helper.py +129 -0
- machineconfig/utils/installer_utils/{installer_abc.py → installer_locator_utils.py} +36 -85
- machineconfig/utils/{installer.py → installer_utils/installer_runner.py} +16 -59
- machineconfig/utils/io.py +0 -1
- machineconfig/utils/links.py +2 -2
- machineconfig/utils/meta.py +30 -16
- machineconfig/utils/options.py +42 -24
- machineconfig/utils/options_tv.py +119 -0
- machineconfig/utils/path_extended.py +42 -20
- machineconfig/utils/path_helper.py +75 -22
- machineconfig/utils/procs.py +1 -1
- machineconfig/utils/scheduler.py +20 -53
- machineconfig/utils/schemas/layouts/layout_types.py +1 -1
- machineconfig/utils/ssh.py +159 -418
- machineconfig/utils/ssh_utils/abc.py +5 -0
- machineconfig/utils/ssh_utils/copy_from_here.py +111 -0
- machineconfig/utils/ssh_utils/copy_to_here.py +303 -0
- machineconfig/utils/ssh_utils/utils.py +142 -0
- machineconfig/utils/ssh_utils/wsl.py +210 -0
- machineconfig/utils/terminal.py +1 -0
- machineconfig/utils/upgrade_packages.py +6 -1
- machineconfig/utils/ve.py +12 -4
- machineconfig-8.12.dist-info/METADATA +132 -0
- {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/RECORD +265 -215
- {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/entry_points.txt +2 -4
- machineconfig/jobs/installer/linux_scripts/pgsql.sh +0 -41
- machineconfig/jobs/installer/linux_scripts/timescaledb.sh +0 -71
- machineconfig/jobs/installer/powershell_scripts/archive_pygraphviz.ps1 +0 -12
- machineconfig/jobs/installer/powershell_scripts/openssh-server_add_key.ps1 +0 -7
- machineconfig/jobs/installer/powershell_scripts/openssh-server_copy-ssh-id.ps1 +0 -14
- machineconfig/scripts/linux/other/switch_ip +0 -20
- machineconfig/scripts/python/ai/command_runner/prompt.txt +0 -9
- machineconfig/scripts/python/define.py +0 -31
- machineconfig/scripts/python/explore.py +0 -49
- machineconfig/scripts/python/helpers_devops/cli_utils.py +0 -246
- machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfag +0 -17
- machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfrga +0 -21
- machineconfig/scripts/python/helpers_msearch/scripts_linux/skrg +0 -4
- machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfb.ps1 +0 -3
- machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfrga.bat +0 -20
- machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +0 -17
- machineconfig/scripts/python/nw/add_ssh_key.py +0 -148
- machineconfig/scripts/python/nw/wsl_windows_transfer.py +0 -66
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +0 -13
- machineconfig/settings/lf/linux/exe/fzf_nano.sh +0 -16
- machineconfig/settings/lf/windows/fzf_edit.ps1 +0 -6
- machineconfig/settings/lf/windows/tst.ps1 +0 -1
- machineconfig/settings/yazi/yazi.toml +0 -17
- machineconfig/setup_linux/apps.sh +0 -66
- machineconfig/setup_linux/others/cli_installation.sh +0 -137
- machineconfig/setup_linux/ssh/openssh_all.sh +0 -25
- machineconfig/setup_linux/ssh/openssh_wsl.sh +0 -38
- machineconfig/setup_mac/apps.sh +0 -73
- machineconfig/setup_windows/apps.ps1 +0 -62
- machineconfig/setup_windows/others/obs.ps1 +0 -4
- machineconfig/setup_windows/ssh/add_identity.ps1 +0 -11
- machineconfig/utils/installer_utils/installer.py +0 -221
- machineconfig-7.50.dist-info/METADATA +0 -92
- /machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/__init__.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/alacritty.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/bypass_paywall.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/cursor.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/espanso.py +0 -0
- /machineconfig/jobs/installer/{custom → python_scripts}/gh.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/goes.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/lvim.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/redis.py +0 -0
- /machineconfig/{setup_linux/others → jobs/scripts/bash_scripts}/android.sh +0 -0
- /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
- /machineconfig/{setup_linux/others → jobs/scripts/bash_scripts}/mint_keyboard_shortcuts.sh +0 -0
- /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_drive +0 -0
- /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_nw_drive +0 -0
- /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_smb +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_cloud.sh +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_nfs +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/start_docker +0 -0
- /machineconfig/{scripts → jobs/scripts/powershell_scripts}/Restore-ThunderbirdProfile.ps1 +0 -0
- /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/docker.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nfs.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nw.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_smb.ps1 +0 -0
- /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/power_options.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_cloud.cmd +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_smb.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/unlock_bitlocker.ps1 +0 -0
- /machineconfig/scripts/python/{nw → ai/utils}/__init__.py +0 -0
- /machineconfig/scripts/python/ai/{vscode_tasks.py → utils/vscode_tasks.py} +0 -0
- /machineconfig/{settings/shells/pwsh/profile.ps1 → scripts/python/helpers_fire_command/f.py} +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/helpers_network}/__init__.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/onetimeshare.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/wifi_conn.py +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → settings/wt}/set_wt_settings.py +0 -0
- {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/WHEEL +0 -0
- {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/top_level.txt +0 -0
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
agents = machineconfig.scripts.python.agents:main
|
|
3
3
|
cloud = machineconfig.scripts.python.cloud:main
|
|
4
4
|
croshell = machineconfig.scripts.python.croshell:main
|
|
5
|
-
define = machineconfig.scripts.python.define:main
|
|
6
5
|
devops = machineconfig.scripts.python.devops:main
|
|
7
|
-
explore = machineconfig.scripts.python.explore:main
|
|
8
6
|
fire = machineconfig.scripts.python.fire_jobs:main
|
|
9
7
|
ftpx = machineconfig.scripts.python.ftpx:main
|
|
10
|
-
machineconfig = machineconfig.scripts.python.
|
|
11
|
-
mcfg = machineconfig.scripts.python.
|
|
8
|
+
machineconfig = machineconfig.scripts.python.mcfg_entry:main
|
|
9
|
+
mcfg = machineconfig.scripts.python.mcfg_entry:main
|
|
12
10
|
msearch = machineconfig.scripts.python.msearch:main
|
|
13
11
|
sessions = machineconfig.scripts.python.sessions:main
|
|
14
12
|
terminal = machineconfig.scripts.python.terminal:main
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# 🐘 POSTGRESQL INSTALLATION SCRIPT 🐘
|
|
3
|
-
# This script installs PostgreSQL database on Ubuntu/Debian systems
|
|
4
|
-
# Reference: https://www.postgresql.org/download/linux/ubuntu/
|
|
5
|
-
|
|
6
|
-
echo """🚀 STARTING POSTGRESQL INSTALLATION | Setting up PostgreSQL database
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
# Install PostgreSQL common package
|
|
10
|
-
echo "📥 Installing PostgreSQL common package..."
|
|
11
|
-
sudo nala install postgresql-common -y
|
|
12
|
-
|
|
13
|
-
# Run the PostgreSQL repository setup script
|
|
14
|
-
echo "🔧 Setting up PostgreSQL repository..."
|
|
15
|
-
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
|
|
16
|
-
|
|
17
|
-
# Install PostgreSQL 17
|
|
18
|
-
echo """📦 INSTALLING POSTGRESQL | Installing PostgreSQL 17
|
|
19
|
-
"""
|
|
20
|
-
sudo nala install postgresql-17 -y
|
|
21
|
-
# Alternative: sudo nala install postgresql -y
|
|
22
|
-
|
|
23
|
-
echo """✅ INSTALLATION COMPLETE | PostgreSQL has been installed successfully
|
|
24
|
-
"""
|
|
25
|
-
echo "ℹ️ PostgreSQL service should be running automatically"
|
|
26
|
-
echo "💡 Connect to default 'postgres' database with: sudo -u postgres psql"
|
|
27
|
-
echo "🔄 To check service status: sudo systemctl status postgresql"
|
|
28
|
-
|
|
29
|
-
# REMOVAL INSTRUCTIONS:
|
|
30
|
-
echo """#-----------------------------------------------------------------------
|
|
31
|
-
📝 NOTES | For future reference
|
|
32
|
-
#-----------------------------------------------------------------------
|
|
33
|
-
To remove PostgreSQL completely:
|
|
34
|
-
sudo apt-get --purge remove postgresql postgresql-*
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
# Alternative installation method (commented out):
|
|
38
|
-
# sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $ubuntu_version-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
|
39
|
-
# curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
|
|
40
|
-
# sudo nala update
|
|
41
|
-
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# ⏱️ TIMESCALEDB INSTALLATION SCRIPT ⏱️
|
|
3
|
-
# This script installs TimescaleDB on Ubuntu/Debian-based Linux distributions
|
|
4
|
-
# Reference: https://docs.timescale.com/self-hosted/latest/install/installation-linux/
|
|
5
|
-
|
|
6
|
-
echo """🔍 DETECTING SYSTEM | Identifying OS distribution version
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
get_ubuntu_base_version() {
|
|
10
|
-
local os_codename=$(lsb_release -cs)
|
|
11
|
-
case "$os_codename" in
|
|
12
|
-
"wilma")
|
|
13
|
-
echo "noble" # Map Mint Wilma to the base image Ubuntu 24.04 LTS
|
|
14
|
-
;;
|
|
15
|
-
"virginia")
|
|
16
|
-
echo "jammy" # Map Mint Virginia to the base image Ubuntu 22.04 LTS
|
|
17
|
-
;;
|
|
18
|
-
*)
|
|
19
|
-
echo "$os_codename"
|
|
20
|
-
;;
|
|
21
|
-
esac
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
ubuntu_version=$(get_ubuntu_base_version)
|
|
25
|
-
echo "📋 Detected distribution: $ubuntu_version"
|
|
26
|
-
|
|
27
|
-
echo """🐘 INSTALLING POSTGRESQL | Setting up PostgreSQL dependencies
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
# Add PostgreSQL repository setup
|
|
31
|
-
echo "🔧 Setting up PostgreSQL repository..."
|
|
32
|
-
sudo nala install postgresql-common -y
|
|
33
|
-
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
|
|
34
|
-
|
|
35
|
-
echo """🔑 ADDING REPOSITORY KEYS | Setting up TimescaleDB repository
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
# Add TimescaleDB repository
|
|
39
|
-
echo "📝 Adding TimescaleDB repository to sources list..."
|
|
40
|
-
echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $ubuntu_version main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
|
|
41
|
-
|
|
42
|
-
echo "🔐 Adding TimescaleDB GPG key..."
|
|
43
|
-
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/timescaledb.gpg
|
|
44
|
-
|
|
45
|
-
echo """📦 INSTALLING TIMESCALEDB | Updating and installing packages
|
|
46
|
-
"""
|
|
47
|
-
|
|
48
|
-
# Update package lists
|
|
49
|
-
echo "🔄 Updating package lists..."
|
|
50
|
-
sudo nala update
|
|
51
|
-
|
|
52
|
-
# Install TimescaleDB with PostgreSQL 16
|
|
53
|
-
echo "📥 Installing PostgreSQL 16 and TimescaleDB..."
|
|
54
|
-
sudo nala install -y postgresql-16 postgresql-client-16 timescaledb-2-postgresql-16
|
|
55
|
-
|
|
56
|
-
echo """⚙️ CONFIGURING TIMESCALEDB | Optimizing database settings
|
|
57
|
-
"""
|
|
58
|
-
|
|
59
|
-
# Run TimescaleDB tuning tool
|
|
60
|
-
echo "🔧 Running TimescaleDB tuning utility..."
|
|
61
|
-
sudo timescaledb-tune
|
|
62
|
-
|
|
63
|
-
# Restart PostgreSQL service
|
|
64
|
-
echo "🔄 Restarting PostgreSQL service..."
|
|
65
|
-
sudo systemctl restart postgresql
|
|
66
|
-
|
|
67
|
-
echo """✅ INSTALLATION COMPLETE | TimescaleDB has been installed successfully
|
|
68
|
-
"""
|
|
69
|
-
echo "🚀 To connect to PostgreSQL, run: sudo -u postgres psql"
|
|
70
|
-
echo "💡 To enable TimescaleDB in a database, run: CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;"
|
|
71
|
-
echo "ℹ️ For more information, visit: https://docs.timescale.com/self-hosted/latest/install/"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# install https://visualstudio.microsoft.com/visual-cpp-build-tools/
|
|
3
|
-
# include
|
|
4
|
-
# winget install Microsoft.VisualStudio.2022.BuildTools
|
|
5
|
-
# winget install Microsoft.VC++2015-2022Redist-x86
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
uv pip install --global-option=build_ext --global-option="-IC:\Program Files\Graphviz\include" --global-option="-LC:\Program Files\Graphviz\lib" pygraphviz
|
|
9
|
-
# not including the options as above (from https://pygraphviz.github.io/documentation/stable/install.html)
|
|
10
|
-
# would result in an error like this: pygraphviz/graphviz_wrap.c(2711): fatal error C1083: Cannot open include file: 'graphviz/cgraph.h': No such file or directory
|
|
11
|
-
|
|
12
|
-
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
$sshfile=""
|
|
3
|
-
$ErrorActionPreference = "Stop"
|
|
4
|
-
$sshd_dir = "$env:ProgramData\ssh"
|
|
5
|
-
cp "$sshd_dir\administrators_authorized_keys" "$sshd_dir\administrators_authorized_keys.orig"
|
|
6
|
-
Get-Content $sshfile >> "$sshd_dir\administrators_authorized_keys"
|
|
7
|
-
Restart-Service sshd -Force
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# This is the Windows equivalent of copy-ssh-id on Linux.
|
|
3
|
-
# Just like the original function, it is a convenient way of doing two things in one go:
|
|
4
|
-
# 1- copy a certain public key to the remote machine.
|
|
5
|
-
# scp ~/.ssh/id_rsa.pub $remote_user@$remote_host:~/.ssh/authorized_keys
|
|
6
|
-
# 2- Store the value on the remote in a file called .ssh/authorized_keys
|
|
7
|
-
# ssh $remote_user@$remote_host "echo $public_key >> ~/.ssh/authorized_keys"
|
|
8
|
-
# Idea from: https://www.chrisjhart.com/Windows-10-ssh-copy-id/
|
|
9
|
-
|
|
10
|
-
$key_value = cat ($env:USERPROFILE + "\.ssh\id_rsa.pub")
|
|
11
|
-
ssh $args[0] "powershell.exe -Command type $key_value >> .ssh/authorized_keys"
|
|
12
|
-
|
|
13
|
-
$my_keys='https://github.com/thisismygitrepo.keys'
|
|
14
|
-
(Invoke-WebRequest $my_keys).Content >> .ssh/authorized_keys
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
echo "🔁 Switching IP ... "
|
|
4
|
-
echo "Current IP: $(curl -s api.ipify.org)"
|
|
5
|
-
echo "🔻 Deactivating current connection ... "
|
|
6
|
-
warp-cli registration delete
|
|
7
|
-
# echo "✅ Deactivated current connection ... "
|
|
8
|
-
echo "😴 Sleeping for 2 seconds ... "
|
|
9
|
-
sleep 2
|
|
10
|
-
echo "🔼 Registering new connection ... "
|
|
11
|
-
warp-cli registration new
|
|
12
|
-
# echo "✅ Registered new connection ... "
|
|
13
|
-
echo "🔗 Connecting ... "
|
|
14
|
-
warp-cli connect
|
|
15
|
-
echo "😴 Sleeping for 2 seconds ... "
|
|
16
|
-
sleep 2
|
|
17
|
-
echo "🔍 Checking status of warp ... "
|
|
18
|
-
warp-cli status
|
|
19
|
-
echo "🔍 Checking new IP ... $(curl -s api.ipify.org) "
|
|
20
|
-
echo "✅ Done ... "
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
I have started a watch-exec server in my terminal and its working now.
|
|
3
|
-
I have set it up to re-run thi script `.ai/terminal/debug/command_runner.sh` automatically.
|
|
4
|
-
A re-run is triggered upon any change of any python file in the repo, or, any change in the make_output.sh script itself.
|
|
5
|
-
The script redirects the output from terminal to the file ./.ai/debug/terminal_output.txt
|
|
6
|
-
Run takes 50 ms only. So by the time you finish editing any python file or the command runner script, the new output is ready for you to read in that text file,
|
|
7
|
-
this makes it much faster for you to iterate because pulling the terminal and closing it every time is a bit slow.
|
|
8
|
-
Please use the terminal_output.txt as your main iteration driver.
|
|
9
|
-
please fix the mistakes that you can see in terminal output.
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"""
|
|
3
|
-
Minimalist programs that only print scripts without frills so it can be sourced by by shell.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import typer
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def define_scripts():
|
|
11
|
-
import platform
|
|
12
|
-
if platform.system() != "Linux":
|
|
13
|
-
raise RuntimeError("This command is only supported on Linux systems.")
|
|
14
|
-
from machineconfig.setup_linux import INTERACTIVE as script_path
|
|
15
|
-
script = script_path.read_text(encoding="utf-8")
|
|
16
|
-
print(script)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def get_app():
|
|
20
|
-
app = typer.Typer(add_completion=False, no_args_is_help=True)
|
|
21
|
-
app.command(name="scripts", help="define all scripts", no_args_is_help=False)(define_scripts)
|
|
22
|
-
return app
|
|
23
|
-
|
|
24
|
-
def main():
|
|
25
|
-
# return app
|
|
26
|
-
app = get_app()
|
|
27
|
-
app()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
# if __name__ == "__main__":
|
|
31
|
-
# main()
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import typer
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def machineconfig_lf():
|
|
6
|
-
# from machineconfig.scripts.python.helpers_msearch import FZFG_LINUX_PATH, FZFG_WINDOWS_PATH
|
|
7
|
-
import platform
|
|
8
|
-
if platform.system() == "Linux":
|
|
9
|
-
script = """
|
|
10
|
-
tmp="$(mktemp)"
|
|
11
|
-
lf -last-dir-path="$tmp" "$@"
|
|
12
|
-
if [ -f "$tmp" ]; then
|
|
13
|
-
dir="$(cat "$tmp")"
|
|
14
|
-
rm -f "$tmp"
|
|
15
|
-
if [ -d "$dir" ]; then
|
|
16
|
-
if [ "$dir" != "$(pwd)" ]; then
|
|
17
|
-
cd "$dir"
|
|
18
|
-
fi
|
|
19
|
-
fi
|
|
20
|
-
fi
|
|
21
|
-
"""
|
|
22
|
-
elif platform.system() == "Windows":
|
|
23
|
-
script = r"""
|
|
24
|
-
$tmp = [System.IO.Path]::GetTempFileName()
|
|
25
|
-
~\AppData\Local\Microsoft\WindowsApps\lf.exe -last-dir-path="$tmp" $args
|
|
26
|
-
if (Test-Path -PathType Leaf "$tmp")
|
|
27
|
-
{
|
|
28
|
-
$dir = Get-Content "$tmp"
|
|
29
|
-
Remove-Item -Force "$tmp"
|
|
30
|
-
if (Test-Path -PathType Container "$dir")
|
|
31
|
-
{
|
|
32
|
-
if ("$dir" -ne "$pwd")
|
|
33
|
-
{
|
|
34
|
-
Set-Location "$dir"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
"""
|
|
39
|
-
else:
|
|
40
|
-
raise RuntimeError("Unsupported platform")
|
|
41
|
-
|
|
42
|
-
from machineconfig.utils.code import exit_then_run_shell_script
|
|
43
|
-
exit_then_run_shell_script(script=script, strict=False)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def main():
|
|
47
|
-
app = typer.Typer(add_completion=False, no_args_is_help=True)
|
|
48
|
-
app.command(name="lf", help="machineconfig lf wrapper.", no_args_is_help=False)(machineconfig_lf)
|
|
49
|
-
app()
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import typer
|
|
4
|
-
from typing import Annotated, Literal, Optional, TypedDict
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
def download(
|
|
8
|
-
url: Annotated[Optional[str], typer.Argument(..., help="The URL to download the file from.")] = None,
|
|
9
|
-
decompress: Annotated[bool, typer.Option("--decompress", "-d", help="Decompress the file if it's an archive.")] = False,
|
|
10
|
-
output: Annotated[Optional[str], typer.Option("--output", "-o", help="The output file path.")] = None,
|
|
11
|
-
) -> None:
|
|
12
|
-
if url is None:
|
|
13
|
-
typer.echo("❌ Error: URL is required.", err=True)
|
|
14
|
-
raise typer.Exit(code=1)
|
|
15
|
-
typer.echo(f"📥 Downloading from: {url}")
|
|
16
|
-
download_path = Path(output) if output else Path(url.split("/")[-1])
|
|
17
|
-
import requests
|
|
18
|
-
import subprocess
|
|
19
|
-
try:
|
|
20
|
-
response = requests.get(url, allow_redirects=True, stream=True, timeout=60)
|
|
21
|
-
response.raise_for_status()
|
|
22
|
-
|
|
23
|
-
total_size = int(response.headers.get('content-length', 0))
|
|
24
|
-
|
|
25
|
-
with open(download_path, 'wb') as f:
|
|
26
|
-
if total_size == 0:
|
|
27
|
-
f.write(response.content)
|
|
28
|
-
else:
|
|
29
|
-
downloaded = 0
|
|
30
|
-
chunk_size = 8192
|
|
31
|
-
for chunk in response.iter_content(chunk_size=chunk_size):
|
|
32
|
-
if chunk:
|
|
33
|
-
f.write(chunk)
|
|
34
|
-
downloaded += len(chunk)
|
|
35
|
-
progress = (downloaded / total_size) * 100
|
|
36
|
-
typer.echo(f"\r⏬ Progress: {progress:.1f}% ({downloaded}/{total_size} bytes)", nl=False)
|
|
37
|
-
typer.echo()
|
|
38
|
-
|
|
39
|
-
typer.echo(f"✅ Downloaded to: {download_path}")
|
|
40
|
-
except requests.exceptions.RequestException as e:
|
|
41
|
-
typer.echo(f"❌ Download failed: {e}", err=True)
|
|
42
|
-
raise typer.Exit(code=1)
|
|
43
|
-
except OSError as e:
|
|
44
|
-
typer.echo(f"❌ File write error: {e}", err=True)
|
|
45
|
-
raise typer.Exit(code=1)
|
|
46
|
-
|
|
47
|
-
if decompress:
|
|
48
|
-
typer.echo(f"📦 Decompressing: {download_path}")
|
|
49
|
-
|
|
50
|
-
base_name = download_path.name
|
|
51
|
-
parts = base_name.split('.')
|
|
52
|
-
base_name = parts[0] if parts else download_path.stem
|
|
53
|
-
|
|
54
|
-
extract_dir = download_path.parent / base_name
|
|
55
|
-
extract_dir.mkdir(parents=True, exist_ok=True)
|
|
56
|
-
|
|
57
|
-
try:
|
|
58
|
-
subprocess.run(
|
|
59
|
-
["ouch", "decompress", str(download_path), "--dir", str(extract_dir)],
|
|
60
|
-
check=True,
|
|
61
|
-
capture_output=True,
|
|
62
|
-
text=True
|
|
63
|
-
)
|
|
64
|
-
typer.echo(f"✅ Decompressed to: {extract_dir}")
|
|
65
|
-
|
|
66
|
-
if download_path.exists():
|
|
67
|
-
download_path.unlink()
|
|
68
|
-
typer.echo(f"🗑️ Removed archive: {download_path}")
|
|
69
|
-
|
|
70
|
-
except subprocess.CalledProcessError as e:
|
|
71
|
-
typer.echo(f"❌ Decompression failed: {e.stderr}", err=True)
|
|
72
|
-
raise typer.Exit(code=1)
|
|
73
|
-
except FileNotFoundError:
|
|
74
|
-
typer.echo("❌ Error: ouch command not found. Please install ouch.", err=True)
|
|
75
|
-
typer.echo("💡 Install with: cargo install ouch", err=True)
|
|
76
|
-
raise typer.Exit(code=1)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def merge_pdfs(
|
|
80
|
-
pdfs: Annotated[list[str], typer.Argument(..., help="Paths to the PDF files to merge.")],
|
|
81
|
-
output: Annotated[Optional[str], typer.Option("--output", "-o", help="Output merged PDF file path.")] = None,
|
|
82
|
-
compress: Annotated[bool, typer.Option("--compress", "-c", help="Compress the output PDF.")] = False,
|
|
83
|
-
) -> None:
|
|
84
|
-
def merge_pdfs_internal(pdfs: list[str], output: str | None, compress: bool) -> None:
|
|
85
|
-
from pypdf import PdfReader, PdfWriter
|
|
86
|
-
writer = PdfWriter()
|
|
87
|
-
for pdf_path in pdfs:
|
|
88
|
-
reader = PdfReader(pdf_path)
|
|
89
|
-
for page in reader.pages:
|
|
90
|
-
writer.add_page(page)
|
|
91
|
-
output_path = output if output else "merged.pdf"
|
|
92
|
-
if compress:
|
|
93
|
-
try:
|
|
94
|
-
for p in writer.pages:
|
|
95
|
-
try:
|
|
96
|
-
# PageObject.compress_content_streams exists in pypdf
|
|
97
|
-
p.compress_content_streams()
|
|
98
|
-
except Exception:
|
|
99
|
-
# best-effort: ignore per-page compression failures
|
|
100
|
-
continue
|
|
101
|
-
except Exception:
|
|
102
|
-
pass
|
|
103
|
-
try:
|
|
104
|
-
writer.compress_identical_objects()
|
|
105
|
-
except Exception:
|
|
106
|
-
# non-fatal if this fails
|
|
107
|
-
pass
|
|
108
|
-
writer.write(output_path)
|
|
109
|
-
print(f"✅ Merged PDF saved to: {output_path}")
|
|
110
|
-
from machineconfig.utils.meta import lambda_to_python_script
|
|
111
|
-
code = lambda_to_python_script(lambda : merge_pdfs_internal(pdfs=pdfs, output=output, compress=compress), in_global=True, import_module=False)
|
|
112
|
-
from machineconfig.utils.code import run_shell_script, get_uv_command_executing_python_script
|
|
113
|
-
uv_command, _py_file = get_uv_command_executing_python_script(python_script=code, uv_with=["pypdf"], uv_project_dir=None)
|
|
114
|
-
run_shell_script(uv_command)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def compress_pdf(
|
|
118
|
-
pdf_input: Annotated[str, typer.Argument(..., help="Path to the input PDF file to compress.")],
|
|
119
|
-
output: Annotated[Optional[str], typer.Option("--output", "-o", help="Output compressed PDF file path.")] = None,
|
|
120
|
-
quality: Annotated[int, typer.Option("--quality", "-q", help="JPEG quality for image compression (0-100, 0=no change, 100=best).")] = 85,
|
|
121
|
-
image_dpi: Annotated[int, typer.Option("--image-dpi", "-d", help="Target DPI for image resampling. If set, images above this DPI will be downsampled.")] = 0,
|
|
122
|
-
# remove_images: Annotated[bool, typer.Option("--remove-images", "-r", help="Remove all images from the PDF.")] = False,
|
|
123
|
-
compress_streams: Annotated[bool, typer.Option("--compress-streams", "-c", help="Compress uncompressed streams.")] = True,
|
|
124
|
-
use_objstms: Annotated[bool, typer.Option("--object-streams", "-s", help="Use object streams for additional compression.")] = True,
|
|
125
|
-
) -> None:
|
|
126
|
-
def compress_pdf_internal(pdf_input: str, output: str | None, quality: int, image_dpi: int, compress_streams: bool, use_objstms: bool) -> None:
|
|
127
|
-
import pymupdf
|
|
128
|
-
from pathlib import Path
|
|
129
|
-
output_path = output if output else pdf_input.replace(".pdf", "_compressed.pdf")
|
|
130
|
-
doc = pymupdf.open(pdf_input)
|
|
131
|
-
try:
|
|
132
|
-
# if remove_images:
|
|
133
|
-
# for page in doc:
|
|
134
|
-
# page.remove_images()
|
|
135
|
-
if quality > 0 or image_dpi > 0:
|
|
136
|
-
doc.rewrite_images(
|
|
137
|
-
dpi_threshold=image_dpi if image_dpi > 0 else None,
|
|
138
|
-
dpi_target=max(72, image_dpi - 10) if image_dpi > 72 else 72,
|
|
139
|
-
quality=quality,
|
|
140
|
-
lossy=True,
|
|
141
|
-
lossless=True,
|
|
142
|
-
)
|
|
143
|
-
doc.save(
|
|
144
|
-
output_path,
|
|
145
|
-
deflate=compress_streams,
|
|
146
|
-
garbage=3,
|
|
147
|
-
use_objstms=1 if use_objstms else 0,
|
|
148
|
-
)
|
|
149
|
-
input_size = Path(pdf_input).stat().st_size
|
|
150
|
-
output_size = Path(output_path).stat().st_size
|
|
151
|
-
ratio = (1 - output_size / input_size) * 100
|
|
152
|
-
print(f"✅ Compressed PDF saved to: {output_path}")
|
|
153
|
-
print(f" Original: {input_size / 1024 / 1024:.2f} MB")
|
|
154
|
-
print(f" Compressed: {output_size / 1024 / 1024:.2f} MB")
|
|
155
|
-
print(f" Reduction: {ratio:.1f}%")
|
|
156
|
-
finally:
|
|
157
|
-
doc.close()
|
|
158
|
-
from machineconfig.utils.meta import lambda_to_python_script
|
|
159
|
-
code = lambda_to_python_script(
|
|
160
|
-
lambda: compress_pdf_internal(pdf_input=pdf_input, output=output, quality=quality, image_dpi=image_dpi, compress_streams=compress_streams, use_objstms=use_objstms),
|
|
161
|
-
in_global=True,
|
|
162
|
-
import_module=False,
|
|
163
|
-
)
|
|
164
|
-
from machineconfig.utils.code import run_shell_script, get_uv_command_executing_python_script
|
|
165
|
-
uv_command, _py_file = get_uv_command_executing_python_script(python_script=code, uv_with=["pymupdf"], uv_project_dir=None)
|
|
166
|
-
run_shell_script(uv_command)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
class MachineSpecs(TypedDict):
|
|
170
|
-
system: str
|
|
171
|
-
distro: str
|
|
172
|
-
home_dir: str
|
|
173
|
-
def get_machine_specs() -> MachineSpecs:
|
|
174
|
-
"""Write print and return the local machine specs."""
|
|
175
|
-
import platform
|
|
176
|
-
UV_RUN_CMD = "$HOME/.local/bin/uv run" if platform.system() != "Windows" else """& "$env:USERPROFILE/.local/bin/uv" run"""
|
|
177
|
-
command = f"""{UV_RUN_CMD} --with distro python -c "import distro; print(distro.name(pretty=True))" """
|
|
178
|
-
import subprocess
|
|
179
|
-
distro = subprocess.run(command, shell=True, capture_output=True, text=True).stdout.strip()
|
|
180
|
-
specs: MachineSpecs = {
|
|
181
|
-
"system": platform.system(),
|
|
182
|
-
"distro": distro,
|
|
183
|
-
"home_dir": str(Path.home()),
|
|
184
|
-
}
|
|
185
|
-
print(specs)
|
|
186
|
-
from machineconfig.utils.source_of_truth import CONFIG_ROOT
|
|
187
|
-
path = CONFIG_ROOT.joinpath("machine_specs.json")
|
|
188
|
-
CONFIG_ROOT.mkdir(parents=True, exist_ok=True)
|
|
189
|
-
import json
|
|
190
|
-
path.write_text(json.dumps(specs, indent=4), encoding="utf-8")
|
|
191
|
-
return specs
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
def init_project(python: Annotated[Literal["3.13", "3.14"], typer.Option("--python", "-p", help="Python version for the uv virtual environment.")]= "3.13") -> None:
|
|
195
|
-
_ = python
|
|
196
|
-
repo_root = Path.cwd()
|
|
197
|
-
if not (repo_root / "pyproject.toml").exists():
|
|
198
|
-
typer.echo("❌ Error: pyproject.toml not found.", err=True)
|
|
199
|
-
raise typer.Exit(code=1)
|
|
200
|
-
print("Adding group `plot` with common data science and plotting packages...")
|
|
201
|
-
script = """
|
|
202
|
-
uv add --group plot \
|
|
203
|
-
# Data & computation
|
|
204
|
-
numpy pandas polars duckdb-engine python-magic \
|
|
205
|
-
# Plotting / visualization
|
|
206
|
-
matplotlib plotly kaleido \
|
|
207
|
-
# Notebooks / interactive
|
|
208
|
-
ipython ipykernel jupyterlab nbformat marimo \
|
|
209
|
-
# Code analysis / type checking / linting
|
|
210
|
-
mypy pyright ruff pylint pyrefly \
|
|
211
|
-
# Packaging / build / dev
|
|
212
|
-
cleanpy \
|
|
213
|
-
# CLI / debugging / utilities
|
|
214
|
-
ipdb pudb \
|
|
215
|
-
# Type hints for packages
|
|
216
|
-
types-python-dateutil types-pyyaml types-requests types-tqdm \
|
|
217
|
-
types-mysqlclient types-paramiko types-pytz types-sqlalchemy types-toml types-urllib3 \
|
|
218
|
-
|
|
219
|
-
"""
|
|
220
|
-
from machineconfig.utils.code import run_shell_script
|
|
221
|
-
run_shell_script(script)
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
def edit(path: Annotated[Optional[str], typer.Argument(..., help="The root directory of the project to edit, or a file path.")] = None) -> None:
|
|
225
|
-
if path is None:
|
|
226
|
-
root_path = Path.cwd()
|
|
227
|
-
print(f"No path provided. Using current working directory: {root_path}")
|
|
228
|
-
else:
|
|
229
|
-
root_path = Path(path).expanduser().resolve()
|
|
230
|
-
print(f"Using provided path: {root_path}")
|
|
231
|
-
from machineconfig.utils.accessories import get_repo_root
|
|
232
|
-
repo_root = get_repo_root(root_path)
|
|
233
|
-
if repo_root is not None and repo_root.joinpath("pyproject.toml").exists():
|
|
234
|
-
code = f"""
|
|
235
|
-
cd {repo_root}
|
|
236
|
-
uv add --dev pylsp-mypy python-lsp-server[all] pyright ruff-lsp # for helix editor.
|
|
237
|
-
source ./.venv/bin/activate
|
|
238
|
-
"""
|
|
239
|
-
else:
|
|
240
|
-
code = ""
|
|
241
|
-
if root_path.is_file():
|
|
242
|
-
code += f"hx {root_path}"
|
|
243
|
-
else:
|
|
244
|
-
code += "hx"
|
|
245
|
-
from machineconfig.utils.code import exit_then_run_shell_script
|
|
246
|
-
exit_then_run_shell_script(code)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# uses fzf as filter After ripgrep (secondary filter)
|
|
4
|
-
# from https://github.com/junegunn/fzf/blob/master/ADVANCED.md#ripgrep-integration
|
|
5
|
-
# 1. Search for text in files using Ripgrep
|
|
6
|
-
# 2. Interactively narrow down the list using fzf
|
|
7
|
-
# 3. Open the file in Vim
|
|
8
|
-
IFS=: read -ra selected < <(
|
|
9
|
-
rg --color=always --line-number --no-heading --smart-case "${*:-}" |
|
|
10
|
-
fzf --ansi \
|
|
11
|
-
--color "hl:-1:underline,hl+:-1:underline:reverse" \
|
|
12
|
-
--delimiter : \
|
|
13
|
-
--preview 'batcat --color=always {1} --highlight-line {2}' \
|
|
14
|
-
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
|
|
15
|
-
)
|
|
16
|
-
[ -n "${selected[0]}" ] && hx "${selected[0]}" "+${selected[1]}"
|
|
17
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# From https://github.com/phiresky/ripgrep-all/wiki/fzf-Integration
|
|
4
|
-
|
|
5
|
-
rga-fzf() {
|
|
6
|
-
RG_PREFIX="rga --files-with-matches"
|
|
7
|
-
local file
|
|
8
|
-
file="$(
|
|
9
|
-
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
|
|
10
|
-
fzf --sort --preview="[[ ! -z {} ]] && rga --pretty --context 5 {q} {}" \
|
|
11
|
-
--phony -q "$1" \
|
|
12
|
-
--bind "change:reload:$RG_PREFIX {q}" \
|
|
13
|
-
--preview-window="70%:wrap"
|
|
14
|
-
)" &&
|
|
15
|
-
echo "opening $file" &&
|
|
16
|
-
hx "$file"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# run the function
|
|
21
|
-
rga-fzf
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
REM adopted from https://github.com/phiresky/ripgrep-all/wiki/fzf-Integration
|
|
3
|
-
|
|
4
|
-
@echo off
|
|
5
|
-
setlocal
|
|
6
|
-
|
|
7
|
-
set RG_PREFIX=rga --files-with-matches
|
|
8
|
-
set FZF_DEFAULT_COMMAND=%RG_PREFIX% %1
|
|
9
|
-
for /f "delims=" %%i in ('fzf --sort --preview "rga --pretty --context 5 {q} {}" --phony -q %1 --bind "change:reload:%RG_PREFIX% {q}" --preview-window="70%:wrap"') do (
|
|
10
|
-
set FILE=%%i
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
if not "%FILE%" == "" (
|
|
14
|
-
echo Opening %FILE%
|
|
15
|
-
start "" "%FILE%"
|
|
16
|
-
) else (
|
|
17
|
-
echo No file selected.
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
endlocal
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import typer
|
|
3
|
-
from typing import Annotated
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def analyze_repo_development(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
|
|
7
|
-
from machineconfig.scripts.python.helpers_repos import count_lines
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
count_lines_path = Path(count_lines.__file__)
|
|
10
|
-
# --project $HOME/code/ machineconfig --group plot
|
|
11
|
-
cmd = f"""uv run --python 3.14 --with "machineconfig[plot]>=7.50" {count_lines_path} analyze-over-time {repo_path}"""
|
|
12
|
-
from machineconfig.utils.code import run_shell_script
|
|
13
|
-
run_shell_script(cmd)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if __name__ == "__main__":
|
|
17
|
-
pass
|