Friday, September 21, 2018

Setting up Office 365 Development environment QuickStart

Setting up Office 365 Development environment QuickStart

1) Install latest version of Node JS
2) Install Visual Studio Code
3) Install latest version of node package manager

npm install -g nom@next

4) Install latest windows build tools

npm install -g windows-build-tools


5) Install Yeoman and Gulp

npm install -g yo gulp

6) Install Yeoman SharePoint Generator

npm install -g @microsoft/sharepoint-generator


To check the list of all global packages

npm list -g

To check whether a specific package is installed globally for example gulp

npm list -g gulp


Wednesday, January 4, 2017

Learning Docker on windows and troubleshooting the errors - part 1

1) Download and install the docker tookbox from
https://www.docker.com/products/docker-toolbox

This installs multiple products, docker engine, docker swarm, oracle virtual box, kitematics, etc.


2) Launch the Docker quick start terminal as administrator

Usually, Note: If the CPU virtualization is not enabled in the BIOS, you get the below error (). Else, you will see no errors.

Creating CA: C:\Users\<<mylogonname>>\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\<<mylogonname>>\.docker\machine\certs\cert.pem
Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
Looks like something went wrong in step ´Checking if machine default exists´... Press any key to continue...

Follow this article to resolve the above error
https://github.com/docker/machine/issues/2256


--------------------
3) docker-machine

This will show you a help guide with the list of commands as shown below

$ docker-machine
Usage: docker-machine.exe [OPTIONS] COMMAND [arg...]

Create and manage machines running Docker.

Version: 0.8.2, build e18a919

Author:
  Docker Machine Contributors - <https://github.com/docker/machine>

Options:
  --debug, -D                                                   Enable debug mode
  --storage-path, -s "C:\Users\<<username>>\.docker\machine"    Configures storage path [$MACHINE_STORAGE_PATH]
  --tls-ca-cert                                                 CA to verify remotes against [$MACHINE_TLS_CA_CERT]
  --tls-ca-key                                                  Private key to generate certificates [$MACHINE_TLS_CA_KEY]
  --tls-client-cert                                             Client cert to use for TLS [$MACHINE_TLS_CLIENT_CERT]
  --tls-client-key                                              Private key used in client TLS auth [$MACHINE_TLS_CLIENT_KEY]
  --github-api-token                                            Token to use for requests to the Github API [$MACHINE_GITHUB_API_TOKEN]
  --native-ssh                                                  Use the native (Go-based) SSH implementation. [$MACHINE_NATIVE_SSH]
  --bugsnag-api-token                                           BugSnag API token for crash reporting [$MACHINE_BUGSNAG_API_TOKEN]
  --help, -h                                                    show help
  --version, -v                                                 print the version

Commands:
  active                Print which machine is active
  config                Print the connection config for machine
  create                Create a machine
  env                   Display the commands to set up the environment for the Docker client
  inspect               Inspect information about a machine
  ip                    Get the IP address of a machine
  kill                  Kill a machine
  ls                    List machines
  provision             Re-provision existing machines
  regenerate-certs      Regenerate TLS Certificates for a machine
  restart               Restart a machine
  rm                    Remove a machine
  ssh                   Log into or run a command on a machine with SSH.
  scp                   Copy files between machines
  start                 Start a machine
  status                Get the status of a machine
  stop                  Stop a machine
  upgrade               Upgrade a machine to the latest version of Docker
  url                   Get the URL of a machine
  version               Show the Docker Machine version or a machine docker version
  help                  Shows a list of commands or help for one command

Run 'docker-machine.exe COMMAND --help' for more information on a command.

----------------------

3)  Now, pulling a helloworld image from docker hub (https://hub.docker.com/)
Note: You can use the Kitematics (to perform the same using a GUI instead of command line)

docker pull kitematic/hello-world-nginx

You may run into below error.
---------------------------------
$ docker pull kitematic/hello-world-nginx
Using default tag: latest
Pulling repository docker.io/kitematic/hello-world-nginx
Network timed out while trying to connect to https://index.docker.io/v1/repositories/kitematic/hello-world-nginx/images. You may want to check your internet connection or if you are behind a proxy.

------------------------------

Don't worry, to resolve this, sometimes you need to just restart the environment

$ docker-machine restart default      # Restart the environment
$ eval $(docker-machine env default)  # Refresh your environment settings

-------------------
4) to check the list of images installed
docker images

5) to run a container from the image (nginx, a reverse proxy, load balancer server for example)
-------------------
docker run kitematic/hello-world-nginx

----------------------
6) to check the list of active containers
docker ps -a to check the status all containers

Note: use doc


7) to stop the container

docker stop <<imagename>>

docker stop nostalgic_mcclintock
-----------------------
8) to remove the container and leave the image as is

docker rm <<containerId>>

 docker rm 2b

----------------------------
9) to run the container on a specific port in daemon mode for example, 

 docker run -d -p 5000:80 kitematic/hello-world-nginx

Here, 5000 is external port and 80 is internal port

10) You can now try launching the instance in the browser
using 

http://192.168.99.100:5000

Saturday, December 24, 2016

Your web part will not appear in the toolbox - Office 365

Your web part will not appear in the toolbox - Office 365

You get below error when you try to load the webpart in the Office 365 workbench (for the first time in the workbench.aspx) after you perform "gulp serve"

----------------------------------
Your web part will not appear in the toolbox. Please make sure "gulp serve" is running in a web part project. Please refresh the page once "gulp serve" is running.
--------------------------------

To resolve this error, you will be to first run the below command to install the certificate (note that the certification error in the local workbench also disappears after this)

gulp trust-dev-cert

After this, you can run gulp serve to again see the local workbench and then launch the office 365 tenant site to see if your locally developed webpart is available to be added on the workbench.aspx