machineconfig 8.51__py3-none-any.whl → 8.61__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.
Files changed (91) hide show
  1. machineconfig/jobs/installer/python_scripts/sysabc.py +13 -34
  2. machineconfig/profile/mapper_dotfiles.toml +3 -3
  3. machineconfig/scripts/python/devops.py +1 -1
  4. machineconfig/scripts/python/devops_navigator.py +1 -1
  5. machineconfig/scripts/python/helper_env/path_manager_tui.py +1 -1
  6. machineconfig/scripts/python/helpers/helper_env/env_manager_tui.py +1 -1
  7. machineconfig/scripts/python/helpers/helper_env/path_manager_tui.py +1 -1
  8. machineconfig/scripts/python/helpers/helpers_croshell/croshell_impl.py +8 -4
  9. machineconfig/scripts/python/helpers/helpers_devops/cli_config.py +33 -1
  10. machineconfig/scripts/python/helpers/helpers_devops/cli_config_mount.py +77 -0
  11. machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +4 -0
  12. machineconfig/scripts/python/helpers/helpers_devops/cli_nw.py +90 -6
  13. machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +3 -3
  14. machineconfig/scripts/python/helpers/helpers_devops/cli_self.py +41 -15
  15. machineconfig/scripts/python/helpers/helpers_devops/cli_share_temp.py +69 -0
  16. machineconfig/scripts/python/helpers/helpers_devops/cli_ssh.py +4 -4
  17. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/__init__.py +0 -0
  18. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/commands.py +25 -0
  19. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/device_entry.py +17 -0
  20. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/devices.py +17 -0
  21. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/linux.py +103 -0
  22. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/macos.py +100 -0
  23. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/selection.py +47 -0
  24. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/utils.py +28 -0
  25. machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/windows.py +91 -0
  26. machineconfig/scripts/python/helpers/helpers_msearch/scripts_windows/fzfg.ps1 +1 -6
  27. machineconfig/scripts/python/helpers/helpers_network/ssh/__init__.py +0 -0
  28. machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_key_windows.py +23 -0
  29. machineconfig/scripts/python/helpers/helpers_network/{ssh_add_ssh_key.py → ssh/ssh_add_ssh_key.py} +21 -27
  30. machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_cloud_init.py +33 -0
  31. machineconfig/scripts/python/helpers/helpers_network/{ssh_debug_linux.py → ssh/ssh_debug_linux.py} +70 -51
  32. machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_linux_utils.py +35 -0
  33. machineconfig/scripts/python/helpers/helpers_network/{ssh_debug_windows.py → ssh/ssh_debug_windows.py} +12 -42
  34. machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_windows_utils.py +34 -0
  35. machineconfig/scripts/python/helpers/helpers_repos/cloud_repo_sync.py +2 -3
  36. machineconfig/scripts/python/helpers/{helpers_terminal/terminal_impl.py → helpers_sessions/attach_impl.py} +16 -25
  37. machineconfig/scripts/python/helpers/helpers_sessions/sessions_impl.py +57 -129
  38. machineconfig/scripts/python/helpers/helpers_sessions/utils.py +69 -0
  39. machineconfig/scripts/python/mcfg_entry.py +0 -7
  40. machineconfig/scripts/python/sessions.py +95 -14
  41. machineconfig/scripts/python/utils.py +3 -2
  42. machineconfig/settings/shells/bash/init.sh +0 -7
  43. machineconfig/settings/shells/pwsh/init.ps1 +2 -4
  44. machineconfig/settings/shells/wezterm/wezterm.lua +1 -0
  45. machineconfig/settings/shells/wt/settings.json +13 -19
  46. machineconfig/settings/shells/zsh/init.sh +0 -1
  47. machineconfig/settings/zellij/__init__.py +0 -0
  48. machineconfig/settings/zellij/config.kdl +0 -295
  49. machineconfig/settings/zellij/layouts/__init__.py +0 -0
  50. machineconfig/settings/zellij/layouts/st.kdl +0 -1
  51. machineconfig/settings/zellij/layouts/st2.kdl +6 -2
  52. machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
  53. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +10 -10
  54. machineconfig/utils/installer_utils/installer_cli.py +6 -2
  55. machineconfig/utils/installer_utils/installer_helper.py +50 -34
  56. machineconfig/utils/installer_utils/installer_locator_utils.py +3 -13
  57. machineconfig/utils/options_utils/tv_options.py +1 -1
  58. machineconfig/utils/procs.py +35 -27
  59. machineconfig/utils/schemas/layouts/layout_types.py +10 -0
  60. machineconfig/utils/source_of_truth.py +1 -0
  61. machineconfig/utils/ssh_utils/abc.py +1 -1
  62. {machineconfig-8.51.dist-info → machineconfig-8.61.dist-info}/METADATA +2 -3
  63. {machineconfig-8.51.dist-info → machineconfig-8.61.dist-info}/RECORD +68 -72
  64. {machineconfig-8.51.dist-info → machineconfig-8.61.dist-info}/entry_points.txt +0 -1
  65. machineconfig/jobs/scripts/bash_scripts/android.sh +0 -2
  66. machineconfig/jobs/scripts/bash_scripts/mount_drive +0 -128
  67. machineconfig/jobs/scripts/bash_scripts/mount_nfs +0 -49
  68. machineconfig/jobs/scripts/bash_scripts/mount_nw_drive +0 -61
  69. machineconfig/jobs/scripts/bash_scripts/mount_smb +0 -3
  70. machineconfig/jobs/scripts/bash_scripts/share_cloud.sh +0 -64
  71. machineconfig/jobs/scripts/bash_scripts/share_nfs +0 -49
  72. machineconfig/jobs/scripts/bash_scripts/start_docker +0 -23
  73. machineconfig/jobs/scripts/powershell_scripts/Restore-ThunderbirdProfile.ps1 +0 -92
  74. machineconfig/jobs/scripts/powershell_scripts/docker.ps1 +0 -7
  75. machineconfig/jobs/scripts/powershell_scripts/mount_nfs.ps1 +0 -42
  76. machineconfig/jobs/scripts/powershell_scripts/mount_nw.ps1 +0 -9
  77. machineconfig/jobs/scripts/powershell_scripts/mount_smb.ps1 +0 -2
  78. machineconfig/jobs/scripts/powershell_scripts/mount_ssh.ps1 +0 -13
  79. machineconfig/jobs/scripts/powershell_scripts/obs.ps1 +0 -4
  80. machineconfig/jobs/scripts/powershell_scripts/power_options.ps1 +0 -7
  81. machineconfig/jobs/scripts/powershell_scripts/share_cloud.cmd +0 -34
  82. machineconfig/jobs/scripts/powershell_scripts/share_smb.ps1 +0 -16
  83. machineconfig/scripts/python/helpers/helpers_network/mount_nfs.py +0 -85
  84. machineconfig/scripts/python/helpers/helpers_network/mount_nw_drive.py +0 -48
  85. machineconfig/scripts/python/helpers/helpers_network/mount_ssh.py +0 -64
  86. machineconfig/scripts/python/terminal.py +0 -58
  87. machineconfig/settings/zellij/config.orig.kdl +0 -295
  88. /machineconfig/{scripts/python/helpers/helpers_terminal → cluster/sessions_managers/wt_utils/examples}/__init__.py +0 -0
  89. /machineconfig/scripts/python/helpers/helpers_network/{ssh_add_identity.py → ssh/ssh_add_identity.py} +0 -0
  90. {machineconfig-8.51.dist-info → machineconfig-8.61.dist-info}/WHEEL +0 -0
  91. {machineconfig-8.51.dist-info → machineconfig-8.61.dist-info}/top_level.txt +0 -0
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # mount nfs share on linux
4
- # sudo nala install nfs-common
5
- # mkdir ~/data/local
6
- # sudo mount -o nolock,noatime,nodiratime,proto=tcp,timeo=600,retrans=2,noac alex-p51s-5:/home/alex/data/local ./data/local
7
-
8
- # Check if remote server is reachable and share folder exists
9
- if ! ping -c 1 "$remote_server" &> /dev/null; then
10
- echo "💥 Error: Remote server $remote_server is not reachable."
11
- exit 1
12
- fi
13
-
14
- #if ! showmount -e "$remote_server" | grep -q "$share_path"; then
15
- # echo "Error: NFS share folder $share_path is not available on $remote_server."
16
- # exit 1
17
- #fi
18
-
19
- # Check if the share is already mounted
20
- if mount | grep -q ":$share_path on "; then
21
- echo "⚠️ The NFS share $share_info is already mounted."
22
- exit 0
23
- fi
24
-
25
-
26
- if [ ! -d "$local_mount_point" ]; then
27
- echo "➡️ Creating local mount point directory $local_mount_point"
28
- sudo mkdir -p "$local_mount_point"
29
- sudo chown "$(id -u):$(id -g)" "$local_mount_point"
30
- fi
31
-
32
- sudo service rpcbind start
33
- sudo service nfs-common start
34
- # without the two above, on wsl, you get error: https://superuser.com/questions/657071/mount-nfs-rpc-statd-is-not-running-but-is-required-for-remote-locking
35
-
36
- echo "💡 Mounting NFS share $share_info at $local_mount_point using command:"
37
- echo "sudo mount -t nfs $share_info $local_mount_point"
38
- sudo mount -t nfs "$share_info" "$local_mount_point"
39
-
40
- # Add a line to fstab file to ensure automount
41
- fstab_line="$remote_server:$share_path $local_mount_point nfs defaults 0 0"
42
- if grep -qF "$fstab_line" /etc/fstab; then
43
- echo "🤷‍♂️ The following line already exists in /etc/fstab:"
44
- echo "$fstab_line"
45
- else
46
- echo "➡️ Adding the following line to /etc/fstab:"
47
- echo "$fstab_line"
48
- echo "$fstab_line" | sudo tee -a /etc/fstab > /dev/null
49
- fi
@@ -1,61 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # mount shared windows folder on linux
4
- # sudo mount -t drvfs '\\SAH0229234\t7share' /mnt/t7share
5
- # or sudo mount -t drvfs 'M:' /mnt/t7share
6
-
7
- #write an extremely verbose bash script to mount a windows network drive in wsl.
8
- #1) The user is prompted for inputs, and is given examples and defaults if enter was pressed.
9
- #2) Before every command is executed, echo what are you doing and what command is used to achieve that
10
- #3) echo long '-----------' between steps
11
- #4) Make the code very robust so it can catch all errors and execute gracefully if anything went wrong.
12
- #5) prompt the user whether he wants the process to be done automatically, in which case add settings to fstab file and refresh it.
13
- #6) if username and password not passed, don't pass them to mount command
14
-
15
-
16
- drive_location=''
17
- mount_point=''
18
- username=''
19
- password=''
20
- machineconfig.scripts.python.mount_nw_drive
21
-
22
- # Check if mount point directory exists, create if not
23
- if [ ! -d "$mount_point" ]; then
24
- echo "The mount point directory does not exist, creating it now..."
25
- mkdir -p "$mount_point"
26
- fi
27
-
28
- # Mount the network drive
29
- echo "Mounting the network drive at $mount_point using the following command:"
30
- mount_command="sudo mount -t drvfs $drive_location $mount_point "
31
- if [[ ! -z $username ]]; then
32
- mount_command="$mount_command -o username=$username"
33
- fi
34
- if [[ ! -z $password ]]; then
35
- mount_command="$mount_command,password=$password"
36
- fi
37
- echo "$mount_command"
38
- $mount_command
39
-
40
- # Check if mount was successful
41
- if [ $? -eq 0 ]; then
42
- echo "The network drive has been successfully mounted at $mount_point."
43
- echo "--------------------------------------"
44
- else
45
- echo "There was an error while mounting the network drive. Please check your input and try again."
46
- exit 1
47
- fi
48
-
49
- # Prompt user if they want to add the mount to fstab
50
- read -p "Do you want to automatically mount this network drive on system startup? (y/n): " auto_mount
51
-
52
- if [[ $auto_mount == "y" ]]; then
53
- echo "Adding mount point to fstab..."
54
- fstab_entry="$drive_location $mount_point drvfs defaults,uid=$(id -u),gid=$(id -g),metadata"
55
- echo "$fstab_entry" | sudo tee -a /etc/fstab
56
- echo "Refreshing fstab..."
57
- sudo mount -a
58
- echo "The network drive has been added to fstab and will automatically mount on system startup."
59
- fi
60
-
61
- exit 0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- sudo mount -t cifs //<vpsa_ip_address>/<export_share> /mnt/<local_share>
@@ -1,64 +0,0 @@
1
- #!/bin/bash
2
- # https://temp.sh/
3
- # 📤 CLOUD FILE SHARING SCRIPT 📤
4
- # This script uploads files or directories to transfer.sh for easy sharing
5
- # Usage: share_cloud <file|directory> or command | share_cloud <file_name>
6
-
7
- # Check if arguments are provided
8
- if [ $# -eq 0 ]; then
9
- echo """ ❌ ERROR | No arguments specified
10
-
11
- 📋 USAGE:
12
- share_cloud <file|directory>
13
- command | share_cloud <file_name>
14
- """>&2
15
- return 1
16
- fi
17
-
18
- # https://temp.sh/
19
-
20
- # Process the input
21
- if tty -s; then
22
- # Direct file/directory upload mode
23
- file="$1"
24
- file_name=$(basename "$file")
25
-
26
- # Check if the file exists
27
- if [ ! -e "$file" ]; then
28
- echo """ ❌ ERROR | File not found
29
-
30
- 🔍 File \"$file\" does not exist
31
- """>&2
32
- return 1
33
- fi
34
-
35
- echo """ 📤 UPLOADING | Sharing file to transfer.sh
36
- """
37
-
38
- # Handle directories by creating a zip archive
39
- if [ -d "$file" ]; then
40
- file_name="$file_name.zip"
41
- echo "📦 Compressing directory \"$file\" for upload..."
42
- (cd "$file" && zip -r -q - .) | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
43
- else
44
- # Handle regular files
45
- echo "📄 Uploading file \"$file\"..."
46
- cat "$file" | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
47
- fi
48
- else
49
- # Pipe mode - reading from stdin
50
- file_name=$1
51
- echo """ 📤 UPLOADING | Sharing from stdin to transfer.sh
52
- """
53
- echo "📋 Creating file \"$file_name\" from piped input..."
54
- curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null
55
-
56
- # Display QR code for the URL
57
- echo """ 📱 QR CODE | Scan with mobile device to access file
58
- """
59
- qr "https://transfer.sh/$file_name"
60
- fi
61
-
62
- echo """✅ UPLOAD COMPLETE | File is available at the URL above
63
- """
64
- echo "⚠️ NOTE: Files are automatically deleted after 14 days"
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # REFERENCES:
4
- # https://help.ubuntu.com/community/NFSv4Howto
5
- # https://www.ibm.com/docs/en/ftmfm/4.0.5?topic=offering-network-file-system-nfs-version-4
6
-
7
- # Function to display an error message and exit the script
8
- exit_with_error() {
9
- echo "Error: $1"
10
- exit 1
11
- }
12
-
13
- # Function to validate if the given directory path exists
14
- validate_directory() {
15
- if [[ ! -d "$1" ]]; then
16
- exit_with_error "Directory '$1' does not exist."
17
- fi
18
- }
19
-
20
- # Function to validate if the given file exists
21
- validate_file() {
22
- if [[ ! -f "$1" ]]; then
23
- exit_with_error "File '$1' does not exist."
24
- fi
25
- }
26
-
27
- # Function to restart NFS server
28
- restart_nfs_server() {
29
- sudo service nfs-server restart
30
- sudo exportfs -ra
31
- }
32
-
33
- mkdir -p "$HOME/data/share_nfs"
34
- read -p "Enter the directory path you want to share [default: ~/data/share_nfs] : " share_path
35
- share_path=${share_path:-$HOME/data/share_nfs}
36
- validate_directory "$share_path"
37
- validate_file "/etc/exports"
38
-
39
- # Generate the NFS export line with default options
40
- export_line="$share_path *(rw,sync,fsid=0,no_subtree_check,crossmnt,no_root_squash,insecure)"
41
- # for wsl, remember to add insecure option to /etc/exportfs file on server side
42
-
43
- # Add the export line to the /etc/exports file
44
- echo "$export_line" | sudo tee -a /etc/exports >/dev/null
45
-
46
- restart_nfs_server
47
-
48
- echo "NFS sharing configured successfully!"
49
-
@@ -1,23 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Ensure the script is run with sudo privileges
4
- if [ "$EUID" -ne 0 ]; then
5
- echo "Please run this script with sudo."
6
- exit 1
7
- fi
8
-
9
- dockerd_path=$(which dockerd)
10
- echo "dockerd_path: $dockerd_path"
11
-
12
- launch_dockerd="sudo $dockerd_path"
13
- echo "launch_dockerd: $launch_dockerd"
14
-
15
- zellij action new-tab --name dockerd
16
- sleep 1
17
- zellij action go-to-tab-name dockerd
18
- sleep 0.5
19
- cd $HOME
20
- zellij action new-pane --direction down -- sudo $dockerd_path
21
- zellij action move-focus up; sleep 0.2
22
- zellij action close-pane; sleep 0.2
23
-
@@ -1,92 +0,0 @@
1
-
2
- <#
3
- .SYNOPSIS
4
- Restores a Thunderbird profile from a backup.
5
-
6
- .DESCRIPTION
7
- This script automates the restoration of a Thunderbird profile. It finds the
8
- default backup profile located in ~/.thunderbird and copies its contents to
9
- the active Thunderbird profile folder in AppData/Roaming.
10
-
11
- WARNING: This script will overwrite the current active Thunderbird profile.
12
- Ensure Thunderbird is closed before running.
13
- #>
14
-
15
- # --- Configuration ---
16
- $ErrorActionPreference = "Stop"
17
-
18
- # --- Script ---
19
-
20
- # 1. Define the root paths for backup and active profiles
21
- $thunderbirdBackupRoot = "$env:USERPROFILE\.thunderbird"
22
- $thunderbirdAppdataRoot = "$env:APPDATA\Thunderbird"
23
-
24
- Write-Host "Thunderbird Profile Restore Script"
25
- Write-Host "-----------------------------------"
26
-
27
- # 2. Find the default profile path from the backup's profiles.ini
28
- try {
29
- $backupIniPath = Join-Path $thunderbirdBackupRoot "profiles.ini"
30
- $backupProfileRelativePath = (Get-Content $backupIniPath | Select-String -Pattern '^Path=' | Select-Object -First 1) -replace '^Path=', ''
31
- $backupProfileFullPath = Join-Path $thunderbirdBackupRoot $backupProfileRelativePath
32
- Write-Host "Found backup profile: $backupProfileFullPath" -ForegroundColor Green
33
- }
34
- catch {
35
- Write-Error "Could not find or read the backup profiles.ini at '$backupIniPath'."
36
- exit 1
37
- }
38
-
39
- # 3. Find the default profile path from the active installation's profiles.ini
40
- try {
41
- $activeIniPath = Join-Path $thunderbirdAppdataRoot "profiles.ini"
42
- $activeProfileRelativePath = (Get-Content $activeIniPath | Select-String -Pattern '^Path=' | Select-Object -First 1) -replace '^Path=', ''
43
- $activeProfileFullPath = Join-Path $thunderbirdAppdataRoot $activeProfileRelativePath
44
- Write-Host "Found active profile: $activeProfileFullPath" -ForegroundColor Green
45
- }
46
- catch {
47
- Write-Error "Could not find or read the active profiles.ini at '$activeIniPath'."
48
- exit 1
49
- }
50
-
51
- # 4. Safety Check: Confirm both profile paths exist
52
- if (-not (Test-Path -Path $backupProfileFullPath -PathType Container)) {
53
- Write-Error "Backup profile directory does not exist: $backupProfileFullPath"
54
- exit 1
55
- }
56
- if (-not (Test-Path -Path $activeProfileFullPath -PathType Container)) {
57
- Write-Error "Active profile directory does not exist: $activeProfileFullPath"
58
- exit 1
59
- }
60
-
61
- # 5. CRITICAL: Get user confirmation before proceeding
62
- Write-Warning "This will completely overwrite the profile at '$activeProfileFullPath' with the contents of the backup."
63
- $confirmation = Read-Host "Are you absolutely sure you want to continue? (y/n)"
64
-
65
- if ($confirmation -ne 'y') {
66
- Write-Host "Operation cancelled by user." -ForegroundColor Yellow
67
- exit 0
68
- }
69
-
70
- # 6. Ensure Thunderbird is not running
71
- Write-Host "Checking for running Thunderbird process..."
72
- $thunderbirdProcess = Get-Process thunderbird -ErrorAction SilentlyContinue
73
- if ($thunderbirdProcess) {
74
- Write-Host "Closing Thunderbird to prevent file conflicts..."
75
- Stop-Process -InputObject $thunderbirdProcess -Force
76
- Start-Sleep -Seconds 3 # Give it a moment to close gracefully
77
- } else {
78
- Write-Host "Thunderbird is not running. Good."
79
- }
80
-
81
- # 7. Copy the backup profile to the active profile directory using robocopy
82
- Write-Host "Starting profile restoration... (This may take a while)"
83
- try {
84
- robocopy $backupProfileFullPath $activeProfileFullPath /MIR /E /IS /IT /NFL /NDL /NJH /NJS /nc /ns /np
85
- Write-Host "Profile restoration complete!" -ForegroundColor Green
86
- Write-Host "You can now start Thunderbird."
87
- }
88
- catch {
89
- Write-Error "An error occurred during the file copy operation."
90
- exit 1
91
- }
92
-
@@ -1,7 +0,0 @@
1
-
2
- # as per https://docs.docker.com/desktop/install/windows-install/
3
- mkdir ~/tmp_results/tmp_installers/docker
4
- cd ~/tmp_results/tmp_installers/docker
5
-
6
- curl "https://desktop.docker.com/win/main/amd64/Docker Desktop Installer.exe" --output installer.exe
7
- Start-Process .\installer.exe -Wait install --accept-license
@@ -1,42 +0,0 @@
1
-
2
- # mount nfs share on windows
3
- # Enable-WindowsOptionalFeature -FeatureName ServicesForNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart
4
- # New-PSDrive -Name "z" -Root "\\alex-p51s-5/home/alex/dbhdd" -Persist -PSProvider "FileSystem"
5
- # notice there is not : separation between host and path
6
- # mount.exe -o anon,nolock,rw,hard,intr,noatime,proto=tcp,no_root_squash alex-p51s-5:/home/alex/dbhdd X:
7
-
8
-
9
- # Install NFS client
10
- Write-Host "Installing NFS client..."
11
- # this is for windows server: Install-WindowsFeature ClientForNFS-Infrastructure -IncludeManagementTools
12
- Enable-WindowsOptionalFeature -FeatureName ServicesForNFS-ClientOnly, ClientForNFS-Infrastructure -Online -NoRestart
13
- Write-Host "NFS client installed successfully."
14
-
15
- $server=''
16
- $sharePath=''
17
- $driveLetter=''
18
- $options = "rw,sec=sys,no_subtree_check"
19
-
20
-
21
- uv run python -m machineconfig.scripts.python.mount_nfs
22
- . $HOME/tmp_results/shells/python_return_command.ps1
23
-
24
- # Configure NFS server
25
- #Write-Host "Configuring NFS server..."
26
- #$nfsServerCommand = "exportfs -o $options $sharePath"
27
- #Write-Host "Running command: $nfsServerCommand"
28
- #Invoke-Expression $nfsServerCommand
29
- #Write-Host "NFS server configured successfully."
30
-
31
- $mountCommand = "mount.exe $server" + ":$sharePath $driveLetter" # + " -o rw,hard,intr,noatime,proto=tcp,no_root_squash"
32
- #.exe is crucial, mount is nothing but alias for New-PSDrive
33
- # New-PSDrive -Name "Y" -Root "\\host/path" -Persist -PSProvider "FileSystem" -Credential $cred
34
- # see this: https://superuser.com/questions/1677820/powershell-mount-nfs-with-options
35
-
36
- Write-Host "Mounting NFS share..."
37
- Write-Host "Running command: $mountCommand"
38
- Invoke-Expression $mountCommand
39
- # create symlink to the mounted drive from ~/data/mount_nfs/{remote_server}
40
- Write-Host "Executing this following command: New-Item -ItemType SymbolicLink -Path $HOME/data/mount_nfs/$server -Target $driveLetter -Force"
41
- New-Item -ItemType SymbolicLink -Path "$HOME/data/mount_nfs/$server" -Target "$driveLetter" -Force
42
- Write-Host "NFS share mounted successfully."
@@ -1,9 +0,0 @@
1
-
2
- # mapping a network drive
3
- # read share name by asking for it
4
- $share_info = Read-Host -Prompt "Enter share info (e.g. \\SAH0229234\t7share) "
5
- $username = Read-Host -Prompt "Enter username (e.g. alex) "
6
- $cred = Get-Credential -Credential "$username"
7
- Write-Host "Executing: New-PSDrive -Name Z -PSProvider FileSystem -Root $share_info -Persist -Credential $cred"
8
- New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root $share_info -Persist -Credential $cred
9
-
@@ -1,2 +0,0 @@
1
-
2
- New-SmbMapping -LocalPath 'X:' -RemotePath '\\alex-xps13\share_smb'
@@ -1,13 +0,0 @@
1
-
2
-
3
- winget install WinFsp.WinFsp --source winget --scope user --accept-package-agreements --accept-source-agreements; winget install SSHFS-Win.SSHFS-Win --source winget --scope user --accept-package-agreements --accept-source-agreements
4
-
5
- $host = ''
6
- $user = ''
7
- $sharePath = ''
8
- $driveLetter = ''
9
-
10
- uv run --python 3.14 --with "machineconfig>=8.51" python -m machineconfig.scripts.python.mount_ssh
11
-
12
- net use T: \\sshfs.kr\$user@$host.local
13
- # this worked: net use T: \\sshfs\alex@alex-p51s-5.local
@@ -1,4 +0,0 @@
1
-
2
-
3
- winget install Gyan.FFmpeg --source winget --scope user --accept-package-agreements --accept-source-agreements
4
-
@@ -1,7 +0,0 @@
1
-
2
- # power and sleep options.
3
- Powercfg /Change monitor-timeout-ac 60
4
- Powercfg /Change monitor-timeout-dc 0
5
- Powercfg /Change standby-timeout-ac 0
6
- Powercfg /Change standby-timeout-dc 0
7
-
@@ -1,34 +0,0 @@
1
-
2
- @echo off
3
- setlocal EnableDelayedExpansion EnableExtensions
4
- goto main
5
- :usage
6
- echo No arguments specified. >&2
7
- echo Usage: >&2
8
- echo transfer ^<file^|directory^> >&2
9
- echo ... ^| transfer ^<file_name^> >&2
10
- exit /b 1
11
- :main
12
- if "%~1" == "" goto usage
13
- timeout.exe /t 0 >nul 2>nul || goto not_tty
14
- set "file=%~1"
15
- for %%A in ("%file%") do set "file_name=%%~nxA"
16
- if exist "%file_name%" goto file_exists
17
- echo %file%: No such file or directory >&2
18
- exit /b 1
19
- :file_exists
20
- if not exist "%file%\" goto not_a_directory
21
- set "file_name=%file_name%.zip"
22
- pushd "%file%" || exit /b 1
23
- set "full_name=%temp%\%file_name%"
24
- powershell.exe -Command "Get-ChildItem -Path . -Recurse | Compress-Archive -DestinationPath ""%full_name%"""
25
- curl.exe --progress-bar --upload-file "%full_name%" "https://transfer.sh/%file_name%"
26
- popd
27
- goto :eof
28
- :not_a_directory
29
- curl.exe --progress-bar --upload-file "%file%" "https://transfer.sh/%file_name%"
30
- goto :eof
31
- :not_tty
32
- set "file_name=%~1"
33
- curl.exe --progress-bar --upload-file - "https://transfer.sh/%file_name%"
34
- goto :eof
@@ -1,16 +0,0 @@
1
-
2
-
3
- $Path = $HOME + '\data\share_smb'
4
-
5
- Get-SmbShare
6
-
7
- if (!(Test-Path -Path $Path)) {
8
- New-Item -ItemType Directory -Path $Path
9
- }
10
-
11
- # ICACLS $Path /grant $env:USERDOMAIN\$env:USERNAME:S
12
-
13
- # provided access to all users irrespective of active directory
14
- echo "Make sure you have elevated privledges to run this command"
15
- New-SmbShare -Name "share_smb" -Path "$Path" FullAccess "Everyone"
16
-
@@ -1,85 +0,0 @@
1
- """NFS mounting script"""
2
-
3
- from pathlib import Path
4
-
5
- from machineconfig.utils.ssh import SSH
6
- from machineconfig.utils.options import choose_from_options, choose_ssh_host
7
-
8
- import platform
9
- import subprocess
10
-
11
-
12
- def main():
13
- print("\n" + "=" * 50)
14
- print("🚀 Starting NFS Mounting Process")
15
- print("=" * 50 + "\n")
16
-
17
- share_info = input("🔗 Enter share path (e.g., machine:~/data/share_nfs) [Press Enter for interactive choice]: ")
18
- if share_info == "":
19
- print("\n🔍 Interactive mode selected for choosing share path.")
20
- tmp = choose_ssh_host(multi=False)
21
- assert isinstance(tmp, str)
22
- ssh = SSH(host=tmp, username=None, hostname=None, ssh_key_path=None, password=None, port=22, enable_compression=False)
23
- default = f"{ssh.hostname}:{ssh.run_shell_cmd_on_remote(command='echo $HOME', verbose_output=False, description='Get home directory', strict_stderr=False, strict_return_code=True).op}/data/share_nfs"
24
- share_info = choose_from_options(msg="📂 Choose a share path:", options=[f"{ssh.hostname}:{item.split(' ')[0]}" for item in ssh.run_shell_cmd_on_remote(command="cat /etc/exports", verbose_output=False, description='Get NFS exports', strict_stderr=False, strict_return_code=False).op.split("\n") if not item.startswith("#")] + [default], default=default, multi=False)
25
- assert isinstance(share_info, str), f"❌ share_info must be a string. Got {type(share_info)}"
26
-
27
- remote_server = share_info.split(":")[0]
28
- share_path = share_info.split(":")[1]
29
-
30
- print(f"\n🌐 Remote Server: {remote_server}")
31
- print(f"📁 Share Path: {share_path}\n")
32
-
33
- if platform.system() in ["Linux", "Darwin"]:
34
- mount_path_1 = Path(share_path)
35
- mount_path_2 = Path.home().joinpath("data/mount_nfs", remote_server)
36
- if str(mount_path_1).startswith("/home"):
37
- mount_path_3 = Path.home().joinpath(*mount_path_1.parts[3:])
38
- else:
39
- mount_path_3 = mount_path_2
40
-
41
- print("🔧 Preparing mount paths...")
42
- local_mount_point_choice = choose_from_options(
43
- msg="📂 Choose mount path OR input custom one:",
44
- options=[mount_path_1, mount_path_2, mount_path_3],
45
- default=mount_path_2,
46
- custom_input=True,
47
- multi=False,
48
- )
49
- local_mount_point = Path(local_mount_point_choice).expanduser()
50
-
51
- txt = f"""
52
- share_info={share_info}
53
- remote_server={remote_server}
54
- share_path={share_path}
55
- local_mount_point={local_mount_point}
56
- """
57
- # PROGRAM_PATH.write_text(txt)
58
- subprocess.run(txt, shell=True, check=True)
59
-
60
- print("✅ Mount paths prepared successfully!\n")
61
-
62
- elif platform.system() == "Windows":
63
- print("\n🔍 Checking existing drives...")
64
- completed = subprocess.run(["powershell", "-Command", "Get-PSDrive -PSProvider 'FileSystem'"], capture_output=True, check=False, text=True)
65
- print((completed.stdout or "").strip())
66
- driver_letter = input(r"🖥️ Choose driver letter (e.g., Z:\\) [Avoid already used ones]: ") or "Z:\\"
67
- txt = f"""
68
- $server = "{remote_server}"
69
- $sharePath = "{share_path}"
70
- $driveLetter = "{driver_letter}"
71
- """
72
- # PROGRAM_PATH.write_text(txt)
73
- subprocess.run(txt, shell=True, check=True)
74
- print("✅ Drive letter selected and configuration saved!\n")
75
-
76
- print("\n📄 Configuration File Content:")
77
- print("-" * 50)
78
- # print(PROGRAM_PATH.read_text(encoding="utf-8"))
79
- print("-" * 50 + "\n")
80
-
81
- print("🎉 NFS Mounting Process Completed Successfully!\n")
82
-
83
-
84
- if __name__ == "__main__":
85
- main()
@@ -1,48 +0,0 @@
1
- from pathlib import Path
2
- import platform
3
-
4
-
5
- def main():
6
- print("\n" + "=" * 50)
7
- print("🚀 Welcome to the Windows Network Drive Mounting Wizard")
8
- print("=" * 50 + "\n")
9
-
10
- drive_location = input("🔗 Enter the network drive location (e.g., //192.168.1.100/Share): ")
11
- machine_name = drive_location.split("//")[1].split("/")[0]
12
-
13
- mount_point_input = input(f"📂 Enter the mount point directory (e.g., /mnt/network) [Default: ~/data/mount_nw/{machine_name}]: ")
14
- if mount_point_input == "":
15
- mount_point = Path.home().joinpath(rf"data/mount_nw/{machine_name}")
16
- else:
17
- mount_point = Path(mount_point_input).expanduser()
18
-
19
- print(f"\n🌐 Network Drive Location: {drive_location}")
20
- print(f"📁 Mount Point: {mount_point}\n")
21
-
22
- username = input("👤 Enter the username: ")
23
- password = input("🔒 Enter the password: ")
24
-
25
- if platform.system() in ["Linux", "Darwin"]:
26
- print("\n🔧 Saving configuration for Linux...")
27
- txt = f"""
28
- drive_location='{drive_location}'
29
- mount_point='{mount_point}'
30
- username='{username}'
31
- password='{password}'
32
-
33
- """
34
- # PROGRAM_PATH.write_text(txt, encoding="utf-8",)
35
- import subprocess
36
-
37
- subprocess.run(txt, shell=True, check=True)
38
- print("✅ Configuration saved successfully!\n")
39
-
40
- elif platform.system() == "Windows":
41
- print("❌ Windows platform is not yet supported.")
42
- raise NotImplementedError
43
-
44
- print("🎉 Windows Network Drive Mounting Process Completed!\n")
45
-
46
-
47
- if __name__ == "__main__":
48
- main()