Skip to content

Instantly share code, notes, and snippets.

View hadim's full-sized avatar

Hadrien Mary hadim

View GitHub Profile
@hadim
hadim / docker-compose.yml
Created February 4, 2024 15:21
RustDesk and Traefik Docker Compose Configuration
# A minimal configuration to host a RustDesk server with Traefik v3 (also works with Traefik v2).
#
# This configuration is based on a single Rustdesk container hosting the two hbbr and hbbs services
# instead of running two separate containers as in the official documentation.
# See https://rustdesk.com/docs/en/self-host/rustdesk-server-oss/docker/ for more information.
#
# This configuration is adapted from https://gist.github.com/FracKenA/5015150a6057afe9a22bf2e4b9d5f2b6.
#
# Pay attention to the comments in the file and adapt the configuration to your needs.
# Once deployed you must configure the Rustdesk client in the Network tab to use the domain
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Compile ctffind4 on CentOS 8

Instructions to compile ctffind4 on CentOS 8.

Install dependencies

# Enable PowerTools
sudo dnf config-manager --set-enabled PowerTools
# Install the joblib library if needed.
# conda install joblib
import joblib as jb
import numpy as np
def my_function_that_take_time(arg1, arg2):
# Simulate a long computation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Python Conda Setup

The goal is to install a Python friendly environment on your computer. It works on Linux, Windows and OSX. The base environment will provide you the minimum to be able to start Jupyter and then we will use different Conda environments with all the necessary packages to do analysis. Those environments will then be available as kernels in Jupyter.

  • Install Anaconda or Miniconda.

    • Miniconda is a light version of Anaconda that provide less packages. If you pan to use Conda environments, I would recommend using it.
  • Open a terminal.

  • Activate the base Conda environment (also called root):

#!/usr/bin/env bash
# Modified from https://gist.github.com/Stono/7e6fed13cfd79598eb15
#
# MIT License applies to this script. I don't accept any responsibility for
# damage you may cause using it.
set -ex
if [[ $EUID -ne 0 ]]; then
echo "* This script needs to be run as root"
@hadim
hadim / cuda.sh
Last active December 24, 2020 21:37
Bash functions to manage your Cuda/cuDNN installations on Linux (tested only on Ubuntu).
#!/usr/bin/env bash
# Cuda and friends installation done right.
# Switch default Cuda version using symbolic link: cuda.switch 9.2
# Install Cuda: cuda.install.cuda 10.0
# Install cuDNN to CUDA_HOME: cuda.install.cudnn 7.5
# Install NCCL to CUDA_HOME: cuda.install.nccl 2.4
# Install Cuda, cuDNN and NCCL: cuda.install 10.0 7.5 2.4
# Author: Hadrien Mary <[email protected]>