Skip to content

Instantly share code, notes, and snippets.

@scandav
scandav / ssh-key-setup-mac.md
Created September 21, 2022 14:09
SSH Key for MAC M1
  1. ssh-keygen -t rsa -b 4096 -C "ubelix" and decide path and passphrase.
  2. Add to ~/.ssh/config:
    Host ubelix
     UseKeychain yes
     AddKeysToAgent yes
     IdentityFile ~/.ssh/id_rsa_ubelix
     Hostname submit03.unibe.ch
     User <YOUR_USER_HERE>
    

ServerAliveInterval 60

@scandav
scandav / export-web-annotator.md
Created September 21, 2022 18:10
Export from Web Annotator container
  1. Establish ssh connection to otpc99.unibe.ch.
  2. run docker command: sudo docker exec -it webannotator_celery_1 celery call web_annotator.tasks.create_export_partial --kwargs='{"project_id":6, "recipient":"davide.scandella@unibe.ch", "host":"http://dome.artorg.unibe.ch:8080/annotator"}' changing project id to desired value. To check project ids: http://dome.artorg.unibe.ch:8080/annotator/admin/web_annotator/project/.
  3. You should receive an email to the link for export.
  4. If you don't receive it:
    1. Navigate to http://otpc99.unibe.ch:5555/ in your browser and check export status (it should be failed).
    2. The exported archive is in /home/otlartorg/web_annotator/data-storage/tmp, just pick and scp the one with the latest creation date.
  5. Example scp command to copy to local computer: scp otpc99:/home/otlartorg/web_annotator/data-storage/tmp/ae2d168aa557414fb1f9c5db901e25ac.zip Documents/development/amd-annotation/data_analysis/

Use Tauri with Full JS/TS

  • Tauri has a frontend and a backend service. It does not ship with a nodejs backend option according to this and this. The tool to do everything with JS is Electron.
  • If you really want to use Tauri with full JS/TS stack, you can load the backend as a binary sidecar, the same way you would compile flask to embed it in Electron.

Use Tauri with Rust backend

This is the designated use case for Tauri:

  • Backend: Rust
@scandav
scandav / hpc-remote-debugging.md
Created November 29, 2022 09:34
HPC Remote Debugging Guide

How To

Connect to HPC and run the following commands.

module load Workspace
salloc --time=02:00:00 --mem-per-cpu=4G --partition=gpu-invest  --gres=gpu:rtx3090:1
srun --pty bash
squeue --me