自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

tianyuan233

好好学习 天天向上

  • 博客(28)
  • 收藏
  • 关注

原创 ./configure: error: SSL modules require the OpenSSL library.

安装nginx的时候出现./configure: error: SSL modules require the OpenSSL library. 解决方法: Centos需要安装openssl-develUbuntu则需要安装:sudo apt-get install libssl-dev

2017-03-25 11:52:08 732

原创 python生成验证码

import randomdef Verifi_code(): code = [] for i in range(6): if i == random.randint(1,5): code.append(str(random.randint(1,5))) else: temp = random.ra

2017-03-25 11:52:05 259

原创 python自带模块发送邮件

# -*- coding: UTF-8 -*-import smtplibfrom email.mime.text import MIMETextmsg = MIMEText('hello, send by Python...', 'plain', 'utf-8')from_addr = '****@163.com'password = '***'to_addr = '*****@

2017-03-25 11:52:02 443

原创 ImportError: No module named MySQLdb

centos解决办法:[root@tyzz MyBlog-Flask]# yum install -y MySQL-python

2017-03-25 11:52:00 490

原创 MySQL常用操作笔记[转]

一、用户创建、权限、删除1、连接MySql操作连接:mysql -h 主机地址 -u 用户名 -p 用户密码 (注:u与root可以不用加空格,其它也一样)断开:exit (回车)终端输入mysql -h 127.0.0.1 -u root -p 然后输入密码。就可以连接到本地的MySql数据库了。2、 创建用户:命令:CREATE USER 'username'@'host' IDENTIF

2017-03-25 11:51:57 222

原创 使用MySQL执行update的时候报错:Error Code 1175.

使用MySQL执行update的时候报错:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences ->

2017-03-25 11:51:54 644

原创 MySQL忘记root密码处理方法

1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库。因为在重新设置MySQL的root密码的期间,MySQL数据库完全出于没有密码保护的状态下,其他的用户也可以任意地登录和修改MySQL的信息。可以采用将MySQL对外的端口封闭,并且停止Apache以及所有的用户进程的方法实现服务器的准安全状态。最安全的状态是到服务器的Console上面操作,并且拔掉网线。2.修改MyS

2017-03-25 11:51:51 297

原创 apache学习笔记(访问控制|禁止解析|禁止指定user_agent)

访问控制[root@tyrr apache2]# vim conf/extra/httpd-vhosts.conf ... AllowOverride None Options None Order allow,deny Allow from all Deny from 1.1.1.1 :禁止解

2017-03-25 11:51:49 1117

原创 apache学习笔记(日志切割|静态缓存|防盗链)

apache日志切割apache日志格式配置文件中的设置vim /usr/local/apache2/conf/httpd.conf # # The following directives define some format nicknames for use with # a CustomLog directive (see below). #

2017-03-25 11:51:46 341

原创 apache虚拟主机基础配置(用户认证,域名跳转)

配置虚拟主机安装discuz[root@tyrr www]# cd[root@tyrr ~]# mkdir -p /data/www[root@tyrr ~]# cd /data/www/[root@tyrr www]# unzip Discuz_X3.2_SC_GBK.zip [root@tyrr www]# lsDiscuz_X3.2_SC_GBK.zip readme upl

2017-03-25 11:51:44 1077

原创 LAMP部署-基础

mysql二进制 包 安装[root@tyrr src]# useradd -s /sbin/nologin -M mysql[root@tyrr src]# id mysqluid=500(mysql) gid=500(mysql) 组=500(mysql)[root@tyrr src]# mv mysql-5.1.73-linux-x86_64-glibc23 /usr/local/m

2017-03-25 11:51:41 324

原创 rsync学习

rsync远程下拉:[root@tyzz ~]# rsync -avPz -e "ssh -p 22" 192.168.74.129:/tmp/111 /mnt/111/The authenticity of host '192.168.74.129 (192.168.74.129)' can't be established.RSA key fingerprint is e1:37:53:

2017-03-25 11:51:38 299

原创 日常运维管理 常用命令(3)

查看定时任务[root@tyzz ~]# crontab -l#secu-tcs-agent monitor, install at Tue Feb 14 11:57:11 CST 2017* * * * * /usr/local/sa/agent/secu-tcs-agent-mon-safe.sh /usr/local/sa/agent > /dev/null 2>&1*/1 * *

2017-03-25 11:51:35 1789

原创 iptables学习笔记

iptables的三张表[root@tyzz ~]# iptables -t filter mangle nat导入导出配置文件[root@tyzz ~]# iptables-save >1.ipt[root@tyzz ~]# cat 1.ipt # Generated by iptables-save v1.4.21 on Tue Feb 28 16:30:36 2

2017-03-25 11:51:33 309

原创 日常运维管理 常用命令(2)

[root@tyzz ~]# w 23:13:58 up 11 days, 9:15, 1 user, load average: 0.00, 0.01, 0.05USER TTY LOGIN@ IDLE JCPU PCPU WHATroot pts/0 23:03 6.00s 0.02s 0.00s w[root@tyzz

