How to deploy your GitHub repositories to cPanel

Guide to Git™ – How to Set Up Deployment

If you’re just getting started with Git, then you might be wondering how to set up deployment. Luckily, there’s a guide to Git™ that can help you out. This guide covers everything from installing Git to configuring your repositories. Once you’ve got Git set up, you can start using it to manage your code changes and deployments.

Set up push deployment

A “push deployment” is a way to deploy your code from a local development environment to a live server. It involves using the git version control system to push your code from a local repository on your computer to a remote repository on the server. To set up push deployment, you first need to clone the remote repository to your local computer. This can be done using the git clone command and specifying the URL of the repository. Once you have cloned the repository, you will need to add your files and make any necessary changes. Once you are ready to deploy, you can push your code to the remote repository using the git push command. This will send your code to the server and update the files in the remote repository.

Set up pull deployment

A pull deployment is a type of deployment where you pull changes from a remote repository onto your local computer. This is done using the git version control system. First, you need to clone the repository onto your local computer. This can be done using the cpanel interface on your cpanel account. Once you have cloned the repository, you can then deploy changes by committing them and pushing them to the remote repository. The remote repository can then be pulled onto the server using the ssh command.

The deployment YAML file

The YAML file is the deployment file that you will use to deploy your website. You can deploy your website using the command line or by specifying the directory in which your website is located. If you are using a public_html directory, you will need to specify the repository in which your website is located.

Automatic or push deployment

Automatic or push deployment is a process where files are automatically copied from a repository to a deployment directory. This can be done using a git command, or through an interface such as cPanel.

Push deployment is often used for version control, so that different versions of files can be easily tracked and deployed. It can also be used to automatically deploy files when they are changed in the repository.

cPanel-managed repositories can be used for automatic or push deployment. Documentation for this can be found in the cPanel documentation.

Manual or pull deployment

There are two ways to deploy a website: manual or pull deployment. With manual deployment, you upload files to your web server using an FTP client or the cPanel interface. With pull deployment, you use git version control to push changes from your local computer to a remote repository. Pull deployments are more automated and can be used to deploy websites from a development environment to a production server.

3. Clone your Repository

In order to clone your repository, you need to have the URL of the remote repository. You can either use SSH or Git to clone your repository. If you are using cPanel, you can find the Clone URL in the Git section. Once you have the URL, you can clone your repository by running the “git clone” command in your terminal. This will create a local copy of the remote repository in your directory.

4. Manage Repositories

A repository is a place where files are stored. CPanel is a web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a website. Git is a version control system that allows you to track changes to files and collaborate with others. CPanel-managed repositories are repositories that are managed by CPanel.

To configure a cpanel-managed repository, you will need to log into your cPanel account and navigate to the “Git Version Control” section. From there, you will be able to create and configure your repositories. To deploy your files, you will need to use the “Deploy” button in the “Git Version Control” section.

🎆✨Congratulations! You have successfully deployed a remote repo to cPanel

Congratulations on successfully deploying your remote repo to cPanel! This is a great accomplishment and will allow you to keep your codebase updated with the latest changes from GitHub.

How do I link GitHub to hosting?

To link GitHub to your hosting account, you’ll need to generate a new SSH key and add it to your GitHub account. Once you’ve done that, you can simply clone your repositories to your hosting account and push changes back up to GitHub.

Does cPanel have Git?

Yes, cPanel has Git. cPanel is a web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel is installed on a web server and allows you to manage your website through a web browser. cPanel includes many features, such as email, databases, file management, security, and more. One of the features that cPanel offers is Git. Git is a distributed version control system that allows you to track changes in your files and revert back to previous versions if needed. cPanel makes it easy to use Git by providing a user-friendly interface.

How do I add a private repository to cPanel?

In order to add a private repository to cPanel, you will first need to create a file called “repositories.yaml” in the /etc/yum.repos.d/ directory. This file will contain the configuration for your private repository. You will then need to add the following lines to this file:

[myprivaterepo]

name=My Private Repository

baseurl=https://myprivaterepo.com/path/to/repo

enabled=1

gpgcheck=0

