-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
194 lines (145 loc) · 7.63 KB
/
README
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
LINUS TECH TIPS STORAGE RANKING SCRIPT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DESCRIPTION
────────────────────────────────────────────────────────────
Generates a text file with the BB code for the forum post as
well as graph images for statistics. Uploads graph images to
a server automatically if one is specified.
DEPENDENCIES
────────────────────────────────────────────────────────────
JSON::XS
File::Spec
Time::Piece
Digest::SHA1
List::Util
Data::Dumper
Net::FTP
GD
GD::Text
GD::Graph
USAGE
────────────────────────────────────────────────────────────
• Download all necessary files and directories:
ltt-rankings.pl
fonts/
images/
json/
Ltt/
• Enter the correct system information into the
json/systems.json file.
┌─────────────────────┐
┌───┤ json/systems.json ├────────────────────────────┐
│ └─────────────────────┘ │
│ │
│ ... previous entry ... │
│}, │
│"system_XXX" : { │
│ "capacity" : "XX.X", │
│ "case" : "Case Model", │
│ "hdds" : { │
│ "AAXXXX" : "X", │
│ "BBXYXX" : "Y", │
│ "CCXQXX" : "Z", │
│ "AAXXVX" : "N" │
│ }, │
│ "notes" : null, │
│ "post" : "post number", │
│ "os" : "Operating System", │
│ "storage_sys" : "Storage System Abbreviation", │
│ "username" : "Username on Forum" │
│} │
│ │
└──────────────────────────────────────────────────────┘
NOTES:
◦ The order in which the entries (case, hdds, ...)
appear is not relevant.
◦ The notes field may or may not be set. If it is
set, it will be pasted as-is into the post text,
so if you wish to use BB formatting for that,
just enter it like you would into the forum
post.
◦ The HDD descriptors must be present in the
json/hdd_types.json file. See below for an
explanation on HDD descriptors.
◦ Technically speaking, the capacity field is
optional at the moment, but for historical
purposes or potential future use we will
continue to use it for now.
◦ See below for a list of abbreviations for the
storage_sys and os fields.
◦ Make sure to follow JSON syntax:
- double quotes,
- no commas for last entry in a given data
structure.
• Create a credentials file json/credentials.json of the
following form:
┌──────────────────────────┐
┌───┤ json/credentials.json ├───────────────────────┐
│ └──────────────────────────┘ │
│ │
│{ │
│ "ftp_user" : "YOUR_FTP_USERNAME", │
│ "ftp_pass" : "PASSWORD", │
│ "ftp_server" : "FTP_SERVER", │
│ "img_server" : "URL_WHERE_IMAGES_WILL_BE" │
│} │
│ │
└──────────────────────────────────────────────────────┘
Alternatively, one can omit the credentials file, in
which case the graph images will be merely stored in the
images/ directory, but will not be uploaded to a server
automatically.
• Run ltt-rankings.pl.
• The output files will be:
◦ ltt-rankings.txt: The text for the forum post.
◦ images/*.png: The image files for the
statistics plots.
• Open forum editor, switch to rich text mode (not raw BB
code editing mode). This is necessary because if the
text is inserted in raw mode, the padding spaces for the
post formatting will be stripped away when the post
ist posted. When posting in rich text mode, the
padding spaces are preserved. Copy and paste text from
ltt-rankings.txt into forum editor, save post and done.
ABBREVIATIONS
────────────────────────────────────────────────────────────
Abbreviations as defined by the abbreviations_key field in
json/constants.json:
WS Windows Server
WHS Windows Home Server
SHR Synology Hybrid RAID
StSp Storage Spaces
RD RAID (unspecified if hardware or software)
HwRD Hardware RAID
SwRD Software RAID
FlRD FlexRAID
When more abbreviations are introduced, make sure to
enter them into the abbreviations_key field in the
json/constants.json file.
HDD DESCRIPTORS
────────────────────────────────────────────────────────────
HDDs are classified by vendor and size, not by model. The
scheme for the HDD descriptor is:
AAXXXX
Where "AA" is a two-letter code for the manufacturer as
defined below, and "XXXX" is a four-digit code for the HDD
size.
The vendor codes are:
HT Hitachi
SG Seagate
SS Samsung
TS Toshiba
US unspecified vendor
WD Western Digital Company
The size descriptor is four digits describing ten gigabytes,
so it would look like this for example:
3 TB disk 0300
500 GB disk 0050
1.5 TB disk 0150
and so on. So a Hitachi drive of 2 TB capacity would have
the HDD descriptor of:
HT0200
If an HDD descriptor is used in json/systems.json which does
not occur in json/hdd_types.json, the scrip will throw a
fatal error and die, notifying the user to amend the records
appropriately.