Skip to content

Instantly share code, notes, and snippets.

View agoose77's full-sized avatar
🏠
Working from home

Angus Hollands agoose77

🏠
Working from home
View GitHub Profile
name: root
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=1_gnu
- anyio=2.2.0=py38h578d9bd_0
- argon2-cffi=20.1.0=py38h497a2fe_2
- arpack=3.7.0=hdefa2d7_2
#!/usr/bin/env python3
import argparse
import gc
import numpy as np
import os
import pathlib
import psutil
kB = 1024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@agoose77
agoose77 / fizzbuzz.py
Created March 5, 2021 14:39
A Pythonic implementation of fizzbuzz without user branches
import itertools
def ident(x):
return x
def replacer(x):
def replace(_):
return x
@agoose77
agoose77 / containers-and-permissions.md
Last active May 13, 2022 12:18
A reference for running containers with non-root permissions

When implementing development environments inside a container, usually I want to:

  1. Run as non-root inside the container (many tools do not like being run as root).
  2. Behave as the non-root user executing the container when reading/writing from mounted volumes

There are some additional (small) security benefits from running as non-root inside a container.

The solution to these problems is complicated by the way that different container runtimes behave:

keep-id

Across the different container runtimes, there is often a flag such as userns=keep-id that maps the UID:GID of the host to the container. Linux creates users by default with UID 1000, so default non-root users will often map directly to host UID.

channels:
- conda-forge
- defaults
dependencies:
- jupyterlab=3.0.5
- xeus-cling=0.11.0
- xtensor=0.22.0
- xtensor-blas=0.18.0
#define MULTIPLICITY_MAX 4352
struct Event {
Int_t rGETCobo[MULTIPLICITY_MAX];
Int_t rGETAsad[MULTIPLICITY_MAX];
// ...
};
#define MULTIPLICITY_MAX 4352
class EventDispatcher: public mfm::FrameBulder {
public:
EventDispatcher(EventHandler* ev);
processFrame(mfm::Frame& frame);
Int_t rGETCobo[MULTIPLICITY_MAX];
https://www.drewsilcock.co.uk/compiling-zsh
http://zsh.sourceforge.net/FAQ/zshfaq01.html#l7
#!/usr/bin/env bash
# If SSH wishes to execute a command, then do so
if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then
exec bash -c "$SSH_ORIGINAL_COMMAND"
fi
exec $HOME/.local/bin/zsh -il