~eloaders/i-nex/I-Nex

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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
' Gambas class file


PUBLIC SUB Form_Open()
  DIM cpuz0, cpuz1, cpuz2, cpuz3, cpuz4, cpuz5 AS String
  TextLabel10.Visible = FALSE
  TextArea28.Visible = FALSE 
  TextLabel21.Visible = FALSE
  'End dpkg installed
  'Procesor
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '1p'" WAIT TO cpuz0
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '2p'" WAIT TO cpuz1
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '3p'" WAIT TO cpuz2
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '4p'" WAIT TO cpuz3
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '5p'" WAIT TO cpuz4
  SHELL "ls /sys/devices/system/cpu/ | grep -v save | sed -n '6p'" WAIT TO cpuz5
  
  cpuz0 = Replace(cpuz0, "\n", "")
  cpuz1 = Replace(cpuz1, "\n", "")
  cpuz2 = Replace(cpuz2, "\n", "")
  cpuz3 = Replace(cpuz3, "\n", "")
  cpuz4 = Replace(cpuz4, "\n", "")
  cpuz5 = Replace(cpuz5, "\n", "")
IF (cpuz0 = "cpu0") = TRUE THEN
ComboBox1.Add("Procesor0")
ENDIF

IF (cpuz1 = "cpu1") = TRUE THEN
ComboBox1.Add("Procesor1")
ENDIF

IF (cpuz2 = "cpu2") = TRUE THEN
ComboBox1.Add("Procesor2")
ENDIF

IF (cpuz3 = "cpu3") = TRUE THEN
ComboBox1.Add("Procesor3")
ENDIF

IF (cpuz4 = "cpu4") = TRUE THEN
ComboBox1.Add("Procesor4")
ENDIF

IF (cpuz5 = "cpu5") = TRUE THEN
ComboBox1.Add("Procesor5")
ENDIF

dospam_uptime()
System()
bios()
kernel()
internet()
dzwiek()
grafika()
dysk()
ComboBox1.Text = "Procesor0"
Label25.Text = Application.version
'Okno na środku
ME.Center

END 


PUBLIC SUB ComboBox1_Click()

  Wykrywanie_procesorow()

END

PUBLIC SUB kernel()
  DIM stringa, risultato, kernel, uzywanyobecniekernel AS String
  DIM righe AS NEW string[]
  DIM count AS Integer
  DIM riga AS NEW String[]
  DIM lista AS NEW String[]
  SHELL "ls /boot/vmlinuz* | cut -d '/' -f 3 " WAIT TO TextArea47.Text
  SHELL "ls /boot/vmlinuz* | cut -d '/' -f 3 | wc -l" WAIT TO Label16.Text
  SHELL "uname -r" WAIT TO Label26.Text
  'Usuwanie kerneli
  SHELL "dpkg-query -W --showformat='${Package}\n' | grep 'linux-image'" TO stringa 
 
  righe = Split(stringa, "\n", "%%", TRUE)  
  
  FOR count = 2 TO righe.Max
     
     riga = Split(righe[count], " ", "%%", TRUE)
     
     risultato = Replace(riga[0], " ", "")
     lista.add(risultato)
  NEXT 
  
  ComboBox3.List = lista
  ComboBox3.Index = 0
  'Koniec usuwania kerneli
  
END

PUBLIC SUB dzwiek()
  
  DIM kartadzwiekowa, kartadzwiekowa2 AS String
  SHELL "lspci | grep 'udio' | cut -d ':' -f 3 | cut -d '(' -f 1" WAIT TO kartadzwiekowa
  TextArea18.Text = kartadzwiekowa

END

