Skip to content

Instantly share code, notes, and snippets.

View jay-johnson's full-sized avatar

Jay jay-johnson

View GitHub Profile
@mspan
mspan / RandomForestsInTen_final.ipynb
Created September 26, 2013 00:10
Overview of Random Forests for newhaven.io presentation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jay-johnson
jay-johnson / Mounting a new Volume for increasing var hard drive space.md
Last active January 17, 2018 23:03
Mounting a new Volume for increasing /var hard drive space

Format the Volume

driver@localhost:/var/lib$ sudo fdisk -l

Disk /dev/sda: 31.5 GB, 31515377664 bytes
255 heads, 63 sectors/track, 3831 cylinders, total 61553472 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
from IPython.core.magic import Magics, magics_class, line_magic
import asyncio
from concurrent.futures import Future
# Credits goes to https://gist.github.com/chrisseto/8f7289497f40ad442a30#gistcomment-1701177
@magics_class
class AsyncMagics(Magics):
@line_magic
def await(self, line):
@steebchen
steebchen / 1-install-ceph-helm.sh
Last active February 24, 2019 01:03
Set up ceph with kubernetes
# Requirements: an existing and running k8s cluster
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init
# taken from http://docs.ceph.com/docs/master/start/kube-helm/
helm serve &
# wait for helm serve to be ready
@fjammes
fjammes / 10-kubeadm.conf
Last active March 13, 2019 07:56
Set up a kubernetes 1.9.1 cluster on Centos7
# Comment line 9 in /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
Environment="KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt"
Environment="KUBELET_CADVISOR_ARGS=--cadvisor-port=0"
# Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"
Environment="KUBELET_CERTIFICATE_ARGS=--rotate-certificates=true --cert-dir=/var/lib/kubelet/pki"
@richleland
richleland / settings.py
Created October 29, 2011 11:00
S3BotoStorage subclass for media and static buckets
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATICFILES_STORAGE = 'path.to.storage.S3StaticStorage'
THUMBNAIL_DEFAULT_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = 'YOUR KEY'
AWS_SECRET_ACCESS_KEY = 'YOUR KEY'
AWS_STORAGE_BUCKET_NAME = 'media.YOURSITE.com'
AWS_STATIC_BUCKET_NAME = 'static.YOURSITE.com'
AWS_S3_CUSTOM_DOMAIN = AWS_STORAGE_BUCKET_NAME
AWS_STATIC_CUSTOM_DOMAIN = AWS_STATIC_BUCKET_NAME
STATIC_URL = 'http://%s/' % AWS_STATIC_BUCKET_NAME
@jbcurtin
jbcurtin / nhuntwalker-asyncio.py
Last active June 15, 2019 13:30
A #microtutorial to show how to use asyncio and some other stdlib-tools, https://pugetsoundpython.slack.com/archives/C03LJKBPJ/p1530204386000485
#!/usr/bin/env python
'''
A #microtutorial to show how to use asyncio and some other stdlib-tools,
https://pugetsoundpython.slack.com/archives/C03LJKBPJ/p1530204386000485
Invoke with,
`python nhuntwalker-asyncio.py -m on`
`python nhuntwalker-asyncio.py -m awe`
`python nhuntwalker-asyncio.py`
@carlessanagustin
carlessanagustin / kubernetes.md
Created March 15, 2017 15:53
Kubernetes tutorial steps

1. Create cluster

Cluster up and running

minikube version
minikube start
kubectl version
@mchirico
mchirico / tensorFlowIrisCSV.py
Last active April 2, 2021 06:56
Tensorflow: working with tensorboard, CSV, and saving results
#!/usr/bin/env python
import tensorflow as tf
import numpy as np
from numpy import genfromtxt
# Build Example Data is CSV format, but use Iris data
from sklearn import datasets
from sklearn.model_selection import train_test_split
import sklearn
def buildDataFromIris():
@jamesbuckett
jamesbuckett / kubeadm.md
Last active April 12, 2021 18:56
kubeadm

Deploy a Kubernetes cluster and Microservices Application

image

What Problem are we solving

What is Kubernetes?

Agenda

  • Deploy a Kubernetes cluster on Digital Ocean using kubeadm