Linux Advanced Applications

Linux

  • More stable and reliable than windows
  • Unix is ​​also better, but it is commercial and generally tied to the hardware

Nginx

  • HTTP server handles http requests from browsers
  • wsgi gateway

MySQL

  • PDB relational database
  • Persistence data persistence
  • SQL

Redis

  • NoSQL(Not only SQL)
  • High Speed ​​Cache
  • Commonly used, more visited here

Cluster-cluster

    • Load Balance
    • Keepalived Hot Standby Active-Active
    • Nginx/LVS + Keepalived Ali does better

awk

  • ps -aux | grep mysql | awk ‘{print $2}’| xargs kill -9 2> error.log
  • code inside single quotes
  • Ability to delete found processes

xargs

  • You can pass the obtained value as a parameter to other functions

Tips Install Python3 under Linux

Unzip + configure environment variables

  • In the home directory vim .bash_profile
  • find PATH= P A T H : HOME/bin
  • Add :root PATH= after P A T H : HOME/bin:/root
  • Pay attention to modify this point and do not modify it wrong, otherwise you will not be able to execute any command
  • source .bash_profile re-execute this file

Login to execute

  • Can modify .bash_profile or .bashrc
  • After logging in again, the content you added will be automatically executed

Boot execution

  • Can modify /etc/rc.local

Scheduled execution -crond

  • crontab -e Edit scheduled tasks
  • crontab -l lists running scheduled tasks
"""
之后会自动进入vim中
在第一行
五个星号分别表示分钟 小时 天 月份 星期
* * * * * 后面加入要执行的命令

* 7,18 3 * * 这样表示每个月的3号的7点到18点的每分钟都执行
如果不是很熟悉怎么写,可以用网上的cton表达式生成器

"""

advanced vim usage

  • :addr/addrev main if name == ' main ': You can abbreviate the definition of the following statement in edit mode, press main and press space or press Enter to call directly
  • The :map shortcut key command can define a shortcut key to execute the command

Shell

  • Can execute system commands
sum=0
int=1
while(($int<=100))
do
sum=`expr $sum + $int`
let "int++"
done
echo $sum

type of language

  • interpreted language
    • Python Shell/Scripting Language PHP JavaScript
  • compiled language
    • c language c++
  • Assembly language
    • Compile machine language 0s and 1s into mnemonics
  • machine language
    • 0,1
  • The higher the execution efficiency, the lower the development efficiency.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324481022&siteId=291194637