Category Archives: How to Install

Vue project installs Axios to implement HTTP request

Contents of articles

First, install Axios. Second, use axios1. Introduce axios2. Get method. Third, post method

summary


preface

we all know that the front end needs to request some data and services asynchronously from the back end, which is the so-called Ajax technology. and Vue.js It has no Ajax capability, so it needs to use Axios to complete the Ajax request.


1、 Install Axios

Axios is a promise based HTTP library, which can be used in browsers and websites node.js Medium

Using NPM:

$ npm install axios

Using yarn:

$ yarn add axios

note: install in the root directory of Vue project, and select the configuration file of the project package.json With the corresponding version number, the installation is successful

2、 Using Axios

1. Introducing Axios

stay main.js When the file is injected into Axios:

import axios from 'axios'
Vue.prototype.$axios = axios  //The $axios before the equal sign can be replaced with another name, but use it consistently 

2. Get method

a relatively complete format: </ font>

this.$axios({ //The $axios here is the one named in main.js
            method: "get",
            url: "http://wthrcdn.etouch.cn/weather_mini",//an API for querying city weather
            headers:{
              'Content-type': "application/json;charset=utf-8"
            },
            params : { 
              city : "GuangZhou"
            },
            dataType:'json',
          })
          .then((res)=>{
            console.log(res.data);
            console.log("success")
          })
          .catch(function (error) {
            console.log(error);
            alert("Failed to connect server");
            console.log("fail")
          });

3. Post method

a relatively complete format: </ font>

this.$axios({
            method:"post",
            url:"http://test/...",
            headers:{
              'Content-type': "application/json;charset=utf-8"
            },
            data : { 
              a : '',
              b : ''
            },
            dataType:'json',
          })
          .then((res)=>{
            console.log(res.data);
            console.log("success")
          })
          .catch(function (error) {
            console.log(error);
            alert("Failed to connect server");
            console.log("fail")
          });

summary

for Axios, it is not too difficult to use without studying its principle. And through the above get and post methods, we can also find that its syntax is very similar to jQuery’s Ajax, and we can easily use it.

Use Maven install to type the war package, which shows that the package XXX does not exist

Today, a jar package has been introduced into the project. When install is typed as war package, the package XXX does not exist.

The solution is as follows: add a paragraph to the POM file.

<configuration>
	<source>1.7</source>
	<target>1.7</target>
	<!--Add this paragraph here, because my jar package is introduced under the WEB-INF path, so write this path here-->
	<compilerArguments>
		<extdirs>src/main/webapp/WEB-INF/lib</extdirs>
	</compilerArguments>
</configuration>

Finally, install succeeded!

Tensorflow: How to Use static_rnn

tf.nn.static_ rnn

Aliases:

tf.contrib.rnn.static_ rnn

tf.nn.static_ rnn

Use the specified RNN neurons to create a recurrent neural network

tf.nn.static_rnn(

    cell,

    inputs,

    initial_state=None,

    dtype=None,

    sequence_length=None,

    scope=None

)

Parameter Description:

  1. Cell: RNN neuron used in neural network, such as basic RNN cell, basic LSTM cell
  2. inputs: a list of length T, each element in the list is a tensor, which is in the form of: [batch]_ size,input_ size]
  3. initial_ state:RNN The initial state of, if cell.state_ If size is an integer, it must be of the appropriate type and shape, such as [batch]_ size, cell.state_ The tensor of [size]. as cell.state_ If size is a tuple, it should be a tensor tuple cell.state_ S in size should have the form of [batch]_ The tuple of the tensor of [size, S].
  4. Dtype: data type of initial state and expected output. Optional parameters.
  5. sequence_ Length: Specifies the length of each input sequence. The size is batch_ The vector of size.
  6. Scope: variable range

Return value:

A (outputs, state) pair

Outputs: a list of length T, in which each element is the corresponding output of each input. For example, one time step corresponds to one output.

State: the final state

