hysyeah

知易行难


  • 首页

  • 分类

  • 标签

  • 归档

  • 关于

  • 搜索

执行go get出现 go: GOPATH entry is relative错误

发表于 2018-04-01 分类于 GO

将~/.zshrc文件中 export GOPATH="/home/hys/mycode/go:/home/hys/mycode/go/gopl:$GOPATH" 改为 export GOPATH="/home/hys/mycode/go:/home/hys/myc ...

阅读全文 »

python标准库之ast

发表于 2018-04-01 分类于 python标准库

ast-Abstract Syntax Trees用于帮助python应用处理抽象语法树# ast.literal_eval()将包含在字符串中的python结构转换为python结构,这些结构包含:strings, bytes, numbers, tuples, lists, dicts, set ...

阅读全文 »

request中之自定义的结构体

发表于 2018-04-01 分类于 requests

# 通过LookupDict构建个可以根据多个value查找key的字典 class LookupDict(dict): """Dictionary lookup object.""" def __init__(self, ...

阅读全文 »

python中的native string

发表于 2018-03-26 分类于 requests

# 将给定的字符串对象转换为native string def to_native_string(string, encoding='ascii'): if isinstance(string, builtin_str): out = string e ...

阅读全文 »

ubuntu上搭建git仓库

发表于 2018-03-21 分类于 未分类

1.安装git ,git-core,openssh-server 2.创建用户git, 3.客户端生成公钥,ssh-keygen -t rsa -C "xxx@126.com" 5.将客户端公钥添加到服务端的~/.ssh/authorized_keys文件下 6.git –bar ...

阅读全文 »

docker使容器和宿主机使用同一网段

发表于 2018-03-16 分类于 未分类

1.通过ifconfig查询物理网卡信息,名称为eno1 2.route -n,查询网关为10.68.2.1 3.使用docker命令创建网络docker network create -d macvlan \ --subnet 10.68.2.0/24 --gateway 10.68.2.1 \ ...

阅读全文 »

docker容器启动时设置容器内服务自启动

发表于 2018-02-24 分类于 未分类

1.编写shell脚本,auto_start.sh #!/bin/sh /etc/init.d/ssh start #启动服务 /bin/bash #一定要加上这句,否则容器会自动退出 2.修改docker-compose.yml volumes: - ./auto_ ...

阅读全文 »

使用docker搭建hadoop,spark集群

发表于 2018-02-12 分类于 未分类

环境:ubuntu 16.04 64位安装所需文件: Java SDK 1.8, scala-2.11.11,hadoop-2.7.4,spark-2.2.0-bin-hadoop2.7 1.docker pull ubuntu2.启动镜像,docker run -idt [image_id] /b ...

阅读全文 »

spark-shell使用mysql存储元数据

发表于 2018-02-07 分类于 未分类

1.hive安装(依赖于hadoop) - 下载hive - 解压到/opt目录下 - 添加环境变量到~/.bashrc export HIVE_HOME=/opt/apache-hive-2.2.0-bin export PATH=$HIVE_HOME/bin:$PATH 2.hive-env.s ...

阅读全文 »

hadoop,spark踩过的坑

发表于 2018-02-07 分类于 未分类

1.WARN yarn.Client: Neither spark.yarn.jars nor spark.yarn.archive is set, falling back to uploading libraries under SPARK_HOMEhdfs dfs -mkdir /hadoop ...

阅读全文 »

docker常用命令2

发表于 2018-02-07 分类于 未分类

# 容器和主机之间的文件复制 1.从主机复制到容器 sudo docker cp host_path containerid:container_path 2.从容器复制到主机 sudo docker cp containerid:container_path host_path # 免sud ...

阅读全文 »

启动docker hadoop集群失败

发表于 2018-02-01 分类于 未分类

启动hadoop发生失败,查看日志文件 docker hadoop Does not contain a valid host:port authority 从google得知,网络信息不能带下划线 解决方法1.docker network ls发现docker网络中NAME:dockerpro ...

阅读全文 »

docker-compose up -d启动失败不能创建网络

发表于 2018-02-01 分类于 未分类

当修改docker-compose.yml文件后台,使用命令docker-coompose up -d 启动服务 出现如下错误 Creating network "master_sparknet" with driver "bridge" ERROR: can ...

阅读全文 »

搭建安全Docker Registry

发表于 2018-01-23 分类于 未分类

1.安装registry docker pull registry 2.制作证书 openssl req -newkey rsa:2048 -nodes -sha256 -keyout certs/domain.key -x509 -days 365 -out certs/domain.crt ...

阅读全文 »

Docker Compose管理mysql容器

发表于 2018-01-22 分类于 未分类

Dockerfile用于管理一个单独的应用容器,Docker Compose用于管理多个容器。 1.sudo pip install docker-compose 2.docker pull mysql 3.mkidr mysql vim docker-compose.yml docker- ...

阅读全文 »

matplotlib.pyplot添加中文显示

发表于 2018-01-14 分类于 pyplot

1.从C:\Windows\Fonts复制微软雅黑字体到/usr/local/lib/python3.5/dist-packages/matplotlib/mpl-data/fonts/ttf 然后将名称修改为 sudo mv MSYHBD.TTF MSYHBD.ttf sudo mv MSYH. ...

阅读全文 »

x86相关寄存器

发表于 2018-01-06 分类于 C语言

IP-Instruction Pointer--指令指针寄存器 CS-Code Segment--段寄存器 DS-Data Segment--数据段寄存器 %rax-%eax-%ax-%al---返回值 %rbx-%ebx-%bx-%bl---被调用者保存 %rcx-%ecx-%cx-%cl--- ...

阅读全文 »

elf可重定向目标文件格式

发表于 2018-01-01 分类于 C语言

ELF头 .text .rodata .data .bss .symtab .rel.text .rel.data .debug .line .strtab 节头部表 典型的ELF可重定位目标文件 .text:已编译程序的机器代码 .rodata:只读数据,一般是程序里面的只读变量(如const修饰 ...

阅读全文 »

gcc常用选项

发表于 2017-12-24 分类于 C语言

/*对源文件hello.c进行预处理,并生成一个ASCII码的中间文件hello.i*/ gcc -E hello.c -o hello.i /*等同于cpp hello.c hello.i*/ /*将hello.c或hello.i翻译成汇编语言文件hello.s*/ gcc -S hello.c ...

阅读全文 »

ubuntu安装readelf

发表于 2017-12-19 分类于 Linux

sudo apt-get install binutils Usage: readelf <option(s)> elf-file(s) Display information about the contents of ELF format files Options are: ...

阅读全文 »
1…121314…17

hys

329 日志
30 分类
35 标签
hysyeah.top © 2019-2025 粤ICP备19077752号