====== Admin info ======

===== Wiki =====

  * NREC (cloud service by UiO)
    * Instance name: ''norment_dokuwiki''
    * Project: ''uio-med-norment'' (Florian, Alex)
    * Region: ''osl''
  * Server: 
    * login ''ssh debian@wiki.norment.uiocloud.no''
    * need to upload shared SSH key-pair (currently installed SSH keys: ''fkrull@mascarpone, oleksanf@mach, sandeep@putty, sandeek@login-1.saga.sigma2.no, oleksandr@mmilcluster4.ucsd.edu''
    * Dokuwiki files are in ''/var/lib/dokuwiki/''
    * renew letsencrypt: login to the server and run "certbot-auto renew"; check result with "certbot-auto certificates" - it should say "VALID: 89 days" . \\ To change the domain run <code>sudo /usr/local/bin/certbot-auto --apache -m norment.wiki@gmail.com -d wiki.norment.uiocloud.no</code>
  * FreeDNS (https://freedns.afraid.org/)
    * account: ''norment.wiki@gmail.com''
    * password: (Florian, Alex)
  * Gmail (used to handle registration emails, FreeDNS account, Certbot) 
    * account: ''norment.wiki@gmail.com''
    * password: (Florian, Alex)
  * Daily backups of the wiki:
<code>
# sudo crontab -l
5 4 * * * /home/debian/wiki_backup.sh

# crontab -l
5 5 * * * /home/debian/wiki_backup_sync.sh

# /home/debian/wiki_backup.sh
tar -czvf  /home/debian/wiki_backup/wiki_norment.$(date +"%Y-%m-%d_%H-%M").tar.gz /var/lib/dokuwiki && chown debian:debian /home/debian/wiki_backup/*.tar.gz

# /home/debian/wiki_backup_sync.sh
rsync --remove-source-files -avzP -e "ssh -i $HOME/.ssh/oleksanf_id_rsa" /home/debian/wiki_backup oleksanf@login.nird.sigma2.no:/projects/NS9114K/biostats
</code>



===== TSD services =====

==== Become service user ====

''p33-serviceuser'' is used as a shared user account to manage services. 
To switch to the service users account, use:

  sudo -u p33-serviceuser bash -i

==== Managing services ====

Services are running on host ''p33-webserver'' and are started by cron. To get an overview of services, switch to the serviceuser account and type

  crontab -l

Files of services are located in

  /tsd/p33/data/durable/shared/
  
Most services are managed by [[https://github.com/LCBC-UiO/tuls|TULS]]. 
  - To add a new service / change the configuration, use the ''p33-webserver'' account, make edits to ''/tsd/p33/data/durable/shared/tuls_cfg_p33/services/''. 
  - To apply the changes, run ''/tsd/p33/data/durable/shared/tuls/bin/update''. This will write an updated crontab. 
  - ''tuls_cfg_p33'' is a git repository . Once everything looks good, git-commit your ''*.service'' file. When committing, use <code>git commit --author="Your Name <bar@foo.com>" ...</code>  


======= TSD access for external users ========

https://www.uio.no/english/services/it/research/sensitive-data/use-tsd/administrative-tasks/administer-users/index.html

<code>
1. Name of the project member (as "Firstname Middle Name(s) Lastname"; Example : "James Wave"):
2. Date of Birth of the project member (DD.MM.YYYY):
3. Passport Number or National ID Number of the project member:
4. Country of Citizenship of the project member:
5. Email Address of the project member (Preferrably institutional address):
6. Phone Number of the project member (Preferrably cell phone):
7. Address Line 1:
8. Address Line 2:
9. Postal Code:
10. City:
11. Country:
</code>
