Python查询Oracle中文乱码问题

用python连接Oracle是总是乱码,最后发现时oracle客户端的字符编码设置不对。

编写的python脚本中需要加入如下几句:

import os
os.environ[‘NLS_LANG’] = ‘SIMPLIFIED CHINESE_CHINA.UTF8’

这样可以保证select出来的中文显示没有问题。

要能够正常的insert和update中文,还需要指定python源文件的字符集密码和oracle一致。

1
2

# -*- coding: utf-8 -*-

参考 https://blog.csdn.net/jianhong1990/article/details/26487479

CDH集群扩容记录

系统为Centos7.5,向集群添加hadoop019服务器(下边图片中的服务器名为hadoop04…,大致流程是这样的,之后会完善的)。

准备工作

  • 查看服务器系统版本

    1
    2
    [root@VM_10_10_centos ~]# cat /etc/redhat-release
    CentOS Linux release 7.5.1804 (Core)
  • 首先修改各新服务器的主机名

    1
    2
    hostnamectl set-hostname  hadoop019
    localectl set-locale LANG=zh_CN.utf8

Read More

Git命令查询远程URL路径

If you want only the remote URL, or referential integrity has been broken:

git config –get remote.origin.url

If you require full output or referential integrity is intact:

git remote show origin

When using git clone (from GitHub, or any source repository for that matter) the default name for the source of the clone is “origin”. Using git remote show will display the information about this remote name. The first few lines should show:

1
2
3
4
5
6
C:\Users\jaredpar\VsVim> git remote show origin
* remote origin
Fetch URL: git@github.com:jaredpar/VsVim.git
Push URL: git@github.com:jaredpar/VsVim.git
HEAD branch: master
Remote branches:

If you want to use the value in the script, you would use the first command listed in this answer.