Skip to content

Instantly share code, notes, and snippets.


Duane DuaneNielsen

Block or report user

Report or block DuaneNielsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DuaneNielsen /
Created Jun 25, 2019
Implementation of Resnet trained with Fixup. No BatchNorm!
import torch
import torch.nn as nn
from torchvision.datasets import CIFAR10
from import DataLoader, random_split, Dataset, ConcatDataset
from tqdm import tqdm
from torch.optim import Adam, SGD
from torchvision.transforms import *
import statistics as stats
from pathlib import Path
from torch.nn.functional import avg_pool2d
DuaneNielsen / install
Last active Apr 29, 2019
Install small redis distrib
View install
snap install helm --classic
/snap/bin/helm init
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
vi values.yaml
#change usePassword: false
helm install stable/redis -n ppo-redis --values values.yaml
DuaneNielsen / notes
Created Apr 27, 2019
Install kubenetes using kubeadmin
View notes
install docker ce
setup docker cri
# Setup daemon.
cat > /etc/docker/daemon.json <<EOF
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
wget -O - | bash
wget -O - | bash
DuaneNielsen /
Last active Apr 26, 2019
running Docker containers inside LXC containers
lxc launch ubuntu:bionic test
lxc exec test /bin/bash --
<install docker ce>
lxc stop test
lxc profile edit docker
lxc profile assign test docker
mount -o bind /var/lib/kubelet /var/lib/kubelet
mount --make shared /var/lib/kubelet
DuaneNielsen /
Last active Apr 17, 2019
setup microk8s
snap install --channel 1.13/stable --classic microk8s
microk8s.enable registry
microk8s.enable dns
microk8s.enable storage # not sure if i need this
snap install helm --classic
/snap/bin/helm init
helm install stable/redis -n ppo-redis
snap alias microk8s.kubectl kubectl
View Configing microk8s with helm
c@ccube:~$ sudo snap install helm
helm 2.9.1 from 'snapcrafters' installed
c@ccube:~$ /snap/bin/helm init
Please copy Kubernetes config to /home/c/snap/helm/common/kube/config.
c@ccube:~$ cp /snap/microk8s/current/client.config /home/c/snap/helm/common/kube/config
c@ccube:~$ /snap/bin/helm init
Creating /home/c/snap/helm/common/repository
Creating /home/c/snap/helm/common/repository/cache
Creating /home/c/snap/helm/common/repository/local
Creating /home/c/snap/helm/common/plugins
View Putting Docker image into microk8s
# use 1.13 stable, it still supports docker well
snap install --channel 1.13/stable --classic microk8s
microk8s.docker build Dockerfile
microk8s.docker tag <container from last step><name you want for container>
mickrok8s.docker push<name you want for container>
container will now be available as<name you want for container>
View Reconfiguring kubelet on microk8s
snap info microk8s
snap run --shell microk8s.start
cd args
vi kublet
DuaneNielsen / Postgress setup for python
Last active Apr 4, 2019
Links for getting postgres up and running on python and ubuntu
View Postgress setup for python
You can’t perform that action at this time.