自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (3)
  • 收藏
  • 关注

原创 selenium.common.exceptions.WebDriverException: Message: ‘chromedriver.exe‘ executable needs to be in

在scrapy框架中使用webdriver时,总是报错:selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home看错误日志的意思是版本不一致,不过我的webdriver和chrom浏览器是一致的。经过单独

2021-01-01 14:11:39 1082

原创 python检查yaml配置文件是否符合要求

# coding=utf-8import loggingimport yamlimport osimport sysreload(sys)sys.setdefaultencoding("utf-8")# 获取当前目录的路径cur_dir = os.path.abspath('.')def check_dt_pacsscp(config): """ ...

2019-09-08 17:33:40 1391

原创 python编写一个程序,用来打印当前目录下所有的文件及文件夹下的文件

# coding=utf-8"""编写一个search(s)的函数,能在当前目录以及当前目录的所有子目录下查找文件名包含指定字符串的文件,并打印出完整路径:$ python search.py testunit_test.logpy/test.pypy/test_os.pymy/logs/unit-test-result.txt"""import osimport sys...

2019-09-08 17:28:52 4725 2

原创 linux环境docker安装启动

centos6.5安装docker:1、yum install epel-release -y2、yum install docker-io -y3、安装的配置文件/etc/sysconfig/docker4、启动docker /etc/init.d/docker startcentos7安装docker:卸载老的docker版本:sudo yu...

2019-07-21 00:06:51 379

原创 ubuntu安装docker

#ubuntu安装docker1、卸载相关sudo apt-get remove docker docker-engine docker.io containerd runc2、安装依赖sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ ...

2019-06-19 01:40:58 237

原创 redis安装及python调用

1、ubuntu安装redis:sudo apt install redis -y2、设置密码(编辑配置文件,找到requrepass这行去掉注释)sudo vim /etc/redis/redis.conf#requirepass 123456 #去掉注释,后面的密码就是redis的密码#找到bind 127.0.0.1 这行改为服务器内网地址保存重启re...

2019-03-16 17:00:36 164

原创 python实现输入Y/N执行或退出程序

