Nginx notes

1. Install in RHEL 7 install development tools

To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:

Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “6” or “7”, for 6.x or 7.x versions, respectively.

  2. Starting, Stopping, and Reloading Configuration …

Pycham shortcut

用过快捷键立即感觉高大上了,最主要的是很方便啊!很强大 cmd b 跳转到声明处(cmd加鼠标) opt + 空格 显示符号代码 (esc退出窗口 回车进入代码) cmd []光标之前/后的位置 opt + F7 find usage cmd backspace 删除当前行 cmd +c 复制光标当前行,剪切同理 cmd + f 当前文件搜索(回车下一个 shift回车上一个) cmd + r 当前文件替换 shift + cmd + f 全局搜索 shift + cmd + R 全局替换 cmd+o 搜索class shift + cmd + o 搜索文件 opt + cmd …

python notes 1

数据类型: str 字符串: strip() – 默认去除字符串最后的终止符号\n,可以在括号内设定特定的参数例如\t 这类型的符号 Boolean Data type : True or False 注意第一个字母为大写 False or True is True False or False is False 0 is falsey, all others are truthy 0.0 is falsey, all others are truthy 可以使用bool() function 作为判断 Variable 变量: 三种赋值方式: 传统赋值:

链式赋值:

序列解包赋值:

打印变量的方法:

List, Tuple, …

MySQL Administrator notes 3 – backup and restore

backup — logical (backup database, tables, views)   |_  physical (backup files)   backup — hot (system are running, if anyone write on the moment, it will not backup)   |_  warm (system op running, the table already lock)   |_  cold (system are shutdown)   backup — full backup   |_ incremental (backup when …

MySQL Administrator notes 2 – user account manager

User manager:

  # if want access all database use *.*

  # ‘username’@‘%’ (means anywhere) # ‘%’@‘%’ (means anybody and anywhere)

  # create a super account like root, *.* means all database and all tables # with grant option means can run grant permissions options:   MAX_CONNECTIONS_PER_HOUR 10   MAX_QUERIES_PER_HOUR …

pymysql notes

1.安装杂项: 需要安装pymssql,步骤如下

  2. 执行SQL

3. 获取新创建数据自增ID

4. 获取查询数据,使用fetch来获取查询的结果

注:在fetch数据时按照顺序进行,可以使用cursor.scroll(num,mode)来移动游标位置,如: cursor.scroll(1,mode=’relative’) # 相对当前位置移动 cursor.scroll(2,mode=’absolute’) # 相对绝对位置移动 5. fetch数据类型 关于默认获取的数据是元祖类型,如果想要或者字典类型的数据,即

fetchone只选择一个执行,如果执行两次fetchone会获取下一个结果,好像迭代器一样 fetchmany选择多个执行,fechmany(3)一次拿三次 fetchall选择全部执行 cursor.scroll(-1, mode=’relative’)  # 相对的位置向上移动游标 cursor.scroll(2, mode=’absolute’)  # 绝对的位置向下移动游标

RHEL 7 Notes

Admin Basics1

Essential commands

Admin Basics2 Man main man page tree /usr/share/man (/etc/man.config(RH6); /etc/man_db.conf(RH7)) man intro show sections section 1 Command section 2 System Calls section 3 Library Functions section 4 special files (device files pts) section 5 file formats (configuration files passwd) section 6 games section 7 miscellany (conventions, standards, protocols) section …

MySQL Administrator notes 1 – config file & installation

mysql  configuration file /etc/my.cnf ~/.my.cnf(create this file in your directory) over write /etc/my.cnf login directory

prompt=‘MySql(\d)>>’                               |—-> database name 显示出来的提示符为 MySql(none)>> there has two of group client and mysql, you need to chmod 600 ~/.my.cnf, if you didn’t chmod …