Code example:

import tensorflow as tf



x=tf.Variable(tf.random_normal([2,4,3])) #[batch_size,timesteps,embedding_dim]

x=tf.unstack(x,axis=1) #Expand by time step

n_neurons = 5 # Number of output neurons



basic_cell = tf.contrib.rnn.BasicRNNCell(num_units=n_neurons)

output_seqs, states = tf.contrib.rnn.static_rnn(basic_cell,x, dtype=tf.float32)



print(len(output_seqs)) #Four time steps

print(output_seqs[0]) # Output one tensor per time step

print(output_seqs[1]) # output one tensor per time step

print(states) #Hide states

The output is as follows:

4 Tensor(“rnn/basic_rnn_cell/Tanh:0”, shape=(2, 5), dtype=float32) Tensor(“rnn/basic_rnn_cell/Tanh_1:0”, shape=(2, 5), dtype=float32) Tensor(“rnn/basic_rnn_cell/Tanh_3:0”, shape=(2, 5), dtype=float32)

Debian: How to install MariaDB

    1. command
apt install mariadb-server

sudo apt purge autoremove

No account password is required for local login, and IP / etc / MySQL can be remotely connected/ mariadb.conf . D directory, comment out this line or IP change

instead

    1. change the password of root
update mysql.user set password=password('ChinaSkill20!') where user='root';
flush privileges;

Create a remote user and set a password

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;

UNIX socket authentication is used by default. Some phpMyAdmin will have “access denied” error when logging in. We can use native MySQL authentication

update mysql.user set plugin = 'mysql_native_password' where User='root';   
flush privileges;  

restart

systemctl restart mariadb

Clion installing glfw_Using clion to configure Vulkan development environment on MacOS

preface
When learning graphics programming, in fact, in MacOS programming environment is the default Xcode, Windows and often use Visual Studio. But since I often have to switch programming between Windows and MacOS, occasionally switch to Ubuntu, and don’t want to switch between different IDEs repeatedly, I chose CLion. The nice thing about CLion is that it’s cross-platform.
Today, I spent several hours configuring the development environment of CLion +Vulkan on MacOS, which paved the way for learning Vulkan later. Those who know CLion know that C/C++ programming of CLion uses CMAKE to do engineering construction, which can force me to use a cross-platform architecture scheme, so that I can know the underlying engineering construction like the palm of my hand, and can also promote me to further understand and learn CMAKE.
My work environment
MacOS: Big Sur

gcc version

~/C/V/shaders ❯❯❯ gcc --versionConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1Apple clang version 12.0.0 (clang-1200.0.32.27)Target: x86_64-apple-darwin20.2.0Thread model: posixInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Configure the Lib required by Vulkan
Vulkan MacOS configuration mainly refers to the Vulkan Tutorial Development Environment. However, many MacOS articles only provide Xcode configuration, but the dependency on the file package is the same. Three main things are needed: Vulkan SDK, GLFW, and GLM.
Let’s take a look at how to install each of these.
Vulkan SDK installation
Vulkan SDK can be downloaded from https://vulkan.lunarg.com/sdk/home directly. See Getting Started with the MacOS Vulkan SDK for details on the installation process. In the process of specific installation, I adopted the step of Install the SDK-alternate method using system paths. Run the Python installation script that comes with the SDK to install:

sudo ./install_vulkan.py

The script is to install the Vulkan SDK libraries and header files in /usr/local.
/usr/local/lib is one of the directories that linker searches for required libraries. The lib installed by the user is stored in the /usr/local folder. The CLion search library is based mainly on the directories specified by the include_directories defined by Cmake.

