11 2018 档案

ubuntu18.04安装openresty
摘要:ubuntu18.04使用openresty官方APT源安装openresty 添加openresty的 APT 仓库,这样就可以便于未来安装或更新软件包(通过 apt-get update 命令)。 运行下面的命令就可以添加仓库(每个系统只需要运行一次): # 导入我们的 GPG 密钥:wget 阅读全文

posted @ 2018-11-28 11:20 zqifa 阅读(2667) 评论(0) 推荐(1) 编辑

ubuntu18.04 apt-get换国内源 阿里源 163源 清华源 中科大源
摘要:服务器上安装了最新的Ubuntu Server 18.04,代号为bionic。使用apt-get命令安装软件时,有时候速度比较慢,有时候会失败。因此考虑用国内的镜像源更换下apt-get的默认源。 ubuntu 查看版本号:lsb_release -a 输出:Distributor ID: Ubu 阅读全文

posted @ 2018-11-28 10:48 zqifa 阅读(5442) 评论(0) 推荐(2) 编辑

ubuntu拒绝root用户ssh远程登录解决办法
摘要:ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录,解决办法就是:修改ssh配置,然后重启ssh服务即可。 vi /etc/ssh/sshd_config 找到并用#注释掉这行:PermitRootLogin prohibit-password新建一行 添加:Perm 阅读全文

posted @ 2018-11-28 10:34 zqifa 阅读(5172) 评论(0) 推荐(2) 编辑

ubuntu18关闭系统自动更新
摘要:ubuntu18.04关闭系统自动更新有两个方法:1.修改配置文件 修改配置文件/etc/apt/apt.conf.d/10periodic#0是关闭,1是开启,将所有值改为0vi etc/apt/apt.conf.d/10periodic APT::Periodic::Update-Package 阅读全文

posted @ 2018-11-28 10:17 zqifa 阅读(7135) 评论(0) 推荐(0) 编辑

debian系统下apache2开启ssi功能
摘要:SSI (Server Side Include)的 html 文件扩展名 (.shtml), 通常称为"服务器端嵌入"或者叫"服务器端包含"说白了就是类似其他语言如 PHP include 引入其他文件,SSI 是通过配置服务器,一个静态 html 文件引入另一个 html 文件的功能 被包含文件 阅读全文

posted @ 2018-11-21 14:42 zqifa 阅读(279) 评论(0) 推荐(0) 编辑

python pytz时区设置模块
摘要:如果你的程序要考虑时区,可以使用pytz。pytz官方文档:http://pytz.sourceforge.net/我使用的python版本:3.7.1 datetime模块中有tzinfo相关的东西,但是它是一个抽象类,文档上说:tzinfo is an abstract base clase, 阅读全文

posted @ 2018-11-16 11:24 zqifa 阅读(3705) 评论(0) 推荐(1) 编辑

python3 TypeError: Unicode-objects must be encoded before hashing
摘要:python3下,利用hash值对字符串进行md5加密时报错:TypeError: Unicode-objects must be encoded before hashing 原因是:python3跟python2区别:python3下字符串为Unicode类型,而hash传递时需要的是utf-8 阅读全文

posted @ 2018-11-16 10:27 zqifa 阅读(8558) 评论(0) 推荐(2) 编辑

centos7编译安装php7.2
摘要:去官网下载php7.2安装包,选择一个结点下载:http://php.net/downloads.php 下载:wget -ivh http://cn.php.net/distributions/php-7.2.12.tar.gz解压源码包:tar -zxf php-7.2.12.tar.gz 安装 阅读全文

posted @ 2018-11-14 19:15 zqifa 阅读(392) 评论(0) 推荐(0) 编辑

python实现切换代理ip
摘要:大量的处理爬虫的时候,IP地址容易被封掉,这个时候可以使用代理IP来帮助完成接下来的任务了 使用Requests模块来完成请求,代码如下: import urllib.requestimport requests url = "http://pv.sohu.com/cityjson?ie=utf-8 阅读全文

posted @ 2018-11-12 10:27 zqifa 阅读(2598) 评论(0) 推荐(0) 编辑

python列表(list)遍历
摘要:list = ['html', 'js', 'css', 'python'] 遍历列表方法1:for i in list: print("序号:%s 值:%s" % (list.index(i) + 1, i)) 遍历列表方法2:for i in range(len(list)): print("序 阅读全文

posted @ 2018-11-08 14:03 zqifa 阅读(3060) 评论(0) 推荐(0) 编辑

python去除\ufeff、\xa0、\u3000
摘要:今天使用python处理一个txt文件的时候,遇到几个特殊字符:\ufeff、\xa0、\u3000,记录一下处理方法 代码:with open(file_path, mode='r') as f: s = f.read() 1.\ufeff 字节顺序标记 去掉\ufeff,只需改一下编码就行,把U 阅读全文

posted @ 2018-11-08 12:01 zqifa 阅读(20345) 评论(0) 推荐(3) 编辑

ubuntu防火墙ufw使用教程
摘要:查看ubuntu版本cat /etc/issue或者lsb_release -a 防火墙 由于Linux原始的防火墙工具iptables过于繁琐,所以ubuntu默认提供了一个基于iptable之上的防火墙工具ufw。ubuntu 系统默认已安装ufw。ubuntu 9.10默认的便是UFW防火墙, 阅读全文

posted @ 2018-11-05 16:28 zqifa 阅读(24109) 评论(0) 推荐(3) 编辑

ubuntu忘记登录密码解决方法
摘要:1.重启系统,长按Shift键,直到出现下面菜单。选择recovery mode(恢复模式)。2.接下来会进入如下界面,选择Drop to root shell prompt ,也就是获取root权限。3.在下面的# 后面敲入 cat /etc/shadow 查看用户名(如果连用户名都忘记的话)4. 阅读全文

posted @ 2018-11-05 16:26 zqifa 阅读(952) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示