PUBLIC SUB dysk()
  DIM wolnegbnadysku, dysktwardy, zajetegb, calkowitapoj AS String
  DIM wolgb, zajgb, calkowite AS Float
  'SHELL "cat /proc/scsi/scsi | grep ATA | head -1 | cut -d ':' -f 3 | cut -d ' ' -f 2-3 && echo $(cat /proc/partitions | grep sda | head -n 1 | awk {'print $3'})/1024/1024 | bc && echo GB" WAIT TO dysktwardy
  SHELL "cat /proc/scsi/scsi | grep 'Vendor'" WAIT TO dysktwardy
  SHELL "echo $(df -m | grep '/' | awk {'print $4'} | head -1)/1000 | bc && echo GB" WAIT TO wolnegbnadysku
  SHELL "echo $(df -m | grep '/' | awk {'print $3'} | head -1)/1000 | bc && echo GB" WAIT TO zajetegb
  SHELL "echo $(df -m | grep '/' | awk {'print $2'} | head -1)/1000 | bc && echo GB" WAIT TO calkowitapoj
  'Progress
  SHELL "df -m | grep / | awk {'print $4'} | head -n 1" WAIT TO wolgb
  SHELL "df -m | grep / | awk {'print $3'} | head -n 1" WAIT TO zajgb
  SHELL "df -m | grep / | awk {'print $2'} | head -n 1" WAIT TO calkowite
  TextLabel1.Text = wolnegbnadysku
  TextArea24.Text = dysktwardy
  TextLabel6.Text = zajetegb
  TextLabel13.Text = calkowitapoj
  ProgressBar2.Value = wolgb / calkowite
  ProgressBar3.Value = zajgb / calkowite
END

PUBLIC SUB bios()
DIM bios_vendor, bios_version, bios_date, board_name, board_vendor AS String
  SHELL "cat /sys/devices/virtual/dmi/id/bios_vendor" TO bios_vendor
  SHELL "cat /sys/devices/virtual/dmi/id/bios_version" TO bios_version
  SHELL "cat /sys/devices/virtual/dmi/id/bios_date" TO bios_date
  SHELL "cat /sys/devices/virtual/dmi/id/board_vendor" TO board_vendor
  SHELL "cat /sys/devices/virtual/dmi/id/board_name" TO board_name
  TextArea25.Text = bios_vendor
  TextArea26.Text = bios_version
  TextArea27.Text = bios_date
  TextArea15.Text = board_vendor
  TextArea16.Text = board_name
END

PUBLIC SUB System()
  DIM hostname, dist, release, arch, gcc, timezone, xorg_version, glx_version AS String
  SHELL "cat /etc/timezone" WAIT TO timezone
  SHELL "hostname" WAIT TO hostname
  SHELL "cat /etc/issue.net" WAIT TO dist 
  SHELL "sed 's/DISTRIB_RELEASE=//' /etc/lsb-release | sed -n '2p'" WAIT TO release
  SHELL "uname -m" WAIT TO arch
  SHELL "gcc -dumpversion" WAIT TO gcc
  SHELL "xdpyinfo | grep 'X.Org version:' | sed -n '1p' | cut -d ':' -f 2" WAIT TO xorg_version
  SHELL "glxinfo | grep 'GLX version:' | sed -n '1p' | cut -d ':' -f 2" WAIT TO glx_version
  
  TextArea31.Text = gcc
  TextArea33.Text = hostname
  TextArea29.Text = dist
  TextArea32.Text = release
  TextArea36.Text = arch
  TextArea30.Text = timezone
  TextArea34.Text = xorg_version
  TextArea35.Text = glx_version
END

PUBLIC SUB grafika()
  DIM stringa, risultato, gpu, opengl_vendor_string, opengl_renderer_string, opengl_version_string, rozdzielczosc AS String
  DIM righe AS NEW string[]
  DIM count AS Integer
  DIM riga AS NEW String[]
  DIM lista AS NEW String[]
  SHELL "lspci | grep 'VGA' | cut -d ':' -f3 | cut -d '(' -f 1" WAIT TO gpu
  SHELL "glxinfo | grep 'OpenGL vendor string:' | sed -n '1p' | cut -d ':' -f 2" WAIT TO opengl_vendor_string
  SHELL "glxinfo | grep 'OpenGL renderer string:' | sed -n '1p' | cut -d ':' -f 2" WAIT TO opengl_renderer_string
  SHELL "glxinfo | grep 'OpenGL version string:' | sed -n '1p' | cut -d ':' -f 2" WAIT TO opengl_version_string
  SHELL "xdpyinfo | grep 'dimensions:' | cut -d ':' -f 2" WAIT TO rozdzielczosc
  'Zmiana rozdzielczości 
  SHELL "xrandr" TO stringa 
 
  righe = Split(stringa, "\n", "%%", TRUE)  
  
  FOR count = 2 TO righe.Max
     
     riga = Split(righe[count], " ", "%%", TRUE)
     
     risultato = Replace(riga[0], " ", "")
     lista.add(risultato)
  NEXT 
  
  ComboBox2.List = lista
  ComboBox2.Index = 0
  'Koniec zmiany rozdzielczości
  
  TextArea17.Text = gpu
  TextArea19.Text = opengl_vendor_string
  TextArea20.Text = opengl_renderer_string
  TextArea21.Text = opengl_version_string
  TextArea38.Text = rozdzielczosc
  Global.kartagraficzna()
