-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_version_tool.sh
69 lines (62 loc) · 1.63 KB
/
get_version_tool.sh
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
#!/bin/sh
# A script to get packages version
# Author: Samina Fu(@sufuf3)
# date:20180405
#
# OS: Ubuntu
# Run: sh check_versions.sh
date="$(date +"%F_%T")"
##### Package Versions #####
Packages=`sudo dpkg --get-selections | grep -w install | awk '{print $1}'`
echo "# Packages' Verson"
echo "# Packages' Verson" >> versions-$date.md
for p in $Packages
do
echo "$p==`apt-cache policy $p | grep Installed | awk '{print $2}'`"
echo "$p==`apt-cache policy $p | grep Installed | awk '{print $2}'`" >> versions-$date.md
done
##### Java Version #####
echo "# Java Version"
{
java -version
echo "# Java Version" >> versions-$date.md
java -version >> versions-$date.md
} || {
echo "No java"
}
##### Python2 pip packages Version #####
echo "# python2 packages version"
{
pip list --format=freeze
echo "# python2 packages version" >> versions-$date.md
pip list --format=freeze >> versions-$date.md
} || {
echo "No python2"
}
##### Python3 pip3 packages Version #####
echo "# python3 packages version"
{
pip3 list
echo "# python3 packages version" >> versions-$date.md
pip3 list >> versions-$date.md
} || {
echo "No python3"
}
##### Cuda Version #####
echo "# nvcc version"
{
nvcc --version
echo "# nvcc version" >> versions-$date.md
echo "cuda(nvcc)==`nvcc --version`" >> versions-$date.md
} || {
echo "No Cuda"
}
##### Jupyter notebook Version #####
echo "# jupyter notebook version"
{
jupyter notebook --version
echo "# jupyter notebook version" >> versions-$date.md
echo "jupyter notebook==`jupyter notebook --version`" >> versions-$date.md
} || {
echo "No jupyter notebook"
}