Skip to content

Instantly share code, notes, and snippets.

View thoraxe's full-sized avatar

Erik Jacobs thoraxe

View GitHub Profile
class CryptoFile
attr_accessor :file_contents, :retrieve_key
attr_reader :id
def initialize(params={})
params.each do |attr, value|
self.public_send("#{attr}=", value)
end if params
if @id == nil
class FilesController < ApplicationController
def create
file = CryptoFile.new
file.file_contents = params[:file_contents]
file.retrieve_key = (0..3).map {rand(10).to_s}.join
if Redis.current.set(file.id, file.to_json)
result = 1
else
@thoraxe
thoraxe / Gemfile
Last active August 29, 2015 13:57
source 'https://rubygems.org'
gem 'rails', '~> 3.2.16'
gem 'rack', '~> 1.4.5'
gem 'redis'
gem 'redis-objects'
gem 'therubyracer'
gem 'haml'
class motd ($message = 'This is the default message') {
file { '/etc/motd':
content => "$message \n",
}
}
if [ -z "$PROMPT_COMMAND" ]; then
case $TERM in
xterm*|vte*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
PROMPT_COMMAND="__vte_prompt_command"
else
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
fi
[root@satellite ~]# foreman-rake bootdisk:generate:generic
Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
339 extents written (0 MB)
rake aborted!
No such file or directory - bootdisk_https://satellite.ejacobs.local.iso
#!ipxe
# Example foreman_bootdisk generic host template
#
# This template is generic, but it will chainload to Foreman so expects the
# host to be registered already.
#
# It loops through all interfaces using DHCP, requesting a template from
# Foreman in the hope that one of the MACs or IPs matches.
#
# Copy this template to customize it, the original is read-only.
#!gpxe
kernel http://satellite.ejacobs.local/pulp/repos/ACME_Corporation/Development/Simple_View/content/dist/rhel/server/6/6Server/x86_64/kickstart//images/pxeboot/vmlinuz ks=http://satellite.ejacobs.local:80/unattended/provision?token=50604488-319e-4f75-92d8-d3a3553ac804&static=yes ksdevice=52:54:00:f4:33:11 network kssendmac ip=${netX/ip} netmask=${netX/netmask} gateway=${netX/gateway} dns=${dns}
initrd http://satellite.ejacobs.local/pulp/repos/ACME_Corporation/Development/Simple_View/content/dist/rhel/server/6/6Server/x86_64/kickstart//images/pxeboot/initrd.img
boot
Operation FAILED: ERF51-5531: unknown permission for hosts#bootdisk_iso
/usr/share/foreman/app/controllers/application_controller.rb:155:in `action_permission'
/usr/share/foreman/app/controllers/hosts_controller.rb:565:in `action_permission'
/usr/share/foreman/app/controllers/application_controller.rb:137:in `current_permission'
/usr/share/foreman/app/controllers/hosts_controller.rb:537:in `resource_base'
/usr/share/foreman/app/controllers/hosts_controller.rb:628:in `find_by_name'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:531:in `block (3 levels) in _run__1124892527801971208__process_action__3329139482596210901__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_9551'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:326:in `around'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callback
install
url --url http://satellite.ejacobs.local/pulp/repos/ACME_Corporation/Development/Simple_View/content/dist/rhel/server/6/6Server/x86_64/kickstart/
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx
network --bootproto dhcp --hostname client-14.ejacobs.local
rootpw --iscrypted $1$8GDrlSQC$k3crReqz.o3hXBjci8KXf0
firewall --service=ssh