END


PUBLIC SUB internet()
  DIM domyslnaprzegladarka, network_controller, ethernet_controller AS String
  SHELL "x-www-browser -version" WAIT TO domyslnaprzegladarka
  SHELL "lspci | grep 'Network' | cut -d ':' -f 3 | cut -d '(' -f 1" WAIT TO network_controller
  SHELL "lspci | grep 'Ethernet' | cut -d ':' -f 3 | cut -d '(' -f 1" WAIT TO ethernet_controller
  'SHELL "ss -a" WAIT TO ssa
  TextArea46.Text = domyslnaprzegladarka
  TextArea22.Text = network_controller
  TextArea23.Text = ethernet_controller
  'TextArea48.Text = ssa
END


PUBLIC SUB Wykrywanie_procesorow()
  DIM eloaders, eloaders2, eloaders3, obrazekcpu, cpu, vendor_id, flags, cpu_MHz, model, stepping, cpu_family, bogomips, address_sizes, cache_size, ldata, linstruction AS String
  
  IF ComboBox1.Text = "Procesor0" THEN 
     eloaders = "1p"
     eloaders2 = "cpu0"
     eloaders3 = "1p"
  ENDIF
  IF ComboBox1.Text = "Procesor1" THEN 
     eloaders = "2p"
     eloaders2 = "cpu1"
     eloaders3 = "3p"
  ENDIF
  IF ComboBox1.Text = "Procesor2" THEN 
     eloaders = "3p"
     eloaders2 = "cpu2"
     eloaders3 = "5p"
  ENDIF
  IF ComboBox1.Text = "Procesor3" THEN 
     eloaders = "4p"
     eloaders2 = "cpu3"
     eloaders3 = "7p"
  ENDIF
  IF ComboBox1.Text = "Procesor4" THEN 
     eloaders = "5p"
     eloaders2 = "cpu4"
     eloaders3 = "9p"
  ENDIF
  IF ComboBox1.Text = "Procesor5" THEN 
     eloaders = "6p"
     eloaders2 = "cpu5"
     eloaders3 = "11p"
  ENDIF
  
  SHELL "cat /proc/cpuinfo | grep 'vendor_id' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO obrazekcpu
  SHELL "cat /proc/cpuinfo | grep 'model name'| sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO cpu
  SHELL "cat /proc/cpuinfo | grep 'vendor_id' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO vendor_id
  SHELL "cat /proc/cpuinfo | grep 'flags' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO flags
  SHELL "cat /proc/cpuinfo | grep 'cpu MHz' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO cpu_MHz
  SHELL "cat /proc/cpuinfo | grep 'model' | sed -n '" & eloaders3 & "' | cut -d ':' -f 2" WAIT TO model
  SHELL "cat /proc/cpuinfo | grep 'stepping' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO stepping
  SHELL "cat /proc/cpuinfo | grep 'cpu family' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO cpu_family
  SHELL "cat /proc/cpuinfo | grep 'bogomips' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO bogomips
  SHELL "cat /proc/cpuinfo | grep 'address sizes' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO address_sizes
  SHELL "cat /proc/cpuinfo | grep 'cache size' | sed -n '" & eloaders & "' | cut -d ':' -f 2" WAIT TO cache_size
  SHELL "cat /sys/devices/system/cpu/" & eloaders2 & "/cache/index0/size" WAIT TO ldata
  SHELL "cat /sys/devices/system/cpu/" & eloaders2 & "/cache/index1/size" WAIT TO linstruction
  
  TextArea1.Text = cpu
  TextArea3.Text = flags
  TextArea4.Text = vendor_id
  TextArea5.Text = cpu_MHz
  TextArea7.Text = model
  TextArea8.Text = stepping
  TextArea6.Text = cpu_family
  TextArea9.Text = bogomips
  TextArea10.Text = address_sizes
  TextArea12.Text = cache_size
  TextArea13.Text = ldata
  TextArea11.Text = linstruction
  
  Global.ikonaprocka()

