Skip to content

Instantly share code, notes, and snippets.

View JacobCallahan's full-sized avatar
🧐
🥓

Jake Callahan JacobCallahan

🧐
🥓
View GitHub Profile
@ntkathole
ntkathole / satellite_cert_generator.sh
Last active November 19, 2020 13:53
Script to generate certificates for satellite server
country=IN
state=Maharashtra
locality=Pune
organization=redhat
organizationalunit=QE
commonname=$(hostname)
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname"
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -subj "/C=$country/ST=$state/L=$locality/O=$organization/OU=$organizationalunit/CN=$commonname"
@johnpmitsch
johnpmitsch / install_katello_client_tools.rb
Last active March 14, 2018 17:34
SUSE - install katello-agent and client tools without dependencies
#!/usr/bin/ruby
# install all rpm files from katello client repos without dependencies
# TODO; get these files from the URL
files = [
"gofer-2.7.6-1.el7.noarch.rpm",
"katello-client-repos-3.5.1-1.el7.noarch.rpm",
"katello-client-repos-latest.rpm",
"katello-host-tools-3.1.0-1.el7.noarch.rpm",
#!/usr/bin/env ruby
Dir.chdir("#{ARGV[0]}") do
if File.exist?("PULP_MANIFEST")
`rm -rf PULP_MANIFEST`
end
files = Dir.glob("**/*")
lines = files.collect do |file|
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@johnpmitsch
johnpmitsch / generate-hosts.rb
Last active June 25, 2018 14:47
proxy generate virt hosts apache
#!/usr/bin/env ruby
base=50000 #port
range="192.168.121."
contents = <<-EOS
Listen %{port} https
<VirtualHost *:%{port}>
ProxyPass / https://%{ip_address}/
<Location />
@omaciel
omaciel / install_pulp.sh
Created September 24, 2015 18:43
Script to install and configure a Pulp Server onto a RHEL 6/7 x86_64 system.
# Script to install and configure a Pulp Server onto a RHEL 6/7 x86_64 system.
# The official documentation can be found here:
# https://pulp.readthedocs.org/en/latest/user-guide/installation.html
export USER_NAME=""
export USER_PASSWORD=""
export POOLID=""
# Handles system services according to the operating system version
function handle_service {
@omaciel
omaciel / gist:11319054
Last active June 8, 2016 17:59
Configure Foreman Smart Proxy with all features baked in
# Figure out what OS version we're running
if uname -r | grep -q el6; then export OS_VERSION=6; else export OS_VERSION=7; fi
# Install libvirt
yum install -y libvirt
if [ $OS_VERSION -eq 6 ]
then
service libvirtd start
chkconfig libvirtd on