Skip to content

Instantly share code, notes, and snippets.

View kathoef's full-sized avatar

Katharina Höflich kathoef

  • Christian-Albrechts-Universität zu Kiel
  • Schleswig-Holstein, Germany
View GitHub Profile
@kathoef
kathoef / Dockerfile
Last active November 25, 2022 15:09
liascript-preview-web extension in code-server does not work?
FROM node:19-bullseye as vscodebundler
RUN npm install -g typescript esbuild vsce
RUN git clone https://github.com/andre-dietrich/liascript-preview-vscode-web
RUN cd liascript-preview-vscode-web && npm install && vsce package && ls
FROM codercom/code-server:4.8.3-bullseye
COPY --from=vscodebundler /liascript-preview-vscode-web/liascript-preview-web-0.2.1.vsix /
RUN code-server --install-extension /liascript-preview-web-0.2.1.vsix
@kathoef
kathoef / README.md
Created October 21, 2022 13:50
LiaScript exporter empty PDF problem

Using liascript PDF exporter,

$ docker run -it -v $PWD:/things ubuntu:22.04 bash
$ apt update
$ apt install wget xz-utils python3
$ wget --quiet https://nodejs.org/download/release/v14.20.1/node-v14.20.1-linux-x64.tar.xz
$ mkdir -p /usr/local/lib/
$ tar xf node-v14.20.1-linux-x64.tar.xz -C /usr/local/lib/
$ export PATH=/usr/local/lib/node-v14.20.1-linux-x64/bin:$PATH
@kathoef
kathoef / installation.md
Last active July 3, 2024 12:54
Gitlab runner: Rootless Docker Executor on Ubuntu 22.04

Setup a rootless Docker build compatible Gitlab runner

Install Docker engine (tested with v20.10.17) and Gitlab runner (tested with v15.2.1) as described here and here.

Identify the UID of the gitlab-runner user.

$ id gitlab-runner
uid=999(gitlab-runner) gid=998(gitlab-runner) groups=998(gitlab-runner)
@kathoef
kathoef / README.md
Last active July 7, 2022 10:09
VS Code server with token password and HTTPS

Remote machine,

$ ssh user@host
$ mkdir -p $HOME/vscodeserver
$ cd $HOME/vscodeserver
$ bash install.sh
$ bash start.sh
c773621a-f86f-4f44-99a8-ef149521765a
[2022-04-14T10:41:07.120Z] info code-server 4.2.0 693b1fac04524bb0e0cfbb93afc85702263329bb
@kathoef
kathoef / outputs.md
Created March 16, 2022 09:36
404 error for JupyterLab started by TLJH
$ jupyterhub-singleuser --debug
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:174] Searching ['/home/jupyter-khoeflich', '/home/jupyter-khoeflich/.jupyter', '/home/jupyter-khoeflich/.local/etc/jupyter', '/opt/tljh/user/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config in /etc/jupyter
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config in /usr/local/etc/jupyter
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config in /opt/tljh/user/etc/jupyter
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config in /home/jupyter-khoeflich/.local/etc/jupyter
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config in /home/jupyter-khoeflich/.jupyter
[D 2022-03-16 10:13:11.371 SingleUserNotebookApp application:731] Looking for jupyter_config i
@kathoef
kathoef / conda-jupyter-kernel-installer.sh
Last active July 31, 2021 17:23
Jupyter conda kernel installer
#!/bin/bash
# Uninstall kernel.
# rm -rf ${HOME}/.local/share/jupyter/kernels/my-pykernel/
# rm -rf ${HOME}/my-pykernel/
# Specify a few targets.
if [[ -f environment.yaml ]]; then
@kathoef
kathoef / xarray-v0.16.2-correlation.ipynb
Created January 13, 2021 17:58
low xarray.corr() performance on big datasets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kathoef
kathoef / era5-parallel-requests.py
Last active May 18, 2021 07:58
parallel download of ERA5 reanalysis data
import cdsapi
import multiprocessing
client = cdsapi.Client(url='xxx',key='xxx:xxx')
def cdsapi_worker(dataset):
result = client.retrieve('reanalysis-era5-single-levels', dataset)
result.download(dataset['file_name'])
def single_dataset(calendar_year, file_prefix):