Copying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-opt to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/vkvia to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPVRemapperTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRV-Tools to /usr/local/lib/cmake/vulkan/SPIRV-ToolsCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-link to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-cfg to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-c-shared.0.44.0.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-val to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/include/vulkan to /usr/local/include/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRVTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/MoltenVKShaderConverter to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/glslangTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/share/vulkan to /usr/local/share/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libshaderc_util.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV-Tools.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/vulkaninfo to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-as to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV-Tools-opt.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRVTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/Applications/vkconfig.app to /Applications/vkconfig.appCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/glslangValidatorTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/OGLCompilerTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-c-shared.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-cpp.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/glslc to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/HLSLTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/Applications/vkcubepp.app to /Applications/vkcubepp.appCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libGenericCodeGen.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-c-shared.0.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-glsl.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-msl.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-remap to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-dis to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/include/spirv_cross to /usr/local/include/spirv_crossCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRV-Tools-link to /usr/local/lib/cmake/vulkan/SPIRV-Tools-linkCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPVRemapperTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/dxc-3.7 to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRV-Tools-opt to /usr/local/lib/cmake/vulkan/SPIRV-Tools-optCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/OGLCompilerTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/glslangValidator to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-lesspipe.sh to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/Applications/vkcube.app to /Applications/vkcube.appCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/HLSLTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/spirv-remapTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/glslangValidatorTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV-Tools-link.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-c.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-reflect to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/Applications/vulkaninfo.app to /Applications/vulkaninfo.appCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-hlsl.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/include/shaderc to /usr/local/include/shadercCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV-Tools-reduce.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libshaderc_combined.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-util.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libvulkan.1.2.162.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libOGLCompiler.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libshaderc_shared.1.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPIRV-Tools-shared.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libvulkan.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libOSDependent.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libshaderc.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/include/spirv-tools to /usr/local/include/spirv-toolsCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/SPIRV-Tools-reduce to /usr/local/lib/cmake/vulkan/SPIRV-Tools-reduceCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libglslang.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libdxcompiler.3.7.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libMoltenVK.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-reflect.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libHLSL.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libdxcompiler.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-cross to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libVkLayer_khronos_validation.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/include/glslang to /usr/local/include/glslangCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/spirv-reduce to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/OSDependentTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/bin/dxc to /usr/local/binCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libspirv-cross-core.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libSPVRemapper.a to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libVkLayer_api_dump.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/spirv-remapTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/OSDependentTargets-release.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libvulkan.1.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/cmake/glslangTargets.cmake to /usr/local/lib/cmake/vulkanCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libshaderc_shared.dylib to /usr/local/libCopying /Volumes/vulkansdk-macos-1.2.162.0/macOS/lib/libMachineIndependent.a to /usr/local/lib

Install GLFW
GLFW is used to create Windows, which supports different operating systems. Both OpenGL and Vulkan are only responsible for rendering graphics to the desktop in memory for display on the screen. As for the final creation of the desktop for each operating system, GL and Vulkan are not responsible for it. That’s what GLFW does. On Apple, GLFW can be installed through BREW. My Mac already had BREW installed, so I simply installed GLFW directly through BREW.

brew install glfw

Install the GLM
Vulkan also does not contain a mathematical library for linear algebra. So we’re going to have to use GLM when we change the graph. He can also install it through BREW.

brew install glm

After installing all the required libs above, we can set our own environment variables in a shell profile. These set environment variables will be used to indicate the path to which libraries to search when I use the CMAKE configuration file in the CLion IDE. Since I’m using ZSH, I added the GLFW and GLM lib paths to ~/.zprofile.

export GLFW_HOME="/usr/local/Cellar/glfw/3.3.2"export GLM_HOME="/usr/local/include/glm"

Note: BREW will place all installations in a directory called CELLAR, and then create soft links in /usr/local to connect to these directories under CELLAR.
And then we’re going to reroute my.zprofile.
When everything is configured, you can call the VKSDK command vkvia</code bbb> check if Vulkan was successfully installed.
You can also run the Vulkan SDK's Cube app to check it out.

Create the CLion project
Let's create a Vulkandemo project. Once created, the project is very simple, with a single HelloWorld code for main.cpp.
Let's draw a triangle here, so let's configure cmake file to make sure that all the header files and libraries we need are loaded correctly.

