Skip to content

Instantly share code, notes, and snippets.

View kuanghan's full-sized avatar

Kuang-Han Huang kuanghan

  • DispatchHealth
  • Mountain View, CA
View GitHub Profile
@kuanghan
kuanghan / lxc_priv_to_unpriv.md
Created January 3, 2019 19:26
Shifting an unprivileged LXC container to privileged

Shifting an unprivileged LXC container to privileged

Still experimental...

Assume that the unprivileged container test already exists. We want a privileged container called test2 to have the same rootfs as test.

Create test2

Create a privileged container first. Probably need to be the exact same OS as test1!

@kuanghan
kuanghan / docker_lxc.md
Created January 3, 2019 18:41
Setting up docker to run in a PRIVILEGED LXC container

Setting up docker to run in a PRIVILEGED LXC container

Set up a privileged container

Create container

Let's call the container docker_test1.

$ sudo lxc-create -t download -n docker_test1
...
Follow the prompts on the screen to set up the new container.

Notes on installing TORTOISE v3.1.1 on a Mac (OSX 10.12.6)

  1. Download TORTOISE (TORTOISEV3.1.1_MACOSX): https://tortoisedti.nichd.nih.gov/stbb/home.html. It should download a file called TORTOISE_V3.1.1_MACOSX.tar.gz in your ~/Downloads directory.
  2. You can move this file to whichever directory you want to install it on your Mac. You can also leave it inside the ~/Downloads directory if you want.
  3. If you have tried to install TORTOISE before, it's best to remove the system PATH settings that previous installations tried to modify. To do this, open both ~/.bashrc and ~/.bash_profile (if you miss one of these two files, you can safely ignore it), and remove all lines that seem to set the path to point to a directory containing TORTOISE in its path. For example, I removed the following lines:
export PATH=/Users/khuang/TORTOISE_V3.1.1/DIFFPREPV311/bin/bin:$PATH
export PATH=/Users/khuang/TORTOISE_V3.1.1/DIFFCALC/DIFFCALCV311:$PATH
export PATH=/Users/khuang/TORTOISE_V3.1.1/DRBUDDIV311/bin:$P
@kuanghan
kuanghan / athena_cuda.md
Last active May 24, 2024 21:55
Install NVIDIA driver & CUDA inside an LXC container running Ubuntu 16.04

Installing NVIDIA Driver & CUDA inside an LXC container running Ubuntu 16.04 on a neuroscience computing server.

Introduction: I was trying to run some neuroscience image processing commands that uses NVIDIA GPU. The challenge is that most of our computation will be run inside an LXC container running Ubuntu 16.04 (the host runs Ubuntu 16.04 as well). Installing the NVIDIA driver on the host is not so hard, but doing it inside the LXC container is much more challenging.

I already have an unprivileged container running, so I will not repeat the steps to create an LXC container here.

Our graphics card is NVIDIA GeForce GTX 1080 Ti.

Here are the main steps: