日期时间转字符串
1 | # 2006-05-16 |
当前系统日期、时间
1 | select getdate() |
当前大数据发展有三大趋势: 数据仓库往数据湖方向发展、批处理往流式处理发展、本地部署往云模式发展。数据湖作为最近两年兴起的热点概念,各大互联网公司都在对其研究和探索。本文参考了阿里、腾讯和网易等公司的一些资料,将告诉你数据湖到底是什么?有什么用?
SpringBoot项目,本机运行正常,打war包放到服务器的Tomcat中之后无法访问,404.
查看了Tomcat的catalina.日志,发现报错:
More than one fragment with the name [org_apache_tomcat_websocket] was found.This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
把Tomcat7 换成Tomcat8
编译 /etc/auto_master 文件,注释掉或者移除以 /home 开头的那一行,保存。
1 | sudo vim /etc/auto_master |
会提示"/etc/auto_master" [readonly] 8L, 196C ,文件不可编辑
可以使用命令
1 | sudo nano /etc/auto_master |
注释掉 /home 哪一行,如下所示:
1 | # |
1 | cd / (这一步很重要) |
1 | sudo ln -s /Users/linjian/config /home/config |
Linux 查看端口占用情况可以使用 lsof 和 netstat 命令。
lsof(list open files)是一个列出当前系统打开文件的工具。
lsof 查看端口占用语法格式:
1 | lsof -i:端口号 |
查看服务器 8000 端口的占用情况:
1 | # lsof -i:8000 |
可以看到 8000 端口已经被轻 nodejs 服务占用。
lsof -i 需要 root 用户的权限来执行,如下图:

更多 lsof 的命令如下:
1 | lsof -i:8080:查看8080端口占用 |
netstat -tunlp 用于显示 tcp,udp 的端口和进程等相关情况。
netstat 查看端口占用语法格式:
1 | netstat -tunlp | grep 端口号 |
例如查看 8000 端口的情况,使用以下命令:
1 | # netstat -tunlp | grep 8000 |
更多命令:
1 | netstat -ntlp //查看当前所有tcp端口 |
在查到端口占用的进程后,如果你要杀掉对应的进程可以使用 kill 命令:
1 | kill -9 PID |
如上实例,我们看到 8000 端口对应的 PID 为 26993,使用以下命令杀死进程:
1 | kill -9 26993 |