~azzar1/unity/add-show-desktop-key

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
.. IVLE - Informatics Virtual Learning Environment
   Copyright (C) 2007-2009 The University of Melbourne

.. This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

.. This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

.. You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

.. _ref-admin-scripts:

*************
Admin scripts
*************

IVLE has a number of admin scripts for uncommon configuration or other
functionality not available in the web application.

Most of these scripts must be run as root.

ivle-addexercise
----------------

.. program:: ivle-addexercise

:program:`ivle-addexercise <EXERCISE>`

Adds an XML encoded exercise to the IVLE database. This is primarily
for importing exercises that pre-date the database storage system.

The exercise's name will be set to the complete path specified on the
command line -- keep this in mind when choosing a working directory.

.. cmdoption:: <EXERCISE>

    The XML file containing the exercise to be uploaded.

ivle-adduser
------------

.. program:: ivle-adduser

:program:`ivle-adduser [OPTIONS] <LOGIN> <FULLNAME>`

Creates a new user in the database. On-disk structures (jails and
Subversion repositories) will be created upon first login.

.. FIXME: "This can also be done through the administration interface."
    (Not yet!)


.. cmdoption:: <LOGIN>

    Login name of the new user

.. cmdoption:: <FULLNAME>

    Full name of the user

.. cmdoption:: -p <PASSWORD>, --password <PASSWORD>

    Cleartext password. If omitted, external authentication mechanisms
    will be tried.

.. cmdoption:: -n <NICK>, --nick <NICK>

    Display name (defaults to <FULLNAME>)

.. cmdoption:: -e <EMAIL>, --email <EMAIL>

    Email address

.. cmdoption:: -s <SID>, --studentid <SID>

    Student ID

.. cmdoption:: --admin

    Give the user global IVLE administrative privileges


ivle-buildjail
--------------

.. program:: ivle-buildjail

:program:`ivle-buildjail [OPTIONS]`

Creates or updates the IVLE jail template. 

.. cmdoption:: -r, --recreate

    Completely recreate the jail - don't just update its IVLE code.

    .. warning::

        This may download hundreds of megabytes from the location specified by 
        ``<MIRROR>``.

.. cmdoption:: -u, --upgrade

    Apply any package updates in the jail.

.. cmdoption:: -m <MIRROR>, --mirror <MIRROR>

    Sets the APT mirror. May also be specified in the ``jail/mirror``
    config key.


ivle-cloneworksheets
--------------------

.. program:: ivle-cloneworksheets

:program:`ivle-cloneworksheets <OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER> 
<NEWSUBJECTCODE> <NEWYEAR> <NEWSEMESTER>`

Populates the offering specified by ``<NEWSUBJECTCODE> <NEWYEAR> 
<NEWSEMESTER>`` with a copy of the worksheets from the offering specified by 
``<OLDSUBJECTCODE> <OLDYEAR> <OLDSEMESTER>``.


ivle-config
-----------

.. program:: ivle-config

:program:`ivle-config [ARG1] [ARG2] ...`

Configures IVLE with machine-specific details, most notably various paths.
Either prompts the administrator for these details or accepts them as
command line arguments.

Command line arguments may be any of the :ref:`configuration option 
<ref-configuration-options>` used in :file:`ivle.conf`. They are provided in 
the form of :samp:`--{section}/{subsection}/{property} {VALUE}` such as 
``--urls/root ivle.org`` or ``--media/externals/jquery 
/usr/share/javascript/jquery``.

Creates or updates :file:`/etc/ivle/ivle.conf` with the selected values,
and overwrites :file:`/etc/ivle/plugins.d/000default` with the latest
default plugin list.


ivle-createdatadirs
-------------------

.. program:: ivle-createdatadirs

:program:`ivle-createdatadirs`

Creates the IVLE data hierarchy (by default under :file:`/var/lib/ivle`) if
it does not already exist.


ivle-enrol
----------

.. program:: ivle-enrol

:program:`ivle-enrol <LOGIN> <SUBJECTCODE> <YEAR> <SEMESTER> [ROLE]`

Enrols a user in an offering.

.. note::
    Users may also be enrolled from the offering administration panel
    in the web interface.

.. cmdoption:: <LOGIN>

    Login of the user to enrol

.. cmdoption:: <SUBJECTCODE>

    Subject code

.. cmdoption:: <YEAR>

    Offering year

.. cmdoption:: <SEMESTER>

    Offering semester

.. cmdoption:: [ROLE]

    Role of the user. Should be one of 'student' (default), 'tutor' or
    'lecturer'.


ivle-enrolallusers
------------------

.. program:: ivle-enrolallusers

