一些有得没得
docker run -rm 表示Automatically remove the container when it exits
docker run –privileged 表示Give extended privileges to this container
docker run -u 设置容器的用户 Username or UID (format: <name|uid>[:<group|gid>])
docker run -i, –interactive 交互性Keep STDIN open even if not attached
docker run -t, –tty 分配终端Allocate a pseudo-TTY
docker run -d, –detach 表示Run container in background and print container ID
docker build –network string 表示构建时候网络Set the networking mode for the RUN instructions during build (default “default”)
groupadd group_docker
usermod -s /sbin/nologin user_docker
useradd -s /sbin/nologin -g group_docker user_docker
yum install net-tools
删除文件恢复
git status
git reset HEAD
git checkout .
更新时间
ntpdate time.windows.com
修改时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
时区选择
tzselect
JDBC问题
访问最新8.0.15版本的MYSQL使用5.1.24的JDBC会出现异常java.math.BigInteger cannot be cast to java.lang.Integer
删除无用文件1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69@echo off
setlocal enabledelayedexpansion
set today=%date:~4,10% %time:~0,8%
set path=%cd%
echo %today% >> delete.log
echo ***start delete*** >> delete.log
set a0=".tmp"
set a1="._mp"
set a2=".log"
set a3=".gid"
set a4=".chk"
set a5=".old"
set a6=".obj"
set a7=".idb"
set a8=".pdb"
set a9=".tlog"
for /r %path% %%s in (*.tmp, *._mp, *.log, *.gid, *.chk, *.old, *.obj, *.idb, *.pdb, *.tlog) do (
set var=%%s
set suffix=!var:~-4,4!
if "!suffix!"==%a0% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a1% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a2% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a3% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a4% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a5% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a6% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a7% (
>> filelists.txt echo %%s
)
if "!suffix!"==%a8% (
>> filelists.txt echo %%s
)
set suffix=!var:~-5,5!
if "!suffix!"==%a9% (
>> filelists.txt echo %%s
)
)
set count=0
set /p choice=please select after check filelists.txt(y.Yes n.No)
If /i %choice%==y (
for /f "delims=" %%i in (filelists.txt) do (
>> delete.log echo %%i
del /f /s /q "%%i"
set /a count+=1
)
) else (
Exit
)
echo ***Successful(total: %count%)*** >> delete.log
del /f /s /q "filelists.txt"
echo= >> delete.log
清理图标缓存1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27rem close explorer.exe
taskkill /f /im explorer.exe
rem clean icon db
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
rem clean TrayNotify
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
rem restart explorer.exe
start explorer
代理插件下载地址Proxy SwitchyOmega
Windows开始窗口默认显示10列,右键-属性-开始菜单-自定义修改
Git 设置Socks5代理1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51git remote -v
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
git config --global --get http.proxy
git config --global --get https.proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
x/tools部分通过github下载到对应目录。
go get -u -v github.com/nsf/gocode
go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
go get -u github.com/golang/dep/cmd/dep
:: 使用git pull更新
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/josharian/impl
:: 更新tools在切换到合适的分支版本
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/fatih/gomodifytags
go get -u -v github.com/haya14busa/goplay/cmd/goplay
go get -u -v github.com/rogpeppe/godef
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/lint/golint
go get -u -v github.com/cweill/gotests/...
go get -u -v github.com/derekparker/delve/cmd/dlv
安装Golint,把下载的golint代码移动到x/tools目录下,执行对应的go install
go install github.com/nsf/gocode
go install github.com/uudashr/gopkgs/cmd/gopkgs
go install github.com/ramya-rao-a/go-outline
go install github.com/acroca/go-symbols
go install golang.org/x/tools/cmd/guru
go install golang.org/x/tools/cmd/gorename
go install github.com/fatih/gomodifytags
go install github.com/haya14busa/goplay/cmd/goplay
go install github.com/josharian/impl
go install github.com/rogpeppe/godef
go install sourcegraph.com/sqs/goreturns
go install github.com/golang/lint/golint
go install github.com/cweill/gotests/...
go install github.com/derekparker/delve/cmd/dlv
go install github.com/golang/dep/cmd/dep
vim /etc/hosts
hostname 设置主机名称
chkconfig –list
chkconfig memsql-ops off
chkconfig –del memsql-ops
yum erase postgresql95
定时任务
1 | tail -f /var/log/cron 查看定时任务执行日志。 |
阿里MVN配置
1 | <mirror> |
Docker安装
docker ce 社区版本
docker ee 企业版本
- 关于centos-extras存储库开启访问此地址
- 开启overlay2存储驱动
Install using the repository
- 安装需要的包
1 | yum install -y yum-utils \ provides the yum-config-manager utility |
- 设置仓库
1 | yum-config-manager \ |
- 安装当前最新版本的DOCKER
1 | yum install docker-ce docker-ce-cli containerd.io |
当你有多个Docker仓库,执行安装默认会安装最高版本的Docker。
执行完成后Docker就已经安装好,并且Docker用户组也一并创建,但是没有用户添加到组中。
安装指定版本的Docker
列出repo中可用版本yum list docker-ce –showduplicates | sort -r
执行更新源yum update在执行以上命令。
启动docker服务
systemctl start docker
Install from a package
从以下地址下载对应版本的docker-ce 和 docker-ce-cli
执行安装命令 yum install ./*.rpm 把3个rpm包放在同一个目录执行即可。
安装完成执行service docker start,执行docker info。
升级docker To upgrade Docker CE, download the newer package file and repeat the installation procedure, using yum -y upgrade instead of yum -y install, and pointing to the new file.
usermod -aG docker your-user 把执行用户追加到docker用户组。注销并重新登录才能生效!
Docker网络模型
Docker安装MYSQL
1 | root权限创建data目录,容器启动会失败,存在数据,重新构建容器也会失败。 |
H2存储数据库
查看CenterOS版本
1 | cat /etc/issue |