Once you have added these lines, you will need to run the “yum update” command in order to update the cPanel package repository list.

Install Docker Engine on CentOS [Hostgator / BlueHost]

Install Docker Engine on CentOS

Estimated reading time: 11 minutes

To get started with Docker Engine on CentOS, make sure you meet the prerequisites, then install Docker.

Prerequisites

OS requirements

To install Docker Engine, you need a maintained version of CentOS 7 or 8. Archived versions aren’t supported or tested.

The centos-extras repository must be enabled. This repository is enabled by default, but if you have disabled it, you need to re-enable it.

The overlay2 storage driver is recommended.

Uninstall old versions

Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them, along with associated dependencies.

$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

It’s OK if yum reports that none of these packages are installed.

The contents of /var/lib/docker/, including images, containers, volumes, and networks, are preserved. The Docker Engine package is now called docker-ce.

Installation methods

You can install Docker Engine in different ways, depending on your needs:

  • Most users set up Docker’s repositories and install from them, for ease of installation and upgrade tasks. This is the recommended approach.
  • Some users download the RPM package and install it manually and manage upgrades completely manually. This is useful in situations such as installing Docker on air-gapped systems with no access to the internet.
  • In testing and development environments, some users choose to use automated convenience scripts to install Docker.

Install using the repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

Set up the repository

Install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.

$ sudo yum install -y yum-utils

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

Optional: Enable the nightly or test repositories.

These repositories are included in the docker.repo file above but are disabled by default. You can enable them alongside the stable repository. The following command enables the nightly repository.

$ sudo yum-config-manager --enable docker-ce-nightly

To enable the test channel, run the following command:

$ sudo yum-config-manager --enable docker-ce-test

You can disable the nightly or test repository by running the yum-config-manager command with the --disable flag. To re-enable it, use the --enable flag. The following command disables the nightly repository.

$ sudo yum-config-manager --disable docker-ce-nightly

Learn about nightly and test channels.

Install Docker Engine

  1. Install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:$ sudo yum install docker-ce docker-ce-cli containerd.io If prompted to accept the GPG key, verify that the fingerprint matches 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35, and if so, accept it.Got multiple Docker repositories?If you have multiple Docker repositories enabled, installing or updating without specifying a version in the yum install or yum update command always installs the highest possible version, which may not be appropriate for your stability needs.This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
  2. To install a specific version of Docker Engine, list the available versions in the repo, then select and install:a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:$ yum list docker-ce --showduplicates | sort -r docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable The list returned depends on which repositories are enabled, and is specific to your version of CentOS (indicated by the .el7 suffix in this example).b. Install a specific version by its fully qualified package name, which is the package name (docker-ce) plus the version string (2nd column) starting at the first colon (:), up to the first hyphen, separated by a hyphen (-). For example, docker-ce-18.09.1.$ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io This command installs Docker, but it doesn’t start Docker. It also creates a docker group, however, it doesn’t add any users to the group by default.
  3. Start Docker.$ sudo systemctl start docker
  4. Verify that Docker Engine is installed correctly by running the hello-world image.$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

This installs and runs Docker Engine. Use sudo to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine

To upgrade Docker Engine, follow the installation instructions, choosing the new version you want to install.

Install from a package

If you cannot use Docker’s repository to install Docker, you can download the .rpm file for your release and install it manually. You need to download a new file each time you want to upgrade Docker Engine.

  1. Go to https://download.docker.com/linux/centos/ and choose your version of CentOS. Then browse to x86_64/stable/Packages/ and download the .rpm file for the Docker version you want to install.NoteTo install a nightly or test (pre-release) package, change the word stable in the above URL to nightly or testLearn about nightly and test channels.
  2. Install Docker Engine, changing the path below to the path where you downloaded the Docker package.$ sudo yum install /path/to/package.rpm Docker is installed but not started. The docker group is created, but no users are added to the group.
  3. Start Docker.$ sudo systemctl start docker
  4. Verify that Docker Engine is installed correctly by running the hello-world image.$ sudo docker run hello-world This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

This installs and runs Docker Engine. Use sudo to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.

