-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathscripts.json
More file actions
455 lines (455 loc) · 19.1 KB
/
scripts.json
File metadata and controls
455 lines (455 loc) · 19.1 KB
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
[
{
"children": [
{
"description": "Prints out current CPU utilization",
"name": "Show CPU",
"script": "top -b -n2 | grep \"Cpu(s)\" | awk '{print $8 \",\"}';",
"showResult": true,
"timeout": 0,
"uid": "1CE0BC40-C03F-40FF-8EF5-F067B78695D1"
},
{
"description": "Prints out current free Memory",
"name": "Show free Memory",
"script": "free;",
"showResult": true,
"timeout": 0,
"uid": "F5C16B0B-B176-4F59-A83E-03287549FE66"
},
{
"description": "Prints out running processes of the current user",
"name": "Show this user's running Processes",
"script": "ps;",
"showResult": true,
"timeout": 0,
"uid": "1B13F2E9-727B-4865-ADD9-7240E3C730E0"
},
{
"description": "Prints out running processes of all users",
"name": "Show all user's running Processes",
"script": "ps -e;",
"showResult": true,
"timeout": 0,
"uid": "551EDCD5-7624-45D8-9F60-80737362FCC0"
},
{
"description": "Prints out all running processes in a tree",
"name": "Show running Processes Tree",
"script": "pstree;",
"showResult": true,
"timeout": 0,
"uid": "BBFC858C-70C3-41CA-ABB3-1F4F66ED458C"
},
{
"description": "Prints out system uptime",
"name": "Show System Uptime",
"script": "uptime;",
"showResult": true,
"timeout": 0,
"uid": "DDA382D2-A4B3-46B7-8A0D-2A4C680F62A4"
}
],
"description": "Scripts for monitoring CPU, Memory, etc",
"name": "System Monitoring",
"uid": "BEBBA2D6-FB52-400E-BB5F-4B8FD2C051F0"
},
{
"children": [
{
"description": "Prints out CPU information",
"name": "Show CPU Info",
"script": "cat /proc/cpuinfo",
"showResult": true,
"timeout": 0,
"uid": "06EF6D64-4BB3-4AF7-A52B-4981DE613B8E"
},
{
"description": "Prints out Memory information",
"name": "Show Memory Info",
"script": "cat /proc/meminfo;",
"showResult": true,
"timeout": 0,
"uid": "E499D11C-1CD5-4B94-B1A9-7C6FA10DBE6E"
},
{
"description": "Prints disk usage of all mounted drives",
"name": "Show Disk Status",
"script": "df -h;",
"showResult": true,
"timeout": 0,
"uid": "4C71C399-05C0-4014-B586-BD956E9540AF"
},
{
"description": "Prints current version of the device",
"name": "Show Current Version",
"script": "cat /proc/version",
"showResult": true,
"timeout": 0,
"uid": "0A46EB7F-CCA6-4F0D-8672-D0E52A506EB0"
},
{
"description": "List attached USB devices",
"name": "Show USB Devices",
"script": "lsusb;",
"showResult": true,
"timout": 0,
"uid": "5DAEBE69-B83B-4DDE-82D3-77E95E5E1455"
},
{
"description": "Prints the system's external IP address",
"name": "Show External IP Address",
"script": "curl ifconfig.me;",
"showResult": true,
"timout": 60,
"uid": "5DACBF45-36EC-4133-B81E-833A817FD15E"
}
],
"description": "Display General System Information",
"name": "Hardware Information",
"uid": "B257AB73-8985-42D2-A056-983FA4ECE8A9"
},
{
"children": [
{
"description": "Displays last 5 logged in users",
"name": "Shows last Users",
"script": " last -n 5",
"showResult": true,
"timeout": 0,
"uid": "FB4D4E8C-3DF8-41A1-A11E-6EB2704E726C"
},
{
"description": "Prints last 30 Auth Log Lines",
"name": "Show Last Authorizations",
"script": "tail -30 /var/log/auth.log;",
"showResult": true,
"timeout": 0,
"uid": "D9061271-B237-42DF-BB74-ABB3F4C4EF00"
},
{
"description": "Show who is logged on and what they're doing",
"name": "Show Logged on Users",
"script": "w;",
"showResult": true,
"timeout": 0,
"uid": "60989A97-56B7-4E1C-A291-CDAAA8AD0C0E"
}
],
"description": "Display Information about last logins, current user, etc.",
"name": "Login Information",
"uid": "0FE5D0F9-DF48-4854-9F9A-8FE998AF367A"
},
{
"children": [
{
"description": "Safely shutdown",
"name": "Shutdown",
"script": " shutdown now;",
"showResult": false,
"timeout": 10,
"uid": "C99921C9-4F18-45EC-A042-F59E0009EC8A"
},
{
"description": "Reboots the system",
"name": "Reboot",
"script": "shutdown -r now;",
"showResult": false,
"timeout": 10,
"uid": "2E41199D-91A8-4779-B73D-FFC74A54D6B4"
}
],
"description": "Shutting down and restarting the system",
"name": "System Restart/Shutdown",
"uid": "557C127C-7C66-49C7-809A-B4631CF1C94F"
},
{
"children": [
{
"description": "Automatically update and upgrade all software packages",
"name": "Update and Upgrade - apt",
"script": "apt-get update; apt-get -y upgrade;",
"showResult": false,
"timeout": 10,
"uid": "9704FA23-33E4-46D2-B67E-439415AB615B"
}
],
"description": "Updating, Upgrading Software Packages and other tasks",
"name": "System Maintenance",
"uid": "AF150AC8-D745-4E8E-905A-D6E84DDB9312"
},
{
"children": [
{
"description": "Mounts a remote drive via NFS",
"name": "Mount NFS",
"script": "#To enable NFS share mounting on raspbian, please see: http://www.raspbian.org/RaspbianFAQ#How_do_I_mount_directories_from_other_Linux.2FUnix.2FBSD_servers.3F__How_do_I_mount_an_NFS_share.3F\n#\nip_address=<#ip_to_nfs_drive#>;\nnfs_path=<#my_local_path_on_nfs_drive#>;\nlocal_mount_path=<#my_local_mount_path#>;\n\nmkdir -p $local_mount_path; sudo mount $ip_address:$nfs_path $local_mount_path;",
"showResult": false,
"timeout": 0,
"uid": "325C7C3D-4E87-44EB-8956-B3EF733BD95B"
},
{
"description": "Unmounts a remove drive connected via NFS",
"name": "Unmount NFS",
"script": "local_mount_path=<#my_local_mount_path#>;\nsudo umount -l -f $local_mount_path;",
"showResult": false,
"timeout": 0,
"uid": "484F315D-D0CF-4416-9F0E-3C67C649755B"
},
{
"description": "Mounts a remote CIFS/SMB file system",
"name": "Mount CIFS/SMB",
"script": "ip_address=<#ip_to_server#>;\nshare_name=<#share_name#>;\nlocal_mount_path=<#my_local_mount_path#>;\nusername=<#myusername#>;\npassword=<#mypassword#>;\n\nsudo mkdir -p $local_mount_path;\nsudo mount -t cifs //$ip_address/$share_name $local_mount_path -o username=$username,password=$password;",
"showResult": false,
"timeout": 0,
"uid": "E2670E41-F80D-4707-8982-A3A312BA5B40"
},
{
"description": "Unmounts a remote CIFS/SMB file system",
"name": "Unmount CIFS/SMB",
"script": "local_mount_path=<#my_local_mount_path#>;\nsudo umount -l -f $local_mount_path;",
"showResult": false,
"timeout": 0,
"uid": "1551F355-D3A8-4CB1-A519-44743E49A470"
},
{
"description": "Prints all network interfaces currently in operation.",
"name": "Current Network Interfaces",
"script": "ifconfig;",
"showResult": true,
"timout": 60,
"uid": "1bf5c8cf-6844-4c73-b933-c3177f4e33f7"
},
{
"description": "Restart Network Services",
"name": "Reset Network Services",
"script": "sudo /etc/init.d/networking restart",
"showResult": true,
"timout": 60,
"uid": "e2d5cfda-3573-4e2e-9523-39a3bac0b121"
}
],
"description": "All Commands about Networking",
"name": "Networking",
"uid": "D0C2C70B-E2B3-4888-8C41-67068BA30BC8"
},
{
"children": [
{
"description": "Searches for a given string",
"name": "Text search",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep \"$searchText\" $filename",
"showResult": true,
"timeout": 0,
"uid": "D910451D-9D1E-4915-96F4-D52822BD8C4F"
},
{
"description": "Searches for a given string case insensitive",
"name": "Text search (Case insensitive)",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep -i \"$searchText\" $filename",
"showResult": true,
"timeout": 0,
"uid": "1F6A6A06-78C6-45A6-8829-51A46613B28F"
},
{
"description": "Searches for a given word case insensitive",
"name": "Word search",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep -iw \"$searchText\" $filename",
"showResult": true,
"timeout": 0,
"uid": "FC452339-F82E-4E5A-8BA4-08B86B97102D"
},
{
"description": "Searches for a given string at the beginning of a line",
"name": "Lines starting with text",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep \"^$searchText.*\" $filename",
"showResult": true,
"timeout": 0,
"uid": "9B7D603E-F016-46BB-AFCC-738D88633401"
},
{
"description": "Searches for a given string at the end of a line",
"name": "Lines ending with text",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep \".*$searchText$\" $filename",
"showResult": true,
"timeout": 0,
"uid": "16DA7332-2457-4C5C-918E-1FDD09B22A4F"
},
{
"description": "Displays all file names that match a given pattern",
"name": "Show files matching string",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\ngrep -l \"$searchText\" $filename",
"showResult": true,
"timeout": 0,
"uid": "BB3A55F9-1DEB-4B0D-BD60-9DAB97AC9001"
},
{
"description": "Displays the number of occurrences of a pattern in a given file",
"name": "Occurrences of text in file",
"script": "searchText=<#mySearchText#>;\nfilename=<#myfile#>;\nsort $filename | uniq -c | sort -nr | grep \"$searchText\"",
"showResult": true,
"timeout": 0,
"uid": "9ED687D6-CB3C-42AC-A406-A122234F0DFA"
}
],
"description": "Searching in Files and Folders",
"name": "Search",
"uid": "0BFA9C70-2A63-42A6-820C-476E508ABBC6"
},
{
"children": [
{
"description": "Synchronizes two folders and preserves metadata",
"name": "Synchronize two folders",
"script": "source=<#source#>;\ndestination=<#destination#>;\nrsync -azv $source $destination;",
"showResult": true,
"timeout": 0,
"uid": "52676F06-E1BF-4F17-ACB2-A6F066A0D050"
},
{
"description": "Synchronize two folders and delete orphaned files at target",
"name": "Backup Folder",
"script": "source=<#source#>;\ndestination=<#destination#>;\nrsync -azv --delete $source $destination;",
"showResult": true,
"timeout": 0,
"uid": "DC8E0E7D-2C05-4CA2-AB83-1F5905D48FD3"
}
],
"description": "Synchronize and Backup Files and Folders",
"name": "Synchronize & Backup",
"uid": "787FE92D-8BFF-40AC-84D7-6985E94FA64A"
},
{
"children": [
{
"description": "List files with no options",
"name": "List files (no option)",
"script": "folder=<#folder#>;\nls $folder",
"showResult": true,
"timeout": 0,
"uid": "D3DF3E5C-F9F3-4AE4-A2C4-3EFAD594BC89"
},
{
"description": "List one file per line",
"name": "List files single line",
"script": "folder=<#folder#>;\nls -1 $folder",
"showResult": true,
"timeout": 0,
"uid": "2C6CCA74-75D1-49B7-8BDD-9C1B5F677228"
},
{
"description": "List files with permissions & size",
"name": "List files detailed",
"script": "folder=<#folder#>;\nls -lh $folder",
"showResult": true,
"timeout": 0,
"uid": "9DC08D6D-9515-4F66-9AE6-6E2720A713D6"
},
{
"description": "List files including hidden ones",
"name": "List hidden files",
"script": "folder=<#folder#>;\nls -a $folder",
"showResult": true,
"timeout": 0,
"uid": "53FE148A-CD4D-4AA0-8B63-68D08B73F56D"
},
{
"description": "List all sub directories and their contents",
"name": "List directory tree recursively",
"script": "folder=<#folder#>;\nls -R $folder",
"showResult": true,
"timeout": 0,
"uid": "28B75316-641F-40E3-BF5B-47B59198B3D9"
},
{
"description": "List all files sorted by file size",
"name": "List files by size",
"script": "folder=<#folder#>;\nls -lSh $folder",
"showResult": true,
"timeout": 0,
"uid": "93C64D03-2672-4250-9683-4EAA71B024FE"
},
{
"description": "Shows the size of the contents of the directory",
"name": "Show size of directory",
"script": "folder=<#folder#>;\ndu -sh $folder",
"showResult": true,
"timeout": 0,
"uid": "0EDD0312-7476-4CD8-A0B6-03F829B89E25"
}
],
"description": "List Files and contents of Folders",
"name": "List Files and Folders",
"uid": "38F06000-679F-441A-B58C-A1BD56EBA902"
},
{
"children": [
{
"description": "Grant ownership of file/folder",
"name": "Grant ownership to user",
"script": "user=<#user#>;\nfile=<#file_path#>;\necho \"before:\" && ls -l $file;\nsudo chown $user $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "3854CF8E-429C-489B-B01A-45591E743A58"
},
{
"description": "Assign a file/folder to a group",
"name": "Assign to group",
"script": "user=<#user#>;\nfile=<#file_path#>;\necho \"before:\" && ls -l $file;\nsudo chgrp $group $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "8F647A96-B381-4185-BE5A-7E8088B99574"
},
{
"description": "Change permissions to User rwx, Group r-x, World r-x",
"name": "Read/Execute World (755)",
"script": "file=<#file_path#>;\necho \"before:\" && ls -l $file;\nchmod 755 $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "B0A8A212-844F-4D1F-9B0C-092326ED710F"
},
{
"description": "Change permissions to User rwx, Group r-x, World ---",
"name": "Read/Execute Group (750)",
"script": "file=<#file_path#>;\necho \"before:\" && ls -l $file;\nchmod 750 $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "C578D566-C754-4C9C-9EED-BC2E0E50829C"
},
{
"description": "Change permissions to User r--, Group r--, World r--",
"name": "Read Only (444)",
"script": "file=<#file_path#>;\necho \"before:\" && ls -l $file;\nchmod 444 $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "12449B62-A0D1-4437-ADBB-6FCBA7A16256"
},
{
"description": "Change permissions to User rw-, Group r--, World r--",
"name": "Owner Read & Write (644)",
"script": "file=<#file_path#>;\necho \"before:\" && ls -l $file;\nchmod 644 $file;echo \"after:\" && ls -l $file;\n",
"showResult": true,
"timeout": 0,
"uid": "500B38BE-E707-49A5-B221-43DFD6D3EB44"
}
],
"description": "Basic File Permission Commands",
"name": "File Permissions",
"uid": "31F7F568-8CCA-4F2B-8F8E-BCF4FFE233A3"
},
{
"children": [
{
"decription": "Restart NZBGet",
"name": "Restart NZBGet",
"script": "sudo service nzbget restart;",
"showResult": true,
"timeout": 0,
"uid": "598e7a85-84ff-455f-b8e6-75af94139150"
}
],
"description": "Start/Stop/Restart Media Services",
"name": "Media Center Control",
"uid": "bb8fd250-6151-42f7-a575-9a94ebb9c8e7"
}
]