生而为人

程序员的自我修养

0%

1. 时间类型字段问题

1.1 时区问题

现象一:写入时间在mysql中查看,与实际时间相差几个小时,程序读出来又是正常的

关于MySQL存入的时间和取出时间不一致的解决

MySQL数据时区问题,及datetime和timestamp类型存储的差异

Time Zone:GMT,UTC,DST,CST

MySQL Config–参数system_time_zone和参数time_zone

查询系统分区:

1
show global variables like'%time_zone%'

解决方案:

1
jdbc:mysql://10.48.204.231:5002/waimai_hubble_analysis_test?useUnicode=true&useSSL=false&serverTimezone=GMT%2B8

[toc]

find

grep

linux使用find命令和grep命令查找文件和文件内容

awk

curl

如果有特殊字符,导致解析失败

  1. 用单引号引起来,这样会原封不动的使用,而不会尝试去解析

    1
    curl -k -v -X POST "https://xxx.net/livy/batches" -u 'admin:xxx!QAZ' -H "Content-Type: application/json" -H "X-Requested-By: admin" -d '{"file":"/users/jingqicao/sparkSubmission/SAMStreaming/ver-01/bin/SAM-1.0-SNAPSHOT.jar", "driverMemory": "30G", "driverCores": 4, "executorCores": 14, "executorMemory": "98G", "numExecutors": 256, "name": "SAMStreaming-ver01-1020-02", "className":"com.microsoft.sam.SAMJobRunner", "args":["ver-01-1020-02","/users/jingqicao/sparkSubmission/SAMStreaming/ver-01/bin/SAMJob_4HD.conf"]}'

    nautilus

ps

查看当前进程

1
2
ps aux
ps -ef

查看进程父子关系

1
2
3
4
5
6
7
8
9
10
11
# 1. 
ps -o pid,ppid,cmd | grep xxx

# 2.
ps l | grep xxx

# 3. 保底方式
for pid in $(ps w | grep network_monitor.sh | grep -v grep | awk '{print $1}'); do
ppid=$(awk '/PPid/ {print $2}' /proc/$pid/status 2>/dev/null)
echo "PID $pid, PPID $ppid"
done

基础

确认

使用的shell类型

1
echo $SHELL
类型 登陆时读取的配置文件 未登录时读取的配置文件
Zsh ~/.zprofile或~/.zlogin ~/.zshrc
Bash ~/.bash_profile、~/.bash_login、~/.profile(按顺序查找第一个) ~/.bashrc

运行

win+R mstsc 远程连接

certificate

win search 中 搜cert即可