This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Vim 去掉 ^M 字符 | |
单个文件: | |
``` | |
%s/^M//g | |
``` | |
(^M是ctrl+v,ctrl+m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert overwrite directory "/tmp/out/" | |
row format delimited fields terminated by "\t" | |
select user, login_time from user_login; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.bashrc | |
input=*** | |
output=*** | |
hadoop fs -rmr ${output} | |
$HADOOP_HOME/bin/hadoop jar $HADOOP_STREAMING \ | |
-D mapred.reduce.tasks=100 \ | |
-D mapred.job.name="zip" \ | |
-D mapred.job.priority=VERY_HIGH \ | |
-D mapred.map.max.attempts="1" \ | |
-D mapreduce.output.fileoutputformat.compress=true \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner \ | |
-jobconf stream.num.map.output.key.fields=2 \ | |
-jobconf num.key.fields.for.partition=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf8 | |
import sys | |
import urllib.parse | |
import traceback | |
keyword = '测试' | |
try: | |
url = "http:/127.0.0.1:8983/solr/demo/query?q=titile_t:" + urllib.parse.quote(keyword, "utf-8") | |
print(url) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export CLICOLOR=1 | |
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] [\D{%a} \t] \n@$(ifconfig | grep "inet " | grep -v 127.0.0. | tail -1 | sed "s/netmask.*//" | sed "s/.*inet //" )\$ ' | |
alias ls='ls -lrt' | |
alias grep='grep --color' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e -x | |
mkdir /usr/java | |
chmod 755 /usr/java/ | |
#将下载的JDK rpm包复制至创建的/usr/java目录下 | |
#执行命令进行安装,安装至/usr/java/的新建文件夹jdk1.8.0_111中 | |
cp /usr/local/src/jdk-8u162-linux-x64.rpm /usr/java/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Worksheet_SelectionChange(ByVal Target As Range) | |
Cells.Interior.ColorIndex = xlNone | |
Rows(Target.row).Interior.ColorIndex = 36 '所在行高亮显示 | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
a = 'test' | |
b = hashlib.md5(a.encode('utf8')) | |
print(b.hexdigest()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"vundle | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
"git interface |