Saturday, July 3, 2021

PowerShell not allow to run nodejs install

Following installation of nodejs managed by nvm for windows, I cannot run the node and npm in the Windows PowerShell unless run the PowerShell using administration access.

The solution is found here. https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system answered Aug 30 '13 at 13:10 by Ralph Willgoss



For Windows 10, Windows 7, Windows 8, Windows Server 2008 R2 or Windows Server 2012, run the following commands as Administrator:
x86 (32 bit)
Open C:\Windows\SysWOW64\cmd.exe
Run the command powershell Set-ExecutionPolicy RemoteSigned
x64 (64 bit)
Open C:\Windows\system32\cmd.exe
Run the command powershell Set-ExecutionPolicy RemoteSigned


Now, node and npm can be run from the Windows PowerShell as normal user, no need administrator privileges.


NVM for windows installation is from here, https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows


 

Wednesday, June 9, 2021

Ubuntu apt-get not showing package list

 I got annoyimh issue when setting up the new server.The apt-get is not showing pakcage list when we press TAB. This article helps to solve the problem, https://askubuntu.com/questions/86375/apt-get-autocomplete-package-name-is-broken. Below is helping me to solve the problem.


# sudo apt-get install --reinstall bash-completion

Wednesday, February 12, 2020

Docker on Ubuntu 18.04

1. Follow the instruction from here
First, update your existing list of packages:
  • sudo apt update
Next, install a few prerequisite packages which let apt use packages over HTTPS:
  • sudo apt install apt-transport-https ca-certificates curl software-properties-common
Then add the GPG key for the official Docker repository to your system:
  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT sources:
  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Next, update the package database with the Docker packages from the newly added repo:
  • sudo apt update
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
  • apt-cache policy docker-ce
You’ll see output like this, although the version number for Docker may be different:
Output of apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: 18.03.1~ce~3-0~ubuntu
  Version table:
     18.03.1~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 18.04 (bionic).
Finally, install Docker:
  • sudo apt install docker-ce
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
  • sudo systemctl status docker



2. Cannot install docker yii2, follow instructions below:
  1. sudo apt-get remove docker-compose
  2. sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  3. sudo chmod +x /usr/local/bin/docker-compose
  4. sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose