Skip to content

Instantly share code, notes, and snippets.

View johnmccabe's full-sized avatar
🍕
eat sleep rebase repeat

John McCabe johnmccabe

🍕
eat sleep rebase repeat
View GitHub Profile
@johnmccabe
johnmccabe / txdocker
Created March 30, 2019 22:07 — forked from JasonAtNvidia/txdocker
Short Bash script to enable use of the GPU within a docker container running on an NVIDIA Jetson TX2. Place inside /usr/local/bin/, chmod +x txdocker, ensure it is in your system PATH, and use just as you would the docker command.
View txdocker
#!/bin/bash
#Jason T. 2-6-2018
# Check specifically for the run command
if [[ $# -ge 2 && $1 == "run" ]]; then
# Tell docker to share the following folders with the base system
# This allows the docker containers to find CUDA, cuDNN, TensorRT
LIB_MAPS="/usr/lib/aarch64-linux-gnu \
/usr/local/cuda \
/usr/local/cuda/lib64"
@johnmccabe
johnmccabe / BREW_OLD_FILES.md
Created November 16, 2018 10:19
Installing/Using old releases with brew
View BREW_OLD_FILES.md

Install Old Releases with Brew

If you need to install an old software release with brew you can do so as follows.

  1. Install the latest version of kubernetes-cli
brew install kubernetes-cli

This will install the latest release (currently 1.12.2) 2. Unlink the installed release so you can install an old version:

@johnmccabe
johnmccabe / README.md
Last active February 14, 2018 01:03
Infrakit DigitalOcean Provisioning
View README.md

DigitalOcean Instance Plugin Infrakit

Note this just provisions instances, doesn't describe the group/vanilla plugin use here.

Set some envvars

INFRAKIT_DIGITALOCEAN_ACCESS_TOKEN=<your token>

Run your plugins

View dashboard-admin.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
@johnmccabe
johnmccabe / INSTALL.md
Created September 27, 2017 09:44
Installing Docker 1.12 on Centos 7
View INSTALL.md
yum -y update
yum -y install yum-utils
yum-config-manager --add-repo https://yum.dockerproject.org/repo/main/centos/7
yum -y update
# yum search --showduplicates docker-engine
yum -y --nogpgcheck install docker-engine-1.12.6-1.el7.centos.x86_64
service docker start
@johnmccabe
johnmccabe / README.md
Last active January 18, 2021 14:29
Running OpenFaaS on Windows 10 - using Docker Swarm on Hyper-V
View README.md
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch registry
docker-machine ssh registry docker run -d -p 5000:5000 --restart=always --name registry registry:2
docker-machine ls # get the ip address of the VM, in this case 10.10.10.197
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry 10.10.10.197:5000 swarm-1
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry 10.10.10.197:5000 swarm-2
docker-machine create --driver hyperv --hyperv-virtual-switch ExternalSwitch --engine-insecure-registry 10.10.10.197:5000 swarm-3
docker-machine ssh swarm-1 docker swarm init  # copy the swarm join command to run on each other hose
docker-machine ssh swarm-2 docker swarm join --token SWMTKN-1-mysecrettoken 10.10.10.198:2377
docker-machine ssh swarm-3 docker swarm join --token SWMTKN-1-mysecrettoken 10.10.10.198:2377
@johnmccabe
johnmccabe / README.md
Last active August 16, 2017 13:43
Git PR subcommand
View README.md

Drop the above file, called git-getpr into your PATH and you can then pull a PR (assuming you have set the source repo remote as upstream):

git getpr <PR ID>

This will pull the PR into a local branch called pr/

@johnmccabe
johnmccabe / README.md
Last active August 10, 2017 21:30
Bumping faas-cli version in brew
View README.md

You can bump a formula entirely on the command line.

$ brew bump-formula-pr --strict faas-cli --tag=0.4.6 --revision=39183ee1b344a7bb8825bd2ebedce5c0bf4262c4

You'll be prompted to allow access to your git credentials in the OSX keychain. There may be some extra setup required tho, possibly setting up the remote?

Already up-to-date.
==> replace "0.4.5" with "0.4.6"
==> replace "e9c738f9a2833980a1bfc0102b3dfdf0cce2684a" with "39183ee1b344a7bb8825bd2ebedce5c0bf4262c4"
==> Downloading https://homebrew.bintray.com/bottles/hub-2.2.9.sierra.bottle.tar.gz
View isthisvalid.json
"target": "/etc/hosts",
"title": "localhost"
},
{
"ensure": "present",
"ip": "255.255.255.255",
"name": "broadcasthost",
"provider": ":aug",
"resource": "host",
"target": "/etc/hosts",
@johnmccabe
johnmccabe / out.json
Created July 4, 2017 22:41
libral.GetTypes() go wrapper output
View out.json
{
"providers": [
{
"name": "file::posix",
"type": "file",
"source": "builtin",
"desc": "A provider to manage POSIX files.\n",
"suitable": true,
"attributes": [
{