Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / min-char-rnn.py
Last active May 27, 2024 03:04
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@omaciel
omaciel / gist:10059276
Created April 7, 2014 21:20
One-Box Setup Satellite 6 to use libvirt for provisioning
puppet module install -i /tmp domcleal/katellovirt
puppet apply -v -e 'include katellovirt' --modulepath /tmp
export FORWARDERS=$(for i in $(cat /etc/resolv.conf |grep nameserver|awk '{print $2}'); do echo --capsule-dns-forwarders $i;done)
export OAUTH_SECRET=$(grep oauth_consumer_secret /etc/foreman/settings.yaml | cut -d ' ' -f 2)
echo FORWARDERS: $FORWARDERS
echo OAUTH_SECRET: $OAUTH_SECRET
katello-installer --capsule-parent-fqdn $(hostname) --capsule-dns true $FORWARDERS --capsule-dns-interface virbr1 --capsule-dns-zone katellolabs.org --capsule-dhcp true --capsule-dhcp-interface virbr1 --capsule-tftp true --capsule-tftp-servername $(hostname) --capsule-puppet true --capsule-puppetca true --capsule-register-in-foreman true --capsule-foreman-oauth-secret $OAUTH_SECRET --capsule-pulp true --capsule-pulp-oauth-secret $OAUTH_SECRET
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@marekjelen
marekjelen / gist:3731919
Created September 16, 2012 10:40
OpenShift @ Ubuntu
# Resources:
#
# * http://bencord0.wordpress.com/2012/08/11/openshift/
#
# Starting with clean install of Ubuntu for start
# Update the system
apt-get update
apt-get upgrade