-
React app development environment REACT_APP NODE_ENV check if development or production
- The “process.env.NODE_ENV” variable is set to “development” when running in development environment.
-
C# XML and LINQ
- Use https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.syndication?view=netframework-4.7.2
- System.servicemodel.syndication for creating RSS feeds.
-
Openfaas setup
- Docker should be present, this means there will be docker swarm also (which is required)
- Install faas-cli :
curl -sL https://cli.openfaas.com | sudo sh
- Initialize docker swarm with:
docker swarm init
- Deploy stack
- for linux 64bit:
git clone https://github.com/openfaas/faas && cd faas && ./deploy_stack.sh
- for rPi armhf:
git clone https://github.com/openfaas/faas && cd faas && ./deploy_stack.armhf.sh
- for linux 64bit:
- Login to faas-cli with the command shown
~/.openfaas/config.yml
contains the login information, thetoken
property needs to be base64 decoded into username and password
-
Creating Openfaas function
- Openfaas functions are created from templates
- Pull templates using: faas-cli template pull
https://github.com/zeerorg/templates
- Templates need to be present in the same folder. (could be improved)
- Creating a function:
faas-cli new function_name --lang {template_name}
- Go into the
function_name
folder where you can edit files to deploy them - Inside the
function_name.yml
there are variables that can be tweeked.
-
Creating Openfaas template
- Every template has 2 parts: Dockerfile, function directory
- The docker file contains the definition of a container that starts the watchdog service and defines necessary environment variables
- The function directory contains the sample function, this function directory is copied to create a new function and the function edits the files inside directory.
- Take examples from “https://github.com/zeerorg/templates” to write new templates
-
Portainer Installation
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
-
Ngrok windows server http asp net .net core
- If bad request is there then host-header needs to change
ngrok http {port} -host-header="localhost:{port}"
-
Asp .net server visual studio error :
Unable to start IIS Server
- This is due to ports and shit
- Close visual studio then, Delete
.vs/config/applicationsettings.json
file, then open visual studio
-
Docker Dockerfile (tags: creating dockerfile container new)
- Add new user to docker container:
RUN useradd -ms /bin/bash newuser
- Creates user and their directory, sets bash as default shell
- Tini (tags: process docker)
- It is init for docker processes to prevent zombie processes
- Refer https://github.com/krallin/tini
- Ubuntu Debian docker images
ENV DEBIAN_FRONTEND noninteractive
- This sets the environment to non-interactive so that there are no prompts
- Use “apt-get” over “apt” for installing packages
- Use “apt-get clean” to remove cached packages
- Search for arm images in https://hub.docker.com/u/arm32v7/
- Add new user to docker container: