Skip to content

Instantly share code, notes, and snippets.

View devynspencer's full-sized avatar
:octocat:

Devyn Spencer devynspencer

:octocat:
View GitHub Profile
@devynspencer
devynspencer / nginx.config
Last active October 24, 2015 00:18
baseline nginx config
events {
worker_connections 1024;
}
http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
gzip on;
@devynspencer
devynspencer / repository.rb
Created October 24, 2015 01:38
Package repository model
class Repository
attr_reader :id, :created_at, :packages, :checksum
def initialize
@id = id
@created_at = Time.now
@packages = packages
@checksum = ''
end
@devynspencer
devynspencer / reposync-arch-x86_64.sh
Last active October 27, 2015 20:15
Output from reposync for x86_64 with --arch flag
➜ rhel6 reposync --plugins --newest-only --download_path "/srv/repositories/rhel6/all/$(date | md5sum | awk '{ print $1 }')" --repoid rhel-6-server-rpms --norepopath --arch x86_64 --urls
Loaded plugins: product-id
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/389-ds-base-1.2.11.15-62.el6_7.x86_64.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/389-ds-base-libs-1.2.11.15-62.el6_7.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/389-ds-base-libs-1.2.11.15-62.el6_7.x86_64.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/ConsoleKit-0.4.1-3.el6.x86_64.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/ConsoleKit-libs-0.4.1-3.el6.x86_64.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/ConsoleKit-x11-0.4.1-3.el6.x86_64.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/DeviceKit-power-014-3.el
➜ rhel6 reposync --plugins --newest-only --download_path "/srv/repositories/rhel6/all/$(date | md5sum | awk '{ print $1 }')" --repoid rhel-6-server-rpms --norepopath --arch i686 --urls
Loaded plugins: product-id
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/389-ds-base-libs-1.2.11.15-62.el6_7.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/DeviceKit-power-014-3.el6.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/ElectricFence-2.2.2-28.el6.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/GConf2-2.28.0-6.el6.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/GConf2-devel-2.28.0-6.el6.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/ImageMagick-6.7.2.7-2.el6.i686.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/NetworkManager-glib-0.8.1-99.el6.i686.rpm
https://cdn.
➜ rhel6 reposync --plugins --newest-only --download_path "/srv/repositories/rhel6/all/$(date | md5sum | awk '{ print $1 }')" --repoid rhel-6-server-rpms --norepopath --arch ppc --urls
Loaded plugins: product-id
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterprise_Linux-Release_Notes-6-as-IN-6-1.el6.noarch.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterprise_Linux-Release_Notes-6-bn-IN-6-1.el6.noarch.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterprise_Linux-Release_Notes-6-de-DE-7-2.1.el6.noarch.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterprise_Linux-Release_Notes-6-en-US-7-2.el6.noarch.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterprise_Linux-Release_Notes-6-es-ES-7-2.1.el6.noarch.rpm
https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os/Packages/Red_Hat_Enterp
bash-shellshock
chef-client
chef-sugar
chefdk
chefdk_bootstrap
cron
curl
fail2ban
git
hostsfile
@devynspencer
devynspencer / fs.rb
Created December 4, 2015 19:44 — forked from geewiz/fs.rb
Chef recipe to set noexec option for /dev/shm
# remount /dev/shm
execute "remount_shm" do
action :nothing
command "mount -o remount /dev/shm"
end
# set noexec for /dev/shm
bash "shm_noexec" do
user "root"
cwd "/etc"
@devynspencer
devynspencer / aliases.sh
Last active February 12, 2016 22:48
RHEL7-specific aliases, auto-completion plugins, and notes.
# http://micahelliott.com/posts/2015-08-27-firewalld-best-practices.html
alias fw='firewall-cmd'
alias fwz='fw --zone'
alias fwp='fw --permanent'
alias fwr='fw --runtime-to-permanent'
alias fwpz='fw --permanent --zone'
alias fwl='fw --list-all-zones'
alias hidden='ls -a | grep "^\."'
alias dotfiles='hidden'
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = 'Berksfile'
config.vm.box = 'bento/centos-7.1'
config.vm.hostname = 'chef.local'
config.vm.network :forwarded_port, guest: 80, host: 8080
@devynspencer
devynspencer / Vagrantfile
Created December 10, 2015 01:24
Global defaults for Chef development using Vagrant. ~/.vagrant.d/Vagrantfile
# global defaults file
def host_hardware_info
hardware = {}
operating_system = RbConfig::CONFIG['host_os']
case operating_system
when /darwin/
hardware[:cpu_cores] = `sysctl -n hw.cpus`.to_i
hardware[:memory] = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4 # MB