Linux Basics command daily accumulate _linux shell

Source: Internet
Author: User
Tags chmod ssh centos

Today, another Linux production environment to build. This is a lot of steps, very cumbersome and have to do things. Although many times, but there are many steps, orders do not remember, every time looking for information is troublesome, so take some steps down to find.

Log on to remote MySQL

Copy Code code as follows:

Mysql-h 192.168.1.100-u Root-p

Assign permissions to MySQL non-root account

Give the account User1 password 123456 users testdb the Select,insert,update,delete permissions for all tables in the database:

Copy Code code as follows:

Grant Select,insert,update,delete on testdb.* to user1@ '% ' of ' identified by ' 123456 ';

Refresh permissions:

Copy Code code as follows:

Flush privileges;

View the maximum number of connections under MySQL

Copy Code code as follows:

Show variables like ' max_connections ';

To modify the maximum number of connections

Copy Code code as follows:

Vi/etc/my.cnf

Find max_connections=100 (added if not), and change to:

Copy Code code as follows:

max_connections=1500

Password-free login to Linux server

Log on to the Linux server using your own computer password (Windows system)

On Windows

Execute with cmd command:

Copy Code code as follows:

SSH-KEYGEN-T RSA

Even knock 3 to enter, you can in the C disk user directory under the. SSH folder to see,

Id_rsa is the private key, Id_rsa.pub is the public key.

On Linux

Perform

Copy Code code as follows:

SSH-KEYGEN-T RSA

Even knock 3 down to enter and then CD. ssh/can see that

Copy Code code as follows:

Id_rsa id_rsa.pub

Create a public key to save a login-free host generation, Authorized_keys

Copy Code code as follows:

Touch Authorized_keys

Change his authority to 600.

Copy Code code as follows:

chmod ~/.ssh/authorized_keys

Finally, the Windows computer's Id_rsa.pub public key is written to the Authorized_keys and saved.

File renaming

Download a good JDK filename in this way jdk-8u65-linux-x64.rpm\? Authparam\=1445848743_f162eddc392f630f3b14bcded3bc3f19 change it to jdk-8u65-linux-x64.rpm. The order is as follows:

Copy Code code as follows:

MV Jdk-8u65-linux-x64.rpm\? Authparam\=1445848743_f162eddc392f630f3b14bcded3bc3f19 jdk-8u65-linux-x64.rpm

Installing JDK

Download JDK

Copy Code code as follows:

wget http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm? Auth param=1445848743_f162eddc392f630f3b14bcded3bc3f19

Download good rename into: jdk-8u65-linux-x64.rpm, give 777 permissions

Copy Code code as follows:

' Chmod 777 jdk-8u65-linux-x64.rpm '

Installation

Copy Code code as follows:

RPM-IVH jdk-8u65-linux-x64.rpm

View

Copy Code code as follows:

Java-version

Configure Environment variables

modifying system environment variable files

Copy Code code as follows:

VI +/etc/profile

Append the following content to the file:

Copy Code code as follows:

Java_home=/usr/java/jdk1.8.0_65
Jre_home=/usr/java/jdk1.8.0_65
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH

To make the modification take effect immediately:

Copy Code code as follows:

Source/etc/profile

CentOS Direct Yum Installation Nginx

Processing Source:

Copy Code code as follows:

RPM-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

To view Yum Nginx information:

Copy Code code as follows:

Yum Info nginx

Installation:

Copy Code code as follows:

Yum Install Nginx

Start Nignx:

Copy Code code as follows:

Service Nginx Start

Enter host address view:

Http://192.168.1.100/

See

Copy Code code as follows:

Welcome to nginx!
If you are here page, the Nginx Web server is successfully installed and working. Further configuration is required.
For online documentation and support the refer to nginx.org.
Commercial support is available at nginx.com.
Thank for using Nginx.

"=" assignment with no spaces around the equal sign

VI in the beginning of the description, #! For special Instructions

VI ~/.BASHRC —————— Open Bash's configuration file

VI ~/.EXRC ————————— Open VI configuration file

Gcc-c hello.c only generate compiled files hello.c

GCC hello.o-o new filename ABC build execution file and rename it to ABC

-E Production preprocessing

-S convert to assembler program XXXX.S

Bitwise operations with & or | Different or ^
1 1 1 1 0
1 0 0 1 1
0 1 0 1 1
0 0 0 0 0

& Use: To detect whether one is 1 or 0; set one to 0.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.