while(True): print("请仔细核对以下内容,确认你所操作的对象是本次打印的内容。按Y/N") in_content = input("请输入:") if in_content == "Y": print("执行成功!") exit(0) elif in_content == "N": print("你..

2019-03-16 15:35:45 20831 1

原创 Linux记录操作日志

history命令可以查看最近1000条命令。调整history命令的大小:vi /etc/profileHISTSIZE=1000 #改为history日志文件默认是保存在.bash_history文件下。history命令默认是没有时间的,可以在/etc/bashrc文件下追加以下:HISTFILESIZE=2000 HISTSIZE=2000 HISTT...

2019-03-15 21:46:37 20263 1

原创 nginx隐藏版本号

1.隐藏版本号:vi nginx.conf  http {         .................        server_tokens off;        ..................}2.隐藏nginx软件名及版本号: 第一步、修改nginx的源码文件(需要在安装之前修改)vi src/core/nginx.h#define N...

2019-01-16 11:34:34 7163 1

原创 hive创建一个自定义函数处理复杂数据

1.数据格式实例:-------------------------------------1,zhangsan:18:beijing|nan|it,20002,lisi:28:nanjing|nan|it,40003,xiaowu:38:qingdao|nan|it,1000--------------------------------创建表,然后load到hive中:...

2018-09-05 15:37:21 953

原创 zookeeper启动脚本

#/bin/sh#for start or stop zookeepera=$1if [[ $a = "start" ]];then for host in node1 node2 node3 do ssh $host "export JAVA_HOME=/usr/local/jdk;/usr/local/zookeeper-3.4.5...

2018-09-04 23:06:31 332

原创 pyspark统计access访问日志中ip的归属地(用本地ip地址库)

本地ip地址库:不足之处便是数据不准确,而且数据变化不能实时更新。第三方ip地址接口:解决了上面的问题,但是查询量太大的话会拒绝服务。本实例演示的是本地ip地址库,数据格式为:(下载地址:https://download.csdn.net/download/wangjiadongge/10644936)62610,1034939648,61.175.237.0,1034939657,...

2018-09-04 14:43:51 408

原创 pyspark获取ip地址的位置信息

#coding=utf-8from pyspark import SparkConf,SparkContextconf=SparkConf().setAppName("getiplocal").setMaster("local[*]")sc=SparkContext(conf=conf)#指定从哪里读取数据#1.规则,ipnumrdd1 = sc.textFile("hdfs://...

2018-09-03 18:25:05 432

原创 python根据ip地址计算归属地(淘宝地址库)

#python 2.x的写法#coding = utf-8import urllib2import jsondef ip2city(ip): apiurl = "http://ip.taobao.com/service/getIpInfo.php?ip=%s" % ip content = urllib2.urlopen(apiurl).read() data =...

2018-09-02 22:00:40 1295

原创 spark RDD算子大全

Transformation Meaning map(func) Return a new distributed dataset formed by passing each element of the source through a function func. filter(func) Return a new dataset formed by selecti...

2018-09-02 12:21:07 968

原创 python整理不规则数据(用函数将一列中某些行为的位置补全)

 注意数据的类型,否则保存会有错误,比如long类型后面带L,需要将其去掉。#coding=utf-8#用于转换ip地址为填写空白处的函数def ip2long(ip_string): return ip_string.find('.') != -1 and reduce(lambda a, b: a << 8 | b, map(int, ip_string....

2018-09-02 02:36:04 1442

原创 nginx+uwsgi+部署flask和django项目

#安装uwsgipipinstalluwsgi#编辑测试文件,用于测试uwsgi是否能正常使用vitest.pydefapplication(env,start_response):start_response('200OK',[('Content-Type','text/html')])return["helloworld"]...

2018-08-31 18:16:53 192

原创 在windows10本地运行wordcount程序报错

错误展示:null chmod 0700 D:\tmp\hadoop-darren\mapred\staging\darren959377275\.staging解决办法很简单,访问下面的url,得到2.7.3文件bin下的hadoop.dll,将其拷贝到windows\system32下搞定https://github.com/SweetInk/hadoop-common-bin...

2018-08-31 17:28:20 823

原创 hive 1.2.2安装配置

1.下载hive:wget http://mirrors.hust.edu.cn/apache/hive/hive-1.2.2/apache-hive-1.2.2-bin.tar.gz 2.解压到指定目录:tar zxf apache-hive-1.2.2-bin.tar.gz -C /usr/local/cd /usr/local/mv apache-hive-1.2....

2018-08-31 01:29:51 680

原创 mysql创建普通用户无法登陆

记录一下mysql-5.1创建普通用户无法登陆的问题,之前一直没有遇到过,无论使用flush privileges刷新还是重新授权都不行。//创建用户:grant all on hive.* to hive@'%' identified by "hive";//刷新权限:flush privileges;//查看创建的用户:select user,host from my...

2018-08-31 01:12:55 2081

原创 html页面布局笔记

一般html布局会用居中显示,这里需要注意的是,当元素设置了固定宽度之后,margin:0 auto才适用,如果设置了width为100%,则无效:.wapper{margin:0 auto;width 100%; }  \\这是无效的.wapper {margin:0 auto;width 750px;}  \\这是正确的 float属性:一般float会对它自己后面的标签产生影...

2018-08-26 11:36:23 2012

原创 css分类导航和圆角菜单的制作

#纵向分类<!DOCTYPE html><html><head><meta charset="utf-8"><title></title><style type="text/css">/*清除默认的边框*/*{margin: 0px;padding: 0px

2018-08-26 11:33:39 1198

原创 python django添加静态资源

在setting中确认以下:STATIC_URL = '/static/' 将静态目录放到app下,在app中创建static目录,然后再创建css、js、image。 在html中添加静态资源的路径:   {% load staticfiles %}<link rel="stylesheet" href="{% static 'css/main.css' %}...

2018-08-26 11:30:07 881

原创 linux普通用户显示bash-4.1$解决办法

其因是家目录下缺少文件: ls -a /etc/skel/.  ..  .bash_logout  .bash_profile  .bashrc全部拷贝到家目录即可:cp /etc/skel/.bash* /home/darren/

2018-08-26 11:28:49 2044 1

原创 zabbix监控钉钉报警配置

下载golang编写的钉钉插件(附件中已上传,可直接下载): 修改zabbix server配置文件:vi /usr/local/zabbix/etc/zabbix_server.confAlertScriptsPath=/usr/local/zabbix/etc/alertscripts 把下载好的golang插件上传至/usr/local/zabbix/etc/ale...

2018-08-26 11:28:00 1793

原创 zabbix触发器无法执行动作

遇到一个坑爹的问题,必须记录下来。问题描述:监控的主机分为了多个组,用户专门建了一个用于接收报警的组,然而这个组成员只能接收某个主机的报警,而不能接收其他主机的报警(现在回想起来了,最后那几个组是新创建的)。 排查的过程:先让其触发一个告警,然后触发器没有执行动作,检查了报警媒介、触发器、动作,都没问题。奇怪……手动发送邮件测试也没问题,只能放大招了,重启zabbix_serv...

2018-08-26 11:27:02 11166 1

原创 \r和\n的区别

\t :为tab。\r :使光标移动到当前行的行首。\n:换一行。比如:echo -e "aaaa\tbb"结果为:aaaa bbecho -e "aaaa\rbb"  结果为:bbaaecho -e "aaaa\nbb"结果为:aaaabb在python中用spark处理数据时,另一种解释:“ ” :一个空格\t   :八个空格\n :回车换行...

2018-08-26 11:23:44 246

原创 将mysql数据导入到redis

用脚本模拟redis的客户端redis-cli实现:(注:mysql地址为10.86.30.203 redis地址为10.86.31.50)1.首先确定mysql表的列:desc test;+-----------+-------------+------+-----+---------+-------+| Field | Type | Null | Key |...

2018-08-20 15:59:23 2835

原创 hadoop集群监控ganglia简单安装配置

 环境:系统:centos7nginx:1.8.1php:5.4.16ganglia:3.7.2安装:这里使用yum安装1.安装epel:yum install epel-release2.安装gmond:yum install ganglia-gmond -y3.安装gmetad:yum install ganglia-gmetad -y...

2018-08-17 12:18:59 200

原创 VisualVM监控tomcat

远程监控Linux上的tomcat java使用有两种方式:一、通过jmx连接:此种方式无法看到Visual GC。二、通过jstatd连接:此时方式无法看到cpu使用情况。 这里两者办法都部署:1、在window上安装java(过程略)2、在windows的java安装家目录下的bin目录会存在一个jvisualvm.exe执行文件,双击即可打开。(如下图)1)j...

2018-08-10 16:45:03 643

原创 sed去掉文件行首空格

#删除文件中行首的空格sed -i 's/^[ \t]*//' result.data#删除文件中行末空格:sed -i 's/[ \t]*$//g' result.data#删除文件中所有的空格:sed -i s/[[:space:]]//g result.data#把文件中空格变为‘,’:sed -i 's/[ \t]/,/g' result.data...

2018-07-02 15:13:12 6841

原创 oracle常用语句

查询语句:select * from student where查询所有的数据库:select devdb from v$database;查看某个数据库中所有的表:select * from user_tables;查看某个用户下所有的表:select * from user_tables where table_name = '用户名'建表:create table student(id i...

2018-06-08 00:27:58 142

原创 Oracle install guide

下载地址:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 内存要求:Minimum: 1 GB ofRAMRecommended: 2 GBof RAM or more#grep MemTotal  /proc/meminfo 查看虚拟内存空间:df -h/dev/shm/ 安装依...

2018-06-08 00:27:05 261

原创 linux中无磁盘空间,找不到占用磁盘的文件

df -h查看:Filesystem Size Used Avail Use% Mounted on/dev/vda1 59G 46G 11G 81% /tmpfs 3.9G 0 3.9G 0% /dev/shm/dev/vdb1 296G 28G 253G 10% /optdf -i查看:Filesy...

2018-06-07 09:32:28 1950

原创 linux中对大文件切割

切割一般分为按大小分割和按一定行数切割。按文件行数:split -l 1000 test.data aaa还可以指定被切割后的文件名split -l 1000 -d -a 3 aaa_   -a, --suffix-length=N 指定后缀长度为N (默认为2)  -b, --bytes=大小 指定每个输出文件的字节大小  -C, --line-bytes=大小 指定每个输出文件里最大行字节大...

2018-06-07 09:28:53 3172

原创 Linux开机显示启动详细信息

直接按F5即可查看,平时无用,开机进度条一直在走始终无法完成时,想找都找不到。找到是什么原因导致系统无法正常启动之后,可以进入当用户模式具体处理所遇到的问题。...

2018-06-02 22:50:21 5872

原创 css笔记

css的调用: left right ###################整个标签调用(全局)####################### div{ background-color:red; } left right ###################################

2016-09-30 17:35:44 196

原创 html笔记

HTML基本:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>测试</title></head><body background="images/beijing"><p>这是一个段落</p&g...

2016-09-26 17:00:35 187

00798自考商务交流

从2007年到2017年的考试历年试题,代码为00798,都是10月份的,山东自考只有10月份的,一年只考一次,试卷全做一遍考试基本上能过了吧

2019-11-24

IP地址库统计大全

格式为:29281,1017878798,60.171.153.14,1017878829,60.171.153.45,安徽省安庆市

2018-09-04

源码安装hadoop需要的资源集合

编译安装hadoop需要的各种软件,其中包括maven、Protobuff、findbug、hadoop-2.4.1和hadoop-2.6.5

2018-05-24

空空如也

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

TA关注的人

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