Upgrade Docker Engine

To upgrade Docker Engine, download the newer package file and repeat the installation procedure, using yum -y upgrade instead of yum -y install, and point to the new file.

Install using the convenience script

Docker provides a convenience script at get.docker.com to install Docker into development environments quickly and non-interactively. The convenience script is not recommended for production environments, but can be used as an example to create a provisioning script that is tailored to your needs. Also refer to the install using the repository steps to learn about installation steps to install using the package repository. The source code for the script is open source, and can be found in the docker-install repository on GitHub.

Always examine scripts downloaded from the internet before running them locally. Before installing, make yourself familiar with potential risks and limitations of the convenience script:

  • The script requires root or sudo privileges to run.
  • The script attempts to detect your Linux distribution and version and configure your package management system for you, and does not allow you to customize most installation parameters.
  • The script installs dependencies and recommendations without asking for confirmation. This may install a large number of packages, depending on the current configuration of your host machine.
  • By default, the script installs the latest stable release of Docker, containerd, and runc. When using this script to provision a machine, this may result in unexpected major version upgrades of Docker. Always test (major) upgrades in a test environment before deploying to your production systems.
  • The script is not designed to upgrade an existing Docker installation. When using the script to update an existing installation, dependencies may not be updated to the expected version, causing outdated versions to be used.

Tip: preview script steps before running

You can run the script with the DRY_RUN=1 option to learn what steps the script will execute during installation:

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ DRY_RUN=1 sh ./get-docker.sh

This example downloads the script from get.docker.com and runs it to install the latest stable release of Docker on Linux:

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2737
<...>

Docker is installed. The docker service starts automatically on Debian based distributions. On RPM based distributions, such as CentOS, Fedora, RHEL or SLES, you need to start it manually using the appropriate systemctl or service command. As the message indicates, non-root users cannot run Docker commands by default.

Use Docker as a non-privileged user, or install in rootless mode?

The installation script requires root or sudo privileges to install and use Docker. If you want to grant non-root users access to Docker, refer to the post-installation steps for Linux. Docker can also be installed without root privileges, or configured to run in rootless mode. For instructions on running Docker in rootless mode, refer to run the Docker daemon as a non-root user (rootless mode).

Install pre-releases

Docker also provides a convenience script at test.docker.com to install pre-releases of Docker on Linux. This script is equivalent to the script at get.docker.com, but configures your package manager to enable the “test” channel from our package repository, which includes both stable and pre-releases (beta versions, release-candidates) of Docker. Use this script to get early access to new releases, and to evaluate them in a testing environment before they are released as stable.

To install the latest version of Docker on Linux from the “test” channel, run:

$ curl -fsSL https://test.docker.com -o test-docker.sh
$ sudo sh test-docker.sh
<...>

Upgrade Docker after using the convenience script

If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There is no advantage to re-running the convenience script, and it can cause issues if it attempts to re-add repositories which have already been added to the host machine.

Uninstall Docker Engine

  1. Uninstall the Docker Engine, CLI, and Containerd packages:$ sudo yum remove docker-ce docker-ce-cli containerd.io
  2. Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:$ sudo rm -rf /var/lib/docker $ sudo rm -rf /var/lib/containerd

You must delete any edited configuration files manually.

From = https://docs.docker.com/engine/install/centos/

The Things Indoor Gateway Setup TTIG

Factory Reset TTIG =

Keep the RESET button (small button at the back of the gateway next to the USB-C port) pressed for 5 seconds until the LED blinks rapidly from GREEN to RED and vice versa for a couple of times.

Hold the SETUP button (at the top of the gateway, next to the LED) for 10 seconds until the LED rapidly blinks RED.

Connect to SSID = MINIHUB-xxxxxx where xxxxxx is the last 6 digits of the gateway ID

Default IP = 192.168.4.1

You can add multiple Networks.

How Do I Stop Internet Explorer from Redirecting to Edge?

How Do I Stop Internet Explorer from Redirecting to Edge?

Launch Microsoft Edge and go to Settings. Navigate to Default browser, and locate Let Internet Explorer open sites in Microsoft Edge. Set this option to Never.