END 

PUBLIC SUB Button2_Click()

  SHELL "gnome-screenshot -w"

END

PUBLIC SUB Button1_Click()

  Finfosys.Close

END

PUBLIC SUB dospam_uptime()
  DIM uptime, total, used, freee, shared, buffers, cached, usedonthistime, swaptotal AS String
  DIM dospam, totpam, totalswap, usedswap AS Float
  SHELL "echo `free -m | grep 'Mem' | awk {'print $2'}` MB" WAIT TO total
  SHELL "echo `free -m | awk {'print $2'} | sed -n '2p'` MB" WAIT TO used
  SHELL "echo `free -m | awk {'print $3'} | sed -n '2p'` MB" WAIT TO freee
  SHELL "echo `free -m | awk {'print $4'} | sed -n '2p'` MB" WAIT TO shared
  SHELL "echo `free -m | awk {'print $5'} | sed -n '2p'` MB" WAIT TO buffers
  SHELL "echo `free -m | awk {'print $6'} | sed -n '2p'` MB" WAIT TO cached
  SHELL "free -m | grep - | awk {'print $3'}" TO dospam
  SHELL "echo `free -m | grep - | awk {'print $3'}` MB" TO usedonthistime
  SHELL "free -m | grep Mem | awk {'print $2'}" WAIT TO totpam
  SHELL "echo `free -m | grep 'Swap:' | awk {'print $2'}` MB" WAIT TO swaptotal
  'Obliczanie zajętości swap
  SHELL "swapon -s | awk {'print $3'} | sed -n '2p'" WAIT TO totalswap
  SHELL "swapon -s | awk {'print $4'} | sed -n '2p'" WAIT TO usedswap
  TextArea39.Text = total
  TextArea40.Text = used
  TextArea41.Text = freee
  TextArea42.Text = shared
  TextArea43.Text = buffers
  TextArea44.Text = cached
  TextLabel7.Text = usedonthistime
  TextArea45.Text = swaptotal
  TextLabel24.Text = usedswap / 1000
  SHELL "uptime" TO uptime
  TextArea37.Text = uptime
  
  ProgressBar1.Value = dospam / totpam
  ProgressBar4.Value = usedswap / totalswap 

END

PUBLIC SUB Button3_Click()

  About.Show

END

PUBLIC SUB Button5_Click()

  dospam_uptime()

END

PUBLIC SUB Button6_Click()

  dospam_uptime()

END

PUBLIC SUB Button4_Click()

  Desktop.Open("http://www.cpu-world.com/cgi-bin/SearchSite.pl?SEARCH=" & TextArea1.Text & "&PROCESS=Search")

END

PUBLIC SUB Button7_Click()
  DIM dpkg AS String
  SHELL "cat /var/lib/dpkg/status | grep '^Status: install ok installed' | wc -l" WAIT TO dpkg
  TextLabel10.Visible = TRUE
  TextArea28.Visible = TRUE
  TextLabel21.Visible = TRUE
  TextArea28.Text = dpkg

END

PUBLIC SUB Button9_Click()

  Last1.Show

END

PUBLIC SUB Button8_Click()

  SHELL "xrandr -s " & ComboBox2.Text & "" WAIT
  grafika()

END

PUBLIC SUB Button10_Click()
'sudo apt-get -y remove
  EXEC ["gksu", "sudo apt-get -y remove " & ComboBox3.Text & ""] WAIT
  kernel()
  Message.Warning("Dla poprawności tego działania proszę\nzaktualizuj gruba poleceniem = sudo update-grub")
END