Git Clone Error – fetch-pack: unexpected disconnect while reading sideband packet

$ git clone --verbose https://halprdgit01.hq.halw.com:8443/scm/nd/hap_group_ui-automation-2023.git
Cloning into 'hap_group_ui-automation-2023'...
Username for 'https://halprdgit01.hq.halw.com:8443': mlr
Password for 'https://mlr@halprdgit01.hq.halw.com:8443':

POST git-upload-pack (142 bytes)
POST git-upload-pack (gzip 4030 to 2040 bytes)
remote: Enumerating objects: 40934, done.
remote: Counting objects: 100% (40934/40934), done.
remote: Compressing objects: 100% (21475/21475), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 3784 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Refer: https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning

Quick solution:

With this kind of error, I usually start by raising the postBuffer size by:

git config --global http.postBuffer 524288000

(some comments below report having to double the value):

git config --global http.postBuffer 1048576000

RDP stops working when screen locks / turns off Ubuntu 22.04

Refer: https://www.youtube.com/watch?v=63uppKZ_Alk

On PopOS 22.04 I installed the application with Firefox, it seems like newer versions of Ubuntu required me to use Chrome, instead.

sudo apt-get install chrome-gnome-shell

GNOME Shell Integration Chrome Exention
https://chromewebstore.google.com/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep?pli=1

https://extensions.gnome.org/

Search For: Allowed Locked Remote Desktop

Maybe this: https://extensions.gnome.org/extension/4338/allow-locked-remote-desktop/

My Cloud SSH Access and Backup

Refer: https://programmingwithjim.wordpress.com/2017/02/22/enabling-rsync-to-the-wd-my-cloud/

mycloud_backups.txt

ssh -oConnectTimeout=300 -oKexAlgorithms=+diffie-hellman-group1-sha1 sshd@192.168.0.11

root@WDMyCloud / # cd shares
root@WDMyCloud /shares # ls -ltr
lrwxrwxrwx    1 root     root            22 Oct  2 12:33 mruckman -> /mnt/HD/HD_a2/mruckman
lrwxrwxrwx    1 root     root            20 Oct  2 12:33 joseph -> /mnt/HD/HD_a2/joseph
lrwxrwxrwx    1 root     root            20 Oct  2 12:33 family -> /mnt/HD/HD_a2/family
lrwxrwxrwx    1 root     root            31 Oct  2 12:33 TimeMachineBackup -> /mnt/HD/HD_a2/TimeMachineBackup
lrwxrwxrwx    1 root     root            23 Oct  2 12:33 SmartWare -> /mnt/HD/HD_a2/SmartWare
lrwxrwxrwx    1 root     root            20 Oct  2 12:33 Public -> /mnt/HD/HD_a2/Public
lrwxrwxrwx    1 root     root            13 Oct  2 12:42 Volume_1 -> /mnt/HD/HD_a2
lrwxrwxrwx    1 root     root            16 Oct  2 12:42 BUP_Slim_BK-1 -> /mnt/USB/USB1_b1

Backup to SSD DRIVE
rsync -ahrv --progress "/mnt/HD/HD_a2/mruckman" "/mnt/USB/USB1_b1/mruckman"
rsync -ahrv --progress "/mnt/HD/HD_a2/joseph"   "/mnt/USB/USB1_b1/joseph"
rsync -ahrv --progress "/mnt/HD/HD_a2/family"   "/mnt/USB/USB1_b1/family"
rsync -ahrv --progress "/mnt/HD/HD_a2/Public"   "/mnt/USB/USB1_b1/public"

TEST
rsync -ahrv --progress "/mnt/HD/HD_a2/Public/Fun Stuff" "/mnt/USB/USB1_b1/Fun Stuff"

NOTE: Using rSync will put "_un" folders on your source root folders

Prevent Password from Expiring

Refer: https://www.cyberciti.biz/tips/setting-off-password-aging-expiration.html

List current settings

chage -l username

Example

Last password change   : Dec 16, 2023
Password expires   : Mar 15, 2024
Password inactive   : never
Account expires   : never
Minimum number of days between password change   : 5
Maximum number of days between password change   : 90
Number of days of warning before password expires   : 7

Update settings (All Settings)

chage username

Increase Max Password Age ONLY

chage -I -1 -m 0 -M 99999 -E -1 username

Skip password with sudo command

To execute the systemctl restart bluetooth command without entering a password on Ubuntu Linux 20.04, you can set up a specific sudoers configuration. This allows your user account to execute this specific command without being prompted for a password.

Follow these steps:

Open the sudoers file using the visudo command. It's essential to use visudo to edit the sudoers file to prevent syntax errors:

sudo visudo

Scroll down or navigate to the bottom of the file and add the following line:

your_username ALL=(ALL) NOPASSWD: /bin/systemctl restart bluetooth

Replace your_username with your actual username on the system. This line grants your user account permission to run the specified command without a password prompt.

Save the changes and close the editor. In visudo, you can save by pressing Ctrl + X, then Y to confirm changes, and Enter to exit.