cmake_minimum_required(VERSION 3.17)project(VulkanDemo)set(CMAKE_CXX_STANDARD 17)# Check environment variables if (NOT DEFINED ENV{GLFW_HOME})    message(FATAL_ERROR "found no env named GLFW_HOME")endif()if (NOT DEFINED ENV{GLM_HOME})    message(FATAL_ERROR "found no env named GLM_HOME")endif()# 暂存环境变量set(GLFW_HOME $ENV{GLFW_HOME})set(GLM_HOME $ENV{GLM_HOME})add_executable(VulkanDemo main.cpp)# 添加 GLFW3 预编译库add_library(glfw SHARED IMPORTED)SET_TARGET_PROPERTIES(glfw PROPERTIES IMPORTED_LOCATION "${GLFW_HOME}/lib/libglfw.3.dylib")# GLMinclude_directories(${GLM_INCLUDE_DIRS})# Vulkanfind_package(Vulkan REQUIRED FATAL_ERROR)target_link_libraries(${PROJECT_NAME} glfw Vulkan::Vulkan)#include_directories(${Vulkan_INCLUDE_DIRS})#target_include_directories(${PROJECT_NAME} PUBLIC ${Vulkan_INCLUDE_DIRS})# copy the shader files to the cmake-build-debug folderfile(COPY shaders DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

Once cmake is configured we start drawing our triangle. This article uses the Vulkan Tutorial code directly. Copy the code to main.cpp</code bbb> We're going to use two shaders here because we're drawing triangles. The code for shader comes from this section. So we need to add two shader files and a compile script to help us generate the spir-v files.
file(COPY shaders DESTINATION ${CMAKE_CURRENT_BINARY_DIR})</code bbb>because calling openfile in main needs to open our shader file. When Clion runs the binaries of the project, it assumes that the resource files are in the cmake-build-debug</code bbb>lder. So we must copy the shader folder to cmake-build-debug</code bbb>
Take a look at what your project as a whole looks like:

Okay, finally, let's run our Vulkandemo program in CLion. A triangle was born!

How to set font color in Latex (3 ways)

1. Use the defined color directly
\usepackage{color}

\textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text}

where textcolor{…} contains the system-defined colors

 

2. Combine the values of red, green and blue to form the color we want
\usepackage{color}

\textcolor[rgb]{r,g,b}{text}

where {r,g,b} represents the combination of red, green and blue colors, and takes values in the range [0-1]

\textcolor[RGB]{R,G,B}{text}

where {R,G,B} represents the combination of red, green and blue colors, and the range of values is [0-255]

 

3. Define a color, call directly
\usepackage{color}

\definecolor{ColorName}{rgb}{r,g,b} This time r/g/b is defined in the range [0-1].

\definecolor{ColorName}{RGB}{R,G,B}, when the domain of R/G/B is defined in [0-255].

Here the name ColorName is defined for the color, and the following can call this color scheme directly

\textcolor{ColorName}{text}

How to Set latex text Bold & Italic

Show upright text: \textup{text}
italic: \textit{text}
slanted italic: \textsl{text}
Display lowercase uppercase text: \textsc{text}
Medium weight: \textmd{text}
Bold command: \textbf{text}
Default value: \textnormal{text}

Italic: \textit{italic}, or \emph{italic}

Fine font: \textlf{light font}

Use equal-width fonts: \texttt{code}

Use sans-serif font: \textsf{sans-serif}

All letters uppercase: \uppercase{CAPITALS}

All letters uppercase, but lowercase letters are smaller: \textsc{Small Capitals}

How to Install Mongdb4.X in Windows

The installation
windows
After the installation is complete, locate the data directory under the installation directory and create a folder named db in the data directory

Open the cmd command line, move the directory to the bin directory under the MongoDB installation directory, and enter the command
mongod --dbpath <dblocations>
mongod --dbpath D:\MongoDB\data\db

