Skip to content

Instantly share code, notes, and snippets.

View jay-johnson's full-sized avatar

Jay jay-johnson

View GitHub Profile
@VigneshChennai
VigneshChennai / variance.rs
Last active July 26, 2022 15:40
Covariant and Invariant - Rust Example
struct CovariantExample<'a, T> {
a: &'a T
}
struct InvariantExample<'a, T> {
a: &'a mut T
}
fn covarient() {
@jnaulty
jnaulty / virt-install-centos
Created March 18, 2018 00:36 — forked from giovtorres/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@tadeck
tadeck / myip.py
Created August 18, 2012 19:59
Python script for getting public IP address
#!/usr/bin/env python
"""
This simple script fetches your IP as seen by web pages, and displays it.
Execute this script locally like that:
$ curl -s https://raw.github.com/gist/3389407/myip.py | python
"""
import urllib2
@mikedilger
mikedilger / Cargo.toml
Last active May 10, 2022 01:49
Using hyper and rustls
[package]
name = "example"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = { version = "1.0", features = [ "backtrace" ] }
futures = "0.3"
@oubiwann
oubiwann / list_queues.txt
Created October 5, 2012 23:18
A Kombu send/receive example
Listing queues ...
hipri 5
lopri 0
midpri 0
...done.
@ashwin
ashwin / RandomFloat.py
Created May 3, 2012 10:57
Generate random float in Python
import random
# Random float in [0.0, 1.0)
a = random.random()
# Random float in [0, 100]
b = random.uniform( 0, 100 )
@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
@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():
@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
@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`