Now, when you run sudo systemctl restart bluetooth with the specified username, it shouldn't prompt for a password. Remember to be cautious when modifying sudoers, as incorrect settings might impact system security. Always follow best practices and ensure you're aware of the security implications.

Install Docker Desktop Ubuntu 22.04

Refer: https://askubuntu.com/questions/1409192/cannot-install-docker-desktop-on-ubuntu-22-04

sudo apt-get update

sudo apt-get install ca-certificates curl gnupg lsb-release

sudo mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

Download current version: https://docs.docker.com/desktop/install/ubuntu/

sudo apt-get install ./docker-desktop-<version>-<arch>.deb

Note: At the end of the installation process, apt displays an error due to installing a downloaded package. You can ignore this error message.

N: Download is performed unsandboxed as root, as file '/home/user/Downloads/docker-desk

It does not seem to start correctly, using this hack:

Refer: https://github.com/docker/desktop-linux/issues/94

Had to close and launch it twice, to see the application properly, it might have hung, start without logon; however additional reading said the start-up process could take some time. You might want to skip this step until you generate the keys.

/opt/docker-desktop/bin/com.docker.backend

Original Docker Desktop Target that DID NOT WORK

Menu Libre Command

/opt/docker-desktop/bin/docker-desktop

You also need to generate keys before you can logon

Refer: https://docs.docker.com/desktop/get-started/#credentials-management-for-linux-users

gpg --generate-key

You'll need to grab the generated public key from the above command, to use with pass init command, as follows:

pass init <your_generated_gpg-id_public_key>

Linux Watch Command

Refer: https://www.makeuseof.com/watch-run-linux-program-periodically/

Sometimes, you need to repeatedly run a command or a program to monitor various aspects of your system, like ongoing processes, disk space usage, or user logins. The Linux watch command lets you automate these tasks without having to manually run them again and again.

Using this command, you can monitor system activities in real time such as user logins, network status, memory and CPU usage, disk space, etc. Let’s see how to use the watch command in Linux.
What Is the Watch Command?

The watch Linux command runs a specified command or a program repeatedly, at regular intervals, and displays its output in the terminal. This lets you observe the changes in the output in real time. It refreshes the output at each interval, overwriting the command's previous output. By default, the command repeats every two seconds and continues until you manually stop it using Ctrl + C.
Watch Command Syntax

The syntax of the watch command is:

watch options <command>

There are various command line options available to use with the watch command. If you run the watch command without any options, it will run the specified command after every two seconds. For instance, the following will show you the output of the ls command:

watch ls -l ~/

The output will show you the changes in the directory listing if a file is created, deleted, or changes in size, while refreshing the output every two seconds.

Run a Command Every X Seconds Using watch

You can change the update interval of the watch command. This means you can tell the watch command to wait for x seconds before repeating the command. To change the update interval, use the -n option followed by the time interval in seconds.

watch -n 

For instance, to run a command after every 5 seconds, run:

watch -n 5 <command>

change update interval of watch command

The watch command overwrites its output on each refresh. Using the -d option, you can also highlight the changes between the previous and updated output.

watch -d

Hide Header in Output of the watch Command

By default, the watch command displays a header at the top of every output that contains the update interval, command name, and the system's current date and time. You can strip the header from the output using the -t option:

watch -t <command>

Play Beeps on Error

When a Linux process finishes running, it returns an exit code. By convention, the value is 0 on success and non-zero to represent an error. The watch command’s -b option plays a beep sound if the command returns a non-zero exit.

Let's say you want to monitor sshd.service and get notified when the service stops; you would use:

watch -b sudo systemctl status sshd.service

This command will give beep sounds when the service stops. The beep will stop when the service resumes. To test this, open another terminal window and stop the service. This will give constant beeps until you start the service again. However, to use this feature, you must have the beep package installed on your system.
Exit the watch Command on Output Change

You can also tell the watch command to stop running and exit when the output of the command changes. You can do this using the -g option. This option is very useful in scenarios when you are waiting for certain changes in the output.

Once the output changes, the watch command will stop. You can combine this usage with the echo command to display a message on the screen.

For example, consider a scenario where you are waiting for a file to arrive in your directory. The following command will monitor the directory for the specified file. As soon as it arrives, the watch command will stop running and the message file arrived will show on the terminal.

watch -g "ls -l | grep filename" && echo "file arrived"

Another useful example is a notification when a specific user logs in to your system:

watch -g "who | grep username" && echo "username logged in"

This command will monitor the output of the who command which lists the users who are logged in. Once the user logs in, the watch command will stop and display a message on the terminal.

Similarly, you can tell the watch command to stop a service when some changes are made in a file. Keep in mind that when using a piped chain of commands, you'll need to enclose the entire command within quotes.
Watch Activities in Your Linux System

If you find yourself doing the same process repeatedly, consider using the watch command to automate it. It saves you from frequently typing the commands to see what has changed.

You can also use the watch command with other Linux commands to monitor system resources and activities, and track changes in files or directories.