2017-03-25 11:51:30 362

原创 日常运维管理 常用命令

[root@tyzz ~]# w 23:13:58 up 11 days, 9:15, 1 user, load average: 0.00, 0.01, 0.05USER TTY LOGIN@ IDLE JCPU PCPU WHATroot pts/0 23:03 6.00s 0.02s 0.00s w[root@tyzz

2017-03-25 11:51:27 317

转载 awk基本用法及举例(2)

多行文件 合并为一行[root@tyzz ~]# echo $aroot:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/l

2017-03-25 11:51:11 187

原创 Oracle误删表恢复操作

scott用户下:SQL> select * from tab;TNAME TABTYPE CLUSTERID------------------------------ ------- ----------BONUS TABLE DEPT

2017-03-25 11:51:08 242

原创 java及tomcat环境配置

jdk环境搭建[root@tyzz ~]# tar -zxvf jdk-8u91-linux-x64.tar.gz [root@tyzz ~]# mv jdk1.8.0_91/ /usr/local/jdk1.8[root@tyzz ~]# ln -s /usr/local/jdk1.8/ /usr/local/jdk[root@tyzz ~]# vim /etc/profile #

2017-03-25 11:51:06 385

原创 awk基本用法及举例

查询文件空行所在的行号[root@tyzz ~]# awk '{if ($0~/^$/)print NR}' test 368[root@tyzz ~]# grep -n ^$ test 3:6:8:[root@tyzz ~]# grep -n ^$ test |tr ":" " "3 6 8统计排序awk -F "/" '{print $3}' domain

2017-03-25 11:51:03 229

原创 sed用法及举例

基本sed编程举例-n 只输出处理后的行-i 直接修改读取的文件内容,而不是输出到终端-r 使用扩展正则表达式打印指定行[root@tyzZ SED]# cat file xdtn 6/56 12356 G 8 34 78zdyn 6/56 12356 G 8 34 78aklm 6/56 12356 G 8 34

2017-03-25 11:51:00 684

原创 shell中的连接符 及grep的使用

shell中的连接符[root@tyzz ~]# ls 1.txt && ls 2.txt1.txt2.txt[root@tyzz ~]# ls 10.txt && ls 2.txtls: cannot access 10.txt: No such file or directory[root@tyzz ~]# ls 1.txt && ls 20.txt1.txtls: canno

2017-03-25 11:50:57 1440

原创 基础知识及命令(1)

[root@tyzz ~]# mkdir -pv 1/2/3mkdir: created directory '1'mkdir: created directory '1/2'mkdir: created directory '1/2/3'-p 递归 创建多级目录-v 显示过程[root@tyzz ~]# rmdir -pv 1/2/3/rmdir: removing direct

2017-03-25 11:50:55 181

原创 cd 和 ls 的用法

[root@tyzz ~]# whoami #查看当前用户root[root@tyzz ~]# id #查看当前用户 uid gif groupsuid=0(root) gid=0(root) groups=0(root)[root@tyzz ~]# echo $HOME #输出当前用户家目录/root[root@tyzz ~]# cd /mnt/ 进入/mnt[root@

2017-03-25 11:50:52 347

原创 单用户模式 以及救援模式修改密码方法

单用户模式1 reboot机器clipboard1.png2 按e 编辑 进入下图clipboard2.png3 选择 第二个 按e 再编辑 再最后 加一个 1 或者 s 重新返回 初始界面clipboard3.pngclipboard2.png按 b 启动 即可进入单用户模式修改密码救援模式1 从bios选择启动项 从cdrom启动2 选择rescue syste

2017-03-25 11:50:49 586

原创 linux运行级别

启动级别0 关机1 单用户2 多用户模式但带网络但不能远程登录3 不受限多用户模式 TUI4 保留5 图形模式6 重新启动查看启动级别 [root@tyzz ~]# runlevel N 5N是上次的级别,3是当前级别 也就是说机器开机就是3级别切换级别init 3

2017-03-25 11:50:46 161

原创 psutil 模块常用函数学习

psutil 模块常用函数学习返回当前CPU利用率的百分比In [4]: import psutilIn [5]: psutil.cpu_percent()Out[5]: 0.9 #返回当前CPU利用率的百分比-------获得逻辑(物理)CPU的个数In [6]: psutil.cpu_count()Out[6]: 4 #获得逻辑(物理)CPU的个数内存占用情况total

2017-03-25 11:50:44 642

原创 SHELL日志分析 实例一

要求:将该文件中的域名截取出来,统计重复域名出现的次数,然后按次数进行降序排列[root@tyzZ SHELL]# cat file http://www.linuxidc.com/index.htmlhttp://www.google.com/index.htmlhttp://www.linuxidc.com/get.htmlhttp://www.linuxidc.com/set.h

2017-03-25 11:50:41 225

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除