Open your browser and enter the address

http://localhost:27017

The following is a success

It looks like you are trying to access MongoDB over HTTP on the native driver port.

Open the service
Go to the bin directory under the installation directory
perform

-> mongod *--dbpath D:\MongoDB\data\db*
-> mongo   or    mongo --host=127.0.0.1 --port=27017
-> show databases;   //If you see the database information, it is successful

Mac: How to Install homebrew, nginx, PHP and MySQL

1. Install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. Install nginx

brew install nginx
nginx -s reload|reopen|stop|quit #Reload Configuration|Restart|Stop|Exit nginx

Nginx-t # tests the configuration for syntax errors
Use this sentence if it is prompted that the PID is missing
Nginx – c “/ usr/local/etc/nginx/nginx. Conf.” ”
nginx
Brew services start nginx
: brew services stop nginx
brew services restart nginx
: brew services restart nginx
: brew services restart nginx
: brew services restart nginx
: brew services restart nginx
3. Install PHP7

brew install php70 --without-apache --with-fpm

PHP
Brew services start PHP
: brew services stop PHP
brew services restart PHP
: brew services start PHP
: brew services stop PHP
: brew services restart PHP
4. Installation of mysql

brew install mysql

cp /usr/local/opt/mysql/support-files/my-default.cnf /etc/my.cnf
brew services start mysql (run)
brew services stop mysql (stop)
mysql
Run: brew services start mysql
Stop: brew services stop mysql
Restart: brew services restart mysql

Homebrew installation strategy of M1 MAC based on ARM architecture

M1 Mac installs Homebrew
Mainly refer to the use of installation process

Main reference

https://sspai.com/post/63935
https://github.com/mikelxc/Workarounds-for-ARM-mac

Main strategy: Install ARM version and X86 version of Homebrew respectively, and in.zshrc through alias name, respectively, to achieve coexistence and specify calls.
The installation process
First install M1 version of BREW, there is no official installation script.

Can focus on website https://brew.sh/
and M1 version homebrew problem summary posted at https://github.com/Homebrew/brew/issues/7857

cd /opt # Switch to the /opt directory
mkdir homebrew # Create the homebrew directory
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

Then write the environment variable of ZSH (assuming ZSH is used)

vim ~/.zshrc

#Write at the beginning
export PATH="/opt/homebrew/bin:$PATH"

Vim basic operation:

    i——insert:w——write(save):q——quit

Install an x86 version of HomeBrew for later use

#Open a new page of zsh
arch -x86_64 $SHELL

#homebrew official install script
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Write environment variables

vim ~/.zshrc

#Write after
export PATH="/usr/local/bin:$PATH"

Let the two coexist with Alias

vim ~/.zshrc

#Write after
alias abrew='/opt/homebrew/bin/brew' # ARM Homebrew
alias ibrew='arch -x86_64 /usr/local/bin/brew' # X86 Homebrew

usage
In ZSH, input such as “Abrew List” to call ARM BREW under OPT and input “iBREW List” to call X86 BREW under USR /local. The PATH of ARM BREW is in front, so the input of “BREW List” calls ARM BREW by default. When there is a package with the same name in the two BREWS, the default priority is to call ARM BREW under the bin.

Automatic installation of NVIDIA 3090 video card driver

#/bin/bash


wget ftp://172.21.230.10:/driver/nvidia-3090/3090_NVIDIA-Linux-x86_64-455.23.04.run

chmod 755 3090_NVIDIA-Linux-x86_64-455.23.04.run

systemctl stop lightdm

./3090_NVIDIA-Linux-x86_64-455.23.04.run --ui=none --no-questions 2>&1

nvidia-smi -q|grep "Product Name"
if [ $?-eq 0 ];
then
        echo "The driver installation was successful."
else
        echo "Driver installation failed"

fi

— UI =none is no interface –no-questions is the default installation