Skip to content

Instantly share code, notes, and snippets.

View mpepping's full-sized avatar

Martijn Pepping mpepping

View GitHub Profile
@mpepping
mpepping / vagrant_hostonly
Created October 13, 2012 17:29
Vagrant host only, multiple vm
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :pp01 do |pp01_config|
pp01_config.vm.box = "vg-centos63"
pp01_config.vm.host_name = "pp01.lab.xbsd.nl"
pp01_config.vm.network :hostonly, "192.168.56.10"
end
@mpepping
mpepping / users.rb
Created November 7, 2012 07:33
facter, sysmgmt, users.rb
Facter.add("users") do
confine :kernel => %w{Linux FreeBSD OpenBSD}
setcode do
users = Array.new
if File.executable?('/usr/bin/getent')
if getent_output = %x{/usr/bin/getent passwd}
getent_output.split("\n").each do |line|
next if line =~ /^nobody/
users << line.split(":")[0] if line.split(":")[2].to_i >= 1000 or line.split(":")[2].to_i == 0
@mpepping
mpepping / gist:4363709
Created December 23, 2012 14:34
Install EPEL6, PuppetLabs OSS and The Foreman repos on RHEL6/CentOS6.
# RHEL6/CentOS6 - Install EPEL6, PuppetLabs OSS and The Foreman repos.
yum localinstall --nogpgcheck "http://mirror.nl.leaseweb.net/epel/6/x86_64/epel-release-6-8.noarch.rpm" -y
yum localinstall --nogpgcheck "http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm" -y
yum localinstall --nogpgcheck "http://yum.theforeman.org/releases/1.0/el6/foreman-release.rpm" -y
@mpepping
mpepping / gist:5142894
Created March 12, 2013 13:35
Vagrantfile /w puppetmaster
# vi: set ft=ruby
Vagrant::Config.run do |config|
# box specs
config.vm.box = "centos63"
config.vm.host_name = "BOXNAME.lab.xbsd.nl"
config.vm.network :hostonly, "192.168.56.BOXIP"
# initial puppet run
┌─[~]
└─▪ echo $PS1
┌─[\[\e[0;36m\]\w\[\e[0m\]] \n└─▪
┌─[~]
└─▪
@mpepping
mpepping / unlimited_strength_cryptography.rb
Created February 1, 2015 20:35
OpenSSL::Cipher::CipherError with Rails3/4 on JRuby
# config/initializers/unlimited_strength_cryptography.rb
if RUBY_PLATFORM == 'java' # Allows the application to work with other Rubies if not JRuby
require 'java'
java_import 'java.lang.ClassNotFoundException'
begin
security_class = java.lang.Class.for_name('javax.crypto.JceSecurity')
restricted_field = security_class.get_declared_field('isRestricted')
restricted_field.accessible = true
@mpepping
mpepping / presentation.bat
Created February 10, 2015 08:41
presentation.bat
# Windows >= 7 : run from startup folder to disable presentation mode at logon.
@echo off
start c:\windows\system32\PresentationSettings.exe /start

Keybase proof

I hereby claim:

  • I am mpepping on github.
  • I am mpepping (https://keybase.io/mpepping) on keybase.
  • I have a public key whose fingerprint is 4378 7564 024D 1E7A D822 7FB4 8638 A18C E3C7 649F

To claim this, I am signing this object:

@mpepping
mpepping / gemrc
Last active September 27, 2022 11:28
Ruby gemrc with install options, such as proxy settings
---
# See 'gem help env' for additional options.
gem: --no-ri --no-rdoc
verbose: true
backtrace: true
bulk_threshold: 1000
http_proxy: http://proxy.example.com:8080
#!/bin/sh
#
# mcollective Application Server for STOMP based agents
#
# chkconfig: - 24 76
#
# description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too
# much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth
# as a bonus.
#