disable-microsoft-edge-redirects

From = https://www.technipages.com/stop-internet-explorer-redirects-to-microsoft-edge#:~:text=Launch%20Microsoft%20Edge%20and%20go,supports%20the%20latest%20web%20standards

ESXi Shows 32 Bit Virtual Machines Instead of 64 Bit

Did you know that using VMWare Workstation, you can drag and drop virtual machines between hosts? Yep !

Recently moved several machined to a new ESXi server and wasn’t able to increase the memory to over 4 gb. Solution below is from https://www.vcloudnotes.com/2019/01/how-to-change-vm-guest-os-information.html

How to change the VM Guest OS type and version information

As we all know that, we specify the guest operating system and its version during the VM creation. In case if you’ve specified the wrong operating system, version or upgrading the already installed guest OS then you will need to change the guest operating system version to reflect the same correctly in vCenter inventory.

Here in my case we just upgraded the operating system of our last remaining Server 2003 servers and want to correct the related guest OS info in vCenter inventory.

Prerequisites

Power off the virtual machine.

Procedure

  • Right-click a virtual machine in the inventory and select Edit Settings. 
  • Click the VM Options tab and expand General Options. 
  • From the Guest OS drop-down menu, select the guest operating system family. 
  • From the Guest OS Version drop-down menu, select the guest operating system version. 
  • If you select Other for the guest operating system family and Other (32-bit) or Other (64-bit) for the version, in the vSphere Web Client you are prompted to type a name for the operating system in the text box. 
  • Click OK. 

And you are done…

Note: When you change the guest operating system type in the virtual machine settings, you change the setting for the guest operating system in the virtual machine’s configuration file. To change the guest operating system itself, you must install the new operating system in the virtual machine. 

When you set the guest operating system type for a new virtual machine, vCenter Server chooses configuration defaults based on the guest type. Changing the guest operating system type after the virtual machine is created does not retroactively change those settings. It affects the recommendations and setting ranges offered after the change. 
Why its important to select the Correct Guest OS Type/Version:Incorrect configuration of Guest OS of the virtual machine can lead to;

  • Reduction of performance
  • Different default type for the SCSI device
  • Different defaults of devices
  • Wrong VMware Tools presented to the Guest OS resulting in failure to install
  • Inability to select virtual hardware such as enhanced vmxnet, vmxnet3 or number of vCPUs.
  • Inability to activate features such as CPU and Memory Hot Add.
  • Inability to activate Fault Tolerance.
  • VM burning up 100% of CPU when idling (rare occasions) 

Reference: http://frankdenneman.nl/2009/12/15/impact-of-mismatch-guest-os-type/
http://www.yellow-bricks.com/2012/01/13/why-selecting-the-correct-os-when-creatingupgrading-a-vm-is-important 

That’s it… 🙂

Lastpass Delete Passwords

From Lastpass =

Delete a single item

  1. Click the inactive (grey or black) LastPass icon inactive LastPass icon in your web browser toolbar.
  2. Enter your email address and master password, then click Log In. Result: An active LastPass icon  is displayed and you are now logged in.
  3. Click the active LastPass icon  in your toolbar, then use the Search field or go to All items and locate your desired item.
  4. Click the Edit icon  to open the item entry.
  5. Click the Delete icon  in the lower-left navigation.
  6. When prompted, click Yes to confirm.
  7. This item has now been moved to your Deleted Items storage. Learn how to permanently delete an item.

Delete multiple items

  1. Log in to LastPass and access your vault by doing either of the following:
    • In your web browser toolbar, click the LastPass icon active LastPass icon and select Open My Vault.
    • Go to https://lastpass.com/?ac=1 and log in with your email address and master password.
  2. Select All Items in the left navigation.
  3. Hover over each item and check the box in the upper-right hand corner to select it.
  4. Use the Actions drop-down menu and select Delete.
  5. When prompted, click Yes to confirm.
  6. These items have now been moved to your Deleted Items storage. Learn how to permanently delete an item.

Instead of clicking each and everyone, use the shift key… select the first box, hold down shift key, and select one from bottom.