:program:`ivle-enrolallusers`

Adds enrolments for all users on the system.
Pulls from the configured :ref:`subject pulldown module 
<ref-subject-pulldown-modules>` the subjects each student
is enrolled in, and adds enrolments to the database.
Does not remove any enrolments.

.. note::
    Pulldown modules are consulted for each user each time they log in,
    so use of this script may not be required.

.. cmdoption:: -u <LOGIN>, --user <LOGIN>

    Just perform enrolment for user ``<LOGIN>``

.. cmdoption:: -v, --verbose

    Print out the details of each enrolment.


ivle-fetchsubmissions
---------------------

.. program:: ivle-fetchsubmissions

:program:`ivle-fetchsubmissions [OPTIONS] <SUBJECT> <PROJECT>`

Retrieves all submissions for a given project. Places each submission in its 
own subdirectory of the current directory. Any errors are reported to stderr
(otherwise is silent).

.. note::
    Since this script accesses Subversion repositories through the
    filesystem, it must be run on the master server.

.. cmdoption:: <SUBJECT>

    Subject short (URL) name

.. cmdoption:: <PROJECTNAME>

    Project short (URL) name

.. cmdoption:: -s <SEMESTER>, --semester <SEMESTER>

    Semester of the offering (eg. 2009/1). Defaults to the currently
    active semester.

.. cmdoption:: -d <PATH>, --dest <PATH>

    Destination directory (defaults to the current directory) in
    which to place submissions. Will create subdirectories in this
    directory of the form ``subject/year/semester/project``.

.. cmdoption:: -z, --zip

    Store each submission in a Zip file.

.. cmdoption:: -v, --verbose

    Print the name of each submission as it is extracted.

.. cmdoption:: --no-txt

    Disable writing a text file with metadata about each submission.


ivle-listusers
--------------

.. program:: ivle-listusers

:program:`ivle-listusers [OPTIONS]`

Lists all users in the IVLE database.

.. cmdoption:: -n, --names

    Print only each user's login name


ivle-marks
----------

.. program:: ivle-marks

:program:`ivle-marks [OPTIONS] <SUBJECT>`

Reports each student's marks for a given subject offering.

.. cmdoption:: <SUBJECT>

    Subject short (URL) name

.. cmdoption:: -s <SEMESTER>, --semester <SEMESTER>

    Semester of the offering (eg. 2009/1). Defaults to the currently
    active semester.

.. cmdoption:: -c <CUTOFF>, --cutoff <CUTOFF>

    Cutoff date (calculate the marks as of this date). Should be provided in 
    the form of ``YYYY-MM-DD H:M:S``.


ivle-mountallusers
------------------

.. program:: ivle-mountallusers

:program:`ivle-mountallusers`

Attempts to mount the jails of all users.

.. note::

    Administrators should not need to manually run this script for regular
    operation.  IVLE will automatically mount users' jails on demand.

.. cmdoption:: -v, --verbose

    Print a message for each mount or unmount.

.. cmdoption:: -u, --unmount

    Unmount jails instead of mounting them.


ivle-refreshfilesystem
----------------------

.. program:: ivle-refreshfilesystem

:program:`ivle-refreshfilesystem`

Refresh parts of the filesystem to match the database.

In particular:
 - all jails are rebuilt
 - missing user jails are created
 - missing user and group Subversion repositories are created
 - jails for missing users are removed
 - Subversion repositories for missing users or groups are removed
 - the Subversion password file is updated
 - the Subversion authorisation files are rewritten

.. warning::
    Due to the full jail rebuilds, existing jail mounts may be broken
    after this script has run. To recover from this situation, use
    ``ivle-mountallusers`` to unmount all of the jails.

.. note::
    Jails and Subversion repositories are not entirely removed. They
    can be found in a timestamped directory alongside their parent.


ivle-remakeuser
---------------

.. program:: ivle-remakeuser

:program:`ivle-remakeuser [OPTIONS] <USER>`

:program:`ivle-remakeuser [OPTIONS] -a`

Rebuilds the jail of a single user or of all users in IVLE. This will
retain all user data, but recreate the rest of the hierarchy and
internal configuration files.

.. cmdoption:: <USER>

    Login of the user whose jail should be rebuilt

.. cmdoption:: -a, --all

    Rebuild the jail of every user

.. cmdoption:: -v, --verbose

    Print a message as each user's jail is remade


ivle-showenrolment
------------------

.. program:: ivle-showenrolment

:program:`ivle-showenrolment <USER>`

Shows the enrolments of a user. Prints subject code, subject name, year, 
semester and the held role for each subject in which they are enrolled.

.. cmdoption:: <USER>

    Login of the user