Skip to content

Instantly share code, notes, and snippets.

View wagenrace's full-sized avatar
😼
Distrusting my cats

Tom Nijhof wagenrace

😼
Distrusting my cats
View GitHub Profile
@xtophs
xtophs / keep-ubuntu-running-in-k8s.md
Last active July 10, 2023 11:48
Keep Ubuntu running in Kubernetes

Keep an Ubuntu container running in a Kubernetes cluster

Sometimes you just need a container that keeps shell running in a kubernetes cluster. It's very handy to debug or to open an ssh tunnel into the container network.

Unfortunately, the ubtuntu or busybox contianers from Docker Hub exit, but this little trick starts the container with a never-ending, ye low CPU consumption tail -f.

Now you can kubectl exec -it into the container, which always maintains context.

---
@kdubovikov
kdubovikov / pytorch_mnist.py
Created June 18, 2017 07:26
PyTorch MNIST example
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
# download and transform train dataset
train_loader = torch.utils.data.DataLoader(datasets.MNIST('